Java Code Examples for org.eclipse.jface.action.IAction#getId()

The following examples show how to use org.eclipse.jface.action.IAction#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HdActionDelegate.java    From http4e with Apache License 2.0 5 votes vote down vote up
public void run( IAction action){
   String id = action.getId();
   FolderView folderView = hdPart.getFolderView();

   if (id.equals("add.tab")) {
      folderView.addTab();

   } else if (id.equals("remove.tab")) {
      folderView.removeTab();
   }
}
 
Example 2
Source File: EmbeddedEditorActions.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void setAction(String actionID, final IAction action) {
	Assert.isNotNull(actionID);
	if (action == null) {
		allActions.remove(actionID);
	} else {
		if (action.getId() == null)
			action.setId(actionID); // make sure the action ID has been set
		allActions.put(actionID, action);
	}
}
 
Example 3
Source File: DecoratedScriptEditor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void setAction( String actionID, IAction action )
{
	super.setAction( actionID, action );
	if ( action != null && action.getId( ) == null )
	{
		action.setId( actionID );
	}
	if ( action != null )
		getActionRegistry( ).registerAction( action );
}
 
Example 4
Source File: ScriptEditor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void setAction( String actionID, IAction action )
{
	super.setAction( actionID, action );
	
	if ( action != null )
	{
		if ( action.getId( ) == null )
		{
			action.setId( actionID );
		}
		getActionRegistry( ).registerAction( action );
	}
}
 
Example 5
Source File: SarosView.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
private IAction registerAction(IAction action) {
  IAction oldAction = registeredActions.put(action.getId(), action);

  if (oldAction != null)
    throw new IllegalArgumentException(
        "tried to register action with id " + action.getId() + " more than once");

  return action;
}
 
Example 6
Source File: ShowWhitespaceCharactersActionContributor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
private ActionContributionItemExtension(IAction action) {
	super(action);
	this.id = action.getId();
}