Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IAction


   *         {@link #enableGroupByAction(ICategoryProvider)} has not been
   *         called.
   */
  public CommonToolBarBuilder addGroupByAction(
      String text, ImageDescriptor image, ICategory... categories) {
    IAction action = new CategoryAction(categoryProvider, categories);
    action.setText(text);
    action.setImageDescriptor(image);
    groupByActions.add(action);
    return this;
  }
View Full Code Here


  @Test
  public void testFormat() {
    Calendar date = Calendar.getInstance();
    Format format = new SimpleDateFormat(CalendarAction.DATE_FORMAT);
    String text = format.format(date.getTime());
    IAction action = CalendarAction.create(manager, shell, date, null, null);
    assertEquals(text, action.getText());
  }
View Full Code Here

  @Test
  public void testPrefixSuffix() {
    String prefix = "abc";
    String suffix = "xyz";
    IAction action = CalendarAction.create(manager, shell, Calendar
        .getInstance(), prefix, suffix);
    assertTrue(action.getText().startsWith(prefix));
    assertTrue(action.getText().endsWith(suffix));
  }
View Full Code Here

      actionItem.setText(type.getShortName());

      actionItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {

          IAction actionToExecute = new ChangeModeAction(type, type.getShortName(),
                  AnnotationEditor.this);

          actionToExecute.run();
        }
      });
    }
View Full Code Here

    protected void createActions() {
        super.createActions();

        // This action will fire a CONTENTASSIST_PROPOSALS operation
        // when executed
        IAction action = new TextOperationAction(IvyPlugin.getDefault().getResourceBundle(),
                "ContentAssistProposal", this, ISourceViewer.CONTENTASSIST_PROPOSALS);
        action.setActionDefinitionId(CONTENTASSIST_PROPOSAL_ID);

        // Tell the editor about this new action
        setAction(CONTENTASSIST_PROPOSAL_ID, action);

        // Tell the editor to execute this action
View Full Code Here

    {
        super.createActions();

        // add content assistant
        ResourceBundle bundle = LdifEditorActivator.getDefault().getResourceBundle();
        IAction action = new ContentAssistAction( bundle, "ldifeditor__contentassistproposal_", this ); //$NON-NLS-1$
        action.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
        setAction( "ContentAssistProposal", action ); //$NON-NLS-1$

        // add execute action (for tool bar)
        if ( actionToolBarManager != null )
        {
            ExecuteLdifAction executeLdifAction = new ExecuteLdifAction( this );
            actionToolBarManager.add( executeLdifAction );
            setAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF, executeLdifAction );
            actionToolBarManager.update( true );
        }

        // add context menu edit actions
        EditLdifAttributeAction editLdifAttributeAction = new EditLdifAttributeAction( this );
        setAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION, editLdifAttributeAction );

        openBestValueEditorAction = new OpenBestValueEditorAction( this );
        IValueEditor[] valueEditors = valueEditorManager.getAllValueEditors();
        openValueEditorActions = new OpenValueEditorAction[valueEditors.length];
        for ( int i = 0; i < this.openValueEditorActions.length; i++ )
        {
            openValueEditorActions[i] = new OpenValueEditorAction( this, valueEditors[i] );
        }
        valueEditorPreferencesAction = new ValueEditorPreferencesAction();

        OpenDefaultValueEditorAction openDefaultValueEditorAction = new OpenDefaultValueEditorAction( this,
            openBestValueEditorAction );
        setAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE, openDefaultValueEditorAction );

        EditLdifRecordAction editRecordAction = new EditLdifRecordAction( this );
        setAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD, editRecordAction );

        // add context menu format actions
        FormatLdifDocumentAction formatDocumentAction = new FormatLdifDocumentAction( this );
        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_DOCUMENT, formatDocumentAction );
        FormatLdifRecordAction formatRecordAction = new FormatLdifRecordAction( this );
        setAction( LdifEditorConstants.ACTION_ID_FORMAT_LDIF_RECORD, formatRecordAction );

        // update cut, copy, paste
        IAction cutAction = getAction( ITextEditorActionConstants.CUT );
        if ( cutAction != null )
        {
            cutAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
                ISharedImages.IMG_TOOL_CUT ) );
        }
        IAction copyAction = getAction( ITextEditorActionConstants.COPY );
        if ( copyAction != null )
        {
            copyAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
                ISharedImages.IMG_TOOL_COPY ) );
        }
        IAction pasteAction = getAction( ITextEditorActionConstants.PASTE );
        if ( pasteAction != null )
        {
            pasteAction.setImageDescriptor( PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
                ISharedImages.IMG_TOOL_PASTE ) );
        }

        activateGlobalActionHandlers();
    }
View Full Code Here

            Messages.getString( "LdifEditor.UsedConnection" ) //$NON-NLS-1$
                + ( browserConnection == null || browserConnection.getConnection() == null ? "-" : browserConnection //$NON-NLS-1$
                    .getConnection().getName() ) );
        // getStatusField("ldapconnection").setText();

        IAction action = getAction( LdifEditorConstants.ACTION_ID_EXECUTE_LDIF );
        if ( action != null )
        {
            action.setEnabled( browserConnection == null );
            action.setEnabled( browserConnection != null );
        }
    }
View Full Code Here

    /**
     * Activates global action handlers
     */
    public void activateGlobalActionHandlers()
    {
        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
        ActionUtils.activateActionHandler( elaa );
        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
        ActionUtils.activateActionHandler( elva );
        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
        ActionUtils.activateActionHandler( elra );
    }
View Full Code Here

    /**
     * Deactivates global action handlers
     */
    public void deactivateGlobalActionHandlers()
    {
        IAction elaa = getAction( BrowserCommonConstants.ACTION_ID_EDIT_ATTRIBUTE_DESCRIPTION );
        ActionUtils.deactivateActionHandler( elaa );
        IAction elva = getAction( BrowserCommonConstants.ACTION_ID_EDIT_VALUE );
        ActionUtils.deactivateActionHandler( elva );
        IAction elra = getAction( LdifEditorConstants.ACTION_ID_EDIT_RECORD );
        ActionUtils.deactivateActionHandler( elra );
    }
View Full Code Here

    }

    private void hookGlobalActions() {
        ApplicationGIS.getToolManager().contributeGlobalActions(this, getViewSite().getActionBars());
        IKeyBindingService service = getSite().getKeyBindingService();
        IAction action = deleteAction;
        getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), action);
        service.registerAction(action);
       

    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.IAction

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.