Package org.eclipse.gef

Examples of org.eclipse.gef.EditPart


    }
    Iterator editParts = operationSet.iterator();
    CompositeTransactionalCommand command = new CompositeTransactionalCommand(
        getEditingDomain(), getCommandLabel());
    while (editParts.hasNext()) {
      EditPart editPart = (EditPart) editParts.next();
      Command curCommand = editPart.getCommand(request);
      if (curCommand != null) {
        command.compose(new CommandProxy(curCommand));
      }
    }
    if (command.isEmpty() || command.size() != operationSet.size()) {
View Full Code Here


      } else {
        fFigureCollectiveMetaAttributeLabelFigure.setText("");
      }
      this.add(fFigureCollectiveMetaAttributeLabelFigure);

      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.CollectiveAttributeCompartmentEditPart.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

     * @generated NOT
     */
    private void updateContents() {
      RoleMixinEditPart editpart = RoleMixinEditPart.this;
      Classifier element = (Classifier) editpart.resolveSemanticElement();
      EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getType(OntoUML.diagram.edit.parts.RoleMixinAttributeCompartmentEditPart.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_3029) {
                  EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
                      .getType(OntoUML.diagram.edit.parts.CollectiveAttributeCompartmentEditPart.VISUAL_ID));
                  return compartmentEditPart == null ? null
                      : compartmentEditPart
                          .getCommand(request);
                }
              }
              return super.getCommand(request);
            }
View Full Code Here

     * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
     */
    public EditPart createEditPart(EditPart context,
                                   Object modelElement) {
        // get EditPart for model element
        EditPart part = getPartForElement( modelElement );
        // store model element in EditPart
        part.setModel( modelElement );
        return part;
    }
View Full Code Here

  /**
   * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
   */
  public EditPart createEditPart(EditPart context, Object model) {

    EditPart part = null;
    // Creates edit part
    if (model instanceof IDiagram) {
      part = new DiagramEditpart();
    } else if (model instanceof INode) {
      part = new ProjectEditPart();
    } else if (model instanceof IConnector) {
      part = new UsesConnectorEditPart();
    } else {
      throw new IllegalStateException("No mapping found for " + ((model != null) ? model.getClass().getSimpleName() : "'null'")
          + " model within " + ((context != null) ? context.getClass().getSimpleName() : "'null'") + " EditPart context!");
    }

    if (logger.isLoggable(Level.FINE)) {
      //$ANALYSIS-IGNORE
      logger.fine(part.getClass().getSimpleName() + " created for model " + model.getClass().getSimpleName());
    }
    // sets the model
    part.setModel(model);
    return part;

  }
View Full Code Here

                    for( MapToolEntry entry : this.mapToolEntries ) {
   
                        if (paletteViewer.getEditPartRegistry().get(entry) != null) {
                            paletteViewer.setActiveTool(entry);
   
                            EditPart part = (EditPart) paletteViewer.getEditPartRegistry().get(entry);
   
                            paletteViewer.reveal(part);
                            break;
                        }
                    }
View Full Code Here

        return null;
    }

    @SuppressWarnings("unchecked")
    public void init( BoxPart owner ) {
        EditPart parentPart = owner.getParent();
        PageImpl pageImpl = (PageImpl) parentPart.getModel();
        EList<Box> boxes = (EList<Box>) pageImpl.getBoxes();
        Box box = owner.getBoxPrinter().getBox();
        int i = boxes.indexOf(box);
        int size = boxes.size();
        if (i >= size - 1)
View Full Code Here

    }
   
    @Override
    protected boolean calculateEnabled() {
        if (getSelectedObjects().size() == 1 && (getSelectedObjects().get(0) instanceof EditPart)) {
            EditPart part = (EditPart) getSelectedObjects().get(0);
            return part.understandsRequest(request);
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public void run() {
        try {
            EditPart part = (EditPart) getSelectedObjects().get(0);
            part.performRequest(request);
        } catch (ClassCastException e) {
            PrintingPlugin.log("", e); //$NON-NLS-1$
        } catch (IndexOutOfBoundsException e) {
            PrintingPlugin.log("", e); //$NON-NLS-1$
        }
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.