Class ActionPanelPropertiesDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ActionPanelPropertiesDialog extends PropertiesDialog
A PropertiesDialog implementation that uses an ActionPanel on the left to show the categories and subcategories, and a CardLayout on the right to show the corresponding FormPanel for the selected category/subcategory.
Since:
swing-extras 2.8
Author:
scorbo2
See Also:
  • Constructor Details

    • ActionPanelPropertiesDialog

      public ActionPanelPropertiesDialog(Window owner, String title, List<AbstractProperty> properties, boolean addPanelHeaders)
      It's generally preferable to use the create factory methods in the parent PropertiesDialog class, but you can directly instantiate this class if you want.
      Parameters:
      owner - the parent window for this dialog
      title - the title to show in the dialog header
      properties - the list of properties to show in this dialog.
      addPanelHeaders - true to auto-generate a header label for each FormPanel.
  • Method Details

    • getActionPanel

      public ActionPanel getActionPanel()
      There are a crazy number of options for ActionPanel, so rather than write wrapper methods for each of them, we just expose the ActionPanel directly. Refer to the ActionPanel Javadocs for details on what you can do with it, or refer to the built-in demo application to see examples of it in action! You can make cosmetic/styling changes to the ActionPanel before or after showing the dialog. Adding or removing actions or action groups, however, is not recommended - better to leave that to this class.
      Returns:
      The ActionPanel used in this dialog, which you can customize as needed.
    • populateFormPanels

      protected void populateFormPanels()
      In this PropertiesDialog implementation, we will generate a FormPanel for each subcategory, then group those FormPanels together in ActionGroups named after the top-level categories. This is a better style than the "classic" tabbed pane style, particularly for very large properties dialogs with many categories and subcategories. Clicking any subcategory in the ActionPanel on the left will show the corresponding FormPanel on the right.
      Specified by:
      populateFormPanels in class PropertiesDialog
    • initLayout

      protected void initLayout()
      Description copied from class: PropertiesDialog
      Sets up the layout of this dialog and populates formPanelList with the FormPanels to be used in this dialog. Descendant classes must implement this method. The expectation is that the subclass will populate the BorderLayout.CENTER region, but subclasses are also free to install something else in the NORTH, EAST, or WEST regions if they wish. The SOUTH region is reserved for our button panel.
      Specified by:
      initLayout in class PropertiesDialog
    • makeFormPanelVisible

      protected void makeFormPanelVisible(FormPanel formPanel)
      Description copied from class: PropertiesDialog
      This will be invoked by our validation method in the case where a form validation error occurs. Descendant classes must implement this method to make the given FormPanel visible to the user, so that they can see the validation errors and fix them. The details of how to do this will depend on how FormPanels are presented in this dialog, so it is left up to descendant classes.
      Specified by:
      makeFormPanelVisible in class PropertiesDialog
      Parameters:
      formPanel - The FormPanel that contains validation errors that the user needs to fix.