Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would recommend a different aproach. Eclipse has viewparts (views) and editors. It is easy to open multiple editors. Views are not so much for open multiple ones. So my suggestion is, that you implement the part you call "FormView" as a StandAloneView and implement the "ChartView" as an editor.</p> <p>I would also recommend to use a different listener for the button, so also the code will be executed when using the keyboard to click the button.</p> <p>My proposal:</p> <pre><code>public class FormView extends ViewPart { ... button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { // this below can also be called by a command but you need to take care about the data, which the user put into the fields in different way. Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IWorkbenchPage page = window.getActivePage(); ChartEditorInput input = new ChartEditorInput(text.getText(),...&lt;other data you need to pass&gt;); try { page.openEditor(input, ChartEditor.ID); } catch (PartInitException e) { e.printStackTrace(); } } }); </code></pre> <p>ChartView needs to be changed to ChartEditor. See here <a href="http://www.vogella.de/articles/RichClientPlatform/article.html#editor_editorinput" rel="nofollow noreferrer">http://www.vogella.de/articles/RichClientPlatform/article.html#editor_editorinput</a> how that is done.<br> ChartEditorInput hereby is a class you need to implement aside the editor class, which holds the data.</p> <p>In your perspective you call:</p> <pre><code>public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); layout.setFixed(false); layout.setEditorAreaVisible(true); layout.addStandaloneView("your.domain.and.FormView", true,IPageLayout.RIGHT, 0.15f, editorArea); </code></pre> <p>Hope this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload