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) { } }
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); } }