Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 6 Custom Controls : Component Library Model

Component Library Model
Library
The Library is the root element in the component library definition. A detailed description of the properties is provided in the following table:
 
Table 20 Library Element Properties
<libraryName>. toLowerCase()
Palette Drawer
There is a single Palette Drawer for each library file. All controls defined in a library file are displayed in this drawer in the Form Designer palette beneath the built-in drawers of Panes, Controls, and Action Buttons.
The detailed description of the properties is provided in the following table:
 
Table 21 Palette Drawer Properties
Event Type
Custom controls can raise any of the built-in events (for example: Update, Enter, Exit, Select) or can raise custom events that do not correspond to the semantics of any of the built-in events. Individual control types can declare the events they support from the union of built-in events and those defined at the library level.
A detailed description of the Event Type properties is provided in the following table:
Table 22 Event Type Properties
Cannot begin with tibco_, to ensure no conflict with built-in events specified by TIBCO.
External Resource
An External Resource can be defined at two levels:
All External Resources needed to load a Control Type need to be defined in one or other of these two places. This includes the JavaScript file that contains the implementation of the ControlWrapper for the Control Type. An External Resource can also contain CSS or localized properties.
A detailed description of the properties is provided in the following table:
 
Table 23 External Resource Properties
resource.resource1. The number increases for each new resource added to the library file.
Short identifier of the resource. Resources should be renamed to something meaningful. The name must begin with "resource." and must be unique within the library file. For properties files, this name is used from script in order to reference the resource bundle. (For example resource.<name>.<key>)
Important: you cannot select an external resource from a referenced project. The external resource must be available locally.
Control Type
The Control Type defines the custom control. A library file can contain one or many Control Types. All Control Types specified here appear in the Palette Drawer defined for the library.
The detailed description of the properties is provided in the following table:
Table 24 Control Type Properties
(Required) Provides the special folder relative URI of the icon that is used when rendering the component in the Form Designer canvas. The icon has to be placed within the Components special folder and it can be an image of type .png, .gif, or .bmp. This icon is used only at design-time.
This is set to true if the underlying widget provides a key handler for the Enter key. The form needs to know this in order to prevent a primary button (for example, 'Submit') from being activated by an Enter keystroke when the custom control has the input focus.
Indicates whether the value managed by this Control Type is multi-valued. If true, then the value for the control can only be bound to multi-valued values. When this is true, it is up to the implementation of the control to manage multiple values. For a multi-valued control with a simple data type, the runtime value will be set as a JavaScript array. When the control is managing multi-valued structured types, the values will be provided in a list.
Can be an image of type .png, .gif, or .bmp
Can be an image of type .png, .gif, or .bmp
normal: single instance rendering of the control, such as within vertical and horizontal panes.
static: Indicates that the control can be rendered within static panes. If supported, then the ControlWrapper must provide the renderStatic() method.
view-text: If specified, then the ControlWrapper must provide a getFormattedValue() method that will return a plain text representation of the value managed by this control.
view-html: If specified, then the ControlWrapper must provide a getFormattedValue() method that will return an HTML representation (as a string) of the value managed by this control.
grid-edit: Indicates that the Control Type provides a rendering specific to edit mode of grid panes. If this mode is not specified, and the Control Type otherwise supports grid panes, then the normal rendering mode will be used in grid panes.
The value of getFormattedText() is used in grid panes in the view mode. If neither view-text or view-html is specified, then the grid-edit mode will always be used in grid panes, or will fall back to normal if grid-edit is not specified.
 
Capabilities
Each capability is specified by an enumerated list comprised of neither, either, or both of the values [component, form].
component flag: The presence of this flag indicates that the component will provide some level of functionality with regards to that capability, so it should be provided with the necessary information and notified if the information related to that capability is updated.
form flag: The presences of this flag indicates that the component expects the form to carry out its normal handling of the capability, even if the component flag is also specified for the capability.
The table below provides specific detail for each combination of flags for each of the capabilities.
 
false (default)
true (default)
For this capability, the form value is always set to false
false (default)
true (default)
ControlWrapper supports a setFocus() method to allow script to change the focus to the control programmatically. If the control type implicitly or explicitly supports rendering within a grid pane, then the focus capability should be set to "component". Otherwise keyboard navigation of the grid pane will skip over cells that contain instances of this control type.
true (default)
false (default)
true (default)
false (default)
true (default)
false (default)
true (default)
false (default)
false (default)
true (default)
true (default)
false (default)
For this capability, the form flag value is always set to false.
false (default)
false (default)
 
Property
The Control Type property details are as follows:
If true, then the following features are enabled:
The get() and set() methods are automatically generated on the control, and content assist and script validation reflects this auto-generated API. For example: if the property name is "orientation", and it is marked as bindable=true, then the following two methods will be available on the control:
<Type> getOrientation()
setOrientation(<Type> value)
Where <Type> depends on the Data Type specified on the Property.
Indicates the Property provides a value which could vary based on locale. A setting of true here will cause the value to be externalized within the form-level resource bundle that is generated automatically.
Indicates whether the value for this property is multi-valued. If true, then the value for this property can only be bound to multi-valued values.
This name is used to expose get() and set() methods on the form Control object, and is used when providing updates to the ControlWrapper using the refresh() method.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved