Package org.enhydra.shark.xpdl

Examples of org.enhydra.shark.xpdl.XMLElement


    protected boolean validateId(XMLPanel pnl, XMLElement el) {
        XMLComplexElement cel = null;
        String newId = null;
        XMLPanel idPanel = null;
        if (el instanceof XMLAttribute) {
            XMLElement parent = el.getParent();
            if (parent instanceof XMLCollectionElement) {
                cel = (XMLCollectionElement) parent;
                newId = cel.get("Id").toValue();
                if (pnl.getValue() instanceof String) {
                    newId = ((String) pnl.getValue()).trim();
View Full Code Here


    protected boolean validateName(XMLPanel pnl, XMLElement el) {
        XMLComplexElement cel = null;
        String newName = null;
        XMLPanel namePanel = null;
        if (el instanceof XMLAttribute) {
            XMLElement parent = el.getParent();
            if (parent instanceof XMLCollectionElement) {
                cel = (XMLCollectionElement) parent;
                newName = cel.get("Name").toValue();
                if (pnl.getValue() instanceof String) {
                    newName = ((String) pnl.getValue()).trim();
View Full Code Here

   public void update(XPDLElementChangeInfo info) {
      if (info.getSource() == this) {
         return;
      }

      XMLElement changedElement = info.getChangedElement();
      XMLElement current = getActiveElement();
      List removedElements = new ArrayList();

      JaWESelectionManager jsm = JaWEManager.getInstance().getJaWEController().getSelectionManager();
      if (changedElement == null || (jsm.getSelectedElements().size() == 1 && !jsm.canEditProperties())) {
         setActiveElement(null);
      } else if (info.getAction() == XMLElementChangeInfo.UPDATED) {
         if (current != null && XMLUtil.isChildsParent(current, info.getChangedElement())) {
            setActiveElement(current);
         }
      } else if (info.getAction() == XPDLElementChangeInfo.SELECTED) {
         setActiveElement(changedElement);
         // TODO: send multi sel to XMLTable and XMLList panels
         // if (changedElement instanceof XMLCollection) {
         // List chngdSubEls=info.getChangedSubElements();
         // if (chngdSubEls.size()>0) {
         // }
         // }
      } else if (info.getAction() == XMLElementChangeInfo.REMOVED) {
         List l = info.getChangedSubElements();
         if (l == null || l.size() == 0) {
            l = new ArrayList();
            l.add(info.getChangedElement());
         }
         for (int i = 0; i < l.size(); i++) {
            XMLElement el = (XMLElement) l.get(i);
            if (el==current || XMLUtil.isParentsChild(el, current)) {
               setActiveElement(null);
            }
            removedElements.add(el);
         }
View Full Code Here

      XMLPanel current = getViewPanel();
      if (current != null) {
         current.cleanup();
      }
      if (displayTitle) {
         XMLElement el = panel.getOwner();
         String t = "";
         if (el != null) {
//            t = " " + getLabelGenerator().getLabel(el);
            t = " " + panel.getTitle();
         }
View Full Code Here

   }

   public XMLElement getActiveElement() {
      XMLPanel p = getViewPanel();
      if (p != null) {
         XMLElement current = p.getOwner();
         if (current instanceof SpecialChoiceElement) {
            current = ((SpecialChoiceElement) current).getControlledElement();
         } else if (current instanceof ActivityTypesChoiceElement) {
            current = ((ActivityTypesChoiceElement) current).getControlledElement();
         }
View Full Code Here

   }

   public void applySpecial() {
      if (!canApplyChanges())
         return;
      XMLElement el = getActiveElement();

      getJaWEComponent().setUpdateInProgress(true);
      JaWEManager.getInstance().getJaWEController().startUndouableChange();
      apply();
      List toSelect = new ArrayList();
      XMLElement toSel = el;
      if (toSel != null) {
         toSelect.add(toSel);
      }
      JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
      getJaWEComponent().setUpdateInProgress(false);
View Full Code Here

      if (isModified) {
         int sw = showModifiedWarning();
         if (sw == JOptionPane.CANCEL_OPTION || (sw == JOptionPane.YES_OPTION && isModified()))
            return;
      }
      XMLElement el = getActiveElement();
      if (el != null) {
         XMLElement parent = el.getParent();
         if (parent != null) {
            XMLElement choice = null;
            while ((choice = XMLUtil.getParentElementByAssignableType(XMLComplexChoice.class, parent)) != null) {
               parent = choice.getParent();
            }
            setActiveElement(parent);
            JaWEManager.getInstance().getJaWEController().getSelectionManager().setSelection(parent, true);
         }
      }
View Full Code Here

      }
   }

   public void displayElement(XMLElement el) {
      XMLPanel previousPanel = getViewPanel();
      XMLElement previousElement = getActiveElement();
      if (previousPanel instanceof XMLTabbedPanel && previousElement != null) {
         XMLTabbedPanel tp = (XMLTabbedPanel) previousPanel;
         Class ec = previousElement.getClass();
         int activeTab = tp.getActiveTab();
         lastActiveTabs.put(ec, new Integer(activeTab));
      }

      // MUST BE SET BEFORE GENERATING NEW PANEL BECAUSE PANELGENERATOR
View Full Code Here

   }

   public void setActiveElement(XMLElement el) {
      if (hm!=null) {
         XMLElement current = getActiveElement();
         hm.addToHistory(current, el);
      }
      displayElement(el);
      getPanelSettings().adjustActions();
   }
View Full Code Here

         int sw = showModifiedWarning();
         if (sw == JOptionPane.CANCEL_OPTION || (sw == JOptionPane.YES_OPTION && isModified()))
            return;
      }
      if (hm.canGoBack()) {
         XMLElement el = hm.getPrevious(getActiveElement());
         displayElement(el);
         JaWEManager.getInstance().getJaWEController().getSelectionManager().setSelection(el, true);
         getPanelSettings().adjustActions();
      }
   }
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.XMLElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.