Examples of ILinkService


Examples of org.eclipse.graphiti.services.ILinkService

  }
 
  private Pair<Shape, LocalVariableStatement> getPEWithType(
      String type, Diagram d) {
   
    ILinkService ls = Graphiti.getLinkService();
    EObject linked = null;
    LocalVariableStatement modelObject = null;
    //Find PE
    Shape peShape = null;
    for (Shape s : d.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof LocalVariableStatement) {
        LocalVariableStatement lvs = (LocalVariableStatement) linked;

        if (lvs.getVariable().getTypeReference().getTarget() instanceof
            ProcessingElementDefinition) {
View Full Code Here

Examples of org.eclipse.graphiti.services.ILinkService

  public void testLiteralToPEConnection() {
   
    final DiagramEditor de = TestUtil.loadFile("addConnection.dispel");
   
    Diagram d = de.getDiagramTypeProvider().getDiagram();
    ILinkService ls = Graphiti.getLinkService();
   
    ContainerShape peShape = null;
    EObject linked = null;
   
    //Get Demo Echo PE
    for (Shape s : d.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof LocalVariableStatement) {
        if (((LocalVariableStatement) linked).getVariable().getName(
            ).equals("DemoEcho")) {
          assertTrue(s instanceof ContainerShape);
          peShape = (ContainerShape) s;
          break;
        }
      }
    }
   
    assertNotNull(peShape);
    assertNotNull(linked.eContainer());
   
    //Find Literal
    Shape literalShape = null;
    for (Shape s : d.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof ConnectionInitialization) {
        ConnectionInitialization ci = (ConnectionInitialization) linked;
        EObject e = Utility.getChildLiteral(ci);
        if (Utility.getLiteralValue(
            Utility.getChildLiteral(ci)).equals("\"Connection\"")) {
          literalShape = s;
          break;
        }
      }
    }
   
    assertNotNull(literalShape);
    assertNotNull(linked.eContainer());
    assertTrue(literalShape.getAnchors().size() > 0);
   
    ProcessingElementParameter param = null;
    Shape paramShape = null;
    for (Shape s :peShape.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof ProcessingElementParameter) {
        ProcessingElementParameter paramTmp =
            (ProcessingElementParameter) linked;
        if (paramTmp.getName().equals("input")) {
          param = paramTmp;
View Full Code Here

Examples of org.eclipse.graphiti.services.ILinkService

  public void testDeletePE() {
   
    final DiagramEditor de = TestUtil.loadFile("test.dispel");
 
    Diagram d = de.getDiagramTypeProvider().getDiagram();
    ILinkService ls = Graphiti.getLinkService();
   
    Shape peShape = null;
    EObject linked = null;

    //Find a PE
    for (Shape s : d.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof LocalVariableStatement) {
        if (((LocalVariableStatement) linked).getVariable().getName(
            ).equals("DemoEcho")) {
          peShape = s;
          break;
View Full Code Here

Examples of org.eclipse.graphiti.services.ILinkService

    return holder.get(0);
  }
 
  public static Pair<Shape, EObject> getLiteralWithName(
      String name, Diagram d) {
    ILinkService ls = Graphiti.getLinkService();
    EObject linked = null;
    EObject modelObject = null;
    //Find Literal
    Shape literalShape = null;
    for (Shape s : d.getChildren()) {
      linked = ls.getBusinessObjectForLinkedPictogramElement(s);
      if (linked instanceof ConnectionInitialization) {
        ConnectionInitialization ci = (ConnectionInitialization) linked;
        EObject e = Utility.getChildLiteral(ci);
        if (Utility.getLiteralValue(
            Utility.getChildLiteral(ci)).equals(name)) {
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.