/** @generated */
  @Override
  protected Command getCreateCommand(CreateElementRequest req) {
    IElementType requestElementType = req.getElementType();
    if (requestElementType == null) {
      return super.getCreateCommand(req);
    }

    if (UMLElementTypes.Lifeline_8001 == requestElementType) {

      return getGEFWrapper(
          new LifelineCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Comment_8005 == requestElementType) {

      return getGEFWrapper(new CommentCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Constraint_8004 == requestElementType) {

      return getGEFWrapper(
          new ConstraintCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.TimeObservation_8006 == requestElementType) {

      return getGEFWrapper(
          new TimeObservationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.DurationObservation_8007 == requestElementType) {

      return getGEFWrapper(
          new DurationObservationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    return super.getCreateCommand(req);
  }
 /** {@inheritDoc} */
 @Override
 protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
   if (UMLElementTypes.Association_4001 == req.getElementType()) {
     return getGEFWrapper(
         new org.eclipse.papyrus.uml.diagram.clazz.custom.command.CAssociationCreateCommand(
             req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.AssociationClass_4017 == req.getElementType()) {
     return getGEFWrapper(
         new CAssociationClassCreateCommand(
             req, req.getSource(), req.getTarget(), DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.TemplateBinding_4015 == req.getElementType()) {
     return getGEFWrapper(
         new CTemplateBindingCreateCommand(req, req.getSource(), req.getTarget()));
   }
   return super.getCompleteCreateRelationshipCommand(req);
 }
 /** @generated */
 protected Command getCreateCommand(CreateElementRequest req) {
   IElementType requestElementType = req.getElementType();
   if (requestElementType == null) {
     return super.getCreateCommand(req);
   }
   if (UMLElementTypes.Comment_1007 == requestElementType) {
     return getGEFWrapper(new CommentCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Model_1027 == requestElementType) {
     return getGEFWrapper(new ModelCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Profile_1024 == requestElementType) {
     return getGEFWrapper(new ProfileCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Package_1012 == requestElementType) {
     return getGEFWrapper(new PackageCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Constraint_1028 == requestElementType) {
     return getGEFWrapper(
         new ConstraintCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Enumeration_3025 == requestElementType) {
     return getGEFWrapper(
         new EnumerationCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.PrimitiveType_3026 == requestElementType) {
     return getGEFWrapper(
         new PrimitiveTypeCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.DataType_3027 == requestElementType) {
     return getGEFWrapper(
         new DataTypeCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Stereotype_1023 == requestElementType) {
     return getGEFWrapper(
         new StereotypeCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   if (UMLElementTypes.Class_3010 == requestElementType) {
     return getGEFWrapper(new ClassCreateCommandCN(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   return super.getCreateCommand(req);
 }
Esempio n. 4
0
 /** @generated */
 protected Command getCreateCommand(CreateElementRequest req) {
   IElementType requestElementType = req.getElementType();
   if (requestElementType == null) {
     return super.getCreateCommand(req);
   }
   if (UMLElementTypes.ExtensionPoint_3007 == requestElementType) {
     return getGEFWrapper(
         new ExtensionPointCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
   }
   return super.getCreateCommand(req);
 }
 /**
  * Overridable method that effectively create the diagram with the given validated parameters
  *
  * @param diagramResource the diagram resource
  * @param owner the diagram's owner
  * @param element the diagram's model element
  * @param prototype the diagram's prototype
  * @param name the diagram's name
  * @return the created diagram, or <code>null</code> if the creation failed
  */
 protected Diagram doCreateDiagram(
     Resource diagramResource,
     EObject owner,
     EObject element,
     ViewPrototype prototype,
     String name) {
   // create diagram
   Diagram diagram =
       ViewService.createDiagram(element, getDiagramNotationID(), getPreferenceHint());
   if (diagram != null) {
     diagram.setName(name);
     diagram.setElement(element);
     DiagramUtils.setOwner(diagram, owner);
     if (!prototype.isNatural()) {
       DiagramUtils.setPrototype(diagram, prototype);
     }
     initializeDiagram(diagram);
     diagramResource.getContents().add(diagram);
   }
   return diagram;
 }
  /** @generated */
  @Override
  protected Command getCreateCommand(CreateElementRequest req) {
    IElementType requestElementType = req.getElementType();
    if (requestElementType == null) {
      return super.getCreateCommand(req);
    }

    if (UMLElementTypes.Property_3002 == requestElementType) {

      return getGEFWrapper(
          new ClassPropertyCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    return super.getCreateCommand(req);
  }
  /** @generated */
  @Override
  protected Command getCreateCommand(CreateElementRequest req) {
    IElementType requestElementType = req.getElementType();
    if (requestElementType == null) {
      return super.getCreateCommand(req);
    }

    if (UMLElementTypes.EnumerationLiteral_3066 == requestElementType) {

      return getGEFWrapper(
          new EnumerationLiteralCreateCommandCLN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    return super.getCreateCommand(req);
  }
  /** @generated */
  @Override
  protected Command getCreateCommand(CreateElementRequest req) {
    IElementType requestElementType = req.getElementType();
    if (requestElementType == null) {
      return super.getCreateCommand(req);
    }

    if (UMLElementTypes.Dependency_2014 == requestElementType) {

      return getGEFWrapper(
          new DependencyNodeCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Association_2015 == requestElementType) {

      return getGEFWrapper(
          new AssociationNodeCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Stereotype_1026 == requestElementType) {

      return getGEFWrapper(
          new StereotypeCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Class_2008 == requestElementType) {

      return getGEFWrapper(new ClassCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Class_1031 == requestElementType) {

      return getGEFWrapper(new MetaclassCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Comment_1002 == requestElementType) {

      return getGEFWrapper(
          new CommentEditPartCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Constraint_1014 == requestElementType) {

      return getGEFWrapper(
          new ConstraintCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Model_2005 == requestElementType) {

      return getGEFWrapper(new ModelCreateCommandTN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Profile_1030 == requestElementType) {

      return getGEFWrapper(new ProfileCreateCommandTN(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Package_2007 == requestElementType) {

      return getGEFWrapper(new PackageCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Enumeration_2006 == requestElementType) {

      return getGEFWrapper(
          new EnumerationCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.PrimitiveType_2009 == requestElementType) {

      return getGEFWrapper(
          new PrimitiveTypeCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.DataType_2010 == requestElementType) {

      return getGEFWrapper(new DataTypeCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    if (UMLElementTypes.Diagram_2016 == requestElementType) {

      return getGEFWrapper(
          new ShortCutDiagramCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
    }
    return super.getCreateCommand(req);
  }