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 Link icon

    • TOPIC_LENGTH Link icon

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

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

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

    • getLookUpTables Link icon

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

      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 Link icon

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

      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 Link icon

      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 Link icon

      public LookupList getLookupList(String topic)
    • addUpdatableComponent Link icon

      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 Link icon

      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 Link icon

      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 -