| Value that can be placed into UIDefaults, which will put additional items into
UIDefaults when its value is requested.
The idea is to avoid putting a lot of things that may not be used into
UIDefaults on startup. So, for example, the first time a tab control's UI
is requested, this value will return the string from which the UI can be
fetched - but first it will put the assorted keys and values that that UI
will need into UIDefaults.
Since multiple UIs may require the same things in UIDefaults, there is the
method createShared(), which will create another instance (really an inner
class instance) that shares the code and key/value pairs. Whichever is
asked for first will initialize the keys and values required. So the usage
pattern is something like:
Object someKeysAndValues = new Object[] {"fooColor", Color.BLUE, "barColor", Color.RED};
UIBootstrapValue bv = new UIBootstrapValue ("com.foo.FnordUIClass", someKeysAndValues);
Object next = bv.createShared ("com.foo.ThiptUIClass");
UIManager.put ("FnordUI", bv);
UIManager.put ("ThiptUI", next);
author: Tim Boudreau |