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
ComponentHandlerinterface.This class implements all methods required by the
ComponentHandlerinterface 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 ObjectgetComponent()Returns the underlying component.ObjectgetData()Returns data of this handler.ObjectgetOuterComponent()Returns the outer component of this handler.Class<?>getType()Returns the data type of this handler.booleanisEnabled()Returns the enabled flag.voidsetComponent(Object c)Sets the underlying component.voidsetData(Object data)Sets data of this handler.voidsetEnabled(boolean f)Sets the enabled flag.voidsetType(Class<?> type)Allows to set this handler's data type.
-
-
-
Method Detail
-
getComponent
public Object getComponent()
Returns the underlying component.- Specified by:
getComponentin 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:
getDatain 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:
setDatain interfaceComponentHandler<Object>- Parameters:
data- the data object
-
getType
public Class<?> getType()
Returns the data type of this handler.- Specified by:
getTypein 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:
getOuterComponentin interfaceComponentHandler<Object>- Returns:
- the handler's outer component
-
isEnabled
public boolean isEnabled()
Returns the enabled flag.- Specified by:
isEnabledin 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:
setEnabledin interfaceComponentHandler<Object>- Parameters:
f- the flag value
-
-