![JAR search and dependency download from the Maven repository](/logo.png)
org.jdesktop.swingx.plaf.AbstractUIChangeHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swingx-all Show documentation
Show all versions of swingx-all Show documentation
Fork of the inactive swingx-all library
package org.jdesktop.swingx.plaf;
import javax.swing.JComponent;
import java.beans.PropertyChangeListener;
import java.util.Map;
import java.util.WeakHashMap;
@SuppressWarnings("nls")
public abstract class AbstractUIChangeHandler implements PropertyChangeListener {
//prevent double installation.
private final Map installed = new WeakHashMap<>();
public void install(JComponent c) {
if (isInstalled(c)) {
return;
}
c.addPropertyChangeListener("UI", this);
installed.put(c, Boolean.FALSE);
}
public boolean isInstalled(JComponent c) {
return installed.containsKey(c);
}
public void uninstall(JComponent c) {
c.removePropertyChangeListener("UI", this);
installed.remove(c);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy