[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Is it possible to open 2 editors in different tab groups ?

Is it possible to get those tabs off the stack (leaving just the drop-down list)?

Bob Foster

Paul Webster wrote:
Setya wrote:

Hi all,

When I open 2nd editor I need it to be placed in different tab groups than the 1st one. Is it possible ?

The current behaviour the 2nd editor always put in the same tab groups as the 1st one than the 2nd editor can be separated by dragging it outside the 1st editor area. I want this behaviour not by dragging but by opening at the first time.


Once you have the second tabbed stack open, you can choose which stack to open an editor in by making it active.

// editors in the 2 different tabbed stacks
IEditorPart last;
IEditorPart current;
// filenames to open in editors
IFile[] filename;

IWorkbenchPage fActivePage;
fActivePage = PlatformUI.getWorkbench()
    .getActiveWorkbenchWindow().getActivePage();
for (int i = 2; i < filename.length; ++i) {
    fActivePage.activate(last);
    last = current;
    current = IDE.openEditor(fActivePage, filename[i], true);
}

There's some automated code in the unit tests that does this, org.eclipse.ui.tests.api.Bug95357Test in the org.eclipse.ui.tests project.

Later,
Paul