DynamicJava Javadoc: Class ButtonFactory

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## koala.dynamicjava.gui.resource
Class ButtonFactory

    java.lang.Object
      |
      +--koala.dynamicjava.gui.resource.ResourceManager
            |
            +--koala.dynamicjava.gui.resource.ButtonFactory

public class ButtonFactory
extends ResourceManager

This class represents a button factory which builds buttons from the content of a resource bundle.
The resource entries format is (for a button named 'Button'):

       Button.text      = text
       Button.icon      = icon_name
       Button.mnemonic  = mnemonic
       Button.action    = action_name
       Button.selected  = true | false
       Button.tooltip   = tool tip text
     where
       text, icon_name and action_name are strings
       mnemonic is a character

Fields inherited from class koala.dynamicjava.gui.resource.ResourceManager
`bundle`

Constructor Summary
`ButtonFactory(java.util.ResourceBundle rb, ActionMap am)` Creates a new button factory

Method Summary
`javax.swing.JButton` | `createJButton(java.lang.String name)` Creates and returns a new swing button
`javax.swing.JCheckBox` | `createJCheckBox(java.lang.String name)` Creates and returns a new swing check box
`javax.swing.JRadioButton` | `createJRadioButton(java.lang.String name)` Creates and returns a new swing radio button

Methods inherited from class koala.dynamicjava.gui.resource.ResourceManager
`getBoolean, getInteger, getString, getStringList, getStringList, getStringList`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ButtonFactory

    public ButtonFactory(java.util.ResourceBundle rb,
                         ActionMap am)

  Creates a new button factory
  Parameters:
    `rb` - the resource bundle that contains the buttons description.
    `am` - the actions to bind to the button

Method Detail

### createJButton

    public javax.swing.JButton createJButton(java.lang.String name)
                                      throws java.util.MissingResourceException,
                                             ResourceFormatException,
                                             MissingListenerException

  Creates and returns a new swing button
  Parameters:
    `name` - the name of the button in the resource bundle
  Throws:
    `java.util.MissingResourceException` - if key is not the name of a button. It is not thrown if the mnemonic and the action keys are missing
    `ResourceFormatException` - if the mnemonic is not a single character
    `MissingListenerException` - if the button action is not found in the action map

### createJRadioButton

    public javax.swing.JRadioButton createJRadioButton(java.lang.String name)
                                                throws java.util.MissingResourceException,
                                                       ResourceFormatException,
                                                       MissingListenerException

  Creates and returns a new swing radio button
  Parameters:
    `name` - the name of the button in the resource bundle
  Throws:
    `java.util.MissingResourceException` - if key is not the name of a button. It is not thrown if the mnemonic and the action keys are missing
    `ResourceFormatException` - if the mnemonic is not a single character
    `MissingListenerException` - if the button action is not found in the action map

### createJCheckBox

    public javax.swing.JCheckBox createJCheckBox(java.lang.String name)
                                          throws java.util.MissingResourceException,
                                                 ResourceFormatException,
                                                 MissingListenerException

  Creates and returns a new swing check box
  Parameters:
    `name` - the name of the button in the resource bundle
  Throws:
    `java.util.MissingResourceException` - if key is not the name of a button. It is not thrown if the mnemonic and the action keys are missing
    `ResourceFormatException` - if the mnemonic is not a single character
    `MissingListenerException` - if the button action is not found in the action map

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Stephane Hillion. All Rights Reserved.