class sap.ui.vk.tools.Tool

Control sample: sap.ui.vk.tools.Tool
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vk/tools/Tool
Application Component: CA-UI5-VTK

Specifies base for all tools to extend


Constructor

Base for all tool controls.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.vk.tools.Tool(sId?, mSettings?, oScope?)
Param Type Default Value Description
sId? string

ID of the new tool instance. sIdis generated automatically if no non-empty ID is given. Note: this can be omitted, regardless of whether mSettings will be provided or not.

mSettings? object

An optional map/JSON object with initial property values, aggregated objects etc. for the new tool instance.

oScope? object

scope An object for resolving string-based type and formatter references in bindings.


Properties

Name Type Default Value Description
active boolean false

Used to control the tool rendering and interaction pipeline.

Visibility: public
footprint string[]

Used to decide whether this tool should be enabled for the target viewport.

Visibility: public
targetViewportType any Visibility: public
toolid string

GUID identifier for the tool to prevent naming conflicts.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
gizmo 0..1 sap.ui.vk.tools.Gizmo

sap.ui.vk.tools.Gizmo owned by this control and used for rendering floating UI


Associations

Name Cardinality Type Description
gizmoContainer 0..1 sap.ui.core.Control

Control into which the gizmo is intended to render .


Events Overview

Event Description
enabled

enabled

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
enabled boolean

Returns the true or false to indicated that the tool is enabled or not. This event is fired by the tool under various conditions, including an attempt to set an activeViewport that is incompatible with the tool. use getActive / setActive to turn the tool on or off

reason string

Methods Overview

Method Description
attachEnabled

Attaches event handler fnFunction to the enabled event of this sap.ui.vk.tools.Tool.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.tools.Tool itself.

destroyGizmo

Destroys the gizmo in the aggregation gizmo.

detachEnabled

Detaches event handler fnFunction from the enabled event of this sap.ui.vk.tools.Tool.

The passed function and listener object must match the ones used for event registration.

sap.ui.vk.tools.Tool.extend

Creates a new subclass of class sap.ui.vk.tools.Tool with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Element.extend.

fireEnabled

Fires event enabled to attached listeners.

getActive

Gets current value of property active.

Used to control the tool rendering and interaction pipeline.

Default value is false.

getFootprint

Gets current value of property footprint.

Used to decide whether this tool should be enabled for the target viewport.

getGizmo

Gets content of aggregation gizmo.

sap.ui.vk.tools.Gizmo owned by this control and used for rendering floating UI

getGizmoContainer

ID of the element which is the current target of the association gizmoContainer, or null.

sap.ui.vk.tools.Tool.getMetadata

Returns a metadata object for class sap.ui.vk.tools.Tool.

getTargetViewportType

Gets current value of property targetViewportType.

getToolid

Gets current value of property toolid.

GUID identifier for the tool to prevent naming conflicts.

setActive

Manages the 'active' flag for this tool and any other internals required

setFootprint

Sets a new value for property footprint.

Used to decide whether this tool should be enabled for the target viewport.

When called with a value of null or undefined, the default value of the property will be restored.

setGizmo

Sets the aggregated gizmo.

setGizmoContainer

Sets the associated gizmoContainer.

setTargetViewportType

Sets a new value for property targetViewportType.

When called with a value of null or undefined, the default value of the property will be restored.

setToolid

Sets a new value for property toolid.

GUID identifier for the tool to prevent naming conflicts.

When called with a value of null or undefined, the default value of the property will be restored.

attachEnabled

Attaches event handler fnFunction to the enabled event of this sap.ui.vk.tools.Tool.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.tools.Tool itself.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vk.tools.Tool itself

destroyGizmo

Destroys the gizmo in the aggregation gizmo.

detachEnabled

Detaches event handler fnFunction from the enabled event of this sap.ui.vk.tools.Tool.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.vk.tools.Tool.extend

Creates a new subclass of class sap.ui.vk.tools.Tool with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Element.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireEnabled

Fires event enabled to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

enabled boolean

Returns the true or false to indicated that the tool is enabled or not. This event is fired by the tool under various conditions, including an attempt to set an activeViewport that is incompatible with the tool. use getActive / setActive to turn the tool on or off

reason string

getActive

Gets current value of property active.

Used to control the tool rendering and interaction pipeline.

Default value is false.

getFootprint

Gets current value of property footprint.

Used to decide whether this tool should be enabled for the target viewport.

getGizmo

Gets content of aggregation gizmo.

sap.ui.vk.tools.Gizmo owned by this control and used for rendering floating UI

getGizmoContainer

ID of the element which is the current target of the association gizmoContainer, or null.

sap.ui.vk.tools.Tool.getMetadata

Returns a metadata object for class sap.ui.vk.tools.Tool.

getTargetViewportType

Gets current value of property targetViewportType.

getToolid

Gets current value of property toolid.

GUID identifier for the tool to prevent naming conflicts.

setActive

Manages the 'active' flag for this tool and any other internals required

Param Type DefaultValue Description
value boolean

indicates whether this tools is active or not

activeTarget object

the tool target is used by the tool to carry out its operations

gizmoContainer object

used to evaluate whether a tool should be rendered as part of the activeTarget

setFootprint

Sets a new value for property footprint.

Used to decide whether this tool should be enabled for the target viewport.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sFootprint string[]

New value for property footprint

setGizmo

Sets the aggregated gizmo.

Param Type DefaultValue Description
oGizmo sap.ui.vk.tools.Gizmo

The gizmo to set

setGizmoContainer

Sets the associated gizmoContainer.

Param Type DefaultValue Description
oGizmoContainer sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this gizmoContainer association; alternatively, an element instance may be given

setTargetViewportType

Sets a new value for property targetViewportType.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
oTargetViewportType any

New value for property targetViewportType

setToolid

Sets a new value for property toolid.

GUID identifier for the tool to prevent naming conflicts.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sToolid string

New value for property toolid