Examples of Swimlane


Examples of org.jbpm.ui.common.model.Swimlane

        }

        @Override
        public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            Swimlane swimlane = (Swimlane) selection.getFirstElement();

            List<Swimlane> children = swimlane.getParent().getChildren(Swimlane.class);
            int index = children.indexOf(swimlane);
            swimlane.getParent().swapChilds(swimlane, up ? children.get(index-1) : children.get(index+1));
            viewer.setSelection(selection);
        }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

public class SwimlaneInitializerProvider extends DelegableProvider {

    @Override
    public String showConfigurationDialog(Delegable delegable) {
        Swimlane swimlane = (Swimlane) delegable;
        ProcessDefinition definition = swimlane.getProcessDefinition();

        String path = definition.getSwimlaneGUIConfiguration().getEditorPath(swimlane.getName());
        SwimlaneConfigDialog dialog = new SwimlaneConfigDialog(definition, swimlane, path);
        if (dialog.open() == IDialogConstants.OK_ID) {
            definition.getSwimlaneGUIConfiguration().putSwimlanePath(swimlane.getName(), dialog.getPath());
            return dialog.getConfiguration();
        }
        return null;
    }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
                Swimlane swimlane = (Swimlane) selection.getFirstElement();
                GPDSearchQuery query = new GPDSearchQuery(editor.getDefinitionFile(), getDefinition(), swimlane.getName());
                NewSearchUI.runQueryInBackground(query);
            } catch (Exception ex) {
              DesignerLogger.logError(ex);
            }
        }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

    private class RenameSwimlaneSelectionListener extends SelectionAdapter {

        @Override
        public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            Swimlane swimlane = (Swimlane) selection.getFirstElement();

            UpdateSwimlaneNameDialog renameDialog = new UpdateSwimlaneNameDialog(swimlane.getProcessDefinition(), false);
            renameDialog.setName(swimlane.getName());
            int result = renameDialog.open();
            String newName = renameDialog.getName();
            boolean useLtk = renameDialog.isProceedRefactoring();
            if (result != IDialogConstants.OK_ID) {
                return;
            }
            IResource projectRoot = editor.getDefinitionFile().getParent();
            if (useLtk) {
                PortabilityRefactoring ref = new PortabilityRefactoring(
                        editor.getDefinitionFile(), editor.getDefinition(),
                        swimlane.getName(), newName);
                useLtk &= ref.isUserInteractionNeeded();
                if (useLtk) {
                    RenameRefactoringWizard wizard = new RenameRefactoringWizard(ref);
                    wizard.setDefaultPageTitle(Messages.getString("Refactoring.variable.name"));
                    RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
                    try {
                        result = op.run(Display.getCurrent().getActiveShell(), "");
                        if (result != IDialogConstants.OK_ID) {
                            return;
                        }
                    } catch (InterruptedException ex) {
                        // operation was canceled
                    }
                }
            }
            swimlane.setName(newName);
            if (useLtk) {
                IDE.saveAllEditors(new IResource[] { projectRoot }, false);
            }
        }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

    private void createSwimlane() {
        UpdateSwimlaneNameDialog newSwimlaneDialog = new UpdateSwimlaneNameDialog(currentDefinition, true);
        if (newSwimlaneDialog.open() == IDialogConstants.OK_ID) {
            String swimlaneName = newSwimlaneDialog.getName();
            Swimlane newSwimlane = JpdlVersionRegistry.getElementTypeDefinition(currentDefinition.getJpdlVersion(), "swimlane").createElement();
            newSwimlane.setParent(currentDefinition);
            newSwimlane.setName(swimlaneName);
            newSwimlane.setDelegationClassName(Swimlane.DELEGATION_CLASS_NAME);
            currentDefinition.addSwimlane(newSwimlane);
            setSwimlane(swimlaneName);
        }
    }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

        }
    }

    private void setSwimlane(String swimlaneName) {
        if (swimlaneName != null) {
            Swimlane swimlane = currentDefinition.getSwimlaneByName(swimlaneName);
            currentNode.setSwimlane(swimlane);
        } else {
            currentNode.setSwimlane(null);
        }
    }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

                                elements.add(copyAction);
                            }
                        }
                    }
                    if (node instanceof SwimlanedNode) {
                        Swimlane swimlane = ((SwimlanedNode) node).getSwimlane();
                        if (swimlane != null) {
                            CopySwimlaneAction copyAction = new CopySwimlaneAction(swimlane);
                            elements.add(copyAction);
                        }
                    }
                    if (node instanceof Active) {
                        List<? extends org.jbpm.ui.common.model.Action> actions = ((Active) node).getActions();
                        for (org.jbpm.ui.common.model.Action action : actions) {
                            AddActionHandlerAction copyAction = new AddActionHandlerAction((Active) copy, action);
                            elements.add(copyAction);
                        }
                    }
                }
            }

            // add transitions
            GEFElementCreationFactory trFactory = new GEFElementCreationFactory("transition", targetDefinition);
            for (Node node : sourceNodeList) {
                List<Transition> transitions = node.getChildren(Transition.class);
                for (Transition transition : transitions) {
                    Node source = targetNodeList.get(transition.getSource().getName());
                    Node target = targetNodeList.get(transition.getTarget().getName());
                    if (source != null && target != null) {
                        Transition tr = (Transition) trFactory.getNewObject(source);
                        tr.setName(transition.getName());
                        tr.setTarget(target);
                        for (Bendpoint bp : transition.getBendpoints()) {
                            tr.getBendpoints().add(new Bendpoint(bp.getX(), bp.getY()));
                        }
                        source.addLeavingTransition(tr);

                        for (org.jbpm.ui.common.model.Action action : transition.getActions()) {
                            AddActionHandlerAction copyAction = new AddActionHandlerAction(tr, action);
                            elements.add(copyAction);
                        }
                    }
                }
            }

            List<ExtraCopyAction> userConfirmedActions = new ArrayList<ExtraCopyAction>();
            for (ExtraCopyAction copyAction : elements) {
                if (copyAction.isUserConfirmationRequired()) {
                    copyAction.setEnabled(false);
                    userConfirmedActions.add(copyAction);
                }
            }
            if (userConfirmedActions.size() > 0) {
                // display dialog with collisions
                CopyGraphRewriteDialog dialog = new CopyGraphRewriteDialog(userConfirmedActions);
                dialog.open();
            }

            // run copy actions
            for (ExtraCopyAction copyAction : elements) {
                if (copyAction.isEnabled()) {
                    copyAction.execute();
                    executedActionsList.add(copyAction);
                }
            }

            // set swimlanes
            for (Node node : targetNodeList.values()) {
                if (node instanceof SwimlanedNode) {
                    SwimlanedNode sourceNode = (SwimlanedNode) copyBuffer.getSourceDefinition().getNodeByNameNotNull(node.getName());
                    Swimlane swimlane = targetDefinition.getSwimlaneByName(sourceNode.getSwimlaneName());
                    ((SwimlanedNode) node).setSwimlane(swimlane);
                }
            }
        } catch (Exception e) {
            DesignerLogger.logError("'Paste' operation failed", e);
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

    }
   
    @Override
    public void activate() {
        if (!isActive()) {
            Swimlane swimlane = getSwimlane();
            if (swimlane != null) {
                swimlane.addPropertyChangeListener(this);
            }
            super.activate();
        }
    }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

    }

    @Override
    public void deactivate() {
        if (isActive()) {
            Swimlane swimlane = getSwimlane();
            if (swimlane != null) {
                swimlane.removePropertyChangeListener(this);
            }
            super.deactivate();
        }
    }
View Full Code Here

Examples of org.jbpm.ui.common.model.Swimlane

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        super.propertyChange(evt);
        String propertyName = evt.getPropertyName();
        if (PROPERTY_SWIMLANE.equals(propertyName)) {
            Swimlane oldSwimlane = (Swimlane) evt.getOldValue();
            Swimlane newSwimlane = (Swimlane) evt.getNewValue();
            if (oldSwimlane != null) {
                oldSwimlane.removePropertyChangeListener(this);
            }
            if (newSwimlane != null) {
                newSwimlane.addPropertyChangeListener(this);
            }
            getFigure().setSwimlaneName(newSwimlane);
        }
        if (PROPERTY_NAME.equals(propertyName) && evt.getSource() instanceof Swimlane) {
            getFigure().setSwimlaneName(getModel().getSwimlane());
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.