|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ehsbe.commons.gui.LnF
public class LnF
Look and Feel setting utils.
| Field Summary | |
|---|---|
static String |
LNF_ACTION_PREFIX
The ID aka action command prefix to be used for an action, which refers to a special Look and feel. |
static String |
LNF_MENU_LIST
the ID, that will be as ID the look and feel action list |
static String |
LNF_NAME
the name of the action property, which will contain the name of the requested Look and Feel |
static String |
LNF_SUBLIST_PREFIX
The ID aka action command prefix, which will be used for actions, which mark a sublist aka category of Look and Feels. |
static String |
LNF_THEME
the name of the action property, which will contain the requested name of the theme of the appropriate Look and Feel. |
static String |
PREF_LNF
user preference key for look and feel |
static String |
PREF_LNF_DEFAULT
user preference default value for look and feel |
static String |
PREF_THEME
user preference key for look and feel theme |
static String |
PREF_THEME_DEFAULT
user preference default value for look and feel theme |
| Constructor Summary | |
|---|---|
LnF()
|
|
| Method Summary | |
|---|---|
static void |
createActions(HashMap<String,Action> actionMap,
HashMap<String,List<Object>> actionLists)
Create a action for each available Look and Feel [Theme] with an ID of "LNF_ACTION_" + N and put them
into an action list with the ID "L_LNF_MENU" , which
might be used to create a JMenu from it. |
static String[] |
getLnfNames()
Get all registered LNF names |
static Color |
getSeparatorForeground()
Get the default foreground color for separators. |
static JLabel |
getSeparatorLabel(JComponent sep)
Find and return the first JLabel in the given separator component (usually created by the jgoddies FormLayoutBuilder#addSeparator). |
static String[] |
getThemes4Lnf(String lnf)
Get all registered theme names for the given look and feel name. |
static void |
main(String[] args)
|
static void |
saveAppLookAndFeel(Preferences prefs,
Action action)
Convinience method to store the given look and feel as well as the theme name in the given preferences obtained fro the given action. |
static void |
saveAppLookAndFeel(Preferences prefs,
String lnfName,
String themeName)
Convinience method to store the given look and feel as well as the theme name in the given preferences. |
static void |
setAppLookAndFeel(Action action)
Sets the application look and feel. |
static void |
setAppLookAndFeel(Preferences prefs)
Set the look and feel using the given preferences. |
static void |
setAppLookAndFeel(String lnfName,
String theme)
Sets the application look and feel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PREF_LNF
public static final String PREF_LNF_DEFAULT
public static final String PREF_THEME
public static final String PREF_THEME_DEFAULT
public static final String LNF_MENU_LIST
public static final String LNF_ACTION_PREFIX
public static final String LNF_SUBLIST_PREFIX
public static final String LNF_NAME
public static final String LNF_THEME
| Constructor Detail |
|---|
public LnF()
| Method Detail |
|---|
public static String[] getLnfNames()
public static String[] getThemes4Lnf(String lnf)
lnf - a look and feel name
nullgetLnfNames()
public static void createActions(HashMap<String,Action> actionMap,
HashMap<String,List<Object>> actionLists)
"LNF_ACTION_" + N and put them
into an action list with the ID "L_LNF_MENU" , which
might be used to create a JMenu from it.
- Parameters:
actionMap - where to put the actions for each themeactionLists - where to put the created action list- See Also:
LNF_ACTION_PREFIX,
LNF_MENU_LIST
public static void saveAppLookAndFeel(Preferences prefs,
Action action)
prefs - where to store the given values.action - where to obtain the look and feel name and theme name.
If null, this method does nothing.
NOTE: If the action does not contain the appropriate properties,
the look and feel settings will be removed from the given
preferences.LNF_NAME,
LNF_THEME,
Action.getValue(String),
saveAppLookAndFeel(Preferences, String, String),
setAppLookAndFeel(Preferences)
public static void saveAppLookAndFeel(Preferences prefs,
String lnfName,
String themeName)
null, the
appropriate property will be removed from the preferences.
prefs - where to store the given values. If null,
this method does nothing.lnfName - the name of the look and feel to storethemeName - the name of the theme to store.public static void setAppLookAndFeel(Preferences prefs)
prefs - preferences to use to obtain the appropriate Look and
Feel name and the name of the theme. Ignored if null.setAppLookAndFeel(String, String)public static void setAppLookAndFeel(Action action)
action - the action to query for the new Look and Feel name and
theme name using the appropriate LNF properties keys.LNF_NAME,
LNF_THEME,
Action.getValue(String),
setAppLookAndFeel(String, String)
public static void setAppLookAndFeel(String lnfName,
String theme)
lnfName - the name of the Look and Feel to use.theme - the name of the theme to use.getLnfNames(),
getThemes4Lnf(String)public static Color getSeparatorForeground()
public static JLabel getSeparatorLabel(JComponent sep)
sep - component to scan for a JLabel
null if no JLabel was found, the first available
JLabel otherwise.public static void main(String[] args)
args -
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||