@Override
 public void actionPerformed(ActionEvent e) {
   DentonDocumentManager mgr =
       WorkspaceFactory.getInstance().getManager(DentonDocumentManager.class);
   if (mgr != null) {
     Workspace ws = WorkspaceFactory.getInstance().getActiveWorkspace();
     WorkspaceItem<DentonDocument> ndoc = mgr.create(ws);
     mgr.openDocument(ndoc);
   }
 }
 @Override
 protected void performAction(ItemWsNode context) {
   WorkspaceItem<TsVariables> cur = (WorkspaceItem<TsVariables>) context.getItem();
   if (cur != null && !cur.isReadOnly()) {
     // create the input dialog
     String oldName = cur.getDisplayName(), newName;
     VarsName nd = new VarsName(cur.getFamily(), NAME_MESSAGE, RENAME_TITLE, oldName);
     nd.addPropertyChangeListener(
         new PropertyChangeListener() {
           @Override
           public void propertyChange(PropertyChangeEvent evt) {
             if (evt.getPropertyName().equals(NotifyDescriptor.PROP_DETAIL)) {}
           }
         });
     if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.OK_OPTION) {
       return;
     }
     newName = nd.getInputText();
     if (newName.equals(oldName)) return;
     ProcessingContext.getActiveContext().getTsVariableManagers().rename(oldName, newName);
     cur.setDisplayName(newName);
     WorkspaceFactory.Event ev =
         new WorkspaceFactory.Event(
             cur.getOwner(), cur.getId(), WorkspaceFactory.Event.ITEMRENAMED);
     WorkspaceFactory.getInstance().notifyEvent(ev);
   }
 }
  public SpecSelectionComponent(boolean showSystemOnly) {
    this.tree = new BeanTreeView();
    this.em = new ExplorerManager();
    this.selectionListener = new SelectionListener();
    this.specification = newProperty(SPECIFICATION_PROPERTY, null);
    this.icon = newProperty(ICON_PROPERTY, null);

    tree.setRootVisible(false);
    tree.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    DecoratedNode root =
        new DecoratedNode(
            new DummyWsNode(WorkspaceFactory.getInstance().getActiveWorkspace(), SPECS_ID),
            showSystemOnly ? ItemWsNodeFilter.SYSTEM_ONLY : Predicates.<Node>alwaysTrue());
    for (DecoratedNode o : root.breadthFirstIterable()) {
      o.setPreferredActionDecorator(DecoratedNode.PreferredAction.DO_NOTHING);
    }

    em.setRootContext(root);

    setLayout(new BorderLayout());
    add(tree, BorderLayout.CENTER);
    setPreferredSize(new Dimension(225, 300));

    em.addVetoableChangeListener(selectionListener);
    addPropertyChangeListener(
        new PropertyChangeListener() {
          @Override
          public void propertyChange(PropertyChangeEvent evt) {
            String p = evt.getPropertyName();
            if (p.equals(SPECIFICATION_PROPERTY)) {
              onSpecificationChange();
            }
          }
        });
  }
 public RevisionAnalysisTopComponent() {
   this(manager().create(WorkspaceFactory.getInstance().getActiveWorkspace()));
 }
 private static RevisionAnalysisDocumentManager manager() {
   return WorkspaceFactory.getInstance().getManager(RevisionAnalysisDocumentManager.class);
 }