Examples of ModelHandler


Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      handler.moveLane(movedLane, targetParticipant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    TextAnnotation ta = null;

    try {
      ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      ta = ModelHandler.FACTORY.createTextAnnotation();
//      ta.setId(EcoreUtil.generateUUID());
      mh.addArtifact(FeatureSupport.getTargetParticipant(context, mh), ta);
      ta.setText("Enter your comment here");
    } catch (IOException e) {
      Activator.logError(e);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    Conversation c = null;
    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      c = ModelHandler.FACTORY.createConversation();
//      c.setId(EcoreUtil.generateUUID());
      c.setName("Conversation");
      handler.addConversationNode(c);
      ModelUtil.setID(c);
    } catch (IOException e) {
      Activator.logError(e);
    }
    addGraphicalRepresentation(context, c);
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

    }

  }

  protected void createDIEdge(Connection connection, BaseElement conElement, BPMNEdge edge) throws IOException {
    ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
    if (edge == null) {
      EList<EObject> businessObjects = Graphiti.getLinkService().getLinkForPictogramElement(getDiagram())
          .getBusinessObjects();
      for (EObject eObject : businessObjects) {
        if (eObject instanceof BPMNDiagram) {
          BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

          edge = BpmnDiFactory.eINSTANCE.createBPMNEdge();
//          edge.setId(EcoreUtil.generateUUID());
          edge.setBpmnElement(conElement);

          if (conElement instanceof Association) {
            edge.setSourceElement(modelHandler.findDIElement(getDiagram(),
                ((Association) conElement).getSourceRef()));
            edge.setTargetElement(modelHandler.findDIElement(getDiagram(),
                ((Association) conElement).getTargetRef()));
          } else if (conElement instanceof MessageFlow) {
            edge.setSourceElement(modelHandler.findDIElement(getDiagram(),
                (BaseElement) ((MessageFlow) conElement).getSourceRef()));
            edge.setTargetElement(modelHandler.findDIElement(getDiagram(),
                (BaseElement) ((MessageFlow) conElement).getTargetRef()));
          } else if (conElement instanceof SequenceFlow) {
            edge.setSourceElement(modelHandler.findDIElement(getDiagram(),
                ((SequenceFlow) conElement).getSourceRef()));
            edge.setTargetElement(modelHandler.findDIElement(getDiagram(),
                ((SequenceFlow) conElement).getTargetRef()));
          }

          ILocation sourceLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getStart());
          ILocation targetLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getEnd());
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    BaseElement element = null;
    try {
      ModelHandler handler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      element = add(context.getTargetContainer(), handler);
    } catch (IOException e) {
      Activator.logError(e);
    }
    addGraphicalRepresentation(context, element);
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
    public Object[] create(ICreateContext context) {
    RootElement element = null;
   
    try {
      ModelHandler handler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      element = createRootElement();
//      element.setId(EcoreUtil.generateUUID());
      handler.addRootElement(element);
    } catch (IOException e) {
      Activator.logError(e);
    }

    addGraphicalRepresentation(context, element);
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    T element = null;
    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      element = createFlowElement(context);
//      element.setId(EcoreUtil.generateUUID());
      if (FeatureSupport.isTargetLane(context) && element instanceof FlowNode) {
        ((FlowNode) element).getLanes().add(
            (Lane) getBusinessObjectForPictogramElement(context.getTargetContainer()));
      }

      handler.addFlowElement(getBusinessObjectForPictogramElement(context.getTargetContainer()), element);
    } catch (IOException e) {
      Activator.logError(e);
    }
    addGraphicalRepresentation(context, element);
    ModelUtil.setID(element);
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane parentLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Lane movedLane = (Lane) getBusinessObjectForPictogramElement(context.getShape());
    parentLane.getChildLaneSet().getLanes().remove(movedLane);
    try {
      ModelHandler mh = ModelHandler.getInstance(getDiagram());
      mh.laneToTop(movedLane);
    } catch (IOException e) {
      Activator.logError(e);
    }
  }
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

  @Override
  public Object[] create(ICreateContext context) {
    Artifact artifact = null;
    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      artifact = createArtifact(context);
      handler.addArtifact(FeatureSupport.getTargetParticipant(context, handler), artifact);
    } catch (IOException e) {
      Activator.logError(e);
    }
    addGraphicalRepresentation(context, artifact);
    return new Object[] { artifact };
View Full Code Here

Examples of org.eclipse.bpmn2.modeler.core.ModelHandler

    if (!(getBusinessObjectForPictogramElement(context.getShape()) instanceof FlowNode)) {
      return false;
    }

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());

      algorithmContainer = getAlgorithmContainer(context);

      if (algorithmContainer.isEmpty()) {
        return onMoveAlgorithmNotFound(context);
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.