Package net.sf.jguiraffe.gui.forms
Class ComponentHandlerImpl
- java.lang.Object
-
- net.sf.jguiraffe.gui.forms.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 Summary
Constructors Constructor Description ComponentHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getComponent()
Returns the underlying component.Object
getData()
Returns data of this handler.Object
getOuterComponent()
Returns the outer component of this handler.Class<?>
getType()
Returns the data type of this handler.boolean
isEnabled()
Returns the enabled flag.void
setComponent(Object c)
Sets the underlying component.void
setData(Object data)
Sets data of this handler.void
setEnabled(boolean f)
Sets the enabled flag.void
setType(Class<?> type)
Allows to set this handler's data type.
-
-
-
Method Detail
-
getComponent
public Object getComponent()
Returns the underlying component.- Specified by:
getComponent
in interfaceComponentHandler<Object>
- Returns:
- the component
-
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 interfaceComponentHandler<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 interfaceComponentHandler<Object>
- Parameters:
data
- the data object
-
getType
public Class<?> getType()
Returns the data type of this handler.- Specified by:
getType
in interfaceComponentHandler<Object>
- Returns:
- the data type
-
setType
public void setType(Class<?> type)
Allows to set this handler's data type. The type set with this method will be returned by thegetType()
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 interfaceComponentHandler<Object>
- Returns:
- the handler's outer component
-
isEnabled
public boolean isEnabled()
Returns the enabled flag.- Specified by:
isEnabled
in interfaceComponentHandler<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 interfaceComponentHandler<Object>
- Parameters:
f
- the flag value
-
-