Expand all

ve.ui.ContextItem

Extends

Constructor

new ve.ui.ContextItem(context, [model], [config]) #

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:
Item in a context.

Properties

exclusivestatic #

Whether this item exclusively handles any model class

Properties:

Type Description
boolean
Source:
Whether this item exclusively handles any model class

modelClassesstatic #

Annotation or node models this item is related to.

Used by #isCompatibleWith.

Properties:

Type Description
Array.<function()>
Source:
Annotation or node models this item is related to.

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:
Context items (by name) which this context item suppresses.

Methods

getCommand() → {ve.ui.Command} #

Get the command for this item.

Source:

Returns:

Type
ve.ui.Command
Get the command for this item.

getFragment() → {ve.dm.SurfaceFragment} #

Get a surface fragment covering the related model node, or the current selection otherwise

Source:

Returns:

Surface fragment

Type
ve.dm.SurfaceFragment
Get a surface fragment covering the related model node, or the current selection otherwise

isNode() → {boolean} #

Check if model is a node

Source:

Returns:

Model is a node

Type
boolean
Check if model is a node

isReadOnly() → {boolean} #

Check if the context's surface is readOnly

Source:

Returns:

Context's surface is readOnly

Type
boolean
Check if the context's surface is readOnly

setup() → {ve.ui.ContextItem}chainable #

Setup the item.

Source:

Returns:

Type
ve.ui.ContextItem
Setup the item.

teardown() → {ve.ui.ContextItem}chainable #

Teardown the item.

Source:

Returns:

Type
ve.ui.ContextItem
Teardown the item.

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
Check if this item is compatible with a given model.

Events

command() #

The context executed a ve.ui.Command

Source:
The context executed a ve.ui.Command