Package org.eclipse.graphiti.mm.pictograms

Examples of org.eclipse.graphiti.mm.pictograms.PictogramElement


  @Override
  public boolean canResizeShape(IResizeShapeContext context) {
    EObject container = context.getShape().eContainer();
    if (container instanceof PictogramElement) {
      PictogramElement containerElem = (PictogramElement) container;
      if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
        return false;
      }
    }
    return super.canResizeShape(context);
View Full Code Here


    composite = new MainPropertiesComposite(parent, SWT.None);
  }

  @Override
  public void refresh() {
    PictogramElement pe = getSelectedPictogramElement();
    if (pe != null) {
      final EObject be = BusinessObjectUtil.getFirstElementOfType(pe, BaseElement.class);
      final BPMNShape shape = BusinessObjectUtil.getFirstElementOfType(pe, BPMNShape.class);
      final BPMN2Editor diagramEditor = (BPMN2Editor) getDiagramEditor();
      updateComposite(be, diagramEditor, shape);
View Full Code Here

    }

    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      PictogramElement element = context.getPictogramElement();
      String property = peService.getPropertyValue(element, CALL_ACTIITY_REF_PROPERTY);
      if (property == null) {
        return Reason.createFalseReason();
      }
      CallActivity callActivity = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
View Full Code Here

   * @param id - ID of this Custom Task
   */
  public static void setId(IContext context, String id) {
   
    if (context instanceof IPictogramElementContext) {
      PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
      Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
    }
    else {
      context.putProperty(CUSTOM_TASK_ID, id);
    }
View Full Code Here

   * @return - ID string for this task.
   */
  public static String getId(IContext context) {
    Object id = null;
    if (context instanceof IPictogramElementContext) {
      PictogramElement pe = ((IPictogramElementContext)context).getPictogramElement();
      id = Graphiti.getPeService().getPropertyValue(pe,CUSTOM_TASK_ID);
    }
    else {
      id = context.getProperty(CUSTOM_TASK_ID);
    }
View Full Code Here

      // create a new AddContext and copy our ID into it.
      IAddContext addContext = new AddContext(context, newObject);
      setId(addContext, getId());
     
      // create the PE and copy our ID into its properties.
      PictogramElement pe = getFeatureProvider().addIfPossible(addContext);
      Graphiti.getPeService().setPropertyValue(pe,CUSTOM_TASK_ID,id);
     
      return pe;
    }
View Full Code Here

    return TYPE_TEXT;
    }

  @Override
    public String getInitialValue(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
    return participant.getName();
    }
View Full Code Here

    return participant.getName();
    }

  @Override
    public void setValue(String value, IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
    participant.setName(value);
    updatePictogramElement(((Shape) pe).getContainer());
    }
View Full Code Here

    return null;
  }

  @Override
  public boolean canDirectEdit(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Object bo = getBusinessObjectForPictogramElement(pe);
    GraphicsAlgorithm ga = context.getGraphicsAlgorithm();
    return bo instanceof Participant && ga instanceof Text;
  }
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canLayout(ILayoutContext context) {
    PictogramElement pictoElem = context.getPictogramElement();
    if (!(pictoElem instanceof ContainerShape)) {
      return false;
    }
    return BusinessObjectUtil.containsElementOfType(pictoElem, BaseElement.class);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.pictograms.PictogramElement

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.