Class DefaultOWThinlet
java.lang.Object
java.awt.Component
java.awt.Container
tripleo.vendor.thinlet.Thinlet
tripleo.vendor.thinlet.objectwrapper.DefaultOWThinlet
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Runnable,OWThinlet
The default
OWThinlet implementation, directly based on thinlet.Thinlet,
that manage the life cycle of Object Wrapper Component.
DefaultOWThinlet maintain a repository of related (Object wrapper - thinlet compoennt),
and define the API required to retrieve OWObject from a given thinlet component.
Implementation Note:
- With JDK < 1.3, all widget which are definitively removed from the hierachy must have it's
conter part OWObject released by the
OWObject.release()call, to avoid leak memory. - For JDK >= 1.3, the repository use a java.util.WeakHashMap, so explicit
OWObject.release()is optional.
- 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
ConstructorsConstructorDescriptionbuild a new OWThinlet, for managing Objecr Wrapper thinlet widget -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified component to the root desktopvoiddefineMethod(Object component, String methodName, Method method) register the given method as named method on the given componentfindObject(@NotNull String name) Finds the first component from the root desktop by a specified name valuefindObject(@NotNull OWWidget component, @NotNull String name) Finds the first component from the specified component by a nameprotected booleanoverload to call the registered objectwrapper methodparseAsObject(@NotNull InputStream inputstream) Creates a component from the given streamparseAsObject(@NotNull InputStream inputstream, @NotNull Object handler) Creates a component from the given stream and event handlerparseAsObject(@NotNull String path) Creates a component (and its subcomponents, and properties) from the given xml resourceparseAsObject(@NotNull String path, @NotNull Object handler) Creates a component from the given xml resource using the specified event handlervoidregister the given OWObject, as managed by the given thinletvoidsetComponent(Object component, String key, Object widget) Issued fromthinlet.Thinlet.voidunregister(@NotNull OWObject widget) unregister the given OWObject, as not managed by the given thinlet@NotNull OWObjectreturn a previously registered object wrapper from the given thinlet component, or build a new wrapper object, ans register it.Methods inherited from class tripleo.vendor.thinlet.Thinlet
add, add, add, addAttribute, addElement, addImpl, characters, create, createImpl, destroy, doLayout, endElement, find, find, finishParse, get, getBoolean, getChoice, getClass, getColor, getComponent, getCount, getDefinition, getDesktop, getDOMAttribute, getDOMCount, getDOMNode, getDOMText, getFont, getIcon, getIcon, getIcon, getInteger, getItem, getItemCountImpl, getItems, getLangResource, getLangResourceDefault, getMethod, getParent, getPreferredSize, getProperty, getSelectedIndex, getSelectedItem, getSelectedItems, getString, getWidget, handleException, insertItem, instance, invokeImpl, isFocusTraversable, paint, parse, parse, parse, parse, parse, parseDOM, parseXML, processEvent, putProperty, remove, removeAll, repaint, requestFocus, run, set, setAllI18n, setBoolean, setChoice, setColor, setColors, setComponent, setFocus, setFont, setFont, setFont, setIcon, setInteger, setKeystroke, setLangResource, setLangResourceDefault, setMethod, setResourceBundle, setString, setString, startElement, updateMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface tripleo.vendor.thinlet.objectwrapper.OWThinlet
add, add, getBoolean, getChoice, getCount, getIcon, getInteger, getItem, getItems, getParent, getProperty, getSelectedIndex, getSelectedItem, getSelectedItems, getString, putProperty, remove, removeAll, setBoolean, setChoice, setColor, setFont, setIcon, setInteger, setKeystroke, setString
-
Field Details
-
frepository
-
-
Constructor Details
-
DefaultOWThinlet
public DefaultOWThinlet()build a new OWThinlet, for managing Objecr Wrapper thinlet widget
-
-
Method Details
-
invoke
overload to call the registered objectwrapper method -
wrap
return a previously registered object wrapper from the given thinlet component, or build a new wrapper object, ans register it. -
register
register the given OWObject, as managed by the given thinlet -
unregister
unregister the given OWObject, as not managed by the given thinlet- Specified by:
unregisterin interfaceOWThinlet
-
add
Adds the specified component to the root desktop -
findObject
Finds the first component from the specified component by a name- Specified by:
findObjectin interfaceOWThinlet- Parameters:
component- the widget is searched inside this componentname- parameter value identifies the widget- Returns:
- the first suitable component, or null
-
findObject
Finds the first component from the root desktop by a specified name value- Specified by:
findObjectin interfaceOWThinlet- Parameters:
name- parameter value identifies the widget- Returns:
- the first suitable component, or null
-
parseAsObject
Creates a component (and its subcomponents, and properties) from the given xml resource- Specified by:
parseAsObjectin interfaceOWThinlet- 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
-
parseAsObject
public OWWidget parseAsObject(@NotNull @NotNull String path, @NotNull @NotNull Object handler) throws IOException Creates a component from the given xml resource using the specified event handler- Specified by:
parseAsObjectin interfaceOWThinlet- 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
-
parseAsObject
Creates a component from the given stream- Specified by:
parseAsObjectin interfaceOWThinlet- Parameters:
inputstream- e.g. new URL("http://myserver/myservlet").openStream()- Returns:
- the root component of the parsed stream
- Throws:
IOException
-
parseAsObject
public OWWidget parseAsObject(@NotNull @NotNull InputStream inputstream, @NotNull @NotNull Object handler) throws IOException Creates a component from the given stream and event handler- Specified by:
parseAsObjectin interfaceOWThinlet- Parameters:
inputstream- read xml from this streamhandler- event handlers are implemented in this object- Returns:
- the parsed components' root
- Throws:
IOException
-
defineMethod
register the given method as named method on the given component- Specified by:
defineMethodin interfaceOWThinlet
-
setComponent
Description copied from interface:OWThinletIssued fromthinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.- Specified by:
setComponentin interfaceOWThinlet
-