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 StringINACTIVE_EInactive Marker Endstatic StringINACTIVE_SInactive Marker Startstatic StringSHORTLIST_ENot in short List item Marker End IDEMPIERE 90static StringSHORTLIST_SNot 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 booleancontainsKey(Object key)The Lookup contains the keybooleancontainsKeyNoDirect(Object key)The Lookup contains the key, do not get directvoiddispose()Disposebooleanequals(Object obj)Indicates whether some other object is "equal to" this one.NamePairget(Object key)Get Object of Key ValueNamePairget(Object key, boolean includeDirect)Get value (name) for key.intgetAD_InfoWindow_ID()intgetAD_Reference_Value_ID()Get Reference ValueStringgetColumnName()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)NamePairgetDirect(Object key, boolean saveInCache, boolean cacheLocal)NamePairgetDirect(Object key, boolean saveInCache, boolean cacheLocal, String trxName)Get Data Direct from Table.StringgetDisplay(Object key)Get Display value (name).MLookupInfogetLookupInfo()NamePairgetNoDirect(Object key)StringgetValidation()Get Validation SQLintgetZoom()Get ZoomintgetZoom(boolean isSOTrx)intgetZoom(MQuery query)Get ZoomMQuerygetZoomQuery()Get Zoom Query StringinthashCode()booleanhasInactive()Has inactive elements in listbooleanisAllLoaded()Is it all loadedbooleanisValidated()Is the List fully ValidatedvoidloadComplete()Wait until async Load Completeintrefresh()Refresh and return number of items read.intrefresh(boolean loadParent)Refresh and return number of items readintrefreshItemsAndCache()voidremoveAllElements()Remove All cached Elementsintsize()Return SizeStringtoString()-
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:
loadCompletein 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:
getDisplayin classLookup- Parameters:
key- key- Returns:
- value
-
containsKey
public boolean containsKey(Object key)
The Lookup contains the key- Specified by:
containsKeyin 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:
containsKeyNoDirectin 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:
isValidatedin classLookup- Returns:
- true, if validated
-
getValidation
public String getValidation()
Get Validation SQL- Overrides:
getValidationin 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:
hasInactivein 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:
getZoomQueryin classLookup- Returns:
- Zoom SQL Where Clause
-
getColumnName
public String getColumnName()
Get underlying fully qualified Table.Column Name- Specified by:
getColumnNamein 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:
removeAllElementsin classLookup- See Also:
Lookup.removeAllElements()
-
getLookupInfo
public MLookupInfo getLookupInfo()
- Returns:
- lookup info
-
-