Package tripleo.vendor.thinlet
Class Thinlet
java.lang.Object
java.awt.Component
java.awt.Container
tripleo.vendor.thinlet.Thinlet
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Runnable
- Direct Known Subclasses:
DefaultOWThinlet
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified component to the root desktopvoidAdds the specified component to the end of the specified containervoidAdds the specified component to the container at the given positionprotected voidprotected @NotNull ObjectaddElement(Object parent, String name) protected voidAdd the component to the parent's ':comp' list, and set its ':parent' or set single componentsprotected voidcharacters(String text) The SAX-like parser calls this method, you have to overwrite itstatic @NotNull ObjectCreates a new componentprotected static @NotNull ObjectcreateImpl(String classname) booleandestroy()This method is called by the FrameLauncher if the window was closing, or AppletLauncher's destroy method.protected voidprotected voidThe SAX-like parser calls this method, you have to overwrite itFinds the first component from the root desktop by a specified name value@Nullable ObjectFinds the first component from the specified component by a nameprotected voidfinishParse(@Nullable Vector<Object> methods, Object root, @NotNull Object handler) protected static @Nullable ObjectGet a specified sub-component or component part.booleangetBoolean(Object component, String key) Gets the property value of the given component by the property keyGets the property value of the given component by the property keystatic @Nullable StringGets the type of the given componentGet custom color of a component.getComponent(Object component, String key) Get the AWT component of the given (currently bean ) widgetintGets the count of sub-components in the list of the given componentprotected static Object @NotNull []getDefinition(@Nullable Object classname, String key, @Nullable String type) Get the topmost componentprotected static @Nullable StringgetDOMAttribute(Object node, @NotNull String key) Gets the attribute value by the specified key for a DOM tagprotected static intgetDOMCount(Object node, @NotNull String key) Gets the number of tags in a tag by a specified tagnameprotected static @Nullable ObjectgetDOMNode(Object node, @NotNull String key, int index) Gets the subtag of the specified tag by tagname and indexprotected static @Nullable StringgetDOMText(Object node) Gets the content string of a tagGet custom font of a component.@Nullable ImageCreates an image from the specified resource.Gets the property value of the given component by the property keyCreates an image, and loads it immediately by defaultintgetInteger(Object component, String key) Gets the property value of the given component by the property key@Nullable ObjectReturns the subcomponent of the given component's specified list at the given indexprotected static intgetItemCountImpl(Object component, String key) Object @NotNull []Gets all the components in this containerstatic ResourceBundleReturns language resource bundle currently in use, or default bundle, or null.static ResourceBundleReturns default language resource bundle, or null.protected Object @NotNull []@Nullable ObjectGets the parent of this componentGets the preferred size of the root component@Nullable ObjectgetProperty(Object component, Object key) Returns the value of the property with the specified key.intgetSelectedIndex(Object component) Gets the index of the first selected item in the given component@Nullable ObjectgetSelectedItem(Object component) Gets the first selected item of the given componentObject @NotNull []getSelectedItems(Object component) Gets the selected item of the given component (list, table, or tree) when multiple selection is allowedGets the property value of the given component by the property key@Nullable Objectprotected voidhandleException(@NotNull Throwable throwable) Overwrite this method to handle exceptions thrown by the invoked custom methodsprotected voidinsertItem(Object parent, Object key, Object component, int index) Referenced by DOMprotected booleanprotected booleanInvokes a method, such as an action, on the specified component.protected voidinvokeImpl(Object method, Object part) booleanThis component can be traversed using Tab or Shift-Tab keyboard focus traversal, although 1.4 replaced this method by isFocusable , so 1.4 compilers write deprecation warningvoidPaints the components inside the graphics clip areaparse(@NotNull InputStream inputstream) Creates a component from the given streamprotected @Nullable Objectparse(@NotNull InputStream inputstream, boolean validate, boolean dom, @NotNull Object handler) parse(@NotNull InputStream inputstream, @NotNull Object handler) Creates a component from the given stream and event handlerCreates a component (and its subcomponents, and properties) from the given xml resourceCreates a component from the given xml resource using the specified event handlerprotected ObjectparseDOM(@NotNull InputStream inputstream) You can use the internal xml parser as a simple DOM-like parser, use the getDOMAttribute , getDOMText , getDOMCount , getDOMNode , getClass , and getParent methods to analise the documentprotected voidparseXML(@NotNull InputStream inputstream) You can use the internal xml parser as a simple SAX-like parser, during the process it calls the startElement , characters , and endElement methodsprotected voidprocessEvent(@NotNull AWTEvent e) Dispatches mouse, key, focus, and component events occurring on the Thinlet component internallyvoidputProperty(Object component, Object key, @Nullable Object value) Binds the specified key to the specified value, and stores in this component.voidRemove the specified component from its parent list, or delete component's popupmenu or table's headervoidRemoves all the components from this container's specified listvoidRepaint the given component's area laterbooleanrequestFocus(Object component) Requests that both the Thinlet component, and the given widget get the input focusvoidrun()A second thread is used to repeat value change events for scrollbar or spinbox during the mouse is pressed, or to pop up tooltipprotected static booleanvoidsetAllI18n(boolean val) Sets the default behaviour of internationalization code.voidsetBoolean(Object component, String key, boolean value) Sets the given property pair (key and value) for the componentvoidSets the given property pair (key and value) for the componentvoidSet custom color on a component.voidsetColors(int background, int text, int textbackground, int border, int disable, int hover, int press, int focus, int select) Sets the 9 colors used for components, and repaints the whole UIvoidsetComponent(Object component, String key, Component bean) Set the AWT component for the given (currently bean ) widgetprotected booleanRequest focus for the given componentvoidSets the only one font used everywhere, and revalidates the whole UI.voidSet custom font on a component, use the othersetFontmethod insteadvoidSet custom font on a componentvoidSets the given property pair (key and value) for the componentvoidsetInteger(Object component, String key, int value) Sets the given property pair (key and value) for the componentvoidsetKeystroke(Object component, String key, String value) voidSet current language resource bundle.voidSet default language resource bundle.voidsetMethod(Object component, String key, @NotNull String value, Object root, @NotNull Object handler) Sets a new event handler method for a componentvoidsetResourceBundle(ResourceBundle resourcebundle) Set a bundle used in parse method, it replaces the parameter values starting with the 'i18n.' string with a value found in the given bundlevoidSets the given property pair (key and value) for the componentprotected booleanprotected voidstartElement(String name, Map<String, String> attributelist) The SAX-like parser calls this method, you have to overwrite itvoidInvokes the paint methodMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
dtd
-
-
Constructor Details
-
Thinlet
public Thinlet()
-
-
Method Details
-
create
Creates a new component- Parameters:
classname- the widget type (e.g. button )- Returns:
- a new component, every component is simply an Object
- Throws:
IllegalArgumentException- for unknown widget type
-
createImpl
-
getDOMAttribute
@Nullable protected static @Nullable String getDOMAttribute(Object node, @NotNull @NotNull String key) Gets the attribute value by the specified key for a DOM tag- Parameters:
node- a specified tagkey- a string to identify the value pair- Returns:
- the value, or null
-
get
Get a specified sub-component or component part. Key is e.g. "header" (table header), ":parent" (parent component), ":comp" (head of a component list), ":next" (next component in a list), "popupmenu" is a popupmenu, etc ... -
getDOMText
Gets the content string of a tag- Parameters:
node- a specified tag- Returns:
- the value, or null
-
getDOMCount
Gets the number of tags in a tag by a specified tagname- Parameters:
node- a specified tagkey- the searched tagname- Returns:
- the number of tags
-
getLangResource
Returns language resource bundle currently in use, or default bundle, or null. -
setLangResource
Set current language resource bundle. This flushes all cached translated values, performs lazy loading of new values, and repaints the desktop. This implementation allows applications to switch language resources on the fly, without rebuilding/reloading components that use them.
The pseudo-code is as follows:- if langResource and langResourceDefault are null, don't translate anything, no matter what other settings are. This behaviour provides compatibility with previous versions.
- if only langResourceDefault is set, use this when translation is required
- if allI18n is set to true:
- if property "i18n" on a component is missing, or set to "true", translate
- if property "i18n" is present, and set to "false", do not translate
- if allI18n is set to false:
- if property "i18n" on a component is missing, or set to "false", do not translate
- if property "i18n" is present, and set to "true", translate
The "translate" step is applied only to values from "text" and "tooltip" properties (for now), and is applied as follows:
- use the value of "text" or "tooltip" as a lookup key
- use langResource to lookup the result value
- if no value is found, use langResourceDefault for lookup
- if no value is found, just return the original value of the property. Set a flag on component that prevents lookups in the future. This flag is cleared when langResource is changed.
- if no value is found, use langResourceDefault for lookup
- cache the result value, if any
If translated value is found successfully, it is cached in the component. This cache is gradually flushed when setLangResource is called. Cached value is also flushed when setString() is called on a component.
- Parameters:
res- resource bundle containing localized texts for "text" and "tooltip"
-
getLangResourceDefault
Returns default language resource bundle, or null. -
setLangResourceDefault
Set default language resource bundle. Resources from this bundle will be used if they are missing in the current bundle.- Parameters:
res- resource bundle containing default localized texts for "text" and "tooltip"
-
setColors
public void setColors(int background, int text, int textbackground, int border, int disable, int hover, int press, int focus, int select) Sets the 9 colors used for components, and repaints the whole UI- Parameters:
background- the backround of panels (dialogs, desktops), and disabled controls, not editable texts, lines between list items (the default value if #e6e6e6 )text- for text, arrow foreground ( black by default)textbackground- the background of text components, and lists ( white by default)border- for outer in inner borders of enabled components ( #909090 by default)disable- for text, border, arrow color in disabled components ( #b0b0b0 by default)hover- indicates that the mouse is inside a button area ( #ededed by default)press- for pressed buttons, gradient image is calculated using the background and this press color ( #b9b9b9 by default)focus- for text caret and rectagle color marking the focus owner ( #89899a by default)select- used as the background of selected text, and list items, and in slider ( #c5c5dd by default)
-
setFont
Sets the only one font used everywhere, and revalidates the whole UI. Scrollbar width/height, spinbox, and combobox button width, and slider size is the same as the font height -
getPreferredSize
Gets the preferred size of the root component- Overrides:
getPreferredSizein classContainer- Returns:
- a dimension object indicating the root component's preferred size
-
getDOMNode
@Nullable protected static @Nullable Object getDOMNode(Object node, @NotNull @NotNull String key, int index) Gets the subtag of the specified tag by tagname and index- Parameters:
node- a specified tagkey- the searched tagnameindex- the index of the requested subtag- Returns:
- the found tag, or null
-
getDefinition
protected static Object @NotNull [] getDefinition(@Nullable @Nullable Object classname, String key, @Nullable @Nullable String type) - Throws:
IllegalArgumentException
-
doLayout
-
paint
Paints the components inside the graphics clip area -
update
Invokes the paint method -
processEvent
Dispatches mouse, key, focus, and component events occurring on the Thinlet component internally- Overrides:
processEventin classContainer
-
set
-
run
public void run()A second thread is used to repeat value change events for scrollbar or spinbox during the mouse is pressed, or to pop up tooltip -
isFocusTraversable
public boolean isFocusTraversable()This component can be traversed using Tab or Shift-Tab keyboard focus traversal, although 1.4 replaced this method by isFocusable , so 1.4 compilers write deprecation warning- Overrides:
isFocusTraversablein classComponent- Returns:
- true as focus-transverable component, overwrites the default false value
-
getClass
Gets the type of the given component- Parameters:
component- a widget- Returns:
- the class name of the component (e.g. button )
-
invoke
Invokes a method, such as an action, on the specified component.- Parameters:
component- the component to fire the event on, such as a textfield or tablepart- the part of the component, null for a textfield, the row for a tableevent- the event to send, such as 'action'- Returns:
- true if a method object was fired
-
invokeImpl
-
getParent
Gets the parent of this component- Parameters:
component- a widget- Returns:
- the parent container of this component or item
-
repaint
Repaint the given component's area later- Parameters:
component- a visible widget inside thinlet desktop
-
requestFocus
Requests that both the Thinlet component, and the given widget get the input focus- Parameters:
component- a focusable widget inside visible and enabled parents, and tabbedpane's selected tab- Returns:
- true, if the given component was focusable
-
setFocus
Request focus for the given component- Parameters:
component- a focusable component- Returns:
- true if the focusowner was changed, otherwise false
-
getDesktop
Get the topmost component- Returns:
- the root object (it is a desktop ), never null
-
getCount
Gets the count of sub-components in the list of the given component- Parameters:
component- a widget- Returns:
- the number of components in this component
-
getSelectedIndex
Gets the index of the first selected item in the given component- Parameters:
component- a widget (combobox, tabbedpane, list, table, header, or tree)- Returns:
- the first selected index or -1
-
removeAll
Removes all the components from this container's specified list- Parameters:
component- the specified container
-
handleException
Overwrite this method to handle exceptions thrown by the invoked custom methods- Parameters:
throwable- the thrown exception by the bussiness logic
-
getSelectedItem
Gets the first selected item of the given component- Parameters:
component- a widget (combobox, tabbedpane, list, table, header or tree)- Returns:
- the first selected item or null
-
getSelectedItems
Gets the selected item of the given component (list, table, or tree) when multiple selection is allowed- Parameters:
component- a widget- Returns:
- the array of selected items, or a 0 length array
-
getItem
Returns the subcomponent of the given component's specified list at the given index- Parameters:
component- a specified containerindex- the index of the component to get- Returns:
- the index th component in this container
-
getItemCountImpl
-
getItems
Gets all the components in this container- Parameters:
component- a specified container- Returns:
- an array of all the components in this container
-
add
Adds the specified component to the root desktop- Parameters:
component- a widget to be added
-
add
Adds the specified component to the end of the specified container- Parameters:
parent- a containercomponent- a component to be added
-
add
Adds the specified component to the container at the given position- Parameters:
parent- a containercomponent- a component to be insertedindex- the position at which to insert the component, or -1 to insert the component at the end
-
insertItem
Referenced by DOM -
remove
Remove the specified component from its parent list, or delete component's popupmenu or table's header- Parameters:
component- the component to be removed
-
find
Finds the first component from the root desktop by a specified name value- Parameters:
name- parameter value identifies the widget- Returns:
- the first suitable component, or null
-
find
Finds the first component from the specified component by a name- Parameters:
component- the widget is searched inside this componentname- parameter value identifies the widget- Returns:
- the first suitable component, or null
-
parse
Creates a component (and its subcomponents, and properties) from the given xml resource- Parameters:
path- is relative to your thinlet instance or the classpath (if the path starts with an / character), or a full URL- Returns:
- the root component of the parsed resource
- Throws:
IOException
-
parse
public Object parse(@NotNull @NotNull String path, @NotNull @NotNull Object handler) throws IOException Creates a component from the given xml resource using the specified event handler- Parameters:
path- is relative to your application package or the classpath, or an URLhandler- bussiness methods are implemented in this object- Returns:
- the parsed components' root
- Throws:
IOException
-
parse
Creates a component from the given stream- Parameters:
inputstream- e.g. new URL("http://myserver/myservlet").openStream()- Returns:
- the root component of the parsed stream
- Throws:
IOException
-
parse
public Object parse(@NotNull @NotNull InputStream inputstream, @NotNull @NotNull Object handler) throws IOException Creates a component from the given stream and event handler- Parameters:
inputstream- read xml from this streamhandler- event handlers are implemented in this object- Returns:
- the parsed components' root
- Throws:
IOException
-
parseXML
You can use the internal xml parser as a simple SAX-like parser, during the process it calls the startElement , characters , and endElement methods- Parameters:
inputstream- e.g. new URL("http://myserver/myservlet").openStream()- Throws:
IOException
-
startElement
The SAX-like parser calls this method, you have to overwrite it- Parameters:
name- of the tagattributelist- a list of attributes including keys and value pairs
-
characters
The SAX-like parser calls this method, you have to overwrite it- Parameters:
text- the content of a tag
-
endElement
protected void endElement()The SAX-like parser calls this method, you have to overwrite it -
parseDOM
You can use the internal xml parser as a simple DOM-like parser, use the getDOMAttribute , getDOMText , getDOMCount , getDOMNode , getClass , and getParent methods to analise the document- Parameters:
inputstream- e.g. new URL("http://myserver/myservlet").openStream()- Returns:
- the root tag
- Throws:
IOException
-
setResourceBundle
Set a bundle used in parse method, it replaces the parameter values starting with the 'i18n.' string with a value found in the given bundle- Parameters:
resourcebundle- a bundle for the next parsing or null to remove the current one- Throws:
MissingResourceException- if no object for the given key can be found
-
parse
@Nullable protected @Nullable Object parse(@NotNull @NotNull InputStream inputstream, boolean validate, boolean dom, @NotNull @NotNull Object handler) throws IOException - Parameters:
inputstream-validate- parse GUI from xml if truedom- parse an xml resoourcehandler-- Returns:
- Throws:
IOExceptionIllegalArgumentException
-
finishParse
-
addImpl
Add the component to the parent's ':comp' list, and set its ':parent' or set single components- Parameters:
index- add at the specified index- Throws:
IllegalArgumentException
-
instance
-
addElement
-
addAttribute
protected void addAttribute(Object component, String key, @NotNull @NotNull String value, @NotNull @NotNull Vector<Object> lasts) - Throws:
IllegalArgumentException
-
setString
Sets the given property pair (key and value) for the component -
setString
-
getString
Gets the property value of the given component by the property key -
setChoice
Sets the given property pair (key and value) for the component -
getWidget
-
getChoice
Gets the property value of the given component by the property key -
setBoolean
Sets the given property pair (key and value) for the component -
getBoolean
Gets the property value of the given component by the property key -
setInteger
Sets the given property pair (key and value) for the component -
getInteger
Gets the property value of the given component by the property key -
setIcon
Sets the given property pair (key and value) for the component -
getIcon
Gets the property value of the given component by the property key -
setKeystroke
-
setMethod
public void setMethod(Object component, String key, @NotNull @NotNull String value, Object root, @NotNull @NotNull Object handler) Sets a new event handler method for a component- Parameters:
component- the target componentkey- the key name of the parameter (e.g. action )value- the method name and parameters (e.g. foo(this, this.text, mybutton, mybutton.enabled) for public void foo(Object component, String text, Object mybutton, boolean enabled) )root- the search starting component for name components in the argumentshandler- the target event handler object including the method- Throws:
IllegalArgumentException
-
getComponent
Get the AWT component of the given (currently bean ) widget- Parameters:
component- a bean widgetkey- the identifier of the parameter- Returns:
- an AWT component, or null
-
setFont
Set custom font on a component, use the othersetFontmethod instead -
setFont
Set custom font on a component- Parameters:
component- component to use the custom fontkey- currently only "font" is supportedfont- custom font to use, or null to reset component to use default font
-
getFont
Get custom font of a component. This method may return null if the default font is used.- Parameters:
component- a componentkey- the identifier of the parameter, e.g. "font"- Returns:
-
setColor
Set custom color on a component. Notes: For "foreground" key, this sets the text color. For "background" key, on gradient-filled components (such as tabs, buttons etc) this will result in a component filled with solid background color, and not a new gradient. Also, Color.brighter() will be used for highlight, and Color.darker() will be used for pressed or not selected.- Parameters:
component- component to use for custom colorkey- currently "background" and "foreground" are supportedcolor- custom color to use, or null to reset component to use default color
-
getColor
Get custom color of a component. This method may return null if the default color is used.- Parameters:
component- a componentkey- the identifier of the parameter, e.g. "foreground"- Returns:
- value of the custom color, or null if default color is used
-
setComponent
Set the AWT component for the given (currently bean ) widget- Parameters:
component- a bean widgetkey- the identifier of the parameterbean- an AWT component, or null
-
getMethod
protected Object @NotNull [] getMethod(Object component, @NotNull @NotNull String value, Object root, @NotNull @NotNull Object handler) - Returns:
- an object list including as follows: - handler object, - method, - list of parameters including 3 values: - ("thinlet", null, null) for the single thinlet component, - (target component, null, null) for named widget as parameter, e.g. mybutton, - (target, parameter name, default value) for a widget's given property, e.g. mylabel.enabled, - ("item", null, null) for an item of the target component as parameter, e.g. tree node, - ("item", parameter name, default value) for the item's given property e.g. list item's text.
-
getProperty
Returns the value of the property with the specified key.- Parameters:
component- searches the hashtable of this componentkey- the client property key- Returns:
- the value to which the key is mapped or null if the key is not mapped to any value
-
setAllI18n
public void setAllI18n(boolean val) Sets the default behaviour of internationalization code. If set to "true", try to translate all components' "text" and "tooltip" values, unless explicitly prohibited by settingi18n="false"on a specific component. If set to "false", do not translate unless explicitly requested by settingi18n="true"on a specific component.
Default value is "false", to provide backwards compatibility.- Parameters:
val- if "true", translate by default; if "false", do not translate by default.
-
putProperty
Binds the specified key to the specified value, and stores in this component. Null value removes the property. Use the parameter tag in the xml resource to bind a string value, the format is: parameter='key=value'- Parameters:
component- the hashtable is binded to this componentkey- the client property keyvalue- the new client property value
-
getIcon
Creates an image, and loads it immediately by default- Parameters:
path- is relative to your thinlet instance or the classpath (if the path starts with '/' character), or a full URL- Returns:
- the loaded image or null
-
getIcon
Creates an image from the specified resource. To speed up loading the same images use a cache (a simple hashtable). And flush the resources being used by an image when you won't use it henceforward- Parameters:
path- is relative to your thinlet instance or the classpath, or an URLpreload- waits for the whole image if true, starts loading (and repaints, and updates the layout) only when required (painted, or size requested) if false- Returns:
- the loaded image or null
-
destroy
public boolean destroy()This method is called by the FrameLauncher if the window was closing, or AppletLauncher's destroy method. Overwrite it to e.g. save the application changes.- Returns:
- true to exit, and false to keep the frame and continue the application
-