/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Wrapper for a value from the desktop. The value is lazily looked up, and
* can be accessed using the <code>UIManager.ActiveValue</code> method
* <code>createValue</code>. If the underlying desktop property changes this
* will force the UIs to update all known Frames. You can invoke
* <code>invalidate</code> to force the value to be fetched again.
*
*/
// NOTE: Don't rely on this class staying in this location. It is likely
// to move to a different package in the future.
/**
* Indicates if an updateUI call is pending.
*/
private static boolean updatePending;
/**
* ReferenceQueue of unreferenced WeakPCLs.
*/
/**
* PropertyChangeListener attached to the Toolkit.
*/
/**
* Key used to lookup value from desktop.
*/
/**
* Value to return.
*/
/**
* Fallback value in case we get null from desktop.
*/
/**
* Cleans up any lingering state held by unrefeernced
* DesktopProperties.
*/
static void flushUnreferencedProperties() {
}
}
/**
* Sets whether or not an updateUI call is pending.
*/
}
/**
* Returns true if a UI update is pending.
*/
private static synchronized boolean isUpdatePending() {
return updatePending;
}
/**
* Updates the UIs of all the known Frames.
*/
private static void updateAllUIs() {
// Check if the current UI is WindowsLookAndfeel and flush the XP style map.
// Note: Change the package test if this class is moved to a different package.
}
}
}
/**
* Updates the UI of the passed in window and all its children.
*/
}
}
/**
* Creates a DesktopProperty.
*
* @param key Key used in looking up desktop value.
* @param fallback Value used if desktop property is null.
*/
// The only sure fire way to clear our references is to create a
// Thread and wait for a reference to be added to the queue.
// Because it is so rare that you will actually change the look
// and feel, this stepped is forgoed and a middle ground of
// flushing references from the constructor is instead done.
// The implication is that once one DesktopProperty is created
// there will most likely be n (number of DesktopProperties created
// by the LookAndFeel) WeakPCLs around, but this number will not
// grow past n.
}
/**
* UIManager.LazyValue method, returns the value from the desktop
* or the fallback value if the desktop value is null.
*/
}
}
return value;
}
/**
* Returns the value from the desktop.
*/
}
}
/**
* Returns the value to use if the desktop property is null.
*/
return fallback;
}
/**
* Invalidates the current value.
*
* @param laf the LookAndFeel this DesktopProperty was created with
*/
invalidate();
}
/**
* Invalides the current value so that the next invocation of
* <code>createValue</code> will ask for the property again.
*/
public void invalidate() {
}
/**
* Requests that all components in the GUI hierarchy be updated
* to reflect dynamic changes in this look&feel. This update occurs
* by uninstalling and re-installing the UI objects. Requests are
* batched and collapsed into a single update pass because often
* many desktop properties will change at once.
*/
protected void updateUI() {
if (!isUpdatePending()) {
setUpdatePending(true);
public void run() {
updateAllUIs();
setUpdatePending(false);
}
};
}
}
/**
* Configures the value as appropriate for a defaults property in
* the UIDefaults table.
*/
}
}
}
}
}
return value;
}
/**
* Returns the key used to lookup the desktop properties value.
*/
return key;
}
/**
* As there is typically only one Toolkit, the PropertyChangeListener
* is handled via a WeakReference so as not to pin down the
* DesktopProperty.
*/
implements PropertyChangeListener {
}
// The property was GC'ed, we're no longer interested in
// PropertyChanges, remove the listener.
dispose();
}
else {
}
}
void dispose() {
}
}
}