|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.AbstractDisposable | +--gumbo.app.MainWindow
A proxy for a Swing top-level window (JFrame, JDialog) that provides a standard GUI consisting of a window with a title bar, menubar, tool bar, status bar, and main content area. Typically used as the "main" window for an application but can also be used as a child window of some owner (subwindow).
The default close operation is to dispose the window, which is generally fine for subwindows, such as dialogs and child windows. Use setDefaultCloseOperation() on this object (not the window graphic) to change the operation (such as WindowConstants.EXIT_ON_CLOSE for the root window of an application).
Constructor Summary | |
MainWindow(java.lang.String name)
Creates an instance. |
|
MainWindow(java.awt.Window window,
java.lang.String name)
Creates an instance. |
Method Summary | |
java.awt.Container |
getContentPane()
Gets the window's content pane. |
javax.swing.JMenuBar |
getMenuBar()
Gets the menu bar. |
javax.swing.JLabel |
getStatusBar()
Gets the status bar. |
java.lang.String |
getStatusText()
Gets the text in the window status bar. |
java.lang.String |
getTitleText()
Gets the text in the window title bar, without the pre-pended app name. |
javax.swing.JToolBar |
getToolBar()
Gets the tool bar. |
java.awt.Window |
getWindowGraphic()
Gets the native graphic implementing the window functionality of this main window. |
java.lang.String |
getWindowName()
Gets the window name used in the title text. |
protected void |
implDispose()
Disposes the window graph, then disposes self. |
protected void |
initWindowGraphic(java.awt.Window graphic)
Initializes the native graphic implementing the window functionality of this main window. |
void |
pack()
Packs the delegate window content into a tight layout making it ready for display, but does not make the window visible. |
void |
setDefaultCloseOperation(int operation)
Sets the default close action of the delegate window. |
void |
setMainArea(java.awt.Component main)
Sets the window main area contents. |
void |
setStatusText(java.lang.String text)
Sets the window status bar text. |
void |
setTitleText(java.lang.String text)
Sets the text in the window title. |
void |
setVisible(boolean visible)
Shows the delegate window, after first packing it if not already displayable, and performs any post-realization processing. |
void |
setWindowName(java.lang.String name)
Sets the window name used in the title bar and error messages, and updates the title bar accordingly. |
static java.lang.String |
showProblemMessage(java.lang.String name,
java.awt.Component parent,
java.lang.String msg,
java.lang.Throwable th)
Shows a dialog as a result of a throw, with the dialog style determined by the throwable type. |
java.lang.String |
showProblemMessage(java.lang.String msg,
java.lang.Throwable th)
Shows a dialog as a result of a throw, with the dialog style determined by the throwable type. |
Methods inherited from class gumbo.util.AbstractDisposable |
dispose, isDisposed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MainWindow(java.lang.String name)
name
- The window name used in the
title bar and error messages. None if null.public MainWindow(java.awt.Window window, java.lang.String name)
window
- The window graphic. Never null.name
- The application name used in the
title bar and error messages. None if null.Method Detail |
public void setDefaultCloseOperation(int operation)
operation
- The operation (WindowConstants.???_ON_CLOSE).public void pack()
public void setVisible(boolean visible)
protected void initWindowGraphic(java.awt.Window graphic)
graphic
- The window graphic (JFrame or JDialog). Never null.public java.awt.Window getWindowGraphic()
public java.awt.Container getContentPane()
public void setWindowName(java.lang.String name)
name
- The window name. None if null.public java.lang.String getWindowName()
public void setTitleText(java.lang.String text)
text
- The text. If null, empty string.public java.lang.String getTitleText()
public void setStatusText(java.lang.String text)
public java.lang.String getStatusText()
public void setMainArea(java.awt.Component main)
public javax.swing.JMenuBar getMenuBar()
public javax.swing.JToolBar getToolBar()
public javax.swing.JLabel getStatusBar()
public java.lang.String showProblemMessage(java.lang.String msg, java.lang.Throwable th)
msg
- The client error message. A newline will be
automatically appended. Null if none.th
- The error object. Null if none.
protected void implDispose()
implDispose
in class AbstractDisposable
public static java.lang.String showProblemMessage(java.lang.String name, java.awt.Component parent, java.lang.String msg, java.lang.Throwable th)
name
- Application name that will appear in the title bar.
Null if none.parent
- Dialog parent component. Null if none.msg
- The client error message. A newline will be
automatically appended. Null if none.th
- The error object. Null if none.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |