nsISupports
Last changed in Gecko 1.9 (Firefox 3)This interface is used to manage instances of the nsIController
interface. Windows and text inputs have default controllers that allow commands such as cmd_copy
to act on the focused element or window. XUL elements can also have controllers, although they do not have any default controllers.
Implemented by: @mozilla.org/xul/xul-controllers;1
. You should not normally need to create an instance, as you normally need to alter the window or element's existing list of controllers. To create an instance, use:
var controllers = Components.classes["@mozilla.org/xul/xul-controllers;1"] .createInstance(Components.interfaces.nsIControllers);
void appendController(in nsIController controller); |
nsIController getControllerAt(in unsigned long index); |
nsIController getControllerById(in unsigned long controllerID); |
unsigned long getControllerCount(); |
nsIController getControllerForCommand(in string command); |
unsigned long getControllerId(in nsIController controller); |
void insertControllerAt(in unsigned long index, in nsIController controller); |
void removeController(in nsIController controller); |
nsIController removeControllerAt(in unsigned long index); |
Attribute | Type | Description |
commandDispatcher |
| Obsolete since Gecko 1.9 |
Adds a controller to the end of the list.
void appendController( in nsIController controller );
controller
NS_ERROR_OUT_OF_MEMORY
Returns the controller instance at the given position.
nsIController getControllerAt( in unsigned long index );
index
The controller at the given position.
NS_ERROR_FAILURE
Returns a controller given by its order, rather than position, of insertion.
nsIController getControllerById( in unsigned long controllerID );
controllerID
The controller element that was inserted with that ID.
NS_ERROR_FAILURE
Returns the current number of controllers.
unsigned long getControllerCount();
None.
The number of controllers currently in the list of controllers.
Searches for a controller that supports the given command.
nsIController getControllerForCommand( in string command );
command
cmd_copy
The first controller in the list that supports the given command.
Returns the order of insertion of a controller.
unsigned long getControllerId( in nsIController controller );
controller
The ID in which the controller was inserted.
NS_ERROR_FAILURE
Inserts a controller at a specific position in the list of controllers. If the position is out of range, nothing happens.
void insertControllerAt( in unsigned long index, in nsIController controller );
index
controller
NS_ERROR_OUT_OF_MEMORY
Removes a controller from the list of controllers.
void removeController( in nsIController controller );
controller
NS_ERROR_FAILURE
Removes a controller from the list of controllers.
nsIController removeControllerAt( in unsigned long index );
index
The controller that was removed.
NS_ERROR_FAILURE