Examples of XMLPanel


Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

    }

    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();
                    idPanel = pnl;
                }
            } else if (parent instanceof Package) {
                cel = (Package) parent;
                newId = cel.get("Id").toValue();
                if (pnl.getValue() instanceof String) {
                    newId = ((String) pnl.getValue()).trim();
                    idPanel = pnl;
                }
            }
        } else if (el instanceof XMLComplexElement) {
            cel = (XMLComplexElement) el;
            newId = cel.get("Id").toValue();
            idPanel = findPanel(pnl, cel.get("Id"));
            if (idPanel != null) {
                if (idPanel.getValue() instanceof String) {
                    newId = ((String) idPanel.getValue()).trim();
                }
            }
        }

        System.err.println("Valid for " + el + ", par=" + el.getParent() + ", newid=" + newId + ", idp=" + idPanel);
        boolean isValid = XMLUtil.isIdValid(newId);

        //check for period (.)
        if(isValid && newId.contains(".")){
            isValid = false;
        }

        if (!isValid) {
            XMLBasicPanel.errorMessage(pnl.getWindow(), ResourceManager.getLanguageDependentString("ErrorMessageKey"), "",
                    ResourceManager.getLanguageDependentString(XPDLValidationErrorIds.ERROR_INVALID_ID));
            idPanel.requestFocus();
            return false;
        }

        if (cel != null) {

            boolean isUniqueId = true;
            if (cel instanceof XMLCollectionElement) {
                isUniqueId = JaWEManager.getInstance().getIdFactory().isIdUnique((XMLCollectionElement) cel, newId);
            } else {
                Package fp = JaWEManager.getInstance().getXPDLHandler().getPackageById(newId);
                if (fp != null && fp != cel && fp.getId().equals(newId)) {
                    isUniqueId = false;
                }
            }

            if (!isUniqueId) {
                XMLBasicPanel.errorMessage(pnl.getWindow(), ResourceManager.getLanguageDependentString("ErrorMessageKey"),
                        "", ResourceManager.getLanguageDependentString(XPDLValidationErrorIds.ERROR_NON_UNIQUE_ID));
                idPanel.requestFocus();
                return false;
            }
        }
        return true;
    }
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

    }

    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();
                    namePanel = pnl;
                }
            } else if (parent instanceof Package) {
                cel = (Package) parent;
                newName = cel.get("Name").toValue();
                if (pnl.getValue() instanceof String) {
                    newName = ((String) pnl.getValue()).trim();
                    namePanel = pnl;
                }
            }
        } else if (el instanceof XMLComplexElement) {
            cel = (XMLComplexElement) el;
            newName = cel.get("Name") != null ? cel.get("Name").toValue() : "";
            namePanel = findPanel(pnl, cel.get("Name"));
            if (namePanel != null) {
                if (namePanel.getValue() instanceof String) {
                    newName = ((String) namePanel.getValue()).trim();
                }
            }
        }

        System.err.println("Valid for " + el + ", par=" + el.getParent() + ", newname=" + newName + ", namep=" + namePanel);
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

        String newFrom = oldFrom;
        String newTo = oldTo;
        String newType = tra.getCondition().getType();

        if (el instanceof Transition) {
            XMLPanel ftPanel = findPanel(pnl, tra.get("From"));
            if (ftPanel != null) {
                Object v = ftPanel.getValue();
                if (v instanceof XMLElement) {
                    if (v instanceof Activity) {
                        newFrom = ((Activity) v).getId();
                    }
                } else if (v instanceof String) {
                    newFrom = ((String) v).trim();
                }
            }
            ftPanel = findPanel(pnl, tra.get("To"));
            if (ftPanel != null) {
                Object v = ftPanel.getValue();
                if (v instanceof XMLElement) {
                    if (v instanceof Activity) {
                        newTo = ((Activity) v).getId();
                    }
                } else if (v instanceof String) {
                    newTo = ((String) v).trim();
                }
            }
            ftPanel = findPanel(pnl, ((Condition) tra.get("Condition")).getTypeAttribute());
            if (ftPanel != null) {
                Object v = ftPanel.getValue();
                if (v instanceof String) {
                    newType = ((String) v).trim();
                }
            }
        } else if (el instanceof XMLAttribute && (el.toName().equals("From") || el.toName().equals("To"))) {
            Object v = pnl.getValue();
            String toOrFrom = null;
            if (v instanceof XMLElement) {
                if (v instanceof Activity) {
                    toOrFrom = ((Activity) v).getId();
                }
            } else if (v instanceof String) {
                toOrFrom = ((String) v).trim();
            }
            if (toOrFrom != null) {
                if (el.toName().equals("From")) {
                    newFrom = toOrFrom;
                } else {
                    newTo = toOrFrom;
                }
            }
        } else if (el instanceof Condition) {
            XMLPanel ftPanel = findPanel(pnl, ((Condition) tra.get("Condition")).getTypeAttribute());
            if (ftPanel != null) {
                Object v = ftPanel.getValue();
                if (v instanceof String) {
                    newType = ((String) v).trim();
                }
            }
        } else if (el instanceof XMLAttribute && el.getParent() instanceof Condition && el.toName().equals("Type")) {
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

      getPanelSettings().adjustActions();
   }

   public void setViewPanel(XMLPanel panel) {
      XMLPanel current = getViewPanel();
      if (current != null) {
         current.cleanup();
      }
      if (displayTitle) {
         XMLElement el = panel.getOwner();
         String t = "";
         if (el != null) {
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

      return null;
   }

   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

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

      }
      return null;
   }

   public void apply() {
      XMLPanel p = getViewPanel();
      if (p != null) {
         p.setElements();
      }
   }
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

      }
   }

   public boolean canApplyChanges() {
      if (getViewPanel() != null) {
         XMLPanel p = getViewPanel();
//         System.err.println("CAAAAAAAACCCCCCCC for "+p);
         if (p.validateEntry()) {
//            System.err.println("ENTRY IS VALID FOR "+p);
            return JaWEManager.getInstance().getPanelValidator().validatePanel(p.getOwner(), p);
         }
      }

      return false;
   }
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

         }
      }
   }

   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
      // CAN SET THIS FLAG TO TRUE
      isModified = false;

      XMLPanel p;
      if (el != null) {
         p = this.panelGenerator.getPanel(el);
      } else {
         p = new XMLBasicPanel();
      }
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

        List panels = new ArrayList();
        Set hidden = getHiddenElements("XMLGroupPanel", el);
        for (int i = 1;; i++) {
            try {
                XMLPanel p = getPanel(el, i, hidden);
                if (p != null) {
                    panels.add(p);
                }
            } catch (Exception ex) {
                break;
View Full Code Here

Examples of org.enhydra.jawe.base.panel.panels.XMLPanel

    }

    //CUSTOM
    protected XMLPanel getPanel(Activity el, int no, Set hidden) {
        XMLPanel p = null;
        List panelElements = new ArrayList();

        switch(no) {
            case 1:
                // get workflow variables and formal parameters
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.