borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.control 

ButtonDialog class

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----java.awt.Window
                           +----java.awt.Dialog
                                   +----borland.jbcl.control.ButtonDialog
                                           +----borland.jbcl.control.ColorChooserDialog
                                           +----borland.jbcl.control.MessageDialog
                                           +----borland.jbcl.control.FontChooserDialog
                                           +----borland.jbcl.control.UserNamePasswordDialog
                                           +----borland.jbcl.control.ExceptionDialog

About the ButtonDialog class

Variables  Constructors  Properties  Methods  Event Listeners

Implements MenuContainer, ActionListener, KeyListener, ImageObserver, Serializable, EventListener

Extends java.awt.Dialog, adding standard buttons and button sets. Extended by JBCL dialog classes. Provides a way to imbed pre-defined buttons and button sets in message boxes and dialog boxes.

The following buttons close the dialog:

The remaining pre-defined buttons do not close the dialog:

Pre-defined button sets
Name of button set Buttons in the button set
OK_CANCEL OK, Cancel
YES_NO Yes, No
YES_NO_CANCEL Yes, No, Cancel
OK_CANCEL_APPLY OK, Cancel, Apply
APPLY_DONE Apply, Done
ALL OK, Yes, No, Cancel, Help, Apply, Done



ButtonDialog variables

Variables implemented in this class

Variables implemented in java.awt.Component

ButtonDialog constructors

ButtonDialog properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.awt.Dialog

Properties implemented in java.awt.Window

Properties implemented in java.lang.Object

ButtonDialog methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.awt.Dialog

Methods implemented in java.awt.Window

Methods implemented in java.lang.Object

ButtonDialog event listeners


ButtonDialog variables

ALL

  public static final int ALL = OK | YES | NO | CANCEL | HELP | APPLY | DONE

APPLY

  public static final int APPLY = 0x040

APPLY_COMMAND

  public static final String APPLY_COMMAND = "apply"

APPLY_DONE

  public static final int APPLY_DONE = APPLY | DONE

CANCEL

  public static final int CANCEL = 0x008

CANCEL_COMMAND

  public static final String CANCEL_COMMAND = "cancel"

DETAILS

  public static final int DETAILS = 0x200

DETAILS_COMMAND

  public static final String DETAILS_COMMAND = "details"

DONE

  public static final int DONE = 0x010

DONE_COMMAND

  public static final String DONE_COMMAND = "done"

HELP

  public static final int HELP = 0x020

HELP_COMMAND

  public static final String HELP_COMMAND = "help"

NEXT

  public static final int NEXT = 0x080

NEXT_COMMAND

  public static final String NEXT_COMMAND = "next"

NO

  public static final int NO = 0x004

NONE

  public static final int NONE = 0x000

NONE_COMMAND

  public static final String NONE_COMMAND = "none"

NO_COMMAND

  public static final String NO_COMMAND = "no"

OK

  public static final int OK = 0x001

OK_CANCEL

  public static final int OK_CANCEL = OK | CANCEL

OK_CANCEL_APPLY

  public static final int OK_CANCEL_APPLY = OK | CANCEL | APPLY

OK_COMMAND

  public static final String OK_COMMAND = "ok"

PREVIOUS

  public static final int PREVIOUS = 0x100

PREVIOUS_COMMAND

  public static final String PREVIOUS_COMMAND = "previous"

YES

  public static final int YES = 0x002

YES_COMMAND

  public static final String YES_COMMAND = "yes"

YES_NO

  public static final int YES_NO = YES | NO

YES_NO_CANCEL

  public static final int YES_NO_CANCEL = YES | NO | CANCEL

actionMulticaster

  protected ActionMulticaster actionMulticaster

buttonAlignment

  protected int buttonAlignment

buttonDescriptors

  protected ButtonDescriptor[] buttonDescriptors

buttonPanel

  protected Panel buttonPanel

buttonPanelHolder

  protected Panel buttonPanelHolder

buttonSet

  protected int buttonSet

centered

  protected boolean centered

enterOK

  protected boolean enterOK

labels

  protected String[] labels

result

  protected ButtonDescriptor result

ButtonDialog constructors

ButtonDialog(java.awt.Frame)

  protected ButtonDialog(java.awt.Frame frame)

Constructs a ButtonDialog.

The following parameters apply to the various ButtonDialog constructors.

Parameters

frame
The host frame for the dialog.
title
The text to display in the title bar of the dialog.
modal
Whether the user must dismiss the dialog before using the rest of the program's UI.
centerPanel
The component which the button set should be centered in, or centered relative to.
buttonPanel
The specific panel in which to place the button set.
buttonDescriptors
An array of button descriptor objects. A button descriptor stores the command, label, id, and closeDialog properties for a button.
buttonSet
The int constant to indicate a pre-defined button set to use. See the Pre-defined button sets table in the About section for this class.

ButtonDialog(java.awt.Frame, java.lang.String)

  protected ButtonDialog(java.awt.Frame frame, java.lang.String title)
Constructs a ButtonDialog. See the parameters table above.

ButtonDialog(java.awt.Frame, java.lang.String, boolean, java.awt.Component, java.awt.Panel, borland.jbcl.control.ButtonDescriptor[])

  protected ButtonDialog(java.awt.Frame frame, java.lang.String title, boolean modal, java.awt.Component centerPanel, java.awt.Panel buttonPanel, borland.jbcl.control.ButtonDescriptor[] buttonDescriptors)
Constructs a ButtonDialog. See the parameters table above.

ButtonDialog(java.awt.Frame, java.lang.String, java.awt.Component)

  public ButtonDialog(java.awt.Frame frame, java.lang.String title, java.awt.Component centerPanel)
Constructs a ButtonDialog. See the parameters table above.

ButtonDialog(java.awt.Frame, java.lang.String, java.awt.Component, int)

  protected ButtonDialog(java.awt.Frame frame, java.lang.String title, java.awt.Component centerPanel, int buttonSet)
Constructs a ButtonDialog. See the parameters table above.


ButtonDialog properties

buttonAlignment

 public int getButtonAlignment()
 public void setButtonAlignment(int alignment)

buttonSet

 public int getButtonSet()
 public void setButtonSet(int bs)
Defines the set of buttons to be displayed as a set of OR'ed button bits. Examples:

centered

 public boolean getCentered()
 public void setCentered(boolean c)

enterOK

 public boolean getEnterOK()
 public void setEnterOK(boolean e)

labels

 public String[] getLabels()
 public void setLabels(java.lang.String[] l)
The labels for the buttons actually used, or the whole button set. Setting all buttons signifies a label list for the whole set.

preferredSize

 public Dimension getPreferredSize()

result

 public int getResult()
 public void setResult(int id)

ButtonDialog methods

assureOnScreen()

  protected void assureOnScreen()

buttonFromCommand(java.lang.String)

  public ButtonDescriptor buttonFromCommand(java.lang.String actionCommand)

buttonFromID(int)

  public ButtonDescriptor buttonFromID(int id)

buttonSetToButtonDescriptors(int)

  protected static final ButtonDescriptor[] buttonSetToButtonDescriptors(int buttonSet)

centerOnScreen()

  protected void centerOnScreen()

enableButton(java.lang.String, boolean)

  public void enableButton(java.lang.String actionCommand, boolean enableState)

listenForKeys(java.awt.Component)

  protected void listenForKeys(java.awt.Component comp)

processActionEvent(java.awt.event.ActionEvent)

  protected void processActionEvent(java.awt.event.ActionEvent e)

processWindowEvent(java.awt.event.WindowEvent)

  protected void processWindowEvent(java.awt.event.WindowEvent e)

Overrides: java.awt.Window.processWindowEvent(WindowEvent)

setupButtonLabels()

  protected void setupButtonLabels()

show()

  public void show()

Overrides: java.awt.Dialog.show()


ButtonDialog event listeners

This class is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

action

 public synchronized void addActionListener(java.awt.event.ActionListener l)
 public synchronized void removeActionListener(java.awt.event.ActionListener l)

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener l)
 public synchronized void removeComponentListener(java.awt.event.ComponentListener l)

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener l)
 public void removeContainerListener(java.awt.event.ContainerListener l)

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener l)
 public synchronized void removeFocusListener(java.awt.event.FocusListener l)

key

 public synchronized void addKeyListener(java.awt.event.KeyListener l)
 public synchronized void removeKeyListener(java.awt.event.KeyListener l)

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener l)
 public synchronized void removeMouseListener(java.awt.event.MouseListener l)

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l)
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)

window

 public synchronized void addWindowListener(java.awt.event.WindowListener l)
 public synchronized void removeWindowListener(java.awt.event.WindowListener l)