FileDocCategorySizeDatePackage
RememberedDecisionsManager.javaAPI DocAzureus 3.0.3.42453Wed Aug 01 13:29:34 BST 2007com.aelitis.azureus.ui.common

RememberedDecisionsManager

public class RememberedDecisionsManager extends Object
Remembers Decisions (usually from message boxes)
author
TuxPaper
created
May 6, 2007

Fields Summary
Constructors Summary
Methods Summary
public static intgetRememberedDecision(java.lang.String id)

		return getRememberedDecision(id, -1);
	
public static intgetRememberedDecision(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 voidsetRemembered(java.lang.String id, int value)
Set a remembered value

param
id remember id
param
value value to store. -1 to remove
since
3.0.1.3

		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();