ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
boolean visible = (Boolean) evt.getNewValue();
Component content = (visible) ? descriptor.getComponent() : null;
if (content != null) {
DockedContainer container = (DockedContainer) descriptor.getToolWindowContainer();
content = container.getContentContainer();
}
if (content == null || descriptor.getDivederLocation() > 0 && splitPane.getDividerSize() != 0) {
if (manager.getShowingGroup() == null) {
synchronized (splitAnimation) {
if (splitAnimation.isAnimating())
splitAnimation.stop();
}
switch (anchor) {
case LEFT:
case TOP:
descriptor.setDivederLocation(splitPane.getDividerLocation());
break;
case RIGHT:
descriptor.setDivederLocation(splitPane.getWidth() - splitPane.getDividerLocation());
break;
case BOTTOM:
descriptor.setDivederLocation(splitPane.getHeight() - splitPane.getDividerLocation());
}
}
}
if (content == null && descriptor.getToolWindow().isVisible())
return;
int divederLocation = descriptor.getDivederLocation();
Object component = getSplitPaneContent();
boolean animate = true;
if (component != null) {
if (component instanceof MultiSplitContainer) {
MultiSplitContainer multiSplitContainer = (MultiSplitContainer) component;
if (manager.getShowingGroup() != null) {
multiSplitContainer.addContent(content);
} else {
if (content == null) {
DockedContainer dockedContainer = (DockedContainer) descriptor.getToolWindowContainer();
multiSplitContainer.removeContent(dockedContainer.getContentContainer());
animate = false;
if (multiSplitContainer.isEmpty()) {
animate = true;
content = null;