Package adams.gui.core
Class RecentSpreadSheetQueriesHandler<M>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.core.AbstractRecentItemsHandler<M,SpreadSheetQueryText>
-
- adams.gui.core.RecentSpreadSheetQueriesHandler<M>
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class RecentSpreadSheetQueriesHandler<M> extends AbstractRecentItemsHandler<M,SpreadSheetQueryText>
A class that handles a list of recent spreadsheet queries.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
RECENTSTATEMENTS_COUNT
the property for storing the number of recent statements.static String
RECENTSTATEMENTS_PREFIX
the property prefix for a recent statement.-
Fields inherited from class adams.gui.core.AbstractRecentItemsHandler
m_AddShortcuts, m_IgnoreChanges, m_Listeners, m_MaxCount, m_Menu, m_PropertiesFile, m_PropertyPrefix, m_RecentItems
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RecentSpreadSheetQueriesHandler(String propsFile, int maxCount, M menu)
Initializes the handler.RecentSpreadSheetQueriesHandler(String propsFile, String propPrefix, int maxCount, M menu)
Initializes the handler.RecentSpreadSheetQueriesHandler(String propsFile, M menu)
Initializes the handler with a maximum of 5 items.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createMenuItemText(int index, SpreadSheetQueryText item)
Generates the text for the menuitem.protected SpreadSheetQueryText
fromString(String s)
Turns the string obtained from the props into an object again.protected String
getCountKey()
Returns the key to use for the counts in the props file.protected String
getItemPrefix()
Returns the key prefix to use for the items in the props file.protected String
toString(SpreadSheetQueryText obj)
Turns an object into a string for storing in the props.-
Methods inherited from class adams.gui.core.AbstractRecentItemsHandler
addRecentItem, addRecentItemListener, check, doUpdateMenu, expand, getAddShortcuts, getMaxCount, getMenu, getPropertiesFile, getPropertyPrefix, getRecentItems, loadProps, notifyRecentItemListenersOfAdd, notifyRecentItemListenersOfSelect, postUpdateMenu, preUpdateMenu, readProps, removeAll, removeRecentItem, removeRecentItemListener, setAddShortcuts, size, updateMenu, writeProps
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
RECENTSTATEMENTS_COUNT
public static final String RECENTSTATEMENTS_COUNT
the property for storing the number of recent statements.- See Also:
- Constant Field Values
-
RECENTSTATEMENTS_PREFIX
public static final String RECENTSTATEMENTS_PREFIX
the property prefix for a recent statement.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RecentSpreadSheetQueriesHandler
public RecentSpreadSheetQueriesHandler(String propsFile, M menu)
Initializes the handler with a maximum of 5 items.- Parameters:
propsFile
- the props file to store the files inmenu
- the menu to add the recent files as subitems to
-
RecentSpreadSheetQueriesHandler
public RecentSpreadSheetQueriesHandler(String propsFile, int maxCount, M menu)
Initializes the handler.- Parameters:
propsFile
- the props file to store the files inmaxCount
- the maximum number of files to keep in menumenu
- the menu to add the recent files as subitems to
-
RecentSpreadSheetQueriesHandler
public RecentSpreadSheetQueriesHandler(String propsFile, String propPrefix, int maxCount, M menu)
Initializes the handler.- Parameters:
propsFile
- the props file to store the files inpropPrefix
- the properties prefix, use null to ignoremaxCount
- the maximum number of files to keep in menumenu
- the menu to add the recent files as subitems to
-
-
Method Detail
-
getCountKey
protected String getCountKey()
Returns the key to use for the counts in the props file.- Specified by:
getCountKey
in classAbstractRecentItemsHandler<M,SpreadSheetQueryText>
- Returns:
- the key
-
getItemPrefix
protected String getItemPrefix()
Returns the key prefix to use for the items in the props file.- Specified by:
getItemPrefix
in classAbstractRecentItemsHandler<M,SpreadSheetQueryText>
- Returns:
- the prefix
-
toString
protected String toString(SpreadSheetQueryText obj)
Turns an object into a string for storing in the props.- Specified by:
toString
in classAbstractRecentItemsHandler<M,SpreadSheetQueryText>
- Parameters:
obj
- the object to convert- Returns:
- the string representation
-
fromString
protected SpreadSheetQueryText fromString(String s)
Turns the string obtained from the props into an object again.- Specified by:
fromString
in classAbstractRecentItemsHandler<M,SpreadSheetQueryText>
- Parameters:
s
- the string representation- Returns:
- the parsed object
-
createMenuItemText
protected String createMenuItemText(int index, SpreadSheetQueryText item)
Generates the text for the menuitem.- Specified by:
createMenuItemText
in classAbstractRecentItemsHandler<M,SpreadSheetQueryText>
- Parameters:
index
- the index of the itemitem
- the item itself- Returns:
- the generated text
-
-