com.jgoodies.forms.factories
Interface ComponentFactory

All Known Implementing Classes:
DefaultComponentFactory

public interface ComponentFactory

An interface that defines the factory methods as used by th PanelBuilder and its subclasses.

#createLabel(String) #createTitle(String), an #createSeparator(String, int) can contain an optiona mnemonic marker. The mnemonic and mnemonic index are indicate by a single ampersand (&). For exampl "&Save", or "Save &as" To use the ampersand itself duplicate it, for exampl "Look&&Feel".

Version:
$Revision: 1.10 $
Author:
Karsten Lentzsch
See Also:
DefaultComponentFactory, PanelBuilder

Method Summary
 JButton createButton(Action action)
          Creates and returns a button that is bound to the given Action.
 JLabel createHeaderLabel(String markedText)
          Creates and returns a label intended for pane headers that use a larger font than the control font and a special foreground color.
 JLabel createLabel(String textWithMnemonic)
          Creates and returns a label with an optional mnemonic.
 JLabel createReadOnlyLabel(String textWithMnemonic)
          Creates and returns a label with an optional mnemoni that is intended to label a read-only component.
 JComponent createSeparator(String textWithMnemonic, int alignment)
          Creates and returns a labeled separator.
 JLabel createTitle(String textWithMnemonic)
          Creates and returns a title label that uses the foreground colo and font of a TitledBorder.
 

Method Detail

createButton

JButton createButton(Action action)
Creates and returns a button that is bound to the given Action Useful to return customized buttons, for example, the JGoodie JGButton is bound to some custom Action properties.

Parameters:
action - provides [bound] visual properties for the button
Returns:
the created button
Since:
1.4

createLabel

JLabel createLabel(String textWithMnemonic)
Creates and returns a label with an optional mnemonic.

Parameters:
textWithMnemonic - the label's text may contain an ampersand (&) to mark a mnemonic
Returns:
an label with optional mnemonic

createReadOnlyLabel

JLabel createReadOnlyLabel(String textWithMnemonic)
Creates and returns a label with an optional mnemoni that is intended to label a read-only component.

Parameters:
textWithMnemonic - the label's text may contain an ampersand (&) to mark a mnemonic
Returns:
an label with optional mnemonic intended for read-onl components
Since:
1.3

createTitle

JLabel createTitle(String textWithMnemonic)
Creates and returns a title label that uses the foreground colo and font of a TitledBorder.

Parameters:
textWithMnemonic - the label's text may contain an ampersand (&) to mark a mnemonic
Returns:
an emphasized title label

createHeaderLabel

JLabel createHeaderLabel(String markedText)
Creates and returns a label intended for pane headers that use a larger font than the control font and a special foreground color For example, on the Windows platform this method may use the font size, and color of the TaskDialog main instruction as describe by the MS User Experience Guide.

markedText is "&Charge Codes", the tex will be set to "Charge Codes", the mnemonic is 'C', and th mnemonic index is 0.

createTitle(String).

Parameters:
markedText - the label text with optional mnemonic marker
Returns:
a label intended for pane headers
Since:
1.6

createSeparator

JComponent createSeparator(String textWithMnemonic,
                           int alignment)
Creates and returns a labeled separator. Useful to separat paragraphs in a panel, which is often a better choice than TitledBorder.

Parameters:
textWithMnemonic - the label's text may contain an ampersand (&) to mark a mnemonic
alignment - text alignment, one of SwingConstants.LEFT SwingConstants.CENTER, SwingConstants.RIGHT
Returns:
a title label with separator on the side


Copyright © 2002-2013 JGoodies Software GmbH. All Rights Reserved.