Package adams.gui.flow
Class RecentActorProcessorHandler<M>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.core.AbstractRecentItemsHandler<M,ActorProcessor>
-
- adams.gui.flow.RecentActorProcessorHandler<M>
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class RecentActorProcessorHandler<M> extends AbstractRecentItemsHandler<M,ActorProcessor>
Recent actor processors handler.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_CHARS
the maximum chars in for the menu item.static String
RECENTPROCESSORS_COUNT
the property for storing the number of recent statements.static String
RECENTPROCESSORS_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 RecentActorProcessorHandler(String propsFile, int maxCount, M menu)
Initializes the handler.RecentActorProcessorHandler(String propsFile, String propPrefix, int maxCount, M menu)
Initializes the handler.RecentActorProcessorHandler(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, ActorProcessor item)
Generates the text for the menuitem.protected ActorProcessor
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(ActorProcessor 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
-
RECENTPROCESSORS_COUNT
public static final String RECENTPROCESSORS_COUNT
the property for storing the number of recent statements.- See Also:
- Constant Field Values
-
RECENTPROCESSORS_PREFIX
public static final String RECENTPROCESSORS_PREFIX
the property prefix for a recent statement.- See Also:
- Constant Field Values
-
MAX_CHARS
public static final int MAX_CHARS
the maximum chars in for the menu item.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RecentActorProcessorHandler
public RecentActorProcessorHandler(String propsFile, M menu)
Initializes the handler with a maximum of 5 items.- Parameters:
propsFile
- the props file to store the items inmenu
- the menu to add the recent items as subitems to
-
RecentActorProcessorHandler
public RecentActorProcessorHandler(String propsFile, int maxCount, M menu)
Initializes the handler.- Parameters:
propsFile
- the props file to store the items inmaxCount
- the maximum number of items to keep in menumenu
- the menu to add the recent items as subitems to
-
RecentActorProcessorHandler
public RecentActorProcessorHandler(String propsFile, String propPrefix, int maxCount, M menu)
Initializes the handler.- Parameters:
propsFile
- the props file to store the items inpropPrefix
- the properties prefix, use null to ignoremaxCount
- the maximum number of items to keep in menumenu
- the menu to add the recent items 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,ActorProcessor>
- 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,ActorProcessor>
- Returns:
- the prefix
-
toString
protected String toString(ActorProcessor obj)
Turns an object into a string for storing in the props.- Specified by:
toString
in classAbstractRecentItemsHandler<M,ActorProcessor>
- Parameters:
obj
- the object to convert- Returns:
- the string representation
-
fromString
protected ActorProcessor fromString(String s)
Turns the string obtained from the props into an object again.- Specified by:
fromString
in classAbstractRecentItemsHandler<M,ActorProcessor>
- Parameters:
s
- the string representation- Returns:
- the parsed object
-
createMenuItemText
protected String createMenuItemText(int index, ActorProcessor item)
Generates the text for the menuitem.- Specified by:
createMenuItemText
in classAbstractRecentItemsHandler<M,ActorProcessor>
- Parameters:
index
- the index of the itemitem
- the item itself- Returns:
- the generated text
-
-