Java 类org.eclipse.gef.ui.actions.UpdateAction 实例源码

项目:snaker-designer    文件:SnakerFlowDesignerEditor.java   
private void updateActions(List<String> actionIds) {
    for (Iterator<String> ids = actionIds.iterator(); ids.hasNext();) {
        IAction action = getActionRegistry().getAction(ids.next());
        if (action == null) {
            continue;
        }
        if (!(action instanceof UpdateAction)) {
            continue;
        }
        ((UpdateAction) action).update();
    }
}
项目:birt    文件:DesignerActionBarContributor.java   
private void updateEditMenu( IContributionManager menubar )
{
    IContributionItem editMenu = menubar.find( IWorkbenchActionConstants.M_EDIT );
    if ( editMenu instanceof IMenuManager )
    {
        ( (IMenuManager) editMenu ).addMenuListener( new IMenuListener( ) {

            public void menuAboutToShow( IMenuManager manager )
            {
                refreshUpdateAction( ActionFactory.CUT.getId( ) );
                refreshUpdateAction( ActionFactory.COPY.getId( ) );
                refreshUpdateAction( ActionFactory.PASTE.getId( ) );
                refreshUpdateAction( ActionFactory.DELETE.getId( ) );
            }

            private void refreshUpdateAction( String actionId )
            {
                if ( getActionRegistry( ) != null )
                {
                    RetargetAction action = (RetargetAction) getAction( actionId );
                    if ( action != null
                            && action.getActionHandler( ) != null
                            && action.getActionHandler( ) instanceof UpdateAction )
                    {
                        ( (UpdateAction) action.getActionHandler( ) ).update( );
                    }
                }
            }
        } );
    }
}
项目:birt    文件:GraphicalEditorWithFlyoutPalette.java   
/**
 * Updates the specified actions.
 * 
 * @param actionIds
 *            the list of ids of actions to update
 */
protected void updateActions( List actionIds )
{
    for ( Iterator ids = actionIds.iterator( ); ids.hasNext( ); )
    {
        IAction action = getActionRegistry( ).getAction( ids.next( ) );
        if ( null != action && action instanceof UpdateAction )
            ( (UpdateAction) action ).update( );
    }
}
项目:birt    文件:SchematicContextMenuProvider.java   
/**
 * Retrieves action item( value ) from the action registry with the given
 * action ID( key ).
 * 
 * @param actionID
 *            the given atcion ID.
 * @return The retrieved action item.
 */
protected IAction getAction( String actionID )
{
    IAction action = getActionRegistry( ).getAction( actionID );
    if ( action instanceof UpdateAction )
    {
        ( (UpdateAction) action ).update( );
    }
    return action;
}
项目:seg.jUCMNav    文件:ActionRegistryManager.java   
/**
 * Updates the specified actions, if they are UpdateActions
 * 
 * @param actionIds
 *            the list of ids of actions to update
 */
public void updateActions(List actionIds) {
    for (Iterator ids = actionIds.iterator(); ids.hasNext();) {
        IAction action = getActionRegistry().getAction(ids.next());
        if (null != action && action instanceof UpdateAction)
            ((UpdateAction) action).update();

    }
}
项目:olca-app    文件:GraphConfig.java   
/**
 * Get the action extension points and register them as actions in the
 * graphical viewer
 */
private List<String> configureActionExtensions() {
    List<String> updateableActions = new ArrayList<>();
    List<Action> actions = loadActionExtensions();
    for (Action action : actions) {
        if (action instanceof EditorAction)
            ((EditorAction) action).setEditor(model.editor);
        actionRegistry.registerAction(action);
        if (action instanceof UpdateAction)
            updateableActions.add(action.getId());
        actionExtensionIds.add(action.getId());
    }
    return updateableActions;
}
项目:gef-gwt    文件:GraphicalEditor.java   
/**
 * A convenience method for updating a set of actions defined by the given
 * List of action IDs. The actions are found by looking up the ID in the
 * {@link #getActionRegistry() action registry}. If the corresponding action
 * is an {@link UpdateAction}, it will have its <code>update()</code> method
 * called.
 * 
 * @param actionIds
 *            the list of IDs to update
 */
protected void updateActions(List actionIds) {
    ActionRegistry registry = getActionRegistry();
    Iterator iter = actionIds.iterator();
    while (iter.hasNext()) {
        IAction action = registry.getAction(iter.next());
        if (action instanceof UpdateAction)
            ((UpdateAction) action).update();
    }
}