Class ComponentFactory


  • public class ComponentFactory
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.JCheckBox newCheckBox​(java.util.ResourceBundle bundle, java.lang.String mnemonicAndNameKey)  
      static <T extends java.lang.Enum<T>>
      BeanListComboBox<T>
      newComboBox​(java.lang.Class<T> enumClass, java.lang.String requiredMessage)  
      static <T extends java.lang.Enum<T>>
      BeanListComboBox<T>
      newComboBox​(java.util.List<T> items, java.lang.String requiredMessage)  
      javax.swing.JTextField newFilterField()
      Create a JTextField with an OblongBorder and an IconBorder using the filter icon.
      <T> FilterField<T> newFilterField​(java.util.function.Function<java.lang.String,​java.util.function.Predicate<T>> predicateFactory, int paddingTop, int paddingBottom)
      Create a FilterField with an OblongBorder and an IconBorder using the filter icon.
      static javax.swing.JComponent newFormSeparator​(java.lang.String label)  
      static javax.swing.JMenu newMenu​(java.util.ResourceBundle bundle, java.lang.String mnemonicAndNameKey)  
      static javax.swing.JSeparator newMenuBarSeparator()  
      static javax.swing.JToolBar newMenuToolBar()  
      static javax.swing.JRadioButton[] newRadioButtonGroup​(java.util.ResourceBundle bundle, java.lang.String... mnemonicAndNameKeys)  
      static javax.swing.JComponent newTableSummaryPanel​(java.lang.String mnemonicAndName, javax.swing.JComponent summary)
      Create a component for displaying a summary (e.g.
      static javax.swing.JButton newToolbarButton​(javax.swing.Action action)
      Creates a button for a toolbar.
      static javax.swing.JToggleButton newToolbarToggleButton​(javax.swing.Action action)
      Creates a toggle button for a toolbar.
      static javax.swing.JTextArea newValidationStatusArea​(int rows, java.util.ResourceBundle bundle)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ACCELERATOR_DELIMITER

        public static final java.lang.String ACCELERATOR_DELIMITER
      • TOOLBAR_BUTTON_ACTION_KEY

        public static final java.lang.String TOOLBAR_BUTTON_ACTION_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • ComponentFactory

        public ComponentFactory()
    • Method Detail

      • newRadioButtonGroup

        public static javax.swing.JRadioButton[] newRadioButtonGroup​(java.util.ResourceBundle bundle,
                                                                     java.lang.String... mnemonicAndNameKeys)
      • newCheckBox

        public static javax.swing.JCheckBox newCheckBox​(java.util.ResourceBundle bundle,
                                                        java.lang.String mnemonicAndNameKey)
      • newValidationStatusArea

        public static javax.swing.JTextArea newValidationStatusArea​(int rows,
                                                                    java.util.ResourceBundle bundle)
      • newFormSeparator

        public static javax.swing.JComponent newFormSeparator​(java.lang.String label)
      • newMenuBarSeparator

        public static javax.swing.JSeparator newMenuBarSeparator()
      • newMenuToolBar

        public static javax.swing.JToolBar newMenuToolBar()
      • newToolbarToggleButton

        public static javax.swing.JToggleButton newToolbarToggleButton​(javax.swing.Action action)
        Creates a toggle button for a toolbar. Sets the button's tooltip text using the button's text and accelerator.
        Parameters:
        action - the button action (should have text and an icon)
        Returns:
        the new button
        See Also:
        Action.ACCELERATOR_KEY
      • newToolbarButton

        public static javax.swing.JButton newToolbarButton​(javax.swing.Action action)
        Creates a button for a toolbar. Sets the button's tooltip text using the action's text and accelerator key.
        Parameters:
        action - the button action (should have text and an icon)
        Returns:
        a new non-focusable button with null text
        See Also:
        Action.ACCELERATOR_KEY
      • newMenu

        public static javax.swing.JMenu newMenu​(java.util.ResourceBundle bundle,
                                                java.lang.String mnemonicAndNameKey)
      • newFilterField

        public javax.swing.JTextField newFilterField()
        Create a JTextField with an OblongBorder and an IconBorder using the filter icon.
      • newFilterField

        public <T> FilterField<T> newFilterField​(java.util.function.Function<java.lang.String,​java.util.function.Predicate<T>> predicateFactory,
                                                 int paddingTop,
                                                 int paddingBottom)
        Create a FilterField with an OblongBorder and an IconBorder using the filter icon.
        Parameters:
        predicateFactory - filter string parser
        paddingTop - padding between top of border and input field
        paddingBottom - padding between bottom of border and input field
      • newTableSummaryPanel

        public static javax.swing.JComponent newTableSummaryPanel​(java.lang.String mnemonicAndName,
                                                                  javax.swing.JComponent summary)
        Create a component for displaying a summary (e.g. total) at the bottom of a table. The right border will provide an offset to account for a vertical scroll bar on the table.
        Parameters:
        mnemonicAndName - label for the summary
        summary - the summary information
        Returns:
        a component with the label and summary on the right
      • newComboBox

        public static <T extends java.lang.Enum<T>> BeanListComboBox<T> newComboBox​(java.lang.Class<T> enumClass,
                                                                                    java.lang.String requiredMessage)
      • newComboBox

        public static <T extends java.lang.Enum<T>> BeanListComboBox<T> newComboBox​(java.util.List<T> items,
                                                                                    java.lang.String requiredMessage)