|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fife.jgoodies.looks.Options
public final class Options
Provides access to optional features of the JGoodies L&Fs
via a key to the system properties, via a key for the UIDefaults
table, via a method, or all of them.
API users can use this class' constants or their values to configure the JGoodies L&amP;f. Using the constants requires the Looks library classes in the class path of the using application/applet, where using the String values doesn't require having this class in the class path.
Field Summary | |
---|---|
static java.lang.String |
COMBO_POPUP_PROTOTYPE_DISPLAY_VALUE_KEY
A JComboBox client property key for the combo's popup menu prototype display value. |
static java.lang.String |
COMBO_RENDERER_IS_BORDER_REMOVABLE
A client property key for combo box renderer components. |
static java.lang.String |
DEFAULT_ICON_SIZE_KEY
|
static java.lang.String |
DEFAULT_LOOK_NAME
The class name of the default JGoodies L&f, PlasticXP. |
static java.lang.String |
EMBEDDED_TABS_KEY
A JTabbedPane client property key that indicates that tabs are painted with a special embedded appearance. |
static java.lang.String |
HI_RES_DISABLED_ICON_CLIENT_KEY
A client property key for components with a disabled icon such as buttons, labels, and tabbed panes. |
static java.lang.String |
HI_RES_GRAY_FILTER_ENABLED_KEY
A UIDefaults key for enabling/disabling the new high-resolution gray filter globally. |
static java.lang.String |
INVERT_SELECTION_CLIENT_KEY
A JTextField client property key that specifies the direction how text shall be selected on focus gain - if at all: from start to end vs. end to start. |
static java.lang.String |
IS_ETCHED_KEY
A JScrollPane client property key for a hint that the scroll pane border should be etched. |
static java.lang.String |
JGOODIES_WINDOWS_NAME
The class name of the JGoodies Windows L&f. |
static java.lang.String |
NO_CONTENT_BORDER_KEY
A JTabbedPane client property key that indicates that no content border shall be painted. |
static java.lang.String |
NO_ICONS_KEY
A JMenu client property key for a hint that the menu items in the menu have no icons. |
static java.lang.String |
NO_MARGIN_KEY
A JPopupMenu client property key for a hint that the border shall have no extra margin. |
static java.lang.String |
NO_REPLACEMENT
A replacement used to replace a given L&f with nothing, that indicates that it should not be used. |
static java.lang.String |
PLASTIC3D_NAME
The class name of the JGoodies Plastic3D L&f. |
static java.lang.String |
PLASTICXP_NAME
The class name of the JGoodies PlasticXP L&f. |
static java.lang.String |
POPUP_DROP_SHADOW_ENABLED_KEY
A UIDefaults key for the popup drop shadow enablement. |
static java.lang.String |
SELECT_ON_FOCUS_GAIN_CLIENT_KEY
A JTextField client property key that specifies whether all text shall be selected on focus gain. |
static java.lang.String |
SELECT_ON_FOCUS_GAIN_KEY
A UIDefaults key for the global default whether text fields shall select all text on focus gain. |
static java.lang.String |
SET_CARET_TO_START_ON_FOCUS_LOST_CLIENT_KEY
A JTextField client property key that specifies whether the caret shall be positioned at the start on focus lost. |
static java.lang.String |
TAB_ICONS_ENABLED_KEY
|
static java.lang.String |
TREE_LINE_STYLE_ANGLED_VALUE
A JTree client property value that indicates that lines shall be drawn. |
static java.lang.String |
TREE_LINE_STYLE_KEY
A JTree client property key for a tree line style hint. |
static java.lang.String |
TREE_LINE_STYLE_NONE_VALUE
A JTree client property value that indicates that lines shall be hidden. |
static java.lang.String |
USE_NARROW_BUTTONS_KEY
|
static java.lang.String |
USE_SYSTEM_FONTS_APP_KEY
A convenience constant for the standard Swing UIDefaults key that configures the use of system fonts. |
static java.lang.String |
USE_SYSTEM_FONTS_KEY
A convenience constant for the standard Swing system property key that configures the use of system fonts. |
Method Summary | |
---|---|
static java.lang.String |
getCrossPlatformLookAndFeelClassName()
Returns the class name for a cross-platform LookAndFeel . |
static java.awt.Dimension |
getDefaultIconSize()
Returns the default icon size that is used in menus, menu items and toolbars. |
static java.lang.String |
getReplacementClassNameFor(java.lang.String className)
Returns the class name that can be used to replace the specified LookAndFeel class name. |
static java.lang.Boolean |
getSelectOnFocusGainEnabled(javax.swing.text.JTextComponent c)
Returns component's individual setting for the select on focus gain feature. |
static java.lang.String |
getSystemLookAndFeelClassName()
Returns the class name for a system specific LookAndFeel . |
static boolean |
getUseNarrowButtons()
Checks and answers if we shall use narrow button margins of 4 pixels. |
static boolean |
getUseSystemFonts()
Returns whether native system fonts shall be used, true
by default unless disabled in the system properties or UIManager. |
static boolean |
isHiResGrayFilterEnabled()
Checks and answers whether the new high-resolution gray filter is enabled or disabled. |
static boolean |
isPopupDropShadowActive()
Checks and answers whether popup drop shadows are active. |
static boolean |
isPopupDropShadowEnabled()
Checks and answers whether the optional drop shadows for PopupMenus are enabled or disabled. |
static boolean |
isSelectOnFocusGainActive(javax.swing.text.JTextComponent c)
Checks and answers whether the select all on focus gain feature is active for the given field. |
static boolean |
isSelectOnFocusGainEnabled()
Checks and answers whether the global default for text fields is to select all text on focus gain. |
static boolean |
isTabIconsEnabled()
Checks and answers if we shall use icons in JTabbedPanes. |
static void |
putLookAndFeelReplacement(java.lang.String original,
java.lang.String replacement)
Puts a replacement name for a given LookAndFeel
class name in the list of all look and feel replacements. |
static void |
removeLookAndFeelReplacement(java.lang.String original)
Removes a replacement name for a given LookAndFeel
class name from the list of all look and feel replacements. |
static void |
setDefaultIconSize(java.awt.Dimension defaultIconSize)
Sets the default icon size. |
static void |
setHiResGrayFilterEnabled(boolean b)
Enables or disables the new high-resolution gray filter globally. |
static void |
setPopupDropShadowEnabled(boolean b)
Enables or disables drop shadows in PopupMenus. |
static void |
setSelectOnFocusGainEnabled(boolean b)
Enables or disables the select on focus gain feature globally. |
static void |
setSelectOnFocusGainEnabled(javax.swing.JTextField field,
java.lang.Boolean b)
Overrides the global default for the select all feature for the given text field. |
static void |
setTabIconsEnabled(boolean b)
Enables or disables the use of icons in JTabbedPanes. |
static void |
setUseNarrowButtons(boolean b)
Globally sets the use narrow or standard button margins. |
static void |
setUseSystemFonts(boolean useSystemFonts)
Sets a value in the UIManager to indicate, that a look&feel may use the native system fonts. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PLASTIC3D_NAME
public static final java.lang.String PLASTICXP_NAME
public static final java.lang.String JGOODIES_WINDOWS_NAME
public static final java.lang.String DEFAULT_LOOK_NAME
public static final java.lang.String USE_SYSTEM_FONTS_KEY
getUseSystemFonts()
,
setUseSystemFonts(boolean)
,
Constant Field Valuespublic static final java.lang.String USE_SYSTEM_FONTS_APP_KEY
getUseSystemFonts()
,
setUseSystemFonts(boolean)
,
Constant Field Valuespublic static final java.lang.String DEFAULT_ICON_SIZE_KEY
public static final java.lang.String USE_NARROW_BUTTONS_KEY
public static final java.lang.String TAB_ICONS_ENABLED_KEY
public static final java.lang.String POPUP_DROP_SHADOW_ENABLED_KEY
isPopupDropShadowEnabled()
,
setPopupDropShadowEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String HI_RES_GRAY_FILTER_ENABLED_KEY
setHiResGrayFilterEnabled(boolean)
,
HI_RES_DISABLED_ICON_CLIENT_KEY
,
Constant Field Valuespublic static final java.lang.String SELECT_ON_FOCUS_GAIN_KEY
setSelectOnFocusGainEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String IS_ETCHED_KEY
public static final java.lang.String NO_ICONS_KEY
public static final java.lang.String NO_MARGIN_KEY
public static final java.lang.String TREE_LINE_STYLE_KEY
TREE_LINE_STYLE_ANGLED_VALUE
,
TREE_LINE_STYLE_NONE_VALUE
,
Constant Field Valuespublic static final java.lang.String TREE_LINE_STYLE_ANGLED_VALUE
TREE_LINE_STYLE_KEY
,
Constant Field Valuespublic static final java.lang.String TREE_LINE_STYLE_NONE_VALUE
TREE_LINE_STYLE_KEY
,
Constant Field Valuespublic static final java.lang.String NO_CONTENT_BORDER_KEY
public static final java.lang.String EMBEDDED_TABS_KEY
public static final java.lang.String COMBO_POPUP_PROTOTYPE_DISPLAY_VALUE_KEY
public static final java.lang.String COMBO_RENDERER_IS_BORDER_REMOVABLE
WindowsComboBoxUI.paintCurrentValue(java.awt.Graphics, java.awt.Rectangle, boolean)
,
Constant Field Valuespublic static final java.lang.String HI_RES_DISABLED_ICON_CLIENT_KEY
isHiResGrayFilterEnabled()
,
setHiResGrayFilterEnabled(boolean)
,
HI_RES_GRAY_FILTER_ENABLED_KEY
,
Constant Field Valuespublic static final java.lang.String SELECT_ON_FOCUS_GAIN_CLIENT_KEY
This feature can be set using
setSelectOnFocusGainEnabled(JTextField, Boolean)
.
If you want to avoid to link application code to the JGoodies Looks
library, you can set the client property directly using:
aTextField.putClientProperty("JGoodies.selectAllOnFocusGain", Boolean.TRUE);
setSelectOnFocusGainEnabled(boolean)
,
Constant Field Valuespublic static final java.lang.String INVERT_SELECTION_CLIENT_KEY
You can set the client property using:
aTextField.putClientProperty("JGoodies.invertSelection", Boolean.TRUE);
public static final java.lang.String SET_CARET_TO_START_ON_FOCUS_LOST_CLIENT_KEY
You can set the client property using:
aTextField.putClientProperty("JGoodies.setCaretToStartOnFocusLost", Boolean.TRUE);
public static final java.lang.String NO_REPLACEMENT
Method Detail |
---|
public static boolean getUseSystemFonts()
true
by default unless disabled in the system properties or UIManager.
setUseSystemFonts(boolean)
,
USE_SYSTEM_FONTS_KEY
,
USE_SYSTEM_FONTS_APP_KEY
public static void setUseSystemFonts(boolean useSystemFonts)
useSystemFonts
- true to enable system fonts in the UIManagergetUseSystemFonts()
,
USE_SYSTEM_FONTS_KEY
,
USE_SYSTEM_FONTS_APP_KEY
public static java.awt.Dimension getDefaultIconSize()
setDefaultIconSize(Dimension)
public static void setDefaultIconSize(java.awt.Dimension defaultIconSize)
defaultIconSize
- the default icon size to setgetDefaultIconSize()
public static boolean getUseNarrowButtons()
true
(narrow) for the JGoodies Windows L&F and the JGoodies Plastic
L&F family. The native Windows L&F uses narrow margins too.
The default can be disabled in the system properties or UIManager.
Note: Using narrow button margins can potentially cause
compatibility issues, if you don't take care that command buttons with
short labels (OK) get a reasonable minimum width. Therefore you can
get back to wide button margins using #setUseNarrowButtons
.
Sun's L&F implementations use a wider button margin of 14 pixels.
Narrow button margins make it easier to give buttons in a button bar the same width, even if some button labels are long. And narrow margins are useful for embedded command buttons that just have an icon, or an ellipsis (…). Many style guides recommend to use a minimum button width in command button bars, for example 50 dialog units on Windows. Such a minimum width makes it easier to click a button, just because the button area has a reasonable minimum size. To ensure a reasonable button minimum width, you may configure a LayoutManager, use a special panel for command button bars, or a factory that vends command button bars.
The JGoodies FormLayout can layout button bars that comply with both the MS Windows Layout Guidelines and the Mac Aqua Human Interface Guidelines. The JGoodies Forms contains a ButtonBarBuilder to build command button bars, and a ButtonBarFactory that vends frequently used button bars.
true
(default) if all buttons shall use narrow
margins, false
for wider marginssetUseNarrowButtons(boolean)
,
USE_NARROW_BUTTONS_KEY
public static void setUseNarrowButtons(boolean b)
In previous versions of the JGoodies Looks this setting was supported also for individual buttons - primarily to offer visual backward compatibility with Sun L&Fs.
b
- true to use narrow button margins globallygetUseNarrowButtons()
,
USE_NARROW_BUTTONS_KEY
public static boolean isTabIconsEnabled()
setTabIconsEnabled(boolean)
public static void setTabIconsEnabled(boolean b)
b
- true to enable icons in tabbed panes, false to disable themisTabIconsEnabled()
public static boolean isPopupDropShadowActive()
Currently only the Mac OS X is detected as platform where the toolkit uses native drop shadows.
isPopupDropShadowEnabled()
,
setPopupDropShadowEnabled(boolean)
public static boolean isPopupDropShadowEnabled()
isPopupDropShadowActive()
,
setPopupDropShadowEnabled(boolean)
,
POPUP_DROP_SHADOW_ENABLED_KEY
public static void setPopupDropShadowEnabled(boolean b)
It is recommended to enable this feature only on platforms that accelerate translucency and snapshots with the hardware.
b
- true to enable drop shadows, false to disable themisPopupDropShadowActive()
,
isPopupDropShadowEnabled()
public static boolean isHiResGrayFilterEnabled()
setHiResGrayFilterEnabled(boolean)
,
HI_RES_GRAY_FILTER_ENABLED_KEY
,
HI_RES_DISABLED_ICON_CLIENT_KEY
public static void setHiResGrayFilterEnabled(boolean b)
HI_RES_DISABLED_ICON_CLIENT_KEY
.
b
- true to enable the high-resolution gray filter,
false to disable themisHiResGrayFilterEnabled()
public static boolean isSelectOnFocusGainEnabled()
For all full description and background
see setSelectOnFocusGainEnabled(boolean)
.
SELECT_ON_FOCUS_GAIN_KEY
,
SELECT_ON_FOCUS_GAIN_CLIENT_KEY
public static void setSelectOnFocusGainEnabled(boolean b)
SELECT_ALL_ON_FOCUS_GAIN_CLIENT_KEY
.
It is enabled by default.Background: If users are more likely going to reenter the entire value in a text field, all text shall be selected on focus gain. If users are more likely to edit a text, the caret shall be placed at the end of the text.
b
- true to enable the select all on focus gain,
false to disable this feature globallyisSelectOnFocusGainEnabled()
public static boolean isSelectOnFocusGainActive(javax.swing.text.JTextComponent c)
c
- the component to check
c
or globally,
false if the feature is disabled for c
or globally
disabled.public static java.lang.Boolean getSelectOnFocusGainEnabled(javax.swing.text.JTextComponent c)
c
- the component to check
isSelectOnFocusGainActive(JTextComponent)
public static void setSelectOnFocusGainEnabled(javax.swing.JTextField field, java.lang.Boolean b)
field
- the field to set this featureb
- Boolean.TRUE to enable, Boolean.FALSE to disable,
null to use the global defaultpublic static void putLookAndFeelReplacement(java.lang.String original, java.lang.String replacement)
LookAndFeel
class name in the list of all look and feel replacements.
original
- the name of the look-and-feel to replacereplacement
- the name of the replacement look-and-feelremoveLookAndFeelReplacement(String)
,
getReplacementClassNameFor(String)
public static void removeLookAndFeelReplacement(java.lang.String original)
LookAndFeel
class name from the list of all look and feel replacements.
original
- the name of the look-and-feel that has been replacedputLookAndFeelReplacement(String, String)
,
getReplacementClassNameFor(String)
public static java.lang.String getReplacementClassNameFor(java.lang.String className)
LookAndFeel
class name.
className
- the name of the look-and-feel class
putLookAndFeelReplacement(String, String)
,
removeLookAndFeelReplacement(String)
public static java.lang.String getCrossPlatformLookAndFeelClassName()
LookAndFeel
.
getSystemLookAndFeelClassName()
public static java.lang.String getSystemLookAndFeelClassName()
LookAndFeel
.
getCrossPlatformLookAndFeelClassName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |