Class LookUpTables

java.lang.Object
generalDatabase.lookupTables.LookUpTables

public class LookUpTables extends Object
Singleton class for managing a common lookup table for many PAMGUARD modules (following from Logger format)
Author:
Doug Gillespie
  • Field Details

    • TOPIC_LENGTH

      public static final int TOPIC_LENGTH
      Maximum length of topic text for a lookup collection
      See Also:
    • CODE_LENGTH

      public static final int CODE_LENGTH
      Maximum length of a lookup code
      See Also:
    • TEXT_LENGTH

      public static final int TEXT_LENGTH
      Maximum length of a lookup item text
      See Also:
  • Method Details

    • getLookUpTables

      public static LookUpTables getLookUpTables()
      Access the LookUpTables class
      Returns:
      reference to a single instance of the Look up table manager.
    • checkTable

      public boolean checkTable()
      Check the database module is present and that the lookup table exists.
      Returns:
      true if the table exists and is correctly formatted with all the right columns.
    • createLookupList

      public LookupList createLookupList(PamCursor resultSet, String topic)
    • addListToDB

      public boolean addListToDB(LookupList newList)

      Adds the passed list to the end of the Lookup table in the current database.

      This method DOES NOT CHECK if the list topic already exists in the table, and try to merge the rows. It simply adds the list to the end of the table.

      Parameters:
      newList -
      Returns:
    • editLookupTopic

      public LookupList editLookupTopic(Window window, String topic)
      Query all LUT items with the given topic name. display these in a table / list (which might be empty) and provide facilities for the user to add to and remove items from this list
      Parameters:
      window -
      topic - LUT topic
      Returns:
      a new list, or null if no new list created.
    • getLookupList

      public LookupList getLookupList(String topic)
    • addUpdatableComponent

      public void addUpdatableComponent(LookupComponent lookupComponent)
      Add a lookup component which can be updated automatically should there be any changes to the components topic.
      Parameters:
      lookupComponent -
    • removeUpdatableComponent

      public boolean removeUpdatableComponent(LookupComponent lookupComponent)
      Remove a lookup component which can be updated automatically should there be any changes to the components topic.
      Parameters:
      lookupComponent -
      Returns:
      true if the component existed in the update list.
    • updateComponents

      public void updateComponents(String lookupTopic)
      Tell all lookup components with the given topic to update their lists, restoring currently selected values if possible.
      Parameters:
      lookupTopic -