Compiere 3.1

org.compiere.controller
Class UIField

java.lang.Object
  extended by org.compiere.framework.VO
      extended by org.compiere.controller.UIFieldVO
          extended by org.compiere.controller.UIField
All Implemented Interfaces:
Serializable, Map<String,String>

public class UIField
extends UIFieldVO

User Interface Field

Version:
$Id$
Author:
Jorg Janke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.compiere.controller.UIFieldVO
createdMS
 
Fields inherited from class org.compiere.framework.VO
p_vos, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
UIField(UIFieldVO vo)
          UIField
 
Method Summary
protected  void addImpactsUIColumn(String columnName)
          Add Column name Impacting UI of this column
protected  void addImpactsValueColumn(String columnName)
          Add Column name Impacting Value of this column
 BigDecimal convertToBigDecimal(String stringValue)
          Convert to BigDecimal.
 int convertToInteger(String stringValue)
          Convert to Integer Checks also data type.
 String convertToString(Object value)
          Convert to String
 Timestamp convertToTimestamp(String stringValue)
          Convert to Timestamp Checks also data type.
 Object getDefault(CContext ctx, int WindowNo, UITab tab)
          Create default value.
 String getDefaultAsString(CContext ctx, int WindowNo, UITab tab)
          Get Default As String
 ArrayList<String> getDependsOnUI()
          Get the list of column names this field Depends On for UI.
 ArrayList<String> getDependsOnValue()
          Get the list of column names this field Depends On for Value.
 ArrayList<String> getImpactsUI()
          Get the list of column names this field impacts their UI.
 ArrayList<String> getImpactsValue()
          Get the list of column names this field impacts their Value.
 String getLabel()
          Get Label (Name w/o Mnemonic)
 Lookup getLookup()
          Get Lookup
 ArrayList<NamePair> getLookupData(Ctx ctx, int windowNo, boolean refresh)
          Get Lookup Data
 String getLookupDisplay(CContext ctx, int windowNo, String key)
          Get Lookup Data
 String getLookupDisplay(CContext ctx, int windowNo, String key, boolean cache)
          Get Lookup Data
 MLookupInfo getLookupInfo()
          Get Lookup Info
 char getMnemonic()
          Get Label Mnemonic
 int getSortNoAsInt()
          Get Sort No
 boolean initialize(CContext ctx, int WindowNo)
          Initialize Field
 boolean isColumnAccess(Ctx ctx)
          Does the Role in the context have r/w access to this column?
protected  boolean isCreateMnemonic()
          Create Mnemonic for field
 boolean isDependentUI()
          Field is Dependent on others for UI
 boolean isDependentValue()
          Field is Dependent on other fields for Value
 boolean isDisplayed(CContext ctx, int WindowNo)
          Field is Displayed
 boolean isEditable(CContext ctx, int WindowNo, UITab tab, boolean inserting)
          Is it Editable - checks IsActive, IsUpdateable, and isDisplayed
 boolean isError()
          Get Background Error.
 boolean isImpactsUI()
          Has Impact on UI.
 boolean isImpactsUITab()
          Columns impact Tab UI
 boolean isImpactsValue()
          Has Impact when value changes.
 boolean isLookup()
          Is this field a Lookup?.
 boolean isMandatory(CContext ctx, int WindowNo)
          Is Field Mandatory
 boolean isParentValue(UITab tab)
          Parent Link Value
 boolean isVirtualColumn()
          Is Virtual Column
 void lookupLoadComplete()
          Wait until Load is complete
 void setError(boolean error)
          Set Error.
protected  void setImpactsUITab(boolean impacts)
          Set Tab UI is impacted by column
protected  void setMnemonic(char mnemonic)
          Set Label Mnemonic
 String toString()
          String Representation
 String validateValueAsString(String oldValue, String newValue)
          Set Value As String
 
Methods inherited from class org.compiere.controller.UIFieldVO
getAD_Column_ID, getAD_Field_ID, getAD_Process_ID, getAD_Reference_ID, getAD_Reference_Value_ID, getAD_Tab_ID, getAD_Table_ID, getAD_User_ID, getAD_UserDef_Field_ID, getAD_UserDef_Tab_ID, getAD_UserDef_Win_ID, getAD_Val_Rule_ID, getAD_Window_ID, getCallout, getColumnName, getColumnSQL, getCustomizationName, getDefaultValue, getDescription, getDisplayLength, getDisplayLogic, getFieldGroup, getFieldLength, getHelp, getMandatoryLogic, getMRSeqNo, getName, getObscureType, getReadOnlyLogic, getSelectionSeqNo, getSeqNo, getSortNo, getSummarySeqNo, getTableName, getUserDef_Role_ID, getValidationCode, getValueMax, getValueMin, getVFormat, isAlwaysUpdateable, isCallout, isDefaultFocus, isDisplayed, isEncryptedColumn, isEncryptedField, isFieldOnly, isHeading, isIdentifier, isKey, isMandatory, isMandatoryUI, isParent, isReadOnly, isSameLine, isSelectionColumn, isSummaryColumn, isTranslated, isUpdateable, setAD_Column_ID, setAD_Column_ID, setAD_Field_ID, setAD_Field_ID, setAD_Process_ID, setAD_Process_ID, setAD_Reference_ID, setAD_Reference_ID, setAD_Reference_Value_ID, setAD_Reference_Value_ID, setAD_Tab_ID, setAD_Tab_ID, setAD_Table_ID, setAD_Table_ID, setAD_User_ID, setAD_User_ID, setAD_UserDef_Field_ID, setAD_UserDef_Field_ID, setAD_UserDef_Tab_ID, setAD_UserDef_Tab_ID, setAD_UserDef_Win_ID, setAD_UserDef_Win_ID, setAD_Val_Rule_ID, setAD_Val_Rule_ID, setAD_Window_ID, setAD_Window_ID, setCallout, setColumnName, setColumnSQL, setCustomizationName, setDefaultValue, setDescription, setDisplayLength, setDisplayLength, setDisplayLogic, setFieldGroup, setFieldLength, setFieldLength, setHelp, setIsAlwaysUpdateable, setIsAlwaysUpdateable, setIsCallout, setIsCallout, setIsDefaultFocus, setIsDefaultFocus, setIsDisplayed, setIsDisplayed, setIsEncryptedColumn, setIsEncryptedColumn, setIsEncryptedField, setIsEncryptedField, setIsFieldOnly, setIsFieldOnly, setIsHeading, setIsHeading, setIsIdentifier, setIsIdentifier, setIsKey, setIsKey, setIsMandatory, setIsMandatory, setIsMandatoryUI, setIsMandatoryUI, setIsParent, setIsParent, setIsReadOnly, setIsReadOnly, setIsSameLine, setIsSameLine, setIsSelectionColumn, setIsSelectionColumn, setIsSummaryColumn, setIsSummaryColumn, setIsTranslated, setIsTranslated, setIsUpdateable, setIsUpdateable, setMandatoryLogic, setMRSeqNo, setMRSeqNo, setName, setObscureType, setReadOnlyLogic, setSelectionSeqNo, setSelectionSeqNo, setSeqNo, setSeqNo, setSortNo, setSortNo, setSummarySeqNo, setSummarySeqNo, setTableName, setUserDef_Role_ID, setUserDef_Role_ID, setValidationCode, setValueMax, setValueMin, setVFormat
 
Methods inherited from class org.compiere.framework.VO
clear, clone, containsKey, containsValue, dump, entrySet, get_xmlDocument, get_xmlString, get_xmlString, get, getData, getEmbedded, getHashMap, isEmpty, keySet, put, put, putAll, remove, setEmbedded, setHdrInfo, size, toStringX, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

UIField

public UIField(UIFieldVO vo)
UIField

Parameters:
vo -
Method Detail

getSortNoAsInt

public int getSortNoAsInt()
Get Sort No

Returns:
sort number ASC/DESC

isVirtualColumn

public boolean isVirtualColumn()
Is Virtual Column

Returns:
true if it has column sql

isMandatory

public boolean isMandatory(CContext ctx,
                           int WindowNo)
Is Field Mandatory

Parameters:
ctx - optional checks Context
Returns:
true if mandatory

isDisplayed

public boolean isDisplayed(CContext ctx,
                           int WindowNo)
Field is Displayed

Parameters:
ctx - optional checks context
Returns:
true if displayed

isEditable

public boolean isEditable(CContext ctx,
                          int WindowNo,
                          UITab tab,
                          boolean inserting)
Is it Editable - checks IsActive, IsUpdateable, and isDisplayed

Parameters:
ctx - optional checks context for Active, IsProcessed, LinkColumn
WindowNo - window
tab - sibling tab
inserting -
Returns:
true, if editable

isColumnAccess

public boolean isColumnAccess(Ctx ctx)
Does the Role in the context have r/w access to this column?

Parameters:
ctx - context for role
Returns:
true if access

isLookup

public boolean isLookup()
Is this field a Lookup?.

Returns:
true if lookup field

initialize

public boolean initialize(CContext ctx,
                          int WindowNo)
Initialize Field

Parameters:
ctx - context
WindowNo - window
Returns:
true if lookup created, false normally

lookupLoadComplete

public void lookupLoadComplete()
Wait until Load is complete


getLookupData

public ArrayList<NamePair> getLookupData(Ctx ctx,
                                         int windowNo,
                                         boolean refresh)
Get Lookup Data

Parameters:
ctx - context
windowNo - window
refresh - requery data
Returns:
list

getLookup

public Lookup getLookup()
Get Lookup

Returns:
lookup if exists

getLookupInfo

public MLookupInfo getLookupInfo()
Get Lookup Info

Returns:
lookup_info if exists

getLookupDisplay

public String getLookupDisplay(CContext ctx,
                               int windowNo,
                               String key)
Get Lookup Data

Parameters:
ctx - context
windowNo - window
key - the string key value
Returns:
display or null if not found

getLookupDisplay

public String getLookupDisplay(CContext ctx,
                               int windowNo,
                               String key,
                               boolean cache)
Get Lookup Data

Parameters:
ctx - context
windowNo - window
key - the string key value
whether - read from cache or from table
Returns:
display or null if not found

getDefault

public Object getDefault(CContext ctx,
                         int WindowNo,
                         UITab tab)
Create default value.
                (a) Key/Parent/IsActive/SystemAccess
      (b) SQL Default
                (c) Column Default              //      system integrity
      (d) User Preference
                (e) System Preference
                (f) DataType Defaults

  Don't default from Context => use explicit defaultValue
  (would otherwise copy previous record)
  

Parameters:
ctx - context
WindowNo - window
tab - the containing tab
Returns:
default value or null

getDefaultAsString

public String getDefaultAsString(CContext ctx,
                                 int WindowNo,
                                 UITab tab)
Get Default As String

Parameters:
ctx - context
WindowNo - window no
tab - tab
Returns:
default value

convertToBigDecimal

public BigDecimal convertToBigDecimal(String stringValue)
Convert to BigDecimal. Checks also data type.

Parameters:
stringValue - value
Returns:
big decimal or null if error

convertToInteger

public int convertToInteger(String stringValue)
Convert to Integer Checks also data type.

Parameters:
stringValue - value
Returns:
integer or 0 if error

convertToTimestamp

public Timestamp convertToTimestamp(String stringValue)
Convert to Timestamp Checks also data type.

Parameters:
stringValue - value
Returns:
integer or null if error

convertToString

public String convertToString(Object value)
Convert to String

Parameters:
value - value
Returns:
String or ""

isParentValue

public boolean isParentValue(UITab tab)
Parent Link Value

Parameters:
tab - tab
Returns:
parent value

getDependsOnUI

public ArrayList<String> getDependsOnUI()
Get the list of column names this field Depends On for UI. (Display, ReadOnly, Mandatory)

Returns:
list of columns

getDependsOnValue

public ArrayList<String> getDependsOnValue()
Get the list of column names this field Depends On for Value. (e.g. Business Partner for a Location field)

Returns:
list of columns

isDependentUI

public boolean isDependentUI()
Field is Dependent on others for UI

Returns:
true if dependent

isDependentValue

public boolean isDependentValue()
Field is Dependent on other fields for Value

Returns:
true if dependent

addImpactsUIColumn

protected void addImpactsUIColumn(String columnName)
Add Column name Impacting UI of this column

Parameters:
columnName - column name

getImpactsUI

public ArrayList<String> getImpactsUI()
Get the list of column names this field impacts their UI. (Display, ReadOnly, Mandatory)

Returns:
list of columns

addImpactsValueColumn

protected void addImpactsValueColumn(String columnName)
Add Column name Impacting Value of this column

Parameters:
columnName - column name

getImpactsValue

public ArrayList<String> getImpactsValue()
Get the list of column names this field impacts their Value.

Returns:
list of columns

setImpactsUITab

protected void setImpactsUITab(boolean impacts)
Set Tab UI is impacted by column

Parameters:
impacts - true if tab impacted

isImpactsUITab

public boolean isImpactsUITab()
Columns impact Tab UI

Returns:
true if column impacts

isImpactsValue

public boolean isImpactsValue()
Has Impact when value changes.

Returns:
true if field has fields it impacts or callouts

isImpactsUI

public boolean isImpactsUI()
Has Impact on UI. Check also isImpactTab

Returns:
true if field impacts UI

validateValueAsString

public String validateValueAsString(String oldValue,
                                    String newValue)
Set Value As String

Parameters:
newValue - new
oldValue - old
Returns:
valid value if possible or null

getLabel

public String getLabel()
Get Label (Name w/o Mnemonic)

Returns:
label

isCreateMnemonic

protected boolean isCreateMnemonic()
Create Mnemonic for field

Returns:
no for r/o, client, org, document no

getMnemonic

public char getMnemonic()
Get Label Mnemonic

Returns:
Mnemonic

setMnemonic

protected void setMnemonic(char mnemonic)
Set Label Mnemonic

Parameters:
mnemonic - Mnemonic

setError

public void setError(boolean error)
Set Error. Used by editors to set the color

Parameters:
error - true if error

isError

public boolean isError()
Get Background Error.

Returns:
error

toString

public String toString()
String Representation

Overrides:
toString in class UIFieldVO
Returns:
info

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.