/**
  * @see
  *     org.topcased.modeler.edit.policies.AbstractEdgeCreationEditPolicy#checkEdge(org.topcased.modeler.di.model.GraphEdge)
  * @generated
  */
 protected boolean checkEdge(GraphEdge edge) {
   if (edge.getSemanticModel() instanceof SimpleSemanticModelElement) {
     return PdSimpleObjectConstants.SIMPLE_OBJECT_ISINTERNALPORTLET.equals(
         ((SimpleSemanticModelElement) edge.getSemanticModel()).getTypeInfo());
   }
   return false;
 }
Esempio n. 2
0
  /**
   * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,java.lang.Object)
   * @generated
   */
  public EditPart createEditPart(EditPart context, Object model) {
    if (model instanceof Diagram) {
      return new ReqDiagramEditPart((Diagram) model);
    } else if (model instanceof GraphNode) {
      final GraphNode node = (GraphNode) model;
      EObject element = Utils.getElement(node);
      if (element != null) {
        if ("http://www.kerblue.org/requirements/1.0"
            .equals(element.eClass().getEPackage().getNsURI())) {
          return (EditPart) new NodeRequirementsSwitch(node).doSwitch(element);
        }
      }

      if (node.getSemanticModel() instanceof SimpleSemanticModelElement) {
        // Manage the Element that are not associated with a model object
      }
    } else if (model instanceof GraphEdge) {
      final GraphEdge edge = (GraphEdge) model;
      EObject element = Utils.getElement(edge);
      if (element != null) {
        if ("http://www.kerblue.org/requirements/1.0"
            .equals(element.eClass().getEPackage().getNsURI())) {
          return (EditPart) new EdgeRequirementsSwitch(edge).doSwitch(element);
        }
      }

      if (edge.getSemanticModel() instanceof SimpleSemanticModelElement) {
        // Manage the Element that are not associated with a model object
        if (ReqSimpleObjectConstants.SIMPLE_OBJECT_IS_RESPONSIBLE.equals(
            ((SimpleSemanticModelElement) edge.getSemanticModel()).getTypeInfo())) {
          return new is_responsibleEditPart(edge);
        }
        if (ReqSimpleObjectConstants.SIMPLE_OBJECT_IS_SUB_GOAL.equals(
            ((SimpleSemanticModelElement) edge.getSemanticModel()).getTypeInfo())) {
          return new is_sub_goalEditPart(edge);
        }
      }
    }
    return super.createEditPart(context, model);
  }