return resultPane;
else if (keyName.equals("Log"))
return logView;
else {
File file = new File(keyName);
IEditor e;
if (!file.exists())
return new FnFDockable(keyName);
e = createEditor(file);
Dockable dockable = (Dockable) e.getData("dockable");
return dockable;
}
}
});
try {
Preferences preferences = Preferences.userNodeForPackage(DisplayWindow.class);
String bytes = preferences.get(getPrefKey("workspace.", System.getProperty(Constants.PROP_PROJECT_DIR)), null);
if (bytes != null) {
workspace.readXML(new ByteArrayInputStream(bytes.getBytes()));
DockableState[] dockables = workspace.getDockables();
for (final DockableState dockableState : dockables) {
if (dockableState.getDockable() instanceof FnFDockable || !dockableState.isDocked()) {
workspace.unregisterDockable(dockableState.getDockable());
}
}
dockables = workspace.getDockables();
for (DockableState ds : dockables) {
if (ds.getDockable() instanceof EditorDockable) {
editor = ((EditorDockable) ds.getDockable()).getEditor();
break;
}
}
return;
}
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (ParserConfigurationException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
} catch (SAXException e1) {
e1.printStackTrace();
}
EditorDockable[] editors = new EditorDockable[] {};
IEditor readmeEditor = null;
try {
readmeEditor = getReadmeEditor();
if (readmeEditor != null)
editors = new EditorDockable[] { (EditorDockable) readmeEditor.getData("dockable") };
} catch (IOException e1) {
e1.printStackTrace();
}
createDefaultWorkspace(editors);
}