1 11 package org.eclipse.ui.commands; 12 13 import java.util.Collection ; 14 import java.util.Map ; 15 16 import org.eclipse.core.commands.Category; 17 import org.eclipse.core.commands.Command; 18 import org.eclipse.core.commands.CommandManager; 19 import org.eclipse.core.commands.IExecutionListener; 20 import org.eclipse.core.commands.IHandler; 21 import org.eclipse.core.commands.ParameterType; 22 import org.eclipse.core.commands.ParameterizedCommand; 23 import org.eclipse.core.commands.SerializationException; 24 import org.eclipse.core.commands.common.NotDefinedException; 25 import org.eclipse.ui.menus.UIElement; 26 import org.eclipse.ui.services.IDisposable; 27 28 40 public interface ICommandService extends IDisposable { 41 42 48 public static final String AUTOGENERATED_CATEGORY_ID = CommandManager.AUTOGENERATED_CATEGORY_ID; 49 50 57 public void addExecutionListener(IExecutionListener listener); 58 59 72 public void defineUncategorizedCategory(String name, String description); 73 74 114 public ParameterizedCommand deserialize( 115 String serializedParameterizedCommand) throws NotDefinedException, 116 SerializationException; 117 118 129 public Category getCategory(String categoryId); 130 131 139 public Command getCommand(String commandId); 140 141 148 public Category[] getDefinedCategories(); 149 150 157 public Collection getDefinedCategoryIds(); 158 159 166 public Collection getDefinedCommandIds(); 167 168 175 public Command[] getDefinedCommands(); 176 177 185 public Collection getDefinedParameterTypeIds(); 186 187 195 public ParameterType[] getDefinedParameterTypes(); 196 197 213 public String getHelpContextId(Command command) throws NotDefinedException; 214 215 231 public String getHelpContextId(String commandId) throws NotDefinedException; 232 233 244 public ParameterType getParameterType(String parameterTypeId); 245 246 255 public void readRegistry(); 256 257 263 public void removeExecutionListener(IExecutionListener listener); 264 265 277 public void setHelpContextId(IHandler handler, String helpContextId); 278 279 296 public IElementReference registerElementForCommand( 297 ParameterizedCommand command, UIElement element) 298 throws NotDefinedException; 299 300 310 public void registerElement(IElementReference elementReference); 311 312 322 public void unregisterElement(IElementReference elementReference); 323 324 351 public void refreshElements(String commandId, Map filter); 352 } 353 | Popular Tags |