Extends
Constructor
new ve.ui.ContextItem(context, [model], [config])
#
Item in a context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
context |
ve.ui.LinearContext | Context the item is in |
|
model |
ve.dm.Model |
optional |
Model the item is related to |
config |
Object |
optional |
Configuration options |
- Source:
Properties
exclusivestatic
#
Whether this item exclusively handles any model class
Properties:
Type | Description |
---|---|
boolean |
- Source:
modelClassesstatic
#
Annotation or node models this item is related to.
Used by #isCompatibleWith.
Properties:
Type | Description |
---|---|
Array.<function()> |
- Source:
sortOrderstatic
#
Sort order of the context item within the context
Items are sorted top to bottom in ascending order. Negative values are allowed.
Properties:
Type | Description |
---|---|
number |
- Source:
Sort order of the context item within the context
Items are sorted top to bottom in ascending order.
suppressesstatic
#
Context items (by name) which this context item suppresses.
See ve.ui.ModeledFactory.
Properties:
Type | Description |
---|---|
Array.<string> |
- Source:
Methods
equals(other) → {boolean}
#
Check whether this context item represents the same content as another
Parameters:
Name | Type | Description |
---|---|---|
other |
ve.ui.ContextItem |
- Source:
Returns:
- Type
- boolean
getCommand() → {ve.ui.Command}
#
getFragment() → {ve.dm.SurfaceFragment}
#
Get a surface fragment covering the related model node, or the current selection otherwise
- Source:
Returns:
Surface fragment
isNode() → {boolean}
#
Check if model is a node
- Source:
Returns:
Model is a node
- Type
- boolean
isReadOnly() → {boolean}
#
Check if the context's surface is readOnly
- Source:
Returns:
Context's surface is readOnly
- Type
- boolean
setup(refreshing) → {ve.ui.ContextItem}chainable
#
Setup the item.
Parameters:
Name | Type | Description |
---|---|---|
refreshing |
boolean | If this is a reconstruction/refresh of a context |
- Source:
Returns:
- Type
- ve.ui.ContextItem
teardown() → {ve.ui.ContextItem}chainable
#
isCompatibleWith(model) → {boolean}static
#
Check if this item is compatible with a given model.
Parameters:
Name | Type | Description |
---|---|---|
model |
ve.dm.Model | Model to check |
- Source:
Returns:
Item can be used with model
- Type
- boolean
Events
command()
#
The context executed a ve.ui.Command
- Source: