Adempiere 3.5.2a

org.adempiere.webui.editor
Class WEditor

java.lang.Object
  extended by org.adempiere.webui.editor.WEditor
All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
WAccountEditor, WAssignmentEditor, WBinaryEditor, WButtonEditor, WDateEditor, WFilenameEditor, WImageEditor, WLocationEditor, WLocatorEditor, WNumberEditor, WPAttributeEditor, WSearchEditor, WStringEditor, WTableDirEditor, WUrlEditor, WYesNoEditor

public abstract class WEditor
extends Object
implements EventListener, PropertyChangeListener

Version:
$Revision: 0.10 $
Author:
Ashley G Ramdass

Field Summary
protected  Component component
           
protected  GridField gridField
           
protected  GridTab gridTab
           
protected  Label label
           
protected  ArrayList<ValueChangeListener> listeners
           
protected  boolean mandatory
           
static int MAX_DISPLAY_LENGTH
           
 
Constructor Summary
WEditor(Component comp, GridField gridField)
           
WEditor(Component comp, String label, String description, boolean mandatory, boolean readonly, boolean updateable)
          Constructor for use if a grid field is unavailable
 
Method Summary
 void addValueChangeListner(ValueChangeListener listener)
           
protected  String cleanColumnName(String originalColumnName)
          Remove the table qualifier from the supplied column name.
protected  void fireValueChange(ValueChangeEvent event)
           
 String getColumnName()
           
 Component getComponent()
           
 String getDescription()
          Method is used to distinguish between 2 similar WSearchEditors
abstract  String getDisplay()
           
 String[] getEvents()
           
 GridField getGridField()
           
 Label getLabel()
           
 WEditorPopupMenu getPopupMenu()
           
abstract  Object getValue()
           
 boolean isAsap()
           
 boolean isMandatory()
           
abstract  boolean isReadWrite()
           
 boolean isVisible()
           
 void propertyChange(PropertyChangeEvent evt)
           
 void setBackground(boolean error)
           
 void setBackground(Color color)
           
protected  void setColumnName(String columnName)
           
protected  void setComponent(Component comp)
          Set the editor component.
 void setGridTab(GridTab gridTab)
           
 void setMandatory(boolean mandatory)
          Set whether the editor represents a mandatory field.
abstract  void setReadWrite(boolean readWrite)
           
abstract  void setValue(Object value)
           
 void setVisible(boolean visible)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zk.ui.event.EventListener
onEvent
 

Field Detail

MAX_DISPLAY_LENGTH

public static final int MAX_DISPLAY_LENGTH
See Also:
Constant Field Values

gridField

protected GridField gridField

gridTab

protected GridTab gridTab

label

protected Label label

component

protected Component component

mandatory

protected boolean mandatory

listeners

protected ArrayList<ValueChangeListener> listeners
Constructor Detail

WEditor

public WEditor(Component comp,
               GridField gridField)

WEditor

public WEditor(Component comp,
               String label,
               String description,
               boolean mandatory,
               boolean readonly,
               boolean updateable)
Constructor for use if a grid field is unavailable

Parameters:
comp - The editor's component
label - column name (not displayed)
description - description of component
mandatory - whether a selection must be made
readonly - whether or not the editor is read only
updateable - whether the editor contents can be changed
Method Detail

getDescription

public String getDescription()
Method is used to distinguish between 2 similar WSearchEditors


setComponent

protected void setComponent(Component comp)
Set the editor component.

Parameters:
comp - the editor component

getGridField

public GridField getGridField()

getColumnName

public String getColumnName()

cleanColumnName

protected String cleanColumnName(String originalColumnName)
Remove the table qualifier from the supplied column name. The column name may be prefixed with the table name i.e. [table name].[column name]. The function returns

Parameters:
originalColumnName - The column name to clean
Returns:
the column name with any table qualifier removed i.e. [column name]

setColumnName

protected void setColumnName(String columnName)

getComponent

public Component getComponent()

setGridTab

public void setGridTab(GridTab gridTab)

getPopupMenu

public WEditorPopupMenu getPopupMenu()

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

addValueChangeListner

public void addValueChangeListner(ValueChangeListener listener)

fireValueChange

protected void fireValueChange(ValueChangeEvent event)

getLabel

public Label getLabel()

setReadWrite

public abstract void setReadWrite(boolean readWrite)

isReadWrite

public abstract boolean isReadWrite()

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()

setBackground

public void setBackground(boolean error)

setBackground

public void setBackground(Color color)

toString

public String toString()
Overrides:
toString in class Object

setValue

public abstract void setValue(Object value)

getValue

public abstract Object getValue()

getDisplay

public abstract String getDisplay()

getEvents

public String[] getEvents()

setMandatory

public void setMandatory(boolean mandatory)
Set whether the editor represents a mandatory field.

Parameters:
mandatory - whether the field is mandatory

isMandatory

public boolean isMandatory()

isAsap

public boolean isAsap()

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.