Class LookupComponent

java.lang.Object
generalDatabase.lookupTables.LookupComponent

public class LookupComponent extends Object
Lookup component to go in dialogs, Logger forms, etc.

Has the look and feel of Logger drop down boxes but lots of extra features, such as being editable and updatable on the fly, etc.

Author:
Doug Gillespie
  • Constructor Details

    • LookupComponent

      public LookupComponent(String lookupTopic, LookupList lookupList, boolean autoUpdate)
      Make a lookup list with an option to auto-update automatically whenever there is a change to this list within PAMGuard, e.g. if the same topic is used in multiple controls.
      Parameters:
      lookupTopic - lookup topic
      lookupList - lookup list
      autoUpdate - flag to auto update in the event of changes.
    • LookupComponent

      public LookupComponent(String lookupTopic, LookupList lookupList)
      Make a lookup component which won't auto-update.
      Parameters:
      lookupTopic - lookup topic
      lookupList - lookup list
  • Method Details

    • getLookupList

      public LookupList getLookupList()
      Returns:
      the lookupList
    • setLookupList

      public void setLookupList(LookupList lookupList)
      Parameters:
      lookupList - the lookupList to set
    • setShowCodePanel

      public void setShowCodePanel(boolean showCode)
      Set whether or not to show the code panel to the left of the main drop down.
      Parameters:
      showCode - show the code panel
    • isShowCodePanel

      public boolean isShowCodePanel()
      Returns:
      true if the code panel is shown.
    • getSelectedItem

      public LookupItem getSelectedItem()
      Returns:
      The currently selected lookup item.
    • showPopupMenu

      public void showPopupMenu(MouseEvent me)
    • setComboFromCode

      public boolean setComboFromCode()
    • fillList

      public void fillList()
    • getComponent

      public JComponent getComponent()
    • setWestTitle

      public void setWestTitle(String westTitle)
    • setNorthTitle

      public void setNorthTitle(String northTitle)
    • isAllowNullSelection

      public boolean isAllowNullSelection()
    • setAllowNullSelection

      public void setAllowNullSelection(boolean allowNullSelection)
    • isAllowEdits

      public boolean isAllowEdits()
    • setAllowEdits

      public void setAllowEdits(boolean allowEdits)
    • setSelectedCode

      public void setSelectedCode(String codeText)
      Set the code manually, then let the comboBox part update itself
      Parameters:
      codeText -
    • getSelectedList

      public Vector<LookupItem> getSelectedList()
      Returns:
      the selectedList
    • setToolTipText

      public void setToolTipText(String hint)
    • setToolTipText

      public void setToolTipText(String codeHint, String comboHint)
    • setTopic

      public void setTopic(String topicName)
    • addChangeListener

      public void addChangeListener(LookupChangeListener changeListener)
      Add a change listener to receive notifications whenever the lookup selection changes.
      Parameters:
      changeListener - change listener
    • removeChangeListener

      public void removeChangeListener(LookupChangeListener changeListener)
      Remove a change listener that received notifications whenever the lookup selection changes.
      Parameters:
      changeListener - change listener
    • getNullSelectionText

      public String getNullSelectionText()
      Returns:
      the nullSelectionText
    • setNullSelectionText

      public void setNullSelectionText(String nullSelectionText)
      Parameters:
      nullSelectionText - the nullSelectionText to set