1 |
/* UIDefaults.java -- database for all settings and interface bindings. |
/* UIDefaults.java -- database for all settings and interface bindings. |
2 |
Copyright (C) 2002, 2004 Free Software Foundation, Inc. |
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
57 |
|
|
58 |
/** |
/** |
59 |
* UIDefaults is a database where all settings and interface bindings are |
* UIDefaults is a database where all settings and interface bindings are |
60 |
* stored into. An PLAF implementation fills one of these (see for example |
* stored into. A PLAF implementation fills one of these (see for example |
61 |
* plaf/basic/BasicLookAndFeel.java) with "ButtonUI" -> new BasicButtonUI(). |
* plaf/basic/BasicLookAndFeel.java) with "ButtonUI" -> new BasicButtonUI(). |
62 |
* |
* |
63 |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
64 |
*/ |
*/ |
68 |
private Locale defaultLocale; |
private Locale defaultLocale; |
69 |
private PropertyChangeSupport propertyChangeSupport; |
private PropertyChangeSupport propertyChangeSupport; |
70 |
|
|
71 |
public interface ActiveValue |
public static interface ActiveValue |
72 |
{ |
{ |
73 |
Object createValue(UIDefaults table); |
Object createValue(UIDefaults table); |
74 |
} |
} |
92 |
} |
} |
93 |
} |
} |
94 |
|
|
95 |
public interface LazyValue |
public static interface LazyValue |
96 |
{ |
{ |
97 |
Object createValue(UIDefaults table); |
Object createValue(UIDefaults table); |
98 |
} |
} |
286 |
|
|
287 |
public Object put(Object key, Object value) |
public Object put(Object key, Object value) |
288 |
{ |
{ |
289 |
Object old = super.put(key, value); |
Object old; |
290 |
|
if (value != null) |
291 |
|
old = super.put(key, value); |
292 |
|
else |
293 |
|
old = super.remove(key); |
294 |
if (key instanceof String && old != value) |
if (key instanceof String && old != value) |
295 |
firePropertyChange((String) key, old, value); |
firePropertyChange((String) key, old, value); |
296 |
return old; |
return old; |