ConditionItemSemanticEditPolicy.java :  » Workflow-Engines » osbl-1_0 » newprocess » diagram » edit » policies » Java Open Source

Java Open Source » Workflow Engines » osbl 1_0 
osbl 1_0 » newprocess » diagram » edit » policies » ConditionItemSemanticEditPolicy.java
package newprocess.diagram.edit.policies;

import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.gmf.runtime.notation.View;

/**
 * @generated
 */
public class ConditionItemSemanticEditPolicy extends
    New_processBaseItemSemanticEditPolicy {

  /**
   * @generated
   */
  protected Command getDestroyElementCommand(DestroyElementRequest req) {
    return getMSLWrapper(new DestroyElementCommand(req) {

      protected EObject getElementToDestroy() {
        View view = (View) getHost().getModel();
        EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
        if (annotation != null) {
          return view;
        }
        return super.getElementToDestroy();
      }

    });
  }

  /**
   * @generated
   */
  protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
    return super.getCreateRelationshipCommand(req);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.