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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringInactive Marker Endstatic final StringInactive Marker Startstatic final StringNot in short List item Marker End IDEMPIERE 90static final StringNot in short List item Marker Start IDEMPIERE 90Fields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) The Lookup contains the keybooleanThe Lookup contains the key (do not check the direct lookup list)voiddispose()DisposebooleanIndicates whether some other object is "equal to" this one.Get NamePair/KeyNamePair for key.Get NamePair/KeyNamePair for key.intintGet 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 StringgetIdentifier(int tableID, Serializable recordID) Get Identifier String from AD_Table_ID and Record_IDstatic StringgetIdentifier(int tableID, Serializable recordID, int windowNo, int tabNo) Get Identifier String from AD_Table_ID and Record_IDstatic StringgetIdentifier(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 MLookupgetRecordsLookup(int tableID, int windowNo, int tabNo) Get Lookupstatic MLookupgetRecordsLookup(int tableID, int windowNo, int tabNo, boolean useUUIDKey) Get LookupGet Validation SQLintgetZoom()Get ZoomintgetZoom(boolean isSOTrx) intGet ZoomGet Zoom Query StringinthashCode()booleanHas inactive elements in listbooleanIs it all loadedbooleanIs the List fully ValidatedvoidWait until asynchronous Load Completeintrefresh()Refresh and return number of items read.intrefresh(boolean loadParent) Refresh and return number of items readintvoidRemove All cached Elementsintsize()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, setShortListMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
loadCompletein 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:
getDisplayin classLookup- Parameters:
key- key value- Returns:
- display text
-
containsKey
Description copied from class:LookupThe Lookup contains the key- Specified by:
containsKeyin classLookup- Parameters:
key- key- Returns:
- true if key exists in local lookup cache or in DB
-
containsKeyNoDirect
Description copied from class:LookupThe Lookup contains the key (do not check the direct lookup list)- Specified by:
containsKeyNoDirectin 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:
isValidatedin classLookup- Returns:
- true if validated (i.e validation code have been parsed)
-
getValidation
Get Validation SQL- Overrides:
getValidationin 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:
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
Description copied from class:LookupPerform Direct Lookup from Table. -
getDirect
Get Data Direct from DB. -
getDirect
Description copied from class:LookupPerform 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:
getZoomQueryin classLookup- Returns:
- Zoom SQL Where Clause
-
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. -
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:
removeAllElementsin 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
-