Class ComponentHandlerImpl

  • All Implemented Interfaces:
    ComponentHandler<Object>

    public class ComponentHandlerImpl
    extends Object
    implements ComponentHandler<Object>

    A simple default implementation of the ComponentHandler interface.

    This class implements all methods required by the ComponentHandler interface without being backed by a really GUI component. All get and set methods operate on internal properties. The class can be used for testing or for components that need a faked component handler.

    Version:
    $Id: ComponentHandlerImpl.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • ComponentHandlerImpl

        public ComponentHandlerImpl()
    • Method Detail

      • setComponent

        public void setComponent​(Object c)
        Sets the underlying component. The passed in object is simply stored in an internal property.
        Parameters:
        c - the component
      • getData

        public Object getData()
        Returns data of this handler. This data is simply stored in an internal property.
        Specified by:
        getData in interface ComponentHandler<Object>
        Returns:
        the component's data
      • setData

        public void setData​(Object data)
        Sets data of this handler. The passed in data object is stored in an internal property.
        Specified by:
        setData in interface ComponentHandler<Object>
        Parameters:
        data - the data object
      • setType

        public void setType​(Class<?> type)
        Allows to set this handler's data type. The type set with this method will be returned by the getType() method. It should always be initialized first.
        Parameters:
        type - the type of this handler
      • getOuterComponent

        public Object getOuterComponent()
        Returns the outer component of this handler. This is the same as the normal component.
        Specified by:
        getOuterComponent in interface ComponentHandler<Object>
        Returns:
        the handler's outer component
      • isEnabled

        public boolean isEnabled()
        Returns the enabled flag.
        Specified by:
        isEnabled in interface ComponentHandler<Object>
        Returns:
        the enabled flag
      • setEnabled

        public void setEnabled​(boolean f)
        Sets the enabled flag. This flag is simply realized by an internal member variable.
        Specified by:
        setEnabled in interface ComponentHandler<Object>
        Parameters:
        f - the flag value