Class EntityPanel.Config

java.lang.Object
is.codion.swing.framework.ui.EntityPanel.Config
Enclosing class:
EntityPanel

public static final class EntityPanel.Config extends Object
Contains configuration settings for a EntityPanel which must be set before the panel is initialized.
  • Field Details

    • USE_KEYBOARD_NAVIGATION

      public static final PropertyValue<Boolean> USE_KEYBOARD_NAVIGATION
      Indicates whether keyboard navigation will be enabled
      Value type: Boolean
      Default value: true
    • DISPOSE_EDIT_DIALOG_ON_ESCAPE

      public static final PropertyValue<Boolean> DISPOSE_EDIT_DIALOG_ON_ESCAPE
      Indicates whether entity edit panel dialogs should be closed on escape
      Value type: Boolean
      Default value: true
    • INCLUDE_TOGGLE_EDIT_PANEL_CONTROL

      public static final PropertyValue<Boolean> INCLUDE_TOGGLE_EDIT_PANEL_CONTROL
      Specifies whether a control for toggling the edit panel is available to the user
      Value type: Boolean
      Default value: true
    • TOOLBAR_CONTROLS

      public static final PropertyValue<Boolean> TOOLBAR_CONTROLS
      Specifies whether the edit controls (Save, update, delete, clear, refresh) should be on a toolbar instead of a button panel
      Value type: Boolean
      Default value: false
    • WINDOW_TYPE

      public static final PropertyValue<EntityPanel.WindowType> WINDOW_TYPE
      Specifies how detail and edit panels should be displayed.
      Value type: EntityPanel.WindowType
      Default value: EntityPanel.WindowType.DIALOG
    • CONTROL_PANEL_CONSTRAINTS

      public static final PropertyValue<String> CONTROL_PANEL_CONSTRAINTS
      Specifies where the control panel should be placed in a BorderLayout
      Value type: Boolean
      Default value: BorderLayout.EAST
      See Also:
    • CONTROL_TOOLBAR_CONSTRAINTS

      public static final PropertyValue<String> CONTROL_TOOLBAR_CONSTRAINTS
      Specifies where the control toolbar should be placed in a BorderLayout
      Value type: Boolean
      Default value: BorderLayout.WEST
      See Also:
    • INCLUDE_CONTROLS

      public static final PropertyValue<Boolean> INCLUDE_CONTROLS
      Specifies whether entity panels should include controls by default
      Value type: Boolean
      Default value: true
    • KEYBOARD_SHORTCUTS

      public static final KeyboardShortcuts<EntityPanel.KeyboardShortcut> KEYBOARD_SHORTCUTS
      The default keyboard shortcut keyStrokes.
  • Method Details

    • entityPanel

      public EntityPanel entityPanel()
      Returns:
      the entity panel
    • caption

      public EntityPanel.Config caption(String caption)
      Parameters:
      caption - the caption to use when presenting this panel
      Returns:
      this Config instance
    • description

      public EntityPanel.Config description(String description)
      Parameters:
      description - the description to use when presenting this panel
      Returns:
      this Config instance
    • icon

      public EntityPanel.Config icon(ImageIcon icon)
      Parameters:
      icon - the icon to use when presenting this panel
      Returns:
      this Config instance
    • detailLayout

      public EntityPanel.Config detailLayout(Function<EntityPanel,EntityPanel.DetailLayout> detailLayout)
      Parameters:
      detailLayout - provides the detail panel layout
      Returns:
      this Config instance
    • toolbarControls

      public EntityPanel.Config toolbarControls(boolean toolbarControls)
      Parameters:
      toolbarControls - true if the edit controls should be on a toolbar instead of a button panel
      Returns:
      this Config instance
      See Also:
    • controlComponentConstraints

      public EntityPanel.Config controlComponentConstraints(String controlComponentConstraints)
      Sets the layout constraints to use for the control panel
       The default layout is as follows (BorderLayout.WEST):
       __________________________________
       |   edit panel           |control|
       |  (EntityEditPanel)     | panel | } editControlPanel
       |________________________|_______|
      
       With (BorderLayout.SOUTH):
       __________________________
       |         edit           |
       |        panel           |
       |________________________| } editControlPanel
       |     control panel      |
       |________________________|
      
       etc.
       
      Parameters:
      controlComponentConstraints - the controls component layout constraints (BorderLayout constraints)
      Returns:
      this Config instance
      Throws:
      IllegalArgumentException - in case the given constraint is not one of BorderLayout.SOUTH, NORTH, EAST or WEST
    • includeToggleEditPanelControl

      public EntityPanel.Config includeToggleEditPanelControl(boolean includeToggleEditPanelControl)
      Parameters:
      includeToggleEditPanelControl - true if a control for toggling the edit panel should be included
      Returns:
      this Config instance
    • includeControls

      public EntityPanel.Config includeControls(boolean includeControls)
      Parameters:
      includeControls - true if the edit and table panel controls should be included
      Returns:
      this Config instance
    • useKeyboardNavigation

      public EntityPanel.Config useKeyboardNavigation(boolean useKeyboardNavigation)
      Parameters:
      useKeyboardNavigation - true if keyboard navigation should be enabled
      Returns:
      this Config instance
    • windowType

      public EntityPanel.Config windowType(EntityPanel.WindowType windowType)
      Parameters:
      windowType - the window type to use when presenting panels
      Returns:
      this Config instance
      See Also:
    • keyStrokes

      Parameters:
      shortcuts - provides this panels KeyboardShortcuts instance.
      Returns:
      this Config instance
    • editPanelState

      public EntityPanel.Config editPanelState(EntityPanel.PanelState editPanelState)
      Parameters:
      editPanelState - the initial edit panel state
      Returns:
      this Config instance
    • disposeEditDialogOnEscape

      public EntityPanel.Config disposeEditDialogOnEscape(boolean disposeEditDialogOnEscape)
      Parameters:
      disposeEditDialogOnEscape - specifies whether entity edit panel dialogs should be closed on escape
      Returns:
      this Config instance