3

I have a multipage editor to which I want to add a page if the user double cliks on a box in another page of the multipage editor (which is a graphical editor). Is this possible? without multipage editor, I can do that using the following code:

public void performRequest(Request req) {
    if(req.getType() == RequestConstants.REQ_OPEN) {
        try {
            MyInput input = new MyInput("");
            IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
            page.openEditor(input, MyEditor.ID);
            }
            catch (PartInitException e) {
                    e.printStackTrace();
            }
        }
    }

I would really appreciate any help, thanks

jean24
  • 189
  • 3
  • 9
  • well, I've managed to do that by simply using creating a method that uses addPage(editor, input) .. Now, the problem that I'm facing is that the created page is visible only if we switch to it, i.e only the tab is visble.. what I want is to directly switch to the new page automatically after its creation.. – jean24 Sep 24 '11 at 22:38
  • 2
    org.eclipse.ui.part.MultiPageEditorPart.setActivePage(int) is what is needed – jean24 Sep 28 '11 at 19:36

0 Answers0