|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface WindowCreator.Handler
Creates new Windows for the purpose of widgets extending
WindowCreator. The widget will typically use this handler as below:
public class Widget extends WindowCreator {
private JPanel accessoryContent = ...;
private Window accessoryWindow;
void showAccessoryInformation() {
accessoryContent... // Do some update here
if (accessoryWindow == null) {
accessoryWindow = getWindowHandler().createWindow(this, accessoryContent, title);
}
accessoryWindow.setVisible(true);
}
}
The default handler will create new windows of kind
JDialog, JFrame or JInternalFrame. However users can provide
a different handler to WindowCreator, for example in order to integrate the
windows with the NetBeans platform.
| display/geotk-widgets-swing (download) | View source code for this class |
| Field Summary | |
|---|---|
static WindowCreator.Handler |
DEFAULT
The default implementation. |
| Method Summary | |
|---|---|
Window |
createWindow(Component owner,
Component content,
String title)
Invoked when the given owner needs to create a new window for the given
content. |
boolean |
showDialog(Component owner,
Component content,
String title)
Shows the given content in a modal dialog with "Ok" and "Cancel" buttons, and wait for the user to close the dialog. |
void |
showError(Component owner,
Component content,
String title)
Shows an error message in a modal dialog with "Ok" button, and wait for the user to close the dialog. |
| Field Detail |
|---|
static final WindowCreator.Handler DEFAULT
owner argument:
JDesktopPane, then the content is added into a
JInternalFrame.JFrame or a JDialog, then the content is
added into a JDialog.JFrame.
| Method Detail |
|---|
Window createWindow(Component owner,
Component content,
String title)
owner needs to create a new window for the given
content. This method shall create new windows initialized as below:
Window.setVisible(boolean) in order to make it visible.DISPOSE_ON_CLOSE.
owner - The WindowCreator which need to create a new window.content - The content to put in the window.title - The window title.
boolean showDialog(Component owner,
Component content,
String title)
owner - The WindowCreator which need to display a dialog window.content - The content to put in the dialog wondow.title - The dialog title.
true if the user clicked on the "Ok" button, or
false otherwise.
void showError(Component owner,
Component content,
String title)
owner - The WindowCreator which need to display a dialog window.content - The content to put in the dialog wondow.title - The dialog title.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||