TabbedDockableContainer dockableContainer = DockingUtilities.findTabbedDockableContainer(dockable);
int order = 1;
if (dockableContainer != null) {
order = dockableContainer.indexOfDockable(dockable) + 1;
}
DockableState dockableState = workspace.getDockableState(editorDockable);
if (dockableState == null) {
workspace.createTab(dockable, editorDockable, order, true);
}
} else {
if (maximizedDockable != null) {
DockableState dockableState = workspace.getDockableState(maximizedDockable);
if (dockableState != null && dockableState.isMaximized())
workspace.restore(maximizedDockable);
}
DockableState dockableState = workspace.getDockableState(editorDockable);
DockableState OPDockableState = workspace.getDockableState(outputPane);
if (dockableState == null && OPDockableState != null && OPDockableState.isDocked())
workspace.split(outputPane, editorDockable, DockingConstants.SPLIT_TOP, 0.8);
else if (dockableState == null) {
DockableState RDockableState = workspace.getDockableState(resultPane);
if (RDockableState != null && RDockableState.isDocked())
workspace.split(resultPane, editorDockable, DockingConstants.SPLIT_TOP, 0.8);
else
workspace.addDockable(editorDockable);
}
}