public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("visibleOnTitleBar".equals(propertyName)) {
ToolWindowAction toolWindowAction = (ToolWindowAction) evt.getSource();
if (!setVisible((Component) toolWindowAction.getValue("component"), (Boolean) evt.getNewValue())) {
Integer index = (Integer) toolWindowAction.getValue("constraint");
addToolWindowAction(toolWindowAction, index != null ? index : -1);
setVisible((Component) toolWindowAction.getValue("component"), (Boolean) evt.getNewValue());
}
} else if ("toolWindowAction".equals(propertyName)) {
if (SwingUtil.getAt(evt, 0, null) != toolWindow.getTypeDescriptor(toolWindow.getType()))
return;
if (evt.getNewValue() != null) {
if (evt.getOldValue() == null) {
// Add the action
ToolWindowAction toolWindowAction = (ToolWindowAction) evt.getNewValue();
if (toolWindowAction.isVisibleOnTitleBar()) {
int index = (Integer) toolWindowAction.getValue("constraint");
addToolWindowAction(toolWindowAction, index);
SwingUtil.repaint(toolWindowTitleButtonPanel);
}
} else {