Package generalDatabase.lookupTables
Class LookUpTables
java.lang.Object
generalDatabase.lookupTables.LookUpTables
Singleton class for managing a common lookup table for 
 many PAMGUARD modules (following from Logger format)
- Author:
 - Doug Gillespie
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum length of a lookup codestatic final intMaximum length of a lookup item textstatic final intMaximum length of topic text for a lookup collection - 
Method Summary
Modifier and TypeMethodDescriptionbooleanaddListToDB(LookupList newList) Adds the passed list to the end of the Lookup table in the current database.voidaddUpdatableComponent(LookupComponent lookupComponent) Add a lookup component which can be updated automatically should there be any changes to the components topic.booleanCheck the database module is present and that the lookup table exists.createLookupList(PamCursor resultSet, String topic) editLookupTopic(Window window, String topic) Query all LUT items with the given topic name.getLookupList(String topic) static LookUpTablesAccess the LookUpTables classbooleanremoveUpdatableComponent(LookupComponent lookupComponent) Remove a lookup component which can be updated automatically should there be any changes to the components topic.voidupdateComponents(String lookupTopic) Tell all lookup components with the given topic to update their lists, restoring currently selected values if possible. 
- 
Field Details
- 
TOPIC_LENGTH
public static final int TOPIC_LENGTHMaximum length of topic text for a lookup collection- See Also:
 
 - 
CODE_LENGTH
public static final int CODE_LENGTHMaximum length of a lookup code- See Also:
 
 - 
TEXT_LENGTH
public static final int TEXT_LENGTHMaximum length of a lookup item text- See Also:
 
 
 - 
 - 
Method Details
- 
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
 - 
addListToDB
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
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
 - 
addUpdatableComponent
Add a lookup component which can be updated automatically should there be any changes to the components topic.- Parameters:
 lookupComponent-
 - 
removeUpdatableComponent
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
Tell all lookup components with the given topic to update their lists, restoring currently selected values if possible.- Parameters:
 lookupTopic-
 
 -