Package org.enhydra.jawe.base.controller

Examples of org.enhydra.jawe.base.controller.JaWEController


        }
    }

    public void actionPerformed(ActionEvent e) {
        if (!(e.getSource() instanceof JaWETypeChoiceButton)) {
            JaWEController jc = JaWEManager.getInstance().getJaWEController();
            Package pkg = jc.getMainPackage();
            if (pkg == null) {
                return;
            }
            jc.startUndouableChange();
            XPDLObjectFactory of = JaWEManager.getInstance().getXPDLObjectFactory();
            WorkflowProcess wp = of.createXPDLObject(pkg.getWorkflowProcesses(),
                    jc.getJaWETypes().getDefaultType(WorkflowProcess.class),
                    true);
            List toSelect = new ArrayList();
            toSelect.add(wp);
            jc.endUndouableChange(toSelect);
        }
    }
View Full Code Here


                        cs
                    });
            jaweController.init();
            loggingManager.info("JaWEManager -> Working with '" + jcClass + "' implementation of JaWE Controller");
        } catch (Throwable ex) {
            jaweController = new JaWEController(new ControllerSettings());
            jaweController.init();
            if (JaWE.getJaWEVersion() != JaWE.COMMUNITY_VERSION) {
                String msg = "JaweManager -> Problems while instantiating JaWE Controller '" + jcClass + "' - using default implementation!";
                loggingManager.error(msg, ex);
            } else {
View Full Code Here

    public void enableDisableAction() {
        setEnabled(JaWEManager.getInstance().getJaWEController().isSaveEnabled(false));
    }

    public void actionPerformed(ActionEvent e) {
        JaWEController jc = JaWEManager.getInstance().getJaWEController();

        boolean save = true;
        boolean allowInvalidPackageSaving = jc.getControllerSettings().allowInvalidPackageSaving() && !"Released".equalsIgnoreCase(jc.getMainPackage().getRedefinableHeader().getPublicationStatus());
        boolean isModelOK = false;

        if (!allowInvalidPackageSaving) {
            StandardPackageValidator xpdlValidator = JaWEManager.getInstance().getXPDLValidator();
            xpdlValidator.init(
                    JaWEManager.getInstance().getXPDLHandler(),
                    jc.getMainPackage(),
                    false,
                    jc.getControllerSettings().getEncoding(),
                    JaWEManager.getInstance().getStartingLocale());

            isModelOK = jc.checkValidity(jc.getMainPackage(), false).size() == 0;
            if (!isModelOK) {
                String msg = jc.getSettings().getLanguageDependentString("ErrorCannotSaveIncorrectPackage");
                jc.getJaWEFrame().message(msg, JOptionPane.ERROR_MESSAGE);
                save = false;
            }
        }

        if (save) {
            String oldFilename = jc.getPackageFilename(jc.getMainPackageId());
            String newFilename = null;
            Package pkg = jc.getMainPackage();
            if (oldFilename == null || myName != null) {
                newFilename = jc.getJaWEFrame().saveDialog(
                        jc.getSettings().getLanguageDependentString("SaveAs" + BarFactory.LABEL_POSTFIX), 0,
                        pkg.getId());
                if (!newFilename.endsWith(".xpdl")) {
                    newFilename = newFilename + ".xpdl";
                }
            } else {
                newFilename = oldFilename;
            }
            if (newFilename != null) {
                jc.savePackage(pkg.getId(), newFilename);
            }
        }
    }
View Full Code Here

    public Delete(JaWEComponent jawecomponent) {
        super(jawecomponent);
    }

    public void enableDisableAction() {
        JaWEController jc = (JaWEController) jawecomponent;

        if (jc.getSelectionManager().canDelete()) {
            setEnabled(true);
        } else {
            setEnabled(false);
        }
    }
View Full Code Here

            setEnabled(false);
        }
    }

    public void actionPerformed(ActionEvent e) {
        JaWEController jc = JaWEManager.getInstance().getJaWEController();
        List sel = jc.getSelectionManager().getSelectedElements();
        XMLElement firstSelected = jc.getSelectionManager().getSelectedElement();

        //CUSTOM
        if ((!(firstSelected instanceof WorkflowProcess)) || (((JMenuItem) e.getSource()).getAccelerator().getKeyCode() == KeyEvent.VK_DELETE && e.getModifiers() != 0)) {
            if (jc.confirmDelete(sel, firstSelected)) {
                jc.getEdit().delete();
            }
        }
        //CUSTOM

    }
View Full Code Here

         int newpos = owncol.indexOf(currentElementAtPosition);

         listModel.remove(movingElementPosition);
         listModel.add(newMovingElementPosition, movingElement);

         JaWEController jc = JaWEManager.getInstance().getJaWEController();
         jc.startUndouableChange();
         owncol.reposition(movingElement.getElement(), newpos);
         List toSelect = new ArrayList();
         toSelect.add(movingElement.getElement());
         jc.endUndouableChange(toSelect);

         try {
            allParam.setSelectedIndex(newMovingElementPosition);
         } catch (Exception ex) {
         }
View Full Code Here

      p.add(buttonDown);
      return p;
   }

   protected void adjustActions() {
      JaWEController jc = JaWEManager.getInstance().getJaWEController();

      XMLElement selEl=getSelectedElement();
      newElementAction.setEnabled(jc.canCreateElement((XMLCollection) getOwner()));
      editElementAction.setEnabled((selEl != null && XMLUtil.getPackage(selEl)!=null));
      deleteElementAction.setEnabled((selEl != null && jc.canRemoveElement((XMLCollection)getOwner(), selEl)));

      boolean canRepos = JaWEManager.getInstance().getJaWEController().canRepositionElement((XMLCollection) getOwner(),
            null);
      moveUpAction.setEnabled(selEl != null && allParam.getSelectedIndex() > 0 && canRepos);
      moveDownAction.setEnabled(selEl != null
View Full Code Here

         DefaultTableModel dtm = (DefaultTableModel) allItems.getModel();
         Vector v = getRow(movingElement);
         dtm.removeRow(movingElementPosition);
         dtm.insertRow(newMovingElementPosition, v);

         JaWEController jc = JaWEManager.getInstance().getJaWEController();
         jc.startUndouableChange();
         owncol.reposition(movingElement, newpos);
         List toSelect = new ArrayList();
         toSelect.add(movingElement);
         jc.endUndouableChange(toSelect);

         setSelectedRow(newMovingElementPosition);

         movingElementPosition = newMovingElementPosition;
      }
View Full Code Here

      }
      return row;
   }

   protected void adjustActions() {
      JaWEController jc = JaWEManager.getInstance().getJaWEController();

      XMLElement selEl=getSelectedElement();
      newElementAction.setEnabled(jc.canCreateElement((XMLCollection) getOwner()));
      editElementAction.setEnabled((selEl != null && XMLUtil.getPackage(selEl)!=null));
      deleteElementAction.setEnabled((selEl != null && jc.canRemoveElement((XMLCollection)getOwner(), selEl)));

      boolean canRepos = JaWEManager.getInstance().getJaWEController().canRepositionElement((XMLCollection) getOwner(),
            null);
      moveUpAction.setEnabled(selEl != null && allItems.getSelectedRow() > 0 && canRepos);
      moveDownAction.setEnabled(selEl != null
View Full Code Here

TOP

Related Classes of org.enhydra.jawe.base.controller.JaWEController

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.