Skip to main content

Class: ObjectHandler

ui.ObjectHandler

Override the corresponding methods, and register an instance to let Datagrok know how to handle objects of the specified type.

isApplicable is used to associate an object with the handler. When handling an object x, the platform uses the first registered handler that claims that it is applicable to that object.

TODO: search, destructuring to properties

Example: https://public.datagrok.ai/js/samples/ui/handlers/handlers

Hierarchy

Constructors

constructor

new ObjectHandler()

Accessors

name

get name(): string

Returns

string

Defined in

ui.ts:1690


type

get type(): string

Type of the object that this meta handles.

Returns

string

Defined in

ui.ts:1686

Methods

getById

getById(id): Promise<any>

Parameters

NameType
idstring

Returns

Promise<any>

Defined in

ui.ts:1694


getCanvasRenderer

getCanvasRenderer(): null | CanvasRenderer

Returns

null | CanvasRenderer

Defined in

ui.ts:1717


getCaption

getCaption(x): string

String representation of the [item], by default item.toString().

Parameters

NameTypeDescription
xanyitem

Returns

string

Defined in

ui.ts:1712


getGridCellRenderer

getGridCellRenderer(): null | GridCellRenderer

Returns

null | GridCellRenderer

Defined in

ui.ts:1722


init

init(): void

Gets called once upon the registration of meta export class.

Returns

void

Defined in

ui.ts:1762


isApplicable

isApplicable(x): boolean

Override this method to check whether this meta class should handle the specified object.

Parameters

NameTypeDescription
xanyspecified object.

Returns

boolean

Defined in

ui.ts:1705


refresh

refresh(x): Promise<any>

Parameters

NameType
xany

Returns

Promise<any>

Defined in

ui.ts:1698


registerParamFunc

registerParamFunc(name, run): void

Registers a function that takes applicable objects as the only argument. It will be suggested to run in the context menu for that object, and also in the "Actions" pane on the context panel.

Example: https://public.datagrok.ai/js/samples/ui/docking/docking

Parameters

NameTypeDescription
namestringfunction name
run(param: any) => anya function that takes exactly one parameter

Returns

void

Defined in

ui.ts:1805


renderCard

renderCard(x, context?): HTMLElement

Renders card div for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1742


renderIcon

renderIcon(x, context?): HTMLElement

Renders icon for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1727


renderMarkup

renderMarkup(x, context?): HTMLElement

Renders markup for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1732


renderPreview

renderPreview(x, context?): Promise<View>

Renders preview list for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

Promise<View>

Defined in

ui.ts:1752


renderProperties

renderProperties(x, context?): HTMLElement

Renders properties list for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1747


renderTooltip

renderTooltip(x, context?): HTMLElement

Renders tooltip for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1737


renderView

renderView(x, context?): HTMLElement

Renders view for the item.

Parameters

NameTypeDefault value
xanyundefined
contextanynull

Returns

HTMLElement

Defined in

ui.ts:1757


toString

toString(): string

Returns

string

Defined in

ui.ts:1692


forEntity

Static forEntity(object, context?): null | ObjectHandler

Parameters

NameTypeDefault value
objectanyundefined
contextanynull

Returns

null | ObjectHandler

Defined in

ui.ts:1780


forSemType

Static forSemType(semType): Promise<ObjectHandler[]>

Parameters

NameType
semTypestring

Returns

Promise<ObjectHandler[]>

Defined in

ui.ts:1791


list

Static list(): ObjectHandler[]

Returns

ObjectHandler[]

Defined in

ui.ts:1772


onResolve

Static onResolve(observer): Subscription

Parameters

NameType
observerPartialObserver<ObjectHandlerResolutionArgs>

Returns

Subscription

Defined in

ui.ts:1776


register

Static register(meta): void

Registers entity handler.

Parameters

NameType
metaObjectHandler

Returns

void

Defined in

ui.ts:1765