RememberedDecisionsManagerpublic class RememberedDecisionsManager extends Object Remembers Decisions (usually from message boxes) |
Methods Summary |
---|
public static int | getRememberedDecision(java.lang.String id)
return getRememberedDecision(id, -1);
| public static int | getRememberedDecision(java.lang.String id, int onlyIfInMask)
if (id == null || onlyIfInMask == 0) {
return -1;
}
Map remembered_decisions = COConfigurationManager.getMapParameter(
"MessageBoxWindow.decisions", new HashMap());
Long l = (Long) remembered_decisions.get(id);
//System.out.println("getR " + id + " -> " + l);
if (l != null) {
int i = l.intValue();
if (onlyIfInMask == -1 || (i & onlyIfInMask) != 0) {
return i;
}
}
return -1;
| public static void | setRemembered(java.lang.String id, int value)Set a remembered value
if (id == null) {
return;
}
Map remembered_decisions = COConfigurationManager.getMapParameter(
"MessageBoxWindow.decisions", new HashMap());
if (value == -1) {
remembered_decisions.remove(id);
} else {
remembered_decisions.put(id, new Long(value));
}
System.out.println("setR " + id + " -> " + value);
COConfigurationManager.setParameter("MessageBoxWindow.decisions",
remembered_decisions);
COConfigurationManager.save();
|
|