/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @since 3.2 */ public final void define(final String name, final String description, final Category category) { define(name, description, category, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @since 3.2 */ public void define(final String name, final String description, final Category category) { define(name, description, category, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @since 3.2 */ public final void define(final String name, final String description, final Category category) { define(name, description, category, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. */ public final void define(final String name, final String description, final Category category, final IParameter[] parameters) { define(name, description, category, parameters, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. */ public void define(final String name, final String description, final Category category, final IParameter[] parameters) { define(name, description, category, parameters, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. */ public final void define(final String name, final String description, final Category category, final IParameter[] parameters) { define(name, description, category, parameters, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. * @param returnType * The type of value returned by this command. This value may be * <code>null</code> if the command does not declare a return * type. * @since 3.2 */ public void define(final String name, final String description, final Category category, final IParameter[] parameters, ParameterType returnType) { define(name, description, category, parameters, returnType, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. * @param returnType * The type of value returned by this command. This value may be * <code>null</code> if the command does not declare a return * type. * @since 3.2 */ public final void define(final String name, final String description, final Category category, final IParameter[] parameters, ParameterType returnType) { define(name, description, category, parameters, returnType, null); }
/** * <p> * Defines this command by giving it a name, and possibly a description as * well. The defined property automatically becomes <code>true</code>. * </p> * <p> * Notification is sent to all listeners that something has changed. * </p> * * @param name * The name of this command; must not be <code>null</code>. * @param description * The description for this command; may be <code>null</code>. * @param category * The category for this command; must not be <code>null</code>. * @param parameters * The parameters understood by this command. This value may be * either <code>null</code> or empty if the command does not * accept parameters. * @param returnType * The type of value returned by this command. This value may be * <code>null</code> if the command does not declare a return * type. * @since 3.2 */ public final void define(final String name, final String description, final Category category, final IParameter[] parameters, ParameterType returnType) { define(name, description, category, parameters, returnType, null); }
@Override public Command defineCommand(String id, String name, String description, Category category, IParameter[] parameters) { Command cmd = commandManager.getCommand(id); if (!cmd.isDefined()) { cmd.define(name, description, category, parameters); cmd.setHandler(HandlerServiceImpl.getHandler(id)); } return cmd; }
@Override public Command defineCommand(String id, String name, String description, Category category, IParameter[] parameters, String helpContextId) { Command cmd = commandManager.getCommand(id); if (!cmd.isDefined()) { cmd.define(name, description, category, parameters, null, helpContextId); cmd.setHandler(HandlerServiceImpl.getHandler(id)); } return cmd; }
command.define(name, description, category, parameters, returnType, helpContextId); command.setHandler(HandlerServiceImpl.getHandler(commandId));
/** * Set the enabled state of the underlying action based on whether there are any * registered launch configuration types that understand how to launch in the * mode of this action. * @param action the {@link IAction} to initialize */ private void initialize(IAction action) { fAction = action; if(fAction != null) { fAction.setEnabled(existsConfigTypesForMode()); fAction.setText(getText()); fAction.setToolTipText(getTooltipText()); String commandId = getCommandId(); ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class); if (service != null) { Command command = service.getCommand(commandId); command.undefine(); command = service.getCommand(commandId); command.define(DebugUIPlugin.removeAccelerators(getText()), getDescription(), service.getCategory("org.eclipse.debug.ui.category.run")); //$NON-NLS-1$ } } }
final String name = LegacyActionTools.removeAcceleratorText(Action .removeMnemonics(label)); command.define(name, tooltip, category, null);