Package org.compiere.model
Class MLookup
- All Implemented Interfaces:
Serializable
,ComboBoxModel<Object>
,ListModel<Object>
,MutableComboBoxModel<Object>
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:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Inactive Marker Endstatic final String
Inactive Marker Startstatic final String
Not in short List item Marker End IDEMPIERE 90static final String
Not in short List item Marker Start IDEMPIERE 90Fields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) The Lookup contains the keyboolean
The Lookup contains the key (do not check the direct lookup list)void
dispose()
Disposeboolean
Indicates whether some other object is "equal to" this one.Get NamePair/KeyNamePair for key.Get NamePair/KeyNamePair for key.int
int
Get Reference Value IDGet underlying fully qualified Table.Column NamegetData
(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) Return data as Array containing Value/KeyNamePairNamePair[]
Perform direct lookup for keysPerform Direct Lookup from Table.Get Data Direct from DB.getDisplay
(Object key) Get Display Text.
If not found, return key embedded in "<>".static String
getIdentifier
(int tableID, Serializable recordID) Get Identifier String from AD_Table_ID and Record_IDstatic String
getIdentifier
(int tableID, Serializable recordID, int windowNo, int tabNo) Get Identifier String from AD_Table_ID and Record_IDstatic String
getIdentifier
(int tableID, Serializable recordID, int windowNo, int tabNo, boolean useUUIDKey) Get Identifier String from AD_Table_ID and Record_IDgetNoDirect
(Object key) Get NamePair/KeyNamePair for key.static MLookup
getRecordsLookup
(int tableID, int windowNo, int tabNo) Get Lookupstatic MLookup
getRecordsLookup
(int tableID, int windowNo, int tabNo, boolean useUUIDKey) Get LookupGet Validation SQLint
getZoom()
Get Zoomint
getZoom
(boolean isSOTrx) int
Get ZoomGet Zoom Query Stringint
hashCode()
boolean
Has inactive elements in listboolean
Is it all loadedboolean
Is the List fully Validatedvoid
Wait until asynchronous Load Completeint
refresh()
Refresh and return number of items read.int
refresh
(boolean loadParent) Refresh and return number of items readint
void
Remove All cached Elementsint
size()
Return SizetoString()
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 Details
-
INACTIVE_S
Inactive Marker Start- See Also:
-
INACTIVE_E
Inactive Marker End- See Also:
-
SHORTLIST_S
Not in short List item Marker Start IDEMPIERE 90- See Also:
-
SHORTLIST_E
Not in short List item Marker End IDEMPIERE 90- See Also:
-
-
Constructor Details
-
MLookup
MLookup Constructor- Parameters:
info
- infoTabNo
- tab no
-
-
Method Details
-
dispose
public void dispose()Dispose -
loadComplete
public void loadComplete()Wait until asynchronous Load Complete- Overrides:
loadComplete
in classLookup
-
get
Get NamePair/KeyNamePair for key. If not found return null.- Parameters:
key
- key value (Integer for Keys or String for Lists)- Returns:
- NamePair/KeyNamePair
-
get
Get NamePair/KeyNamePair for key. -
getNoDirect
Get NamePair/KeyNamePair for key.
If not found in local lookup cache, do not try to load direct from DB.- Parameters:
key
-- Returns:
- NamePair/KeyNamePair or null
-
getDisplay
Get Display Text.
If not found, return key embedded in "<>".- Specified by:
getDisplay
in classLookup
- Parameters:
key
- key value- Returns:
- display text
-
containsKey
Description copied from class:Lookup
The Lookup contains the key- Specified by:
containsKey
in classLookup
- Parameters:
key
- key- Returns:
- true if key exists in local lookup cache or in DB
-
containsKeyNoDirect
Description copied from class:Lookup
The Lookup contains the key (do not check the direct lookup list)- Specified by:
containsKeyNoDirect
in classLookup
- Parameters:
key
- key- Returns:
- true if key exists in local lookup cache (do not check DB)
-
toString
-
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode() -
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 (i.e validation code have been parsed)
-
getValidation
Get Validation SQL- Overrides:
getValidation
in classLookup
- Returns:
- Validation SQL
-
getAD_Reference_Value_ID
public int getAD_Reference_Value_ID()Get Reference Value ID- Returns:
- AD_Reference_Value_ID
-
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
Description copied from class:Lookup
Perform Direct Lookup from Table. -
getDirect
Get Data Direct from DB. -
getDirect
Description copied from class:Lookup
Perform direct lookup for keys -
getZoom
public int getZoom()Get Zoom -
getZoom
Get Zoom -
getZoom
public int getZoom(boolean isSOTrx) -
getZoomQuery
Get Zoom Query String- Overrides:
getZoomQuery
in classLookup
- Returns:
- Zoom SQL Where Clause
-
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. -
refreshItemsAndCache
public int refreshItemsAndCache()- Returns:
- number of items read
-
refresh
public int refresh(boolean loadParent) Refresh and return number of items read- Parameters:
loadParent
- true to load data of lookup with IsParent=true- Returns:
- no of items refresh
-
removeAllElements
public void removeAllElements()Remove All cached Elements- Overrides:
removeAllElements
in classLookup
- See Also:
-
getLookupInfo
- Returns:
- lookup info
-
getRecordsLookup
Get Lookup- Parameters:
tableID
-windowNo
-tabNo
-- Returns:
- null if tableID <= 0 or the table doesn't have any key column, else
MLookup
-
getRecordsLookup
Get Lookup- Parameters:
tableID
-windowNo
-tabNo
-useUUIDKey
- - default false- Returns:
- null if tableID <= 0 or the table doesn't have any key column, else
MLookup
-
getIdentifier
Get Identifier String from AD_Table_ID and Record_ID- Parameters:
tableID
-recordID
-- Returns:
- String
-
getIdentifier
Get Identifier String from AD_Table_ID and Record_ID- Parameters:
tableID
-recordID
-windowNo
-tabNo
-- Returns:
- String
-
getIdentifier
public static String getIdentifier(int tableID, Serializable recordID, int windowNo, int tabNo, boolean useUUIDKey) Get Identifier String from AD_Table_ID and Record_ID- Parameters:
tableID
-recordID
-windowNo
-tabNo
-useUUIDKey
- - default false- Returns:
- String
-