Examples of ISapphirePart


Examples of org.eclipse.sapphire.ui.ISapphirePart

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            ISapphirePart part = context.find(ISapphirePart.class);
            if (part instanceof SapphireDiagramEditorPagePart)
            {
                SapphireDiagramEditorPagePart diagramPagePart = (SapphireDiagramEditorPagePart)part;
                DiagramEditorPageDef pageDef = diagramPagePart.getPageDef();
                if (pageDef.getConnectionServiceType().content() == ConnectionServiceType.STANDARD)
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    public void init( final SapphireAction action,
                      final ActionHandlerDef def )
    {
        super.init( action, def );
       
        final ISapphirePart part = getPart();
       
        if( part instanceof SapphireDiagramEditorPagePart )
        {
            ( (SapphireDiagramEditorPagePart) part ).attach
            (
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

        refreshEnablement();
    }
   
    private void refreshEnablement()
    {
        final ISapphirePart part = getPart();
      boolean enabled = false;
     
      if( part instanceof DiagramNodePart || part instanceof ShapePart ||
          (part instanceof DiagramConnectionPart && ((DiagramConnectionPart)part).removable()))
      {
        enabled = true;
      }
      else
      {
        SapphireDiagramEditorPagePart diagramPart = part.nearest(SapphireDiagramEditorPagePart.class);
        List<ISapphirePart> selectedParts = diagramPart.getSelections();
        for (ISapphirePart selectedPart : selectedParts)
        {
          if (selectedPart instanceof DiagramNodePart || selectedPart instanceof ShapePart ||
              (selectedPart instanceof DiagramConnectionPart && ((DiagramConnectionPart)selectedPart).removable()))
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    }
   
    @Override
    protected Object run(Presentation context)
    {
        ISapphirePart part = context.part();
        if (part instanceof DiagramConnectionPart)
        {
            DiagramConnectionPart connPart = (DiagramConnectionPart)part;
            connPart.remove();  
        }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

  {
    try
    {
      IViewPart propertiesView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.PropertySheet");
     
      ISapphirePart sapphirePart = getPart();
      SapphireEditor editor = sapphirePart.nearest(SapphireEditor.class);
      editor.setFocus();
      propertiesView.setFocus();
    }
    catch (PartInitException e)
    {
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    public void init( final SapphireAction action,
                      final ActionHandlerDef def )
    {
        super.init( action, def );
       
        final ISapphirePart part = getPart();
        SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
        editorPart.attach
        (
            new FilteredListener<SelectionChangedEvent>()
            {
                @Override
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

        refreshEnablement();
    }
   
    private void refreshEnablement()
    {
        final ISapphirePart part = getPart();
      boolean enabled = false;
     
      if (part instanceof ShapePart && part.parent() instanceof ShapeFactoryPart)
      {
        ShapeFactoryPart shapeFactory = (ShapeFactoryPart)part.parent();
        List<ShapePart> children = shapeFactory.getChildren();
        enabled = children.indexOf(part) > 0;
      }
      setEnabled( enabled );
    }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    }

  @Override
  protected Object run(Presentation context)
  {
        final ISapphirePart part = getPart();
      ShapeFactoryPart shapeFactory = (ShapeFactoryPart)part.parent();
      Element element = part.getLocalModelElement();
      ElementList<?> list = shapeFactory.getModelElementList();
    list.moveUp(element);
    SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
    editorPart.setSelections(Collections.singletonList(part), true);
    refreshEnablement();
    return null;
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

    public void init( final SapphireAction action,
                      final ActionHandlerDef def )
    {
        super.init( action, def );
       
        final ISapphirePart part = getPart();
        SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
        editorPart.attach
        (
            new FilteredListener<SelectionChangedEvent>()
            {
                @Override
View Full Code Here

Examples of org.eclipse.sapphire.ui.ISapphirePart

        refreshEnablement();
    }
   
    private void refreshEnablement()
    {
        final ISapphirePart part = getPart();
      boolean enabled = false;
     
      if (part instanceof ShapePart && part.parent() instanceof ShapeFactoryPart)
      {
        ShapeFactoryPart shapeFactory = (ShapeFactoryPart)part.parent();
        List<ShapePart> children = shapeFactory.getChildren();
        enabled = children.indexOf(part) != -1 && children.indexOf(part) < ( children.size() - 1 ) ;
      }
      setEnabled( enabled );
    }
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.