Extends
Constructor
new ve.ui.DataTransferHandlerFactory()
#
Data transfer handler factory.
Data transfer handler factory.
Methods
getHandlerNameForItem(item, isPaste, isPasteSpecial) → {string|undefined
}
#
undefined
}
#
Get a handler name for a specific data transfer item
Parameters:
Name | Type | Description |
---|---|---|
item |
ve.ui.DataTransferItem | Data transfer item |
isPaste |
boolean | Handler being used for paste |
isPasteSpecial |
boolean | Handler being used for "paste special" |
Returns:
Handler name, or undefined if not found
- Type
-
string
|
undefined
Get a handler name for a specific data transfer item
register(constructor, [name])
#
Register a constructor with the factory.
function MyClass() {};
OO.initClass( MyClass );
MyClass.static.name = 'hello';
// Register class with the factory, available via the symbolic name "hello"
factory.register( MyClass );
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
constructor |
function | Constructor to use when creating object |
|
name |
string |
optional |
Symbolic name to use for #create().
This parameter may be omitted in favour of letting the constructor decide
its own name, through |
Throws:
-
If a parameter is invalid
- Type
- Error
Register a constructor with the factory.
unregister(constructor)
#
Unregister a constructor from the factory.
Parameters:
Name | Type | Description |
---|---|---|
constructor |
string | function | Constructor function or symbolic name to unregister |
Throws:
-
If a parameter is invalid
- Type
- Error
Unregister a constructor from the factory.
updateIndexes(constructor, insert)
#
Update indexes used for handler loopup
Parameters:
Name | Type | Description |
---|---|---|
constructor |
function | Handler's constructor to insert/remove |
insert |
boolean | Insert the handler into the indexes, remove otherwise |
Update indexes used for handler loopup