예제 #1
0
  public void performAction(Node[] activatedNodes) {
    Node n = activatedNodes[0];
    Folder folder = (Folder) n.getValue("Folder"); // NOI18N
    assert folder != null;
    Node thisNode = (Node) n.getValue("This"); // NOI18N
    assert thisNode != null;
    Project project = (Project) n.getValue("Project"); // NOI18N
    assert project != null;

    ConfigurationDescriptorProvider pdp =
        project.getLookup().lookup(ConfigurationDescriptorProvider.class);
    MakeConfigurationDescriptor makeConfigurationDescriptor = pdp.getConfigurationDescriptor();
    if (!makeConfigurationDescriptor.okToChange()) {
      return;
    }

    NotifyDescriptor.InputLine dlg =
        new NotifyDescriptor.InputLine(getString("FolderNameTxt"), getString("NewFolderName"));
    dlg.setInputText(folder.suggestedNewFolderName());
    String newname = null;

    if (NotifyDescriptor.OK_OPTION.equals(DialogDisplayer.getDefault().notify(dlg))) {
      newname = dlg.getInputText();
    } else {
      return;
    }

    Folder newFolder = folder.addNewFolder(true);
    newFolder.setDisplayName(newname);
    MakeLogicalViewProvider.setVisible(project, newFolder);
  }
 public void performAction(Node[] activatedNodes) {
   for (int i = 0; i < activatedNodes.length; i++) {
     Node n = activatedNodes[i];
     Folder folder = (Folder) n.getValue("Folder"); // NOI18N
     Item item = (Item) n.getValue("Item"); // NOI18N
     Project project = (Project) n.getValue("Project"); // NOI18N
     if (project == null) {
       return; // FIXUP
     }
     MakeCustomizerProvider cp = project.getLookup().lookup(MakeCustomizerProvider.class);
     if (cp == null) {
       return; // FIXUP
     }
     cp.showCustomizer(item);
     // dumpNativeFileInfo(item);
   }
 }