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) {
      }
    }
Exemplo n.º 2
0
  private void init() {
    // get absolute locations of icons
    String addImgRelPath =
        "data"
            + File.separator
            + "icons"
            + File.separator
            + "16x16"
            + File.separator
            + "actions"
            + File.separator
            + "list-add.png";
    File addImgFile = new File(addImgRelPath);
    String addImgURI = addImgFile.toURI().toASCIIString();

    String removeImgRelPath =
        "data"
            + File.separator
            + "icons"
            + File.separator
            + "16x16"
            + File.separator
            + "actions"
            + File.separator
            + "list-remove.png";
    File remImgFile = new File(removeImgRelPath);
    String remImgURI = remImgFile.toURI().toASCIIString();

    String infoTxt =
        INFO_TEXT
            .replaceAll("\\$\\{section_add_img\\}", addImgURI)
            .replaceAll("\\$\\{section_remove_img\\}", remImgURI);

    super.setInformationText(getClass().getName() + ".info", infoTxt);
  }
    public void actionPerformed(java.awt.event.ActionEvent evt) {
      SectionPanel sectionPanel = ((SectionPanel.HeaderButton) evt.getSource()).getSectionPanel();
      ExtendedServletsType servlet = (ExtendedServletsType) sectionPanel.getKey();
      // removing from data model

      try {
        dObj.setChangedFromUI(true);
        dObj.getWebExt().removeExtendedServlets(servlet);
        sectionPanel.getSectionView().removeSection(sectionPanel.getNode());
        sectionPanel.getSectionView().updateUI();
        sectionPanel.updateUI();

        dObj.modelUpdatedFromUI();

      } catch (java.io.IOException ec) {

      } finally {
        dObj.setChangedFromUI(false);
      }
    }
Exemplo n.º 4
0
 private void init() {
   super.setInformationText(getClass().getName() + ".info", INFO_TEXT);
 }