private void update() {
    DefaultMutableTreeNode node = getSelectedNode();
    getOKAction().setEnabled(node != null && node.isLeaf());

    PatternDescriptor descriptor = getSelectedDescriptor();
    if (descriptor != null) {
      updateDetails(descriptor);
    }
  }
private void update()