private void setCurrentEditorDockable(EditorDockable editorDockable) {
if (editorDockable == null) {
editor = null;
} else if (editor != null) {
Dockable dockable = (Dockable) editor.getData("dockable");
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);
}