Class Lookup

    • Constructor Detail

      • Lookup

        public Lookup​(int displayType,
                      int windowNo)
        Lookup
        Parameters:
        displayType - display type
        windowNo - window no
    • Method Detail

      • getDisplayType

        public int getDisplayType()
        Get Display Type
        Returns:
        display type
      • getWindowNo

        public int getWindowNo()
        Get Window No
        Returns:
        Window No
      • setSelectedItem

        public void setSelectedItem​(Object anObject)
        Set the value of the selected item. The selected item may be null.

        Specified by:
        setSelectedItem in interface ComboBoxModel<Object>
        Parameters:
        anObject - The combo box value or null for no selection.
      • getSize

        public int getSize()
        Get Size of Model
        Specified by:
        getSize in interface ListModel<Object>
        Returns:
        size
      • getElementAt

        public Object getElementAt​(int index)
        Get Element at Index
        Specified by:
        getElementAt in interface ListModel<Object>
        Parameters:
        index - index
        Returns:
        value
      • getIndexOf

        public int getIndexOf​(Object anObject)
        Returns the index-position of the specified object in the list.
        Parameters:
        anObject - object
        Returns:
        an int representing the index position, where 0 is the first position
      • removeAllElements

        public void removeAllElements()
        Empties the list.
      • put

        public void put​(String key,
                        String value)
        Put Value
        Parameters:
        key - key
        value - value
      • put

        public void put​(int key,
                        String value)
        Put Value
        Parameters:
        key - key
        value - value
      • fillComboBox

        public void fillComboBox​(boolean mandatory,
                                 boolean onlyValidated,
                                 boolean onlyActive,
                                 boolean temporary,
                                 boolean shortList)
        Fill ComboBox with lookup data (async using Worker). - try to maintain selected item
        Parameters:
        mandatory - has mandatory data only (i.e. no "null" selection)
        onlyValidated - only validated
        onlyActive - onlt active
        temporary - save current values - restore via fillComboBox (true)
      • fillComboBox

        public void fillComboBox​(boolean restore)
        Fill ComboBox with old saved data (if exists) or all data available
        Parameters:
        restore - if true, use saved data - else fill it with all data
      • getDisplay

        public abstract String getDisplay​(Object key)
        Get Display of Key Value
        Parameters:
        key - key
        Returns:
        String
      • get

        public abstract NamePair get​(Object key)
        Get Object of Key Value
        Parameters:
        key - key
        Returns:
        Object or null
      • getData

        public abstract ArrayList<Object> getData​(boolean mandatory,
                                                  boolean onlyValidated,
                                                  boolean onlyActive,
                                                  boolean temporary,
                                                  boolean shortlist)
        Fill ComboBox with Data (Value/KeyNamePair)
        Parameters:
        mandatory - has mandatory data only (i.e. no "null" selection)
        onlyValidated - only validated
        onlyActive - only active
        temporary - force load for temporary display
        Returns:
        ArrayList
      • getColumnName

        public abstract String getColumnName()
        Get underlying fully qualified Table.Column Name. Used for VLookup.actionButton (Zoom)
        Returns:
        column name
      • containsKey

        public abstract boolean containsKey​(Object key)
        The Lookup contains the key
        Parameters:
        key - key
        Returns:
        true if contains key
      • containsKeyNoDirect

        public abstract boolean containsKeyNoDirect​(Object key)
        The Lookup contains the key, do not push direct
        Parameters:
        key - key
        Returns:
        true if contains key
      • refresh

        public int refresh()
        Refresh Values - default implementation
        Returns:
        size
      • isValidated

        public boolean isValidated()
        Is Validated - default implementation
        Returns:
        true if validated
      • getValidation

        public String getValidation()
        Get dynamic Validation SQL (none)
        Returns:
        validation
      • hasInactive

        public boolean hasInactive()
        Has Inactive records - default implementation
        Returns:
        true if inactive
      • getZoom

        public int getZoom()
        Get Zoom - default implementation
        Returns:
        Zoom AD_Window_ID
      • getZoom

        public int getZoom​(boolean isSOTrx)
        Parameters:
        isSOTrx -
        Returns:
        Zoom AD_Window_ID
      • getZoom

        public int getZoom​(MQuery query)
        Get Zoom - default implementation
        Parameters:
        query - query
        Returns:
        Zoom Window - here 0
      • getZoomQuery

        public MQuery getZoomQuery()
        Get Zoom Query String - default implementation
        Returns:
        Zoom Query
      • getDirect

        public NamePair getDirect​(Object key,
                                  boolean saveInCache,
                                  boolean cacheLocal,
                                  String trxName)
        Get Data Direct from Table. Default implementation - does not requery
        Parameters:
        key - key
        saveInCache - save in cache for r/w
        cacheLocal - cache locally for r/o
        trxName - the transaction name
        Returns:
        value
      • getDirect

        public NamePair getDirect​(Object key,
                                  boolean saveInCache,
                                  boolean cacheLocal)
      • getDirect

        public NamePair[] getDirect​(Object[] keys)
        Parameters:
        keys -
        Returns:
        name pair arrays
      • dispose

        public void dispose()
        Dispose - clear items w/o firing events
      • loadComplete

        public void loadComplete()
        Wait until async Load Complete
      • setMandatory

        public void setMandatory​(boolean flag)
        Set lookup model as mandatory, use in loading data
        Parameters:
        flag -
      • isMandatory

        public boolean isMandatory()
        Is lookup model mandatory
        Returns:
        boolean
      • isLoaded

        public boolean isLoaded()
        Is this lookup model populated
        Returns:
        boolean
      • setShortList

        public void setShortList​(boolean shortlist)
      • isShortList

        public boolean isShortList()