Examples of SapphireActionHandler


Examples of org.eclipse.sapphire.ui.SapphireActionHandler

  }

  @Override
  public boolean canExecute()
  {
    SapphireActionHandler deleteActionHandler = this.nodePresentation.part().getAction(DELETE_ACTION_ID).getFirstActiveHandler();
    return deleteActionHandler.isEnabled();
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

  }
   
  @Override
  public void execute()
  {
        SapphireActionHandler deleteActionHandler = this.nodePresentation.part().getAction(DELETE_ACTION_ID).getFirstActiveHandler();
        deleteActionHandler.execute(this.nodePresentation);   
   
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

       
        final Table mainTable = (Table) super.createContents( tableComposite, true );
       
        final SapphireActionGroup actions = getActions();
        final SapphireAction moveRightAction = actions.getAction( SapphireActionSystem.ACTION_MOVE_RIGHT );
        final SapphireActionHandler moveRightActionHandler = createMoveRightActionHandler();
        moveRightActionHandler.init( moveRightAction, null );
        moveRightAction.addHandler( moveRightActionHandler );
       
        final SapphireToolBarActionPresentation actionsPresentation = new SapphireToolBarActionPresentation( getActionPresentationManager() );
        actionsPresentation.setToolBar( toolbar );
       
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

            {
              final List<SapphireActionHandler> handlers = action.getActiveHandlers();
 
              if( handlers.size() == 1 )
              {
                final SapphireActionHandler handler = handlers.get( 0 );
     
                final Runnable runnable = new Runnable()
                {
                  public void run()
                  {
                    handler.execute( manager.context() );
                  }
                };
     
                Display.getDefault().asyncExec( runnable );
              }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

  protected void invokeDoubleTapAction(final ShapePart shapePart)
  {
    List<SapphireActionHandler> actionHandlers = shapePart.getAction(DOUBLE_TAB_ACTION).getActiveHandlers()
    if (!actionHandlers.isEmpty())
    {
      final SapphireActionHandler firstHandler = actionHandlers.get(0);
            getShapePresentation().display().asyncExec
            (
                new Runnable()
                {
                    public void run()
                    {
                        firstHandler.execute(getShapePresentation());
                    }
                }
            );
    }
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

        final boolean isDeprecated = property.definition().hasAnnotation( Deprecated.class );
        final boolean isReadOnly = ( property.definition().isReadOnly() || part.getRenderingHint( PropertyEditorDef.HINT_READ_ONLY, false ) );
        final boolean isSensitiveData = property.definition().hasAnnotation( SensitiveData.class );
       
        final SapphireActionGroup actions = getActions();
        final SapphireActionHandler jumpActionHandler = actions.getAction( ACTION_JUMP ).getFirstActiveHandler();

        final SapphireToolBarActionPresentation toolBarActionsPresentation = new SapphireToolBarActionPresentation( getActionPresentationManager() );
        toolBarActionsPresentation.addFilter( createFilterByActionId( ACTION_ASSIST ) );
        toolBarActionsPresentation.addFilter( createFilterByActionId( ACTION_JUMP ) );
       
        actions.addFilter
        (
            new SapphireActionHandlerFilter()
            {
                @Override
                public boolean check( final SapphireActionHandler handler )
                {
                    final String actionId = handler.getAction().getId();
                   
                    if( actionId.equals( ACTION_BROWSE ) && ( isReadOnly || suppressBrowseAction ) )
                    {
                        return false;
                    }
                   
                    return true;
                }
            }
        );
       
        final boolean isActionsToolBarNeeded = toolBarActionsPresentation.hasActions();
        final boolean isBrowseOnly = part.getRenderingHint( PropertyEditorDef.HINT_BROWSE_ONLY, false );
       
        final Composite textFieldParent = createMainComposite
        (
            parent,
            new CreateMainCompositeDelegate( part )
            {
                @Override
                public boolean canScaleVertically()
                {
                    return isLongString;
                }
            }
        );
       
        addControl( textFieldParent );

        int textFieldParentColumns = 1;
        if( isActionsToolBarNeeded ) textFieldParentColumns++;
        if( isDeprecated ) textFieldParentColumns++;
       
        textFieldParent.setLayout( glayout( textFieldParentColumns, 0, 0, 0, 0 ) );
       
        final Composite nestedComposite = new Composite( textFieldParent, SWT.NONE );
        nestedComposite.setLayoutData( isLongString ? gdfill() : gdvalign( gdhfill(), SWT.CENTER ) );
        nestedComposite.setLayout( glspacing( glayout( 2, 0, 0 ), 2 ) );
       
        addControl( nestedComposite );
       
        final PropertyEditorAssistDecorator decorator = createDecorator( nestedComposite );
       
        decorator.control().setLayoutData( gdvalign( gd(), SWT.TOP ) );
        decorator.addEditorControl( nestedComposite );
       
        final int style
            = SWT.BORDER |
              ( isLongString ? SWT.MULTI | SWT.WRAP | SWT.V_SCROLL : SWT.NONE ) |
              ( ( isReadOnly || isBrowseOnly ) ? SWT.READ_ONLY : SWT.NONE ) |
              ( isSensitiveData ? SWT.PASSWORD : SWT.NONE );
       
        this.textField = new Text( nestedComposite, style );
        this.textField.setLayoutData( gdfill() );
        decorator.addEditorControl( this.textField, true );
       
        final Serialization serialization = property.definition().getAnnotation( Serialization.class );

        final TextOverlayPainter.Controller textOverlayPainterController = new TextOverlayPainter.Controller()
        {
            @Override
            public boolean isHyperlinkEnabled()
            {
                return ( jumpActionHandler == null ? false : jumpActionHandler.isEnabled() );
            }

            @Override
            public void handleHyperlinkEvent()
            {
                if( jumpActionHandler != null )
                {
                    jumpActionHandler.execute( TextFieldPropertyEditorPresentation.this );
                }
            }

            @Override
            public String overlay()
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

        );
    }
   
    private void refreshActionHandler()
    {
        final SapphireActionHandler oldActionHandler = this.actionHandler;
       
        if( this.actionHandler != null )
        {
            this.actionHandler.detach( this.actionHandlerListener );
            this.actionHandler = null;
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

        return this.actionHandler;
    }
   
    public boolean enabled()
    {
        final SapphireActionHandler handler = handler();
        return ( handler != null && handler.isEnabled() );
    }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

                    {
                        final List<SapphireActionHandler> handlers = action.getEnabledHandlers();
                       
                        if( handlers.size() == 1 )
                        {
                            final SapphireActionHandler handler = handlers.get( 0 );
                           
                            final Runnable runnable = new Runnable()
                            {
                                public void run()
                                {
                                    handler.execute( getManager().context() );
                                }
                            };
                           
                            ( (SwtPresentation) getManager().context() ).display().asyncExec( runnable );
                        }
View Full Code Here

Examples of org.eclipse.sapphire.ui.SapphireActionHandler

      ILabelProvider labelProvider = new PopupMenuLabelProvider();
      PopupMenu popupMenu = new PopupMenu(menuEntries, labelProvider);

      boolean b = popupMenu.show(Display.getCurrent().getActiveShell());
      if (b) {
        SapphireActionHandler handler = (SapphireActionHandler)popupMenu.getResult();
        executeActionHandler(handler);
      }
    } else if (getSapphireAction().isEnabled()) {
      // has no ContextButtonMenuEntries -> execute ContextButton
      executeActionHandler(getSapphireAction().getFirstActiveHandler());
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.