public boolean parse(Element element, final Context context) {
final ToolWindowAnchor anchor = ToolWindowAnchor.valueOf(element.getAttribute("anchor"));
// load toolWindowBar properties
MyDoggyToolWindowBar toolWindowBar = (MyDoggyToolWindowBar) context.get(ToolWindowManager.class).getToolWindowBar(anchor);
toolWindowBar.setDividerSize(getInteger(context, element, "dividerSize", 3));
toolWindowBar.setAggregateMode(getBoolean(context, element, "aggregateMode", false));
toolWindowBar.setLength(getInteger(context, element, "length", 23));
Element layoutElement = getElement(element, "layout");
if (layoutElement != null) {
String layoutAsText = layoutElement.getTextContent();
XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(layoutAsText.getBytes()));
final MultiSplitLayout.Node layout = (MultiSplitLayout.Node) decoder.readObject();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MyDoggyToolWindowBar) context.get(ToolWindowManager.class).getToolWindowBar(anchor)).setLayout(layout);
}
});
}
Element workspaceElement = getElement(element, "workspace");
if (workspaceElement != null) {
byte[] workspace = Base64.decode(workspaceElement.getTextContent());
toolWindowBar.setToolWorkspace(workspace, getBoolean(context, element, "toolsVisible", false));
}
return false;
}