|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.tool.ToolDialog
public abstract class ToolDialog
Lightweight wrapper class to provide standard support for tool dialogs. Dialogs have a title, optional menu bar, a body, and an optional set of buttons, including a default button. The actual dialog displayed may be a JDialog, or a JInternalFrame, depending on the current desktop.
Nested Class Summary | |
---|---|
class |
ToolDialog.Restorer
|
Field Summary | |
---|---|
protected java.awt.Component |
parent
Parent component of this dialog. |
protected Tool |
tool
Parent tool of this dialog. |
protected UIFactory |
uif
Factory associated with this dialog instance. |
Constructor Summary | |
---|---|
protected |
ToolDialog(java.awt.Component parent,
UIFactory uif,
java.lang.String uiKey)
Create a ToolDialog. |
Method Summary | |
---|---|
protected void |
disableDefaultDisposeHandler()
By default disposing tool leads closing tool's ToolDialogs. |
void |
dispose()
Dispose of any window system resources used by the dialog. |
protected java.awt.Container |
getBody()
Get the component for the main body of the dialog. |
protected javax.swing.JButton[] |
getButtons()
Get the buttons from the button bar at the bottom of the dialog. |
protected javax.swing.JButton |
getDefaultButton()
Get the default button from the button bar at the bottom of the dialog. |
java.awt.Container |
getDialogParent()
Get a parent component for a dialog to use. |
protected javax.swing.JMenuBar |
getJMenuBar()
Get the menu bar for the dialog. |
protected java.awt.Point |
getLocation()
Get the location of the dialog. |
protected ToolDialog.Restorer |
getRestorer()
|
protected java.awt.Dimension |
getSize()
Get the size of the dialog. |
protected java.lang.String |
getTitle()
Get the title for the dialog. |
Tool |
getTool()
Get the tool for which this is a dialog. |
protected abstract void |
initGUI()
Initialize the GUI, by calling the various setXXX methods. |
boolean |
isShowing()
Check if the dialog is currently showing on the screen. |
boolean |
isVisible()
Check if the dialog is currently showing on the screen. |
void |
pack()
packs the dialog. |
protected void |
setBody(java.awt.Container body)
Set the component for the main body of the dialog. |
protected void |
setButtons(javax.swing.JButton[] buttons,
javax.swing.JButton defaultButton)
Set the buttons to appear in a button bar at the bottom of the dialog. |
protected void |
setComponentListener(java.awt.event.ComponentListener l)
Set a ComponentListener to be registered on the dialog. |
protected void |
setDefaultCloseOperation(int operation)
This method add to allow subclasses of ToolDialog to change default close operation. |
protected void |
setHelp(java.lang.String helpID)
Set the help ID for the dialog. |
protected void |
setI18NTitle(java.lang.String key)
Specify the title for the dialog. |
protected void |
setI18NTitle(java.lang.String key,
java.lang.Object arg)
Specify the title for the dialog. |
protected void |
setI18NTitle(java.lang.String key,
java.lang.Object[] args)
Specify the title for the dialog. |
protected void |
setJMenuBar(javax.swing.JMenuBar menuBar)
Set the menu bar for the dialog. |
protected void |
setLocation(int x,
int y)
Set the location of the dialog. |
protected void |
setLocation(java.awt.Point p)
Set the location of the dialog. |
protected void |
setRestorer(ToolDialog.Restorer restorer)
|
protected void |
setSize(java.awt.Dimension d)
Set the size of the dialog. |
protected void |
setSize(int width,
int height)
Set the size of the dialog. |
void |
setVisible(boolean b)
Specify whether the dialog should be made visible on the screen or not. |
protected void |
windowClosingAction(java.awt.AWTEvent e)
this method invokes in Window/JInternalFrame listener (depends on dialog variable instance). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.awt.Component parent
protected final UIFactory uif
protected final Tool tool
Constructor Detail |
---|
protected ToolDialog(java.awt.Component parent, UIFactory uif, java.lang.String uiKey)
parent
- The parent component of this dialog.uif
- Factory instance associated with this dialoguiKey
- Key to use to get strings and other properties for this
dialog.Method Detail |
---|
public Tool getTool()
public boolean isShowing()
isVisible()
,
setVisible(boolean)
public boolean isVisible()
setVisible(boolean)
public void pack()
setVisible(boolean)
setVisible(boolean)
public void setVisible(boolean b)
b
- True if the dialog should be made visible, false if is should
be made invisible.isVisible()
public void dispose()
public java.awt.Container getDialogParent()
protected abstract void initGUI()
protected java.lang.String getTitle()
setI18NTitle(java.lang.String)
protected void setI18NTitle(java.lang.String key)
key
- key to use to retrieve the dialogs titlegetTitle()
protected void setI18NTitle(java.lang.String key, java.lang.Object arg)
key
- key to use to retrieve the dialogs titlearg
- item to substitute into the title from the resource bundlegetTitle()
protected void setI18NTitle(java.lang.String key, java.lang.Object[] args)
key
- key to use to retrieve the dialogs titleargs
- items to substitute into the title from the resource bundlegetTitle()
protected void setHelp(java.lang.String helpID)
helpID
- the help identifier for this dialogprotected javax.swing.JMenuBar getJMenuBar()
setJMenuBar(javax.swing.JMenuBar)
protected void setJMenuBar(javax.swing.JMenuBar menuBar)
menuBar
- The menu bar for this dialog; should not be null.getJMenuBar()
protected java.awt.Container getBody()
setBody(java.awt.Container)
protected void setBody(java.awt.Container body)
body
- the body container that should be used by this dialoggetBody()
protected javax.swing.JButton[] getButtons()
setButtons(javax.swing.JButton[], javax.swing.JButton)
protected javax.swing.JButton getDefaultButton()
setButtons(javax.swing.JButton[], javax.swing.JButton)
protected void setButtons(javax.swing.JButton[] buttons, javax.swing.JButton defaultButton)
buttons
- buttons to usedefaultButton
- button from the previous argument which should be
used as the defaultgetButtons()
,
getDefaultButton()
protected void setComponentListener(java.awt.event.ComponentListener l)
l
- listener to attach to this componentprotected java.awt.Dimension getSize()
setSize(java.awt.Dimension)
protected void setSize(java.awt.Dimension d)
d
- the new size of this dialoggetSize()
protected void setSize(int width, int height)
width
- the new width of this dialogheight
- the new height of this dialoggetSize()
protected java.awt.Point getLocation()
setLocation(java.awt.Point)
protected void setLocation(java.awt.Point p)
p
- the new location of this dialoggetLocation()
protected void setLocation(int x, int y)
x
- - the x-coordinate of the new location's top-left corner in the parent's coordinate spacey
- - the y-coordinate of the new location's top-left corner in the parent's coordinate spacegetLocation()
protected void setDefaultCloseOperation(int operation)
operation
- one of WindowConstants used by JDialog/JInternalFrame
setDefaultCloseOperation methodprotected void windowClosingAction(java.awt.AWTEvent e)
protected void disableDefaultDisposeHandler()
protected ToolDialog.Restorer getRestorer()
protected void setRestorer(ToolDialog.Restorer restorer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |