public void actionPerformed(java.awt.event.ActionEvent evt) {
      try {
        dObj.setChangedFromUI(true);
        WSWebExt webext = dObj.getWebExt();
        ExtendedServletsType es = new ExtendedServletsType();
        es.setDefaults();
        int number = webext.getExtendedServlets().length + 1;
        long time_id = java.lang.System.currentTimeMillis();

        es.setExtendedServlet("");
        es.setXmiId("ServletExtension_" + time_id);
        es.setHref("");

        // rr.setTitle("Binding Item #"+number);
        webext.addExtendedServlets(es);
        //////////////////////////////////
        Node servletNode = new ServletsNode();
        view.getRoot().getChildren().add(new Node[] {servletNode});
        servletNode.setDisplayName(servletNode.getDisplayName() + number);

        dObj.modelUpdatedFromUI();
        SectionPanel sectionPanel = new SectionPanel(view, servletNode, es);
        sectionPanel.setHeaderActions(new javax.swing.Action[] {removeServletAction});
        ((WSWebExtView) view).getServletsContainer().addSection(sectionPanel, true);
        dObj.setChangedFromUI(false);

      } catch (java.io.IOException ex) {
      } catch (java.lang.IllegalArgumentException ex) {
      }
    }
Exemple #2
0
 @Override
 public int compareTo(Node o) {
   if (!(o instanceof PackageNode)) {
     return -1;
   } else {
     String on = o.getDisplayName();
     String tn = getDisplayName();
     return tn.compareTo(on);
   }
 }
  @Override
  public String getDisplayName() {
    final Node orig = getOriginal();

    String name = orig.getDisplayName();

    // do not show children counts for non content nodes
    if (orig instanceof AbstractContentNode) {
      // show only for file content nodes
      AbstractFile file = getLookup().lookup(AbstractFile.class);
      if (file != null) {
        try {
          final int numChildren = file.getChildrenCount();
          name = name + " (" + numChildren + ")";
        } catch (TskCoreException ex) {
          logger.log(Level.SEVERE, "Error getting children count to display for file: " + file, ex);
        }
      }
    }

    return name;
  }
  public State mouseReleased(Widget widget, WidgetMouseEvent event) {
    if (mEditNode == null) {
      return State.REJECTED;
    }
    if (widget instanceof ImageWidget) {
      ((ImageWidget) widget).setPaintAsDisabled(false);
    }
    final PropertySheet propertySheetPanel = new PropertySheet();
    final Node editNodeRef = mEditNode;
    mEditNode = null;

    propertySheetPanel.setNodes(new Node[] {editNodeRef});
    final Object[] options = new Object[] {Constants.CLOSE};
    final DialogDescriptor descriptor =
        new DialogDescriptor(
            propertySheetPanel,
            NbBundle.getMessage(getClass(), "STR_PROPERTIES", editNodeRef.getDisplayName()),
            true,
            options,
            null,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null);
    descriptor.setClosingOptions(options);

    final Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);

    // The dialog is modal, allow the action chain to continue while
    // we open the dialog later.
    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            dlg.setVisible(true);
          }
        });

    return State.CONSUMED;
  }
 @Override
 public String getDisplayName() {
   return baseNode.getDisplayName();
 }
Exemple #6
0
 @Override
 public int compareTo(Node o) {
   String on = o.getDisplayName();
   String tn = getDisplayName();
   return tn.compareTo(on);
 }