Examples of IGraphicalEditPart


Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

    if (selected.eContainer() != null) {               
      helper.deleteElement(selected, selected.eContainer(), selected.eContainingFeature());
     
      // is this element currently contained within the current
      // edit part?
      IGraphicalEditPart contained = elementContainedWithin(selected, diagramEditPart);
      if (contained != null) {
        // it is: delete the node from the current display               
        DeleteCommand command2 = new DeleteCommand(editingDomain, contained.getPrimaryView());
        command2.execute(monitor, info);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  private IGraphicalEditPart elementContainedWithin(EObject d,
      IGraphicalEditPart diagramEditPart) {
   
    for (Object obj : diagramEditPart.getChildren()) {
      if (obj instanceof IGraphicalEditPart) {
        IGraphicalEditPart p = (IGraphicalEditPart) obj;
        if (d.equals(p.resolveSemanticElement()))
          return p;
      }
    }
    return null;
   
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /**
   * @generated
   */
  public List getTypesForPopupBar(IAdaptable host) {
    IGraphicalEditPart editPart = (IGraphicalEditPart) host
        .getAdapter(IGraphicalEditPart.class);
    if (editPart instanceof eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.NodeTypeEditPart) {
      ArrayList types = new ArrayList(2);
      types
          .add(eu.admire.visual.pmml.treemodel._40.diagram.providers.PMMLElementTypes.SimplePredicateType_3001);
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /**
   * @generated
   */
  public List getRelTypesOnSource(IAdaptable source) {
    IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
        .getAdapter(IGraphicalEditPart.class);
    if (sourceEditPart instanceof eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.NodeTypeEditPart) {
      return ((eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.NodeTypeEditPart) sourceEditPart)
          .getMARelTypesOnSource();
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /** UML elements modifications listeners initialization */
  protected void initListeners() {
    EditPart p = getDiagramEditPart();
    if((p!=null)&&(p instanceof IGraphicalEditPart)) {
      IGraphicalEditPart g = (IGraphicalEditPart)p;
      editingDomain = g.getEditingDomain();
      Diagram d = null;
      Object m = g.getModel();
      String name = null;
      if((m!=null)&&(m instanceof Diagram)) {
        d = (Diagram)m;
        EObject eo = d.getElement();
        if(eo instanceof Package) {
          name =
            PackageHandler.buildFullyQualifiedName(
                (Package)eo
            );

        }
        else if(eo instanceof Class) {
          Class cl = (Class)eo;
          name =
            ClassHandler.buildFullyQualifiedName(
                cl
            );
        }
        if(name!=null) {
          TransactionalEditingDomain domain =
            g.getEditingDomain();
          if(listeners.get(name)==null) {
            IElementHandling elH = findHandler(g);
            if(elH!=null) {
              domain.addResourceSetListener(elH);
              listeners.put(name, elH);
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

                      childEditPart instanceof
                      IGraphicalEditPart
                  )&&
                  (childH!=null)
              ) { 
                IGraphicalEditPart graphicalPart =
                  ((IGraphicalEditPart)childEditPart);
                TransactionalEditingDomain domain =
                  graphicalPart.getEditingDomain();
                if(listeners.get(name)==null) {
                  domain.addResourceSetListener(childH);
                  listeners.put(name, childH);
                }
                else {
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /**
   * @generated
   */
  public List getRelTypesOnSourceAndTarget(IAdaptable source,
      IAdaptable target) {
    IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
        .getAdapter(IGraphicalEditPart.class);
    IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
        .getAdapter(IGraphicalEditPart.class);
    if (sourceEditPart instanceof ConnectionInitializationEditPart) {
      return ((ConnectionInitializationEditPart) sourceEditPart)
          .getMARelTypesOnSourceAndTarget(targetEditPart);
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /**
   * @generated
   */
  public List getTypesForSource(IAdaptable target,
      IElementType relationshipType) {
    IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
        .getAdapter(IGraphicalEditPart.class);
    if (targetEditPart instanceof ConnectionInitializationEditPart) {
      return ((ConnectionInitializationEditPart) targetEditPart)
          .getMATypesForSource(relationshipType);
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

  /**
   * @generated
   */
  public List getTypesForTarget(IAdaptable source,
      IElementType relationshipType) {
    IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
        .getAdapter(IGraphicalEditPart.class);
    if (sourceEditPart instanceof ConnectionInitializationEditPart) {
      return ((ConnectionInitializationEditPart) sourceEditPart)
          .getMATypesForTarget(relationshipType);
    }
View Full Code Here

Examples of org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart

   */
  protected EObject selectExistingElement(IAdaptable host, Collection types) {
    if (types.isEmpty()) {
      return null;
    }
    IGraphicalEditPart editPart = (IGraphicalEditPart) host
        .getAdapter(IGraphicalEditPart.class);
    if (editPart == null) {
      return null;
    }
    Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
    HashSet<EObject> elements = new HashSet<EObject>();
    for (Iterator<EObject> it = diagram.getElement().eAllContents(); it
        .hasNext();) {
      EObject element = it.next();
      if (isApplicableElement(element, types)) {
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.