Class AbstractPreferencePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ApplicationPreferenceModelPanel, LogPanelPreferencePanel

public abstract class AbstractPreferencePanel extends JPanel
Some basic plumbing for Preference related dialogs. Sub classes have the following responsibilities:
  • Must call this this classes initComponents() method from within the sub-classes constructor, this method laysout the panel and calls the abstract createTreeModel method to initialise the tree of Panels.
  • Must override createTreeModel() method to return a TreeModel whose TreeNodes getUserObject() method will return a JComponent that is displayed as the selected editable Preference panel. This JComponent's .toString() method is used as the title of the preference panel
See Also:
  • Field Details

    • titleLabel

      private final JLabel titleLabel
    • mainPanel

      private final JPanel mainPanel
    • selectedPrefPanel

      private final JPanel selectedPrefPanel
    • okButton

      private final JButton okButton
    • cancelButton

      private final JButton cancelButton
    • okCancelListener

      private ActionListener okCancelListener
    • currentlyDisplayedPanel

      private Component currentlyDisplayedPanel
    • prefTree

      private final JTree prefTree
  • Constructor Details

    • AbstractPreferencePanel

      public AbstractPreferencePanel()
  • Method Details

    • initComponents

      protected void initComponents()
      Setup and layout for the components
    • createTreeModel

      protected abstract TreeModel createTreeModel()
      Returns:
      tree model
    • setDisplayedPrefPanel

      protected void setDisplayedPrefPanel(JComponent panel)
      Ensures a specific panel is displayed in the spot where preferences can be selected.
      Parameters:
      panel -
    • notifyOfLookAndFeelChange

      public void notifyOfLookAndFeelChange()
    • setOkCancelActionListener

      public void setOkCancelActionListener(ActionListener l)
    • hidePanel

      public void hidePanel()
    • getCancelButton

      protected final JButton getCancelButton()
      Returns:
      Returns the cancelButton.
    • getOkButton

      protected final JButton getOkButton()
      Returns:
      Returns the okButton.