nextapp.echo
Class Window

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by nextapp.echo.Window
All Implemented Interfaces:
java.io.Serializable, Component

public class Window
extends AbstractComponent

A top-level window.

See Also:
Serialized Form

Field Summary
static int DISPOSE_ON_CLOSE
          A value for the DefaultCloseOperation property that indicates the window should be disposed when a user clicks its close button.
static int DO_NOTHING_ON_CLOSE
          A value for the DefaultCloseOperation property that indicates the window should not take any action when closed.
static java.lang.String HEIGHT_CHANGED_PROPERTY
           
static int HIDE_ON_CLOSE
          A value for the DefaultCloseOperation property that indicates the window should be hidden when a user clicks its close button.
static int SIZE_UNKNOWN
          Deprecated. Use EchoConstants.UNDEFINED_SIZE.
static java.lang.String STYLE_DEFAULT_CLOSE_OPERATION
          A style constant for the DefaultCloseOperation property.
static java.lang.String STYLE_HEIGHT
          A style constant for the Height property.
static java.lang.String STYLE_WIDTH
          A style constant for the Width property.
static java.lang.String TITLE_CHANGED_PROPERTY
           
static java.lang.String WIDTH_CHANGED_PROPERTY
           
static java.lang.String Z_INDEX_CHANGED_PROPERTY
           
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
Window()
          Creates a Window.
Window(java.lang.String title)
          Creates a Window with the specified title.
 
Method Summary
 void add(Component c, int index)
          Adds the specified Component as the nth child All component add operations use this method to add components.
 void addWindowListener(WindowListener l)
          Adds a WindowListener to the window.
 void applyStyle(Style style)
          Sets stylistic properties of this component based on a Style object.
 void dispose()
          Destroys the window.
 AbstractPane getContent()
          Returns the content of this Window.
 int getDefaultCloseOperation()
          Returns the operation that will happen by default if the user closes the window.
 EchoInstance getEchoInstance()
          Returns the EchoInstance object to which this window belongs.
 int getHeight()
          Returns the height of the window.
 java.util.Locale getLocale()
          Overrides Component.getLocale() such that the applciation's locale is returned if this Window's locale is not set.
 java.lang.String getTitle()
          Returns the window title.
 int getWidth()
          Returns the width of the window.
 void removeWindowListener(WindowListener l)
          Removes a WindowListener from the window.
 void setContent(AbstractPane newValue)
          Sets the content of the window.
 void setDefaultCloseOperation(int defaultCloseOperation)
          Sets the operation that will happen by default if the user closes the window.
 void setHeight(int newValue)
          Sets the height of the window.
 void setTitle(java.lang.String newValue)
          Sets the window title.
 void setWidth(int newValue)
          Sets the width of the window.
 void toBack()
          Brings the window to the back, such that it is obscured by any other browser windows.
 void toFront()
          Brings the window to the front, such that it is not obscured by any other browser windows.
 void userClose()
          Informs the window that the user has attempted to close it.
 
Methods inherited from class nextapp.echo.AbstractComponent
add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getFont, getForeground, getIdentifier, getListenerList, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setFont, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_DEFAULT_CLOSE_OPERATION

public static final java.lang.String STYLE_DEFAULT_CLOSE_OPERATION
A style constant for the DefaultCloseOperation property.

See Also:
Constant Field Values

STYLE_HEIGHT

public static final java.lang.String STYLE_HEIGHT
A style constant for the Height property.

See Also:
Constant Field Values

STYLE_WIDTH

public static final java.lang.String STYLE_WIDTH
A style constant for the Width property.

See Also:
Constant Field Values

SIZE_UNKNOWN

public static final int SIZE_UNKNOWN
Deprecated. Use EchoConstants.UNDEFINED_SIZE.
A constant used to specify an unknown grid cell width or height.

See Also:
Constant Field Values

DO_NOTHING_ON_CLOSE

public static final int DO_NOTHING_ON_CLOSE
A value for the DefaultCloseOperation property that indicates the window should not take any action when closed. If a user clicks the close button on a window and its WindowListeners take no action, the window will remain open.

See Also:
Constant Field Values

HIDE_ON_CLOSE

public static final int HIDE_ON_CLOSE
A value for the DefaultCloseOperation property that indicates the window should be hidden when a user clicks its close button. This DefaultCloseOperation is equivalent to calling Window.setVisible(false).

See Also:
Constant Field Values

DISPOSE_ON_CLOSE

public static final int DISPOSE_ON_CLOSE
A value for the DefaultCloseOperation property that indicates the window should be disposed when a user clicks its close button. This DefaultCloseOperation is equivalent to calling Window.dispose().

See Also:
Constant Field Values

HEIGHT_CHANGED_PROPERTY

public static final java.lang.String HEIGHT_CHANGED_PROPERTY
See Also:
Constant Field Values

WIDTH_CHANGED_PROPERTY

public static final java.lang.String WIDTH_CHANGED_PROPERTY
See Also:
Constant Field Values

TITLE_CHANGED_PROPERTY

public static final java.lang.String TITLE_CHANGED_PROPERTY
See Also:
Constant Field Values

Z_INDEX_CHANGED_PROPERTY

public static final java.lang.String Z_INDEX_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

Window

public Window()
Creates a Window.


Window

public Window(java.lang.String title)
Creates a Window with the specified title.

Parameters:
title - The window title.
Method Detail

add

public void add(Component c,
                int index)
Description copied from interface: Component
Adds the specified Component as the nth child All component add operations use this method to add components. Components that require notification of all child additions should override this method (making sure to call the superclass' implementation).

Specified by:
add in interface Component
Overrides:
add in class AbstractComponent
Parameters:
c - The child component to add.
index - The index at which to add the child component, or -1 to add the component at the end.
See Also:
Component.add(Component, int)

addWindowListener

public void addWindowListener(WindowListener l)
Adds a WindowListener to the window.

Parameters:
l - The WindowListener to be added.

applyStyle

public void applyStyle(Style style)
Description copied from interface: Component
Sets stylistic properties of this component based on a Style object. The version of this method in Component will set foreground and background colors and the font from the style if they are present. Components should override this method if they allow more properties to be set from a style object, and should call super.applyStyle() if necessary.

Specified by:
applyStyle in interface Component
Overrides:
applyStyle in class AbstractComponent
Parameters:
style - The style object from which to retrieve properties for this Component.
See Also:
Component.applyStyle(Style)

dispose

public void dispose()
Destroys the window. Identical to calling EchoInstance.removeWindow().


getContent

public final AbstractPane getContent()
Returns the content of this Window.

Returns:
A ContentPane or ContainerPane that is the content of this window.

getEchoInstance

public EchoInstance getEchoInstance()
Returns the EchoInstance object to which this window belongs.

Specified by:
getEchoInstance in interface Component
Overrides:
getEchoInstance in class AbstractComponent
Returns:
The EchoInstance object to which this window belongs.

getHeight

public int getHeight()
Returns the height of the window.

Returns:
The inside height of the window, in pixels.

getLocale

public java.util.Locale getLocale()
Overrides Component.getLocale() such that the applciation's locale is returned if this Window's locale is not set.

Specified by:
getLocale in interface Component
Overrides:
getLocale in class AbstractComponent
Returns:
The locale for this component, or if it has none, the application's locale.

getDefaultCloseOperation

public int getDefaultCloseOperation()
Returns the operation that will happen by default if the user closes the window.

Returns:
The default close operation, one of the following values:
  • DO_NOTHING_ON_CLOSE: Do not dispose or hide the window. Instead, registered window listeners should handle the closing of the window if necessary in the windowClosing() method.
  • HIDE_ON_CLOSE: Hide the window.
  • DISPOSE_ON_CLOSE: Dispose of the window.

getTitle

public java.lang.String getTitle()
Returns the window title.

Returns:
The title of the window.

getWidth

public int getWidth()
Returns the width of the window.

Returns:
The inside width of the window, in pixels.

toBack

public void toBack()
Brings the window to the back, such that it is obscured by any other browser windows.


toFront

public void toFront()
Brings the window to the front, such that it is not obscured by any other browser windows.


removeWindowListener

public void removeWindowListener(WindowListener l)
Removes a WindowListener from the window.

Parameters:
l - The WindowListener to be removed.

setContent

public final void setContent(AbstractPane newValue)
Sets the content of the window.

Parameters:
newValue - a ContainerPane or ContentPane that holds content.

setDefaultCloseOperation

public void setDefaultCloseOperation(int defaultCloseOperation)
Sets the operation that will happen by default if the user closes the window.

Parameters:
defaultCloseOperation - The default close operation, one of the following values:
  • DO_NOTHING_ON_CLOSE: Do not dispose or hide the window. Instead, registered window listeners should handle the closing of the window if necessary in the windowClosing() method.
  • HIDE_ON_CLOSE: Hide the window.
  • DISPOSE_ON_CLOSE: Dispose of the window.

setHeight

public void setHeight(int newValue)
Sets the height of the window.

Parameters:
newValue - The inside height of the window, in pixels.

setTitle

public void setTitle(java.lang.String newValue)
Sets the window title.

Parameters:
newValue - The title of the window.

setWidth

public void setWidth(int newValue)
Sets the width of the window.

Parameters:
newValue - The inside width of the window, in pixels.

userClose

public void userClose()
Informs the window that the user has attempted to close it.