Interface OWThinlet

All Known Implementing Classes:
DefaultOWThinlet

public interface OWThinlet
Represent a specialized Thinlet like, that manage the life cycle of Object Wrapper Component.

OWThinlet maintain a repository of related (Object wrapper - thinlet component), 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 counter 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() become optional.
  • Method Details

    • wrap

      OWObject wrap(Object component)
      Return a previously registered object wrapper from the given thinlet component, or build a new wrapper object and register it.
    • register

      void register(OWObject widget)
      register the given OWObject, as managed by the given thinlet
    • unregister

      void unregister(OWObject widget)
      unregister the given OWObject, as not managed by the given thinlet
    • add

      void add(OWWidget component)
      Adds the specified widget to the root desktop
      Parameters:
      component - a widget to be added
    • findObject

      OWObject findObject(OWWidget component, String name)
      Finds the first widget from the specified component by a name
      Parameters:
      component - the widget is searched inside this component
      name - parameter value identifies the widget
      Returns:
      the first suitable component, or null
    • findObject

      OWObject findObject(String name)
      Finds the first widget from the root desktop by a specified name value
      Parameters:
      name - parameter value identifies the widget
      Returns:
      the first suitable component, or null
    • parseAsObject

      OWWidget parseAsObject(String path) throws IOException
      Creates a widget (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
    • parseAsObject

      OWWidget parseAsObject(String path, Object handler) throws IOException
      Creates a widget from the given xml resource using the specified event handler
      Parameters:
      path - is relative to your application package or the classpath, or an URL
      handler - bussiness methods are implemented in this object
      Returns:
      the parsed components' root
      Throws:
      IOException
    • parseAsObject

      OWWidget parseAsObject(InputStream inputstream) throws IOException
      Creates a widget from the given stream
      Parameters:
      inputstream - e.g. new URL("http://myserver/myservlet").openStream()
      Returns:
      the root component of the parsed stream
      Throws:
      IOException
    • parseAsObject

      OWWidget parseAsObject(InputStream inputstream, Object handler) throws IOException
      Creates a widget from the given stream and event handler
      Parameters:
      inputstream - read xml from this stream
      handler - event handlers are implemented in this object
      Returns:
      the parsed components' root
      Throws:
      IOException
    • defineMethod

      void defineMethod(Object component, String methodName, Method method)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setString

      void setString(Object component, String key, String value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getString

      String getString(Object component, String key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setChoice

      void setChoice(Object component, String key, String value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getChoice

      String getChoice(Object component, String key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setBoolean

      void setBoolean(Object component, String key, boolean value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getBoolean

      boolean getBoolean(Object component, String key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setInteger

      void setInteger(Object component, String key, int value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getInteger

      int getInteger(Object component, String key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setIcon

      void setIcon(Object component, String key, Image icon)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getIcon

      Image getIcon(Object component, String key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setKeystroke

      void setKeystroke(Object component, String key, String value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setFont

      void setFont(Object component, String key, Font font)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setColor

      void setColor(Object component, String key, Color color)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • putProperty

      void putProperty(Object component, Object key, Object value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getProperty

      @Nullable @Nullable Object getProperty(Object component, Object key)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • setComponent

      void setComponent(Object component, String key, Object value)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getParent

      @Nullable @Nullable Object getParent(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • add

      void add(Object parent, Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • add

      void add(Object parent, Object component, int index)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • remove

      void remove(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • removeAll

      void removeAll(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getSelectedIndex

      int getSelectedIndex(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getSelectedItem

      @Nullable @Nullable Object getSelectedItem(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getSelectedItems

      Object[] getSelectedItems(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getItem

      @Nullable @Nullable Object getItem(Object component, int index)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getItems

      Object[] getItems(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.
    • getCount

      int getCount(Object component)
      Issued from thinlet.Thinlet. Part of the thinlet like interface, required to have several ObjectWrapperThinlet implementation.