}\r
}\r
\r
+ /**\r
+ * Gets a detached copy of a command. For the change manager\r
+ * to become aware of any changes to the copy it must be \r
+ * checked back in with 'checkIn(Pazpar2Command)'\r
+ * \r
+ * @param commandName\r
+ * @return Copy this state's instance of the given command\r
+ */\r
public Pazpar2Command checkOut (String commandName) {\r
return getCurrentState().getCommand(commandName).copy();\r
}\r
return states.get(currentKey);\r
}\r
\r
+ /**\r
+ * Changes the current state key. Invoked from the UI to have the state \r
+ * manager switch to another state than the current one. \r
+ * \r
+ * @param key\r
+ */\r
public void setCurrentStateKey(String key) { \r
if (currentKey.equals(key)) {\r
logger.debug("setCurrentStateKey: no key change detected");\r
}\r
}\r
\r
- \r
+ /**\r
+ * Sets a pending-state-change flag for the given command. Used by\r
+ * the beans to decide whether, say, a search should be executed before\r
+ * doing the next show. \r
+ * \r
+ * It is up to the client to set and reset this flag since the state\r
+ * manager is not otherwise informed about actual request activities \r
+ * (only about the definition of commands to be executed)\r
+ * \r
+ * @param command\r
+ * @param bool\r
+ */\r
public void hasPendingStateChange(String command, boolean bool) {\r
pendingStateChanges.put(command, new Boolean(bool));\r
}\r
\r
+ /**\r
+ * \r
+ * @param command\r
+ * @return true if there is a non-executed command change in this state\r
+ */\r
public boolean hasPendingStateChange (String command) {\r
return pendingStateChanges.get(command).booleanValue();\r
}\r