Community
Participate
Working Groups
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
public void widgetSelected( final SelectionEvent e ) {
try {
Command buttonCommand = ( Command ) button.getData();
buttonCommand.getHandler().execute( new ExecutionEvent() );
IHandler handler = buttonCommand.getHandler();
if( handler != null ) {
handler.execute( new ExecutionEvent() );
}
} catch( ExecutionException e1 ) {
e1.printStackTrace();
import org.eclipse.core.commands.CommandManager;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
Command command = param.getCommand();
if( command != null ) {
command.getHandler().execute( new ExecutionEvent() );
IHandler handler = command.getHandler();
} catch( final ExecutionException e ) {
e.printStackTrace();