/** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(
       EditPolicy.PRIMARY_DRAG_ROLE, new ActivityDiagramEditPart.NodeLabelDragPolicy());
 }
 public boolean appliesTo(ISelection selection, IConfigurationElement configuration) {
   if (selection instanceof IStructuredSelection) {
     IStructuredSelection ss = ((IStructuredSelection) selection);
     if (ss.size() <= 0 || ss.size() > 1) {
       return false;
     }
     Object first = ss.getFirstElement();
     if (first instanceof CompartmentEditPart) {
       CompartmentEditPart compEP = (CompartmentEditPart) first;
       // Check if he is really a children
       if (compEP.getParent() instanceof ListCompartmentEditPart) return true;
       else return false;
     }
   }
   return false;
 }
 /** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ComrelTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(
       EditPolicy.PRIMARY_DRAG_ROLE, new CompositeRefactoringEditPart.NodeLabelDragPolicy());
 }
 @Override
 public void deactivate() {
   try {
     super.deactivate();
   } catch (Exception e) {
   }
 }
 /** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ParallelJTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(
       EditPolicy.PRIMARY_DRAG_ROLE, new SpecificationEditPart.NodeLabelDragPolicy());
 }
 /** @generated */
 protected void handleNotificationEvent(Notification event) {
   Object feature = event.getFeature();
   if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
     Integer c = (Integer) event.getNewValue();
     setFontColor(DiagramColorRegistry.getInstance().getColor(c));
   } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
     refreshUnderline();
   } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
     refreshStrikeThrough();
   } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
       || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
     refreshFont();
   } else {
     if (getParser() != null
         && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
       refreshLabel();
     }
     if (getParser() instanceof ISemanticParser) {
       ISemanticParser modelParser = (ISemanticParser) getParser();
       if (modelParser.areSemanticElementsAffected(null, event)) {
         removeSemanticListeners();
         if (resolveSemanticElement() != null) {
           addSemanticListeners();
         }
         refreshLabel();
       }
     }
   }
   super.handleNotificationEvent(event);
 }
  /** @generated */
  @Override
  protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    installEditPolicy(
        EditPolicy.PRIMARY_DRAG_ROLE,
        new NonResizableEditPolicy() {

          @Override
          protected List createSelectionHandles() {
            List handles = new ArrayList();
            NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
            return handles;
          }

          @Override
          public Command getCommand(Request request) {
            return null;
          }

          @Override
          public boolean understandsRequest(Request request) {
            return false;
          }
        });
  }
 /** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(
       EditPolicyRoles.SEMANTIC_ROLE, new NestedInterfaceForComponentItemSemanticEditPolicy());
   installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
   installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
 }
 /** @generated */
 protected void refreshVisuals() {
   super.refreshVisuals();
   refreshLabel();
   refreshFont();
   refreshFontColor();
   refreshUnderline();
   refreshStrikeThrough();
 }
 /** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(
       EditPolicy.SELECTION_FEEDBACK_ROLE,
       new WebApp.diagram.edit.policies.WebAppTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
 }
Ejemplo n.º 11
0
 /** @generated */
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(
       EditPolicy.PRIMARY_DRAG_ROLE, new CompositeStructureDiagramEditPart.NodeLabelDragPolicy());
   installEditPolicy(
       IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new PropertyLabelEditPolicy());
 }
 /** @generated */
 protected void removeSemanticListeners() {
   if (parserElements != null) {
     for (int i = 0; i < parserElements.size(); i++) {
       removeListenerFilter("SemanticModel" + i); // $NON-NLS-1$
     }
   } else {
     super.removeSemanticListeners();
   }
 }
 /** @generated */
 @Override
 protected void createDefaultEditPolicies() {
   super.createDefaultEditPolicies();
   installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ExitStateBehaviorItemSemanticEditPolicy());
   installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
   installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
   installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
   installEditPolicy(
       QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
 }
 /** @generated */
 protected void addSemanticListeners() {
   if (getParser() instanceof ISemanticParser) {
     EObject element = resolveSemanticElement();
     parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
     for (int i = 0; i < parserElements.size(); i++) {
       addListenerFilter(
           "SemanticModel" + i, this, (EObject) parserElements.get(i)); // $NON-NLS-1$
     }
   } else {
     super.addSemanticListeners();
   }
 }
Ejemplo n.º 15
0
  /**
   * @generated NOT (update at each lifeline name modification) handle possible change in the name
   *     container size
   */
  protected void handleNotificationEvent(Notification event) {
    refreshLabel();
    Object feature = event.getFeature();
    if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
      Integer c = (Integer) event.getNewValue();
      setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
      refreshUnderline();
    } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
      refreshStrikeThrough();
    } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
        || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
        || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
        || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
      refreshFont();
    } else {
      if (getParser() != null
          && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
        refreshLabel();
      }
      if (getParser() instanceof ISemanticParser) {
        ISemanticParser modelParser = (ISemanticParser) getParser();
        if (modelParser.areSemanticElementsAffected(null, event)) {
          removeSemanticListeners();
          if (resolveSemanticElement() != null) {
            addSemanticListeners();
          }
          refreshLabel();
        }
      }
    }

    // handle possible change in the name container size
    if (UMLPackage.Literals.LIFELINE__REPRESENTS.equals(feature)
        || UMLPackage.Literals.LIFELINE__DECOMPOSED_AS.equals(feature)
        || UMLPackage.Literals.LIFELINE__SELECTOR.equals(feature)
        || event.getNotifier() instanceof Bounds) {
      ((LifelineEditPart) getParent()).updateLifelinePosition();
    }

    super.handleNotificationEvent(event);
  }
  /** @generated */
  protected void createDefaultEditPolicies() {
    super.createDefaultEditPolicies();
    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ControlTextSelectionEditPolicy());
    installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    installEditPolicy(
        EditPolicy.PRIMARY_DRAG_ROLE,
        new NonResizableEditPolicy() {

          protected List createSelectionHandles() {
            List handles = new ArrayList();
            NonResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles);
            ((MoveHandle) handles.get(0)).setBorder(null);
            return handles;
          }

          public Command getCommand(Request request) {
            return null;
          }

          public boolean understandsRequest(Request request) {
            return false;
          }
        });
  }
 /** @generated */
 protected void removeNotationalListeners() {
   super.removeNotationalListeners();
   removeListenerFilter("PrimaryView"); // $NON-NLS-1$
 }
 /** @generated */
 protected void addNotationalListeners() {
   super.addNotationalListeners();
   addListenerFilter("PrimaryView", this, getPrimaryView()); // $NON-NLS-1$
 }
Ejemplo n.º 19
0
 /** @generated */
 public void deactivate() {
   removeOwnerElementListeners();
   super.deactivate();
 }
Ejemplo n.º 20
0
 /** @generated */
 public void activate() {
   super.activate();
   addOwnerElementListeners();
 }