Examples of ISapphirePart


Examples of org.eclipse.sapphire.ui.ISapphirePart

        {
            public void helpRequested(HelpEvent event)
            {             
              if (getSelectedParts() != null && getSelectedParts().size() == 1)
              {
                ISapphirePart part = getSelectedParts().get(0);
                final SapphireHelpContext context = new SapphireHelpContext(part.getLocalModelElement(), null);
                if (context.getText() != null || (context.getRelatedTopics() != null && context.getRelatedTopics().length > 0))
                {
                    // determine a location in the upper right corner of the widget
                    org.eclipse.swt.graphics.Point point = HelpSystem.computePopUpLocation(event.widget.getDisplay());
                    // display the help
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

      // Bug 370869 - DND from the tool palette would show an invalid cursor before placing the new node
      // in direct edit mode. TODO why?
      //viewer.getControl().forceFocus();
     
      GraphicalEditPart editpart = getGraphicalEditPart(part);
      ISapphirePart parentPart = part.parent();
      while ((editpart == null || !editpart.isSelectable()) && parentPart != null)
      {
        editpart = getGraphicalEditPart(parentPart);
        parentPart = parentPart.parent();
      }
      if (editpart != null)
      {
        // Force a layout first.
        viewer.flush();
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

public abstract class SeparatorPart extends FormComponentPart
{
    @Override
    protected Function initVisibleWhenFunction()
    {
        final ISapphirePart parent = parent();
       
        if( parent instanceof FormPart )
        {
            final FormPart form = (FormPart) parent;
           
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

            }
      }
    }   
    if (this.sapphireParts.size() == 1)
    {
          ISapphirePart part = this.sapphirePart.parent();
         
          while( part != null )
          {
              final String mainActionContext = part.getMainActionContext();
             
              if( mainActionContext != null )
              {
                  final SapphireActionGroup groupOfActions = part.getActions( mainActionContext );
                 
                  if( handleKeyEvent( event, getManager(), groupOfActions, true ) )
                  {
                      return true;
                  }
              }
             
              part = part.parent();
          }
         
      return parent != null && parent.keyPressed(event);
    }
    return false;
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

            {
                throw new RuntimeException( invalidPath.format( pathString ) );
            }
        }
       
        ISapphirePart ancestor = parent();
        SapphirePart highestUninitializedAncestor = null;
       
        while( ancestor instanceof SapphirePart && ! ( (SapphirePart) ancestor ).initialized() )
        {
            highestUninitializedAncestor = (SapphirePart) ancestor;
            ancestor = ancestor.parent();
        }
       
        if( highestUninitializedAncestor == null )
        {
            initListSelectionServiceListener();
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

                    return propertyEditorPart;
                }
            }
        }
       
        final ISapphirePart parent = part.parent();
       
        if( parent != null )
        {
            return findPropertyEditor( parent, element, property, searchedParts );
        }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

  }
 
  @Override
  public void buildContextMenu( final IMenuManager menuManager )
  {
    final ISapphirePart part;
    final DiagramPresentation presentation;
        final GraphicalEditPart editPart;
        final String context;

        final List<GraphicalEditPart> selection = this.editor.getSelectedEditParts();
       
        List<ISapphirePart> emptySelection = new ArrayList<ISapphirePart>();
   
    if( selection.size() == 1 )
    {
      editPart = selection.get( 0 );
     
      if( editPart instanceof SapphireDiagramEditorPageEditPart )
      {
        context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
        presentation = this.editor.getDiagramPresentation();
      }
      else if( editPart instanceof DiagramNodeEditPart )
      {
        DiagramNodeEditPart nodePart = (DiagramNodeEditPart)editPart;
        if (isMouseOnEditPart(nodePart))
        {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_NODE;
          presentation = ((DiagramNodeEditPart)editPart).getPresentation();
        }
        else
        {
          this.editor.selectParts(emptySelection);
          context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
          presentation = this.editor.getDiagramPresentation();
        }
      }
      else if (editPart instanceof ShapeEditPart)
      {
        DiagramNodeEditPart nodePart = ((ShapeEditPart)editPart).getNodeEditPart();
        if (isMouseOnEditPart(nodePart))
        {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_NODE_SHAPE;
          presentation = ((ShapeEditPart)editPart).getShapePresentation();
        }
        else
        {
          this.editor.selectParts(emptySelection);
          context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
          presentation = this.editor.getDiagramPresentation();
        }
      }
      else if( editPart instanceof DiagramConnectionEditPart )
      {
        if (isMouseOnEditPart(editPart))
        {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_CONNECTION;
          presentation = ((DiagramConnectionEditPart)editPart).getPresentation();
        }
        else
        {
          this.editor.selectParts(emptySelection);
          context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
          presentation = this.editor.getDiagramPresentation();
        }
       
      }
      else if( editPart instanceof DiagramConnectionLabelEditPart )
      {
          return;
      }
      else
      {
          throw new IllegalStateException();
      }
     
      part = presentation.part();
    }
    else if( selection.size() > 1 )
    {
      if (isMouseOnEditParts(selection))
      {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_MULTIPLE_PARTS;
      }
      else
      {
        this.editor.selectParts(emptySelection);
        context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;       
      }
      presentation = this.editor.getDiagramPresentation();
        part = this.editor.getPart();     
    }
    else
    {
        throw new IllegalStateException();
    }
   
    final Map<SapphireActionSystemPart,ActionSystemPartBridge> updatedCache = new IdentityHashMap<SapphireActionSystemPart,ActionSystemPartBridge>();
    String currentGroupId = null;
   
    for( SapphireAction action : part.getActions( context ).getActions() )
    {
        if( action.getId().equals( DIAGRAM_NODE_DEFAULT_ACTION ) )
        {
            continue;
        }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    {
      List<ISapphirePart> parts = diagramEditor.getSelectedParts();
      DiagramModel model = diagramEditor.getDiagramModel();
      if (parts.size() == 1)
      {
        ISapphirePart part = parts.get(0);
        if (part instanceof DiagramNodePart)
        {
          model.handleDirectEditing((DiagramNodePart)part);
        }
        else if (part instanceof ShapePart)
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    @Override
    protected void init()
    {
        super.init();
       
        final ISapphirePart parent = parent();

        if( parent instanceof MasterDetailsContentNodePart )
        {
            this.parentNode = (MasterDetailsContentNodePart) parent;
        }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

   
    public boolean controls( final Element element )
    {
        if( element == getModelElement() )
        {
            final ISapphirePart parentPart = parent();
           
            if( parentPart != null && parentPart instanceof MasterDetailsContentNodePart )
            {
                final MasterDetailsContentNodePart parentNode = (MasterDetailsContentNodePart) parentPart;
               
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.