net.sf.doolin.gui.field.support
Class AbstractField<V>

java.lang.Object
  extended by net.sf.doolin.gui.field.support.AbstractField<V>
Type Parameters:
V - type of object for the view
All Implemented Interfaces:
Field<V>, PropertyContainer
Direct Known Subclasses:
GUITableField, GUITreeField, SimpleField

public abstract class AbstractField<V>
extends Object
implements Field<V>

Abstract field definition.

Author:
Damien Coraboeuf

Constructor Summary
AbstractField(GUIView<V> view, FieldDescriptor<V> fieldDescriptor)
          Constructor.
 
Method Summary
 ActionContext getActionContext()
          Gets the action context for this field
 JComponent getCoreComponent()
           
 FieldDescriptor<V> getFieldDescriptor()
          Gets the field descriptor.
 Object getProperty(Object key)
          Retrieves a property from this view
 GUIView<V> getView()
          Gets the view.
protected  void setActionContext(ActionContext actionContext)
          Sets the action context.
 void setProperty(Object key, Object value)
          Attaches a property to the view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.gui.field.Field
getFieldComponent
 

Constructor Detail

AbstractField

public AbstractField(GUIView<V> view,
                     FieldDescriptor<V> fieldDescriptor)
Constructor.

Parameters:
view - Owning view
fieldDescriptor - Associated descriptor
Method Detail

getActionContext

public ActionContext getActionContext()
Gets the action context for this field

Specified by:
getActionContext in interface Field<V>
Returns:
Action context

getCoreComponent

public JComponent getCoreComponent()
Specified by:
getCoreComponent in interface Field<V>

getFieldDescriptor

public FieldDescriptor<V> getFieldDescriptor()
Gets the field descriptor.

Specified by:
getFieldDescriptor in interface Field<V>
Returns:
the field descriptor

getProperty

public Object getProperty(Object key)
Retrieves a property from this view

Specified by:
getProperty in interface PropertyContainer
Parameters:
key - Property key
Returns:
Property value or null if not defined

getView

public GUIView<V> getView()
Gets the view.

Specified by:
getView in interface Field<V>
Returns:
the view

setActionContext

protected void setActionContext(ActionContext actionContext)
Sets the action context.

Parameters:
actionContext - the new action context

setProperty

public void setProperty(Object key,
                        Object value)
Attaches a property to the view. If the value is null, the property will be removed from the view instead.

Specified by:
setProperty in interface PropertyContainer
Parameters:
key - Property key
value - Property value


Copyright © 2011. All Rights Reserved.