Class AcceptCancelPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class AcceptCancelPanel extends JPanel
A JPanel representing a normative sized and aligned Ok and Cancel buttons according on the gvSIG's style sheet. The buttons size is automatically handled as far as the panel is BorderLayout-ed.
Author:
jaume dominguez faus - jaume.dominguez@iver.es
See Also:
  • Constructor Details

    • AcceptCancelPanel

      public AcceptCancelPanel(ActionListener okAction, ActionListener cancelAction)
      Creates a new instance of the panel with the buttons aligned to the right and with the respective action handlers.
      Parameters:
      okAction - , the handler for the ok button clicking.
      cancelAction - , the handler for the cancel button clicking.
    • AcceptCancelPanel

      public AcceptCancelPanel()
      Creates a new instance of the panel with the buttons aligned to the right with no listeners set.
  • Method Details

    • addCancelButtonActionListener

      public void addCancelButtonActionListener(ActionListener l)
      Adds an ActionListener to the cancel button.
      Parameters:
      l -
    • setOkButtonActionListener

      public void setOkButtonActionListener(ActionListener l)
      Sets the ActionListener to the OK button removing any other previous one.
      Parameters:
      l -
    • setCancelButtonActionListener

      public void setCancelButtonActionListener(ActionListener l)
      Sets the ActionListener to the cancel button removing any other previous one.
      Parameters:
      l -
    • addOkButtonActionListener

      public void addOkButtonActionListener(ActionListener l)
      Adds an ActionListener to the OK button.
      Parameters:
      l -
    • getOkButton

      public JButton getOkButton()
      Returns the ok button contained by this panel since resizing issues should be automatically handled by the layout manager. The use of this method is discouraged, it is keeped only for compatibility issues. Try using specific button properties access methods contained by this class instead.
      Returns:
      the Ok button
    • isOkButtonEnabled

      public boolean isOkButtonEnabled()
    • isCancelButtonEnabled

      public boolean isCancelButtonEnabled()
    • setOkButtonEnabled

      public void setOkButtonEnabled(boolean b)
    • setCancelButtonEnabled

      public void setCancelButtonEnabled(boolean b)