Package org.eclipse.gef

Examples of org.eclipse.gef.EditPart


                    .getViewAndElementDescriptor()
                    .getCreateElementRequestAdapter();
                IElementType type = (IElementType) adapter
                    .getAdapter(IElementType.class);
                if (type == OntoUML.diagram.providers.OntoUMLElementTypes.Property_3032) {
                  EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
                      .getType(OntoUML.diagram.edit.parts.ModeAttributeCompartmentEditPart.VISUAL_ID));
                  return compartmentEditPart == null ? null
                      : compartmentEditPart
                          .getCommand(request);
                }
              }
              return super.getCommand(request);
            }
View Full Code Here


    EObject targetView = editor.getDiagram().eResource().getEObject(
        elementId);
    if (targetView == null) {
      return;
    }
    EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView);
    if (targetEditPart != null) {
      OntoUML.diagram.part.OntoUMLDiagramEditorUtil
          .selectElementsInDiagram(editor, Arrays
              .asList(new EditPart[] { targetEditPart }));
    }
View Full Code Here

  /**
   * @generated
   */
  protected IGraphicalEditPart createEditPart(View view) {
    EditPart part = factory.createEditPart(null, view);
    if (part instanceof IGraphicalEditPart) {
      return (IGraphicalEditPart) part;
    }
    return null;
  }
View Full Code Here

                    .getViewAndElementDescriptor()
                    .getCreateElementRequestAdapter();
                IElementType type = (IElementType) adapter
                    .getAdapter(IElementType.class);
                if (type == OntoUML.diagram.providers.OntoUMLElementTypes.Property_3039) {
                  EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
                      .getType(OntoUML.diagram.edit.parts.StructuralDatatypeAttributeCompartmentEditPart.VISUAL_ID));
                  return compartmentEditPart == null ? null
                      : compartmentEditPart
                          .getCommand(request);
                }
              }
              return super.getCommand(request);
            }
View Full Code Here

     * @generated NOT
     */
    private void updateContents() {
      StructuralDatatypeEditPart editpart = StructuralDatatypeEditPart.this;
      Classifier element = (Classifier) editpart.resolveSemanticElement();
      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.StructuralDatatypeAttributeCompartmentEditPart.VISUAL_ID));
      if (compartmentEditPart != null) {
        if (element.getAttribute().size() == 0)
          ((View) compartmentEditPart.getModel()).setVisible(false);
        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
          else {
            View view = (((View) (compartmentEditPart).getModel()));
            DrawerStyle drawerStyle = (DrawerStyle) view
                .getStyle(NotationPackage.eINSTANCE
View Full Code Here

                    .getViewAndElementDescriptor()
                    .getCreateElementRequestAdapter();
                IElementType type = (IElementType) adapter
                    .getAdapter(IElementType.class);
                if (type == OntoUML.diagram.providers.OntoUMLElementTypes.Property_2005) {
                  EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
                      .getType(OntoUML.diagram.edit.parts.ModeAttributeCompartmentEditPart.VISUAL_ID));
                  return compartmentEditPart == null ? null
                      : compartmentEditPart
                          .getCommand(request);
                }
              }
              return super.getCommand(request);
            }
View Full Code Here

     * @generated NOT
     */
    private void updateContents() {
      ModeEditPart editpart = ModeEditPart.this;
      Classifier element = (Classifier) editpart.resolveSemanticElement();
      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.ModeAttributeCompartmentEditPart.VISUAL_ID));
      if (compartmentEditPart != null) {
        if (element.getAttribute().size() == 0)
          ((View) compartmentEditPart.getModel()).setVisible(false);
        else {
          if (((View) compartmentEditPart.getModel()).isVisible() == false)
            ((View) compartmentEditPart.getModel())
                .setVisible(true);
          else {
            View view = (((View) (compartmentEditPart).getModel()));
            DrawerStyle drawerStyle = (DrawerStyle) view
                .getStyle(NotationPackage.eINSTANCE
View Full Code Here

   */
  public static void selectElementsInDiagram(
      IDiagramWorkbenchPart diagramPart, List/*EditPart*/editParts) {
    diagramPart.getDiagramGraphicalViewer().deselectAll();

    EditPart firstPrimary = null;
    for (Iterator it = editParts.iterator(); it.hasNext();) {
      EditPart nextPart = (EditPart) it.next();
      diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
      if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
        firstPrimary = nextPart;
      }
    }
View Full Code Here

    IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart
        .getViewer();
    final int intialNumOfEditParts = editPartCollector.size();

    if (element instanceof View) { // support notation element lookup
      EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(
          element);
      if (editPart != null) {
        editPartCollector.add(editPart);
        return 1;
      }
    }

    String elementID = EMFCoreUtil.getProxyID(element);
    List associatedParts = viewer.findEditPartsForElement(elementID,
        IGraphicalEditPart.class);
    // perform the possible hierarchy disjoint -> take the top-most parts only
    for (Iterator editPartIt = associatedParts.iterator(); editPartIt
        .hasNext();) {
      EditPart nextPart = (EditPart) editPartIt.next();
      EditPart parentPart = nextPart.getParent();
      while (parentPart != null && !associatedParts.contains(parentPart)) {
        parentPart = parentPart.getParent();
      }
      if (parentPart == null) {
        editPartCollector.add(nextPart);
      }
    }
View Full Code Here

        && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
      view = (View) lazyElement2ViewMap.getElement2ViewMap().get(
          targetElement);
    } else if (findElementsInDiagramByID(diagramEditPart, targetElement,
        lazyElement2ViewMap.editPartTmpHolder) > 0) {
      EditPart editPart = (EditPart) lazyElement2ViewMap.editPartTmpHolder
          .get(0);
      lazyElement2ViewMap.editPartTmpHolder.clear();
      view = editPart.getModel() instanceof View ? (View) editPart
          .getModel() : null;
    }

    return (view == null) ? diagramEditPart.getDiagramView() : view;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gef.EditPart

Copyright © 2018 www.massapicom. 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.