try {
// only install theme if L&F is Plastic;
// bomb out if the L&F class cannot be found at all.
Class lf = Class.forName(lfName);
if (PlasticLookAndFeel.class.isAssignableFrom(lf)) {
PlasticTheme foundTheme = themeWithName(themeName);
if (foundTheme == null) {
logObj.warn("Could not set selected theme '"
+ themeName
+ "' - using default '"
+ ModelerConstants.DEFAULT_THEME_NAME
+ "'.");
themeName = ModelerConstants.DEFAULT_THEME_NAME;
foundTheme = themeWithName(themeName);
}
// try to configure theme
PlasticLookAndFeel.setMyCurrentTheme(foundTheme);
}
// try to set set L&F
UIManager.setLookAndFeel(lfName);
}
catch (Exception e) {
logObj.warn("Could not set selected LookAndFeel '"
+ lfName
+ "' - using default '"
+ ModelerConstants.DEFAULT_LAF_NAME
+ "'.");
// re-try with defaults
lfName = ModelerConstants.DEFAULT_LAF_NAME;
themeName = ModelerConstants.DEFAULT_THEME_NAME;
PlasticTheme defaultTheme = themeWithName(themeName);
PlasticLookAndFeel.setMyCurrentTheme(defaultTheme);
try {
UIManager.setLookAndFeel(lfName);
}