}
class ActivePropertyChangeListener implements PropertyChangeListener {
public synchronized void propertyChange(PropertyChangeEvent evt) {
ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
// Fire "active.before" for all bars
PropertyChangeEvent event = new PropertyChangeEvent(evt.getSource(), "active.before",
evt.getOldValue(), evt.getNewValue());
for (MyDoggyToolWindowBar bar : bars)
bar.propertyChange(event);
// Fire "active" for specific bar
getBar(descriptor.getToolWindow().getAnchor()).propertyChange(evt);
if (Boolean.FALSE.equals(evt.getNewValue())) {
activeToolWindowId = null;
if (last != null) {
boolean shouldRequest = true;
for (MyDoggyToolWindowBar bar : bars) {
if (bar.valueAdjusting && getBar(descriptor.getToolWindow().getAnchor()) == bar) {
shouldRequest = false;
break;
}
}
if (shouldRequest) {
last.requestFocusInWindow();
}
}
} else activeToolWindowId = descriptor.getToolWindow().getId();
}