Package org.compiere.model
Class MLocatorLookup
- All Implemented Interfaces:
Serializable
,ComboBoxModel<Object>
,ListModel<Object>
,MutableComboBoxModel<Object>
Warehouse Locator Lookup Model.
- Version:
- $Id: MLocatorLookup.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
- BF [ 1892920 ] Locators fieldshould be ordered by Warehouse/Value
- FR [ 2306161 ] Removed limit of 200 on max number of locators.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
ConstructorDescriptionMLocatorLookup
(Properties ctx, int WindowNo) ConstructorMLocatorLookup
(Properties ctx, int WindowNo, String validationCode) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) The Lookup contains the keyboolean
Same ascontainsKey(Object)
in this lookup implementation.void
dispose()
Disposevoid
dynamicDisplay
(Properties ctx) Get KeyNamePair via key value.Get underlying fully qualified Table.Column NamegetData()
Return data as Locator ArrayList, waits for loader to finish if loading is in progress.getData
(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) Get lookup dataGet from MLocator cache or DBgetDisplay
(Object key) Get Display textgetMLocator
(Object keyValue, String trxName) Get from MLocator cache or DBint
Get Only Productint
Get Only Wahrehouseboolean
Is Locator with key valid (Warehouse)boolean
Is Locator with key valid (Warehouse)void
Wait until async Load Completeint
refresh()
Refresh local lookup cacheint
Callrefresh()
ifisNeedRefresh()
return true.void
setOnly_Product_ID
(int only_Product_ID) Set Product restrictionvoid
setOnly_Warehouse_ID
(int only_Warehouse_ID) Set Warehouse restrictionvoid
setValidationCode
(String validationCode) Set SQL validation code for lookuptoString()
Methods inherited from class org.compiere.model.Lookup
addElement, fillComboBox, fillComboBox, getDirect, getDirect, getDirect, getDisplayType, getElementAt, getIndexOf, getSelectedItem, getSize, getValidation, getWindowNo, getZoom, getZoom, getZoom, getZoomQuery, hasInactive, insertElementAt, isLoaded, isMandatory, isShortList, isValidated, put, put, removeAllElements, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
Field Details
-
C_Locator_ID
protected int C_Locator_ID
-
-
Constructor Details
-
MLocatorLookup
Constructor- Parameters:
ctx
- contextWindowNo
- window no
-
MLocatorLookup
Constructor- Parameters:
ctx
- contextWindowNo
- window novalidationCode
- Lookup validation code
-
-
Method Details
-
dispose
public void dispose()Dispose -
setOnly_Warehouse_ID
public void setOnly_Warehouse_ID(int only_Warehouse_ID) Set Warehouse restriction- Parameters:
only_Warehouse_ID
- warehouse
-
getOnly_Warehouse_ID
public int getOnly_Warehouse_ID()Get Only Wahrehouse- Returns:
- M_Warehouse_ID
-
setOnly_Product_ID
public void setOnly_Product_ID(int only_Product_ID) Set Product restriction- Parameters:
only_Product_ID
- Product
-
getOnly_Product_ID
public int getOnly_Product_ID()Get Only Product- Returns:
- M_Product_ID
-
loadComplete
public void loadComplete()Wait until async Load Complete- Overrides:
loadComplete
in classLookup
-
get
Get KeyNamePair via key value. Delegate togetDirect(Object, boolean, String)
if key not in local lookup cache(m_lookup
). -
getDisplay
Get Display text- Specified by:
getDisplay
in classLookup
- Parameters:
key
- key value- Returns:
- display text
-
containsKey
The Lookup contains the key- Specified by:
containsKey
in classLookup
- Parameters:
key
- key- Returns:
- true, if lookup contains key
-
containsKeyNoDirect
Same ascontainsKey(Object)
in this lookup implementation.- Specified by:
containsKeyNoDirect
in classLookup
- Parameters:
key
- key- Returns:
- true if contains key
-
getDirect
Get from MLocator cache or DB- Parameters:
keyValue
- integer key valuesaveInCache
- true save in lookup cachetrxName
- transaction- Returns:
- KeyNamePair
-
getMLocator
Get from MLocator cache or DB- Parameters:
keyValue
- integer key valuetrxName
- transaction- Returns:
- MLocator
-
toString
-
isValid
Is Locator with key valid (Warehouse)- Parameters:
key
- key- Returns:
- true if valid
-
isValid
Is Locator with key valid (Warehouse)- Parameters:
locator
- locator- Returns:
- true if valid
-
getData
Return data as Locator ArrayList, waits for loader to finish if loading is in progress.- Returns:
- Collection of MLocator
-
getData
public ArrayList<Object> getData(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary, boolean shortlist) Get lookup data -
refresh
public int refresh()Refresh local lookup cache -
refreshIfNeeded
public int refreshIfNeeded()Callrefresh()
ifisNeedRefresh()
return true.- Returns:
- lookup size
-
getColumnName
Get underlying fully qualified Table.Column Name- Specified by:
getColumnName
in classLookup
- Returns:
- Table.ColumnName
-
dynamicDisplay
-
setValidationCode
Set SQL validation code for lookup- Parameters:
validationCode
-
-