Class Scheme
- All Implemented Interfaces:
Comparable,IIdentifiable
An instance of IScheme is a handle representing a binding
scheme as defined by the extension point org.eclipse.ui.bindings.
The identifier of the handle is the identifier of the scheme being represented.
An instance of IScheme can be obtained from an instance of
ICommandManager for any identifier, whether or not a scheme
with that identifier is defined in the plugin registry.
The handle-based nature of this API allows it to work well with runtime
plugin activation and deactivation. If a scheme is defined, that means that
its corresponding plug-in is active. If the plug-in is then deactivated, the
scheme will still exist but it will be undefined. An attempt to use an
undefined scheme will result in a NotDefinedException
being thrown.
This class is not intended to be extended by clients.
- Since:
- 3.1
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.core.commands.common.NamedHandleObject
description, nameFields inherited from class org.eclipse.core.commands.common.HandleObject
defined, id, string -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddSchemeListener(ISchemeListener schemeListener) Registers an instance ofISchemeListenerto listen for changes to attributes of this instance.final intfinal voidDefines this scheme by giving it a name, and possibly a description and a parent identifier as well.final StringReturns the identifier of the parent of the scheme represented by this handle.final voidremoveSchemeListener(ISchemeListener schemeListener) Unregisters an instance ofISchemeListenerlistening for changes to attributes of this instance.final StringtoString()The string representation of this command -- for debugging purposes only.final voidundefine()Makes this scheme become undefined.Methods inherited from class org.eclipse.core.commands.common.NamedHandleObject
getDescription, getNameMethods inherited from class org.eclipse.core.commands.common.HandleObject
equals, getId, hashCode, isDefinedMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Method Details
-
addSchemeListener
Registers an instance ofISchemeListenerto listen for changes to attributes of this instance.- Parameters:
schemeListener- the instance ofISchemeListenerto register. Must not benull. If an attempt is made to register an instance ofISchemeListenerwhich is already registered with this instance, no operation is performed.
-
compareTo
- Specified by:
compareToin interfaceComparable
-
define
Defines this scheme by giving it a name, and possibly a description and a parent identifier as well. The defined property for the scheme automatically becomes
true.Notification is sent to all listeners that something has changed.
- Parameters:
name- The name of this scheme; must not benull.description- The description for this scheme; may benull.parentId- The parent identifier for this scheme; may benull.
-
getParentId
Returns the identifier of the parent of the scheme represented by this handle.
Notification is sent to all registered listeners if this attribute changes.
- Returns:
- the identifier of the parent of the scheme represented by this
handle. May be
null. - Throws:
NotDefinedException- if the scheme represented by this handle is not defined.
-
removeSchemeListener
Unregisters an instance ofISchemeListenerlistening for changes to attributes of this instance.- Parameters:
schemeListener- the instance ofISchemeListenerto unregister. Must not benull. If an attempt is made to unregister an instance ofISchemeListenerwhich is not already registered with this instance, no operation is performed.
-
toString
The string representation of this command -- for debugging purposes only. This string should not be shown to an end user.- Specified by:
toStringin classHandleObject- Returns:
- The string representation; never
null.
-
undefine
public final void undefine()Makes this scheme become undefined. This has the side effect of changing the name, description and parent identifier tonull. Notification is sent to all listeners.- Specified by:
undefinein classHandleObject
-