Package kiyut.swing.util

## Class MenuFactory

- java.lang.Object
- - kiyut.swing.util.MenuFactory

-     public class MenuFactory
      extends Object

  Factory Method for create JMenuBar using ResourceBundle. Note: a lot of idea adapted from Apache Batik
  Author:
    KIYUT

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Map<String,​Action>` | `actionMap` |
    `protected ResourceBundle` | `bundle` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MenuFactory​(ResourceBundle bundle, Map<String,​Action> actionMap)` | Creates a new instance of MenuFactory

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `configureActionMap​(ResourceBundle bundle, Map<String,​Action> actionMap)` | Configure Action Map based on ResourceBundle
    `protected void` | `configureMenuItem​(JMenuItem item, String name)` | Configure MenuItem.
    `protected List<String>` | `convertToList​(String str)` |
    `protected JCheckBoxMenuItem` | `createJCheckBoxMenuItem​(String name)` |
    `protected JMenu` | `createJMenu​(String name)` | Return JMenu
    `protected JMenuItem` | `createJMenuItem​(String name)` |
    `JMenuBar` | `createMenuBar()` | Return JMenuBar
    `static JMenuBar` | `createMenuBar​(ResourceBundle bundle, Map<String,​Action> actionMap)` | Creates JMenuBar
    `protected JComponent` | `createMenuComponent​(String name)` | Return JComponent
    `JPopupMenu` | `createPopupMenu​(String name)` | Return JPopupMenu
    `static JPopupMenu` | `createPopupMenu​(ResourceBundle bundle, Map<String,​Action> actionMap, String name)` | Creates JPopupMenu

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### bundle

          protected ResourceBundle bundle

    - #### actionMap

          protected Map<String,​Action> actionMap

  - ### Constructor Detail

    - #### MenuFactory

          public MenuFactory​(ResourceBundle bundle,
                             Map<String,​Action> actionMap)

      Creates a new instance of MenuFactory
      Parameters:
        `bundle` - the ResourceBundle
        `actionMap` - map contain action with actionCommand as Key

  - ### Method Detail

    - #### configureActionMap

          public static void configureActionMap​(ResourceBundle bundle,
                                                Map<String,​Action> actionMap)

      Configure Action Map based on ResourceBundle
      Parameters:
        `bundle` - ResourceBundle
        `actionMap` - Map of Actions

    - #### createMenuBar

          public static JMenuBar createMenuBar​(ResourceBundle bundle,
                                               Map<String,​Action> actionMap)

      Creates JMenuBar
      Parameters:
        `bundle` - the ResourceBundle
        `actionMap` - map contain action with actionCommand as Key
      Returns:
        JMenuBar

    - #### createPopupMenu

          public static JPopupMenu createPopupMenu​(ResourceBundle bundle,
                                                   Map<String,​Action> actionMap,
                                                   String name)

      Creates JPopupMenu
      Parameters:
        `bundle` - the ResourceBundle
        `actionMap` - map contain action with actionCommand as Key
        `name` - the property key in the ResourceBundle
      Returns:
        JMenuBar

    - #### createMenuBar

          public JMenuBar createMenuBar()

      Return JMenuBar
      Returns:
        JMenuBar

    - #### createPopupMenu

          public JPopupMenu createPopupMenu​(String name)

      Return JPopupMenu
      Parameters:
        `name` - Property Key
      Returns:
        JPopupMenu

    - #### convertToList

          protected List<String> convertToList​(String str)

    - #### createMenuComponent

          protected JComponent createMenuComponent​(String name)

      Return JComponent
      Parameters:
        `name` - Property Key
      Returns:
        JComponent

    - #### createJMenu

          protected JMenu createJMenu​(String name)

      Return JMenu
      Parameters:
        `name` - name
      Returns:
        JMenu

    - #### createJMenuItem

          protected JMenuItem createJMenuItem​(String name)

    - #### createJCheckBoxMenuItem

          protected JCheckBoxMenuItem createJCheckBoxMenuItem​(String name)

    - #### configureMenuItem

          protected void configureMenuItem​(JMenuItem item,
                                           String name)

      Configure MenuItem. If action is exist, it will using action property instead.
      Parameters:
        `item` - JMenuItem
        `name` - name