org.geotoolkit.gui.swing
Interface WindowCreator.Handler

Enclosing class:
WindowCreator

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.

Since:
3.12
Version:
3.14
Author:
Martin Desruisseaux (Geomatys)
Module:
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

DEFAULT

static final WindowCreator.Handler DEFAULT
The default implementation. The kind of window created by this implementation depends on the parent of the owner argument:

Method Detail

createWindow

Window createWindow(Component owner,
                    Component content,
                    String title)
Invoked when the given owner needs to create a new window for the given content. This method shall create new windows initialized as below:

Parameters:
owner - The WindowCreator which need to create a new window.
content - The content to put in the window.
title - The window title.
Returns:
The new window.

showDialog

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.

Parameters:
owner - The WindowCreator which need to display a dialog window.
content - The content to put in the dialog wondow.
title - The dialog title.
Returns:
true if the user clicked on the "Ok" button, or false otherwise.

showError

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.

Parameters:
owner - The WindowCreator which need to display a dialog window.
content - The content to put in the dialog wondow.
title - The dialog title.
Since:
3.14


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.