Package org.compiere.model
Class MLookup
- java.lang.Object
-
- javax.swing.AbstractListModel<Object>
-
- org.compiere.model.Lookup
-
- org.compiere.model.MLookup
-
- All Implemented Interfaces:
Serializable
,ComboBoxModel<Object>
,ListModel<Object>
,MutableComboBoxModel<Object>
public final class MLookup extends Lookup implements Serializable
An intelligent MutableComboBoxModel, which determines what can be cached.Validated - SQL is final / not dynamic AllLoaded - All Records are loaded Get Info about Lookup - SQL - KeyColumn - Zoom Target
- Version:
- $Id: MLookup.java,v 1.4 2006/10/07 00:58:57 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
INACTIVE_E
Inactive Marker Endstatic String
INACTIVE_S
Inactive Marker Startstatic String
SHORTLIST_E
Not in short List item Marker End IDEMPIERE 90static String
SHORTLIST_S
Not in short List item Marker Start IDEMPIERE 90-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description MLookup(MLookupInfo info, int TabNo)
MLookup Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object key)
The Lookup contains the keyboolean
containsKeyNoDirect(Object key)
The Lookup contains the key, do not get directvoid
dispose()
Disposeboolean
equals(Object obj)
Indicates whether some other object is "equal to" this one.NamePair
get(Object key)
Get Object of Key ValueNamePair
get(Object key, boolean includeDirect)
Get value (name) for key.int
getAD_InfoWindow_ID()
int
getAD_Reference_Value_ID()
Get Reference ValueString
getColumnName()
Get underlying fully qualified Table.Column NameArrayList<Object>
getData(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist)
Return data as Array containing Value/KeyNamePairNamePair[]
getDirect(Object[] keys)
NamePair
getDirect(Object key, boolean saveInCache, boolean cacheLocal)
NamePair
getDirect(Object key, boolean saveInCache, boolean cacheLocal, String trxName)
Get Data Direct from Table.String
getDisplay(Object key)
Get Display value (name).MLookupInfo
getLookupInfo()
NamePair
getNoDirect(Object key)
String
getValidation()
Get Validation SQLint
getZoom()
Get Zoomint
getZoom(boolean isSOTrx)
int
getZoom(MQuery query)
Get ZoomMQuery
getZoomQuery()
Get Zoom Query Stringint
hashCode()
boolean
hasInactive()
Has inactive elements in listboolean
isAllLoaded()
Is it all loadedboolean
isValidated()
Is the List fully Validatedvoid
loadComplete()
Wait until async Load Completeint
refresh()
Refresh and return number of items read.int
refresh(boolean loadParent)
Refresh and return number of items readint
refreshItemsAndCache()
void
removeAllElements()
Remove All cached Elementsint
size()
Return SizeString
toString()
-
Methods inherited from class org.compiere.model.Lookup
addElement, fillComboBox, fillComboBox, getDisplayType, getElementAt, getIndexOf, getSelectedItem, getSize, getWindowNo, insertElementAt, isLoaded, isMandatory, isShortList, put, put, removeElement, removeElementAt, setMandatory, setSelectedItem, setShortList
-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
-
-
-
Field Detail
-
INACTIVE_S
public static final String INACTIVE_S
Inactive Marker Start- See Also:
- Constant Field Values
-
INACTIVE_E
public static final String INACTIVE_E
Inactive Marker End- See Also:
- Constant Field Values
-
SHORTLIST_S
public static final String SHORTLIST_S
Not in short List item Marker Start IDEMPIERE 90- See Also:
- Constant Field Values
-
SHORTLIST_E
public static final String SHORTLIST_E
Not in short List item Marker End IDEMPIERE 90- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MLookup
public MLookup(MLookupInfo info, int TabNo)
MLookup Constructor- Parameters:
info
- infoTabNo
- tab no
-
-
Method Detail
-
loadComplete
public void loadComplete()
Wait until async Load Complete- Overrides:
loadComplete
in classLookup
-
get
public NamePair get(Object key, boolean includeDirect)
Get value (name) for key. If not found return null;- Parameters:
key
- key (Integer for Keys or String for Lists)- Returns:
- value
-
getDisplay
public String getDisplay(Object key)
Get Display value (name). If not found return key embedded in inactive signs.- Specified by:
getDisplay
in classLookup
- Parameters:
key
- key- Returns:
- value
-
containsKey
public boolean containsKey(Object key)
The Lookup contains the key- Specified by:
containsKey
in classLookup
- Parameters:
key
- key- Returns:
- true if key is known
-
containsKeyNoDirect
public boolean containsKeyNoDirect(Object key)
The Lookup contains the key, do not get direct- Specified by:
containsKeyNoDirect
in classLookup
- Parameters:
key
- key- Returns:
- true if key is known
-
toString
public String toString()
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
-
size
public int size()
Return Size- Returns:
- size
-
isAllLoaded
public boolean isAllLoaded()
Is it all loaded- Returns:
- true, if all loaded
-
isValidated
public boolean isValidated()
Is the List fully Validated- Overrides:
isValidated
in classLookup
- Returns:
- true, if validated
-
getValidation
public String getValidation()
Get Validation SQL- Overrides:
getValidation
in classLookup
- Returns:
- Validation SQL
-
getAD_Reference_Value_ID
public int getAD_Reference_Value_ID()
Get Reference Value- Returns:
- Reference Value
-
hasInactive
public boolean hasInactive()
Has inactive elements in list- Overrides:
hasInactive
in classLookup
- Returns:
- true, if list contains inactive values
-
getAD_InfoWindow_ID
public int getAD_InfoWindow_ID()
- Returns:
- AD_InfoWindow_ID
-
getData
public ArrayList<Object> getData(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist)
Return data as Array containing Value/KeyNamePair
-
getDirect
public NamePair getDirect(Object key, boolean saveInCache, boolean cacheLocal, String trxName)
Get Data Direct from Table.
-
getZoom
public int getZoom(MQuery query)
Get Zoom
-
getZoom
public int getZoom(boolean isSOTrx)
-
getZoomQuery
public MQuery getZoomQuery()
Get Zoom Query String- Overrides:
getZoomQuery
in classLookup
- Returns:
- Zoom SQL Where Clause
-
getColumnName
public String getColumnName()
Get underlying fully qualified Table.Column Name- Specified by:
getColumnName
in classLookup
- Returns:
- Key Column
-
refresh
public int refresh()
Refresh and return number of items read. Get get data of parent lookups
-
refreshItemsAndCache
public int refreshItemsAndCache()
-
refresh
public int refresh(boolean loadParent)
Refresh and return number of items read- Parameters:
loadParent
- get data of parent lookups- Returns:
- no of items refresh
-
removeAllElements
public void removeAllElements()
Remove All cached Elements- Overrides:
removeAllElements
in classLookup
- See Also:
Lookup.removeAllElements()
-
getLookupInfo
public MLookupInfo getLookupInfo()
- Returns:
- lookup info
-
-