|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.plaf.LookAndFeelAddons
public class LookAndFeelAddons
Provides additional pluggable UI for new components added by the library. By default, the library
uses the pluggable UI returned by getBestMatchAddonClassName()
.
The default addon can be configured using the swing.addon
system property as follow:
java -Dswing.addon=ADDONCLASSNAME ...
System.getProperties().put("swing.addon", ADDONCLASSNAME);
The addon can also be installed directly by calling the setAddon(String)
method. For
example, to install the Windows addons, add the following statement
LookAndFeelAddons.setAddon("com.l2fprod.common.swing.plaf.windows.WindowsLookAndFeelAddons");
.
Constructor Summary | |
---|---|
LookAndFeelAddons()
|
Method Summary | |
---|---|
static void |
contribute(ComponentAddon component)
Each new component added by the library will contribute its default UI classes, colors and fonts to the LookAndFeelAddons. |
static LookAndFeelAddons |
getAddon()
|
static String |
getBestMatchAddonClassName()
Based on the current look and feel (as returned by UIManager.getLookAndFeel() ),
this method returns the name of the closest LookAndFeelAddons to use. |
protected Object[] |
getDefaults()
|
static String |
getSystemAddonClassName()
Gets the addon best suited for the operating system where the virtual machine is running. |
static ComponentUI |
getUI(JComponent component,
Class<?> expectedUIClass)
Workaround for IDE mixing up with classloaders and Applets environments. |
static ComponentUI |
getUI(JComponent component,
String uiClassID)
Create the UI for the given component. |
void |
initialize()
|
static boolean |
isTrackingLookAndFeelChanges()
|
static void |
loadDefaults(Object[] keysAndValues)
Adds the given defaults in UIManager. |
static void |
setAddon(Class<? extends LookAndFeelAddons> addonClass)
|
static void |
setAddon(LookAndFeelAddons addon)
|
static void |
setAddon(String addonClassName)
|
static void |
setTrackingLookAndFeelChanges(boolean tracking)
If true, everytime the Swing look and feel is changed, the addon which best matches the current look and feel will be automatically selected. |
static void |
uncontribute(ComponentAddon component)
Removes the contribution of the given addon |
void |
uninitialize()
|
static void |
unloadDefaults(Object[] keysAndValues)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LookAndFeelAddons()
Method Detail |
---|
public void initialize()
public void uninitialize()
protected Object[] getDefaults()
public static void loadDefaults(Object[] keysAndValues)
keysAndValues
- public static void unloadDefaults(Object[] keysAndValues)
public static void setAddon(String addonClassName) throws InstantiationException, IllegalAccessException, ClassNotFoundException
InstantiationException
IllegalAccessException
ClassNotFoundException
public static void setAddon(Class<? extends LookAndFeelAddons> addonClass) throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
public static void setAddon(LookAndFeelAddons addon)
public static LookAndFeelAddons getAddon()
public static String getBestMatchAddonClassName()
UIManager.getLookAndFeel()
),
this method returns the name of the closest LookAndFeelAddons
to use.
public static String getSystemAddonClassName()
public static void contribute(ComponentAddon component)
ComponentAddon
.
component
- public static void uncontribute(ComponentAddon component)
component
- public static ComponentUI getUI(JComponent component, Class<?> expectedUIClass)
component
- expectedUIClass
-
public static ComponentUI getUI(JComponent component, String uiClassID)
uiClassID
is expected to
resolve to a UI class name.
component
- uiClassID
- public static void setTrackingLookAndFeelChanges(boolean tracking)
tracking
- true to automatically update the addon, false to not automatically track the
addon. Defaults to false.getBestMatchAddonClassName()
public static boolean isTrackingLookAndFeelChanges()
setTrackingLookAndFeelChanges(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |