java.lang.Object | |
↳ | com.google.gwt.user.client.Window |
This class provides access to the browser window's methods, properties, and events.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Window.ClosingEvent | Fired just before the browser window closes or navigates to a different site. | ||||||||||
Window.ClosingHandler | Handler for Window.ClosingEvent events. |
||||||||||
Window.Location | This class provides access to the browser's location's object. | ||||||||||
Window.Navigator | This class provides access to the browser's navigator object. | ||||||||||
Window.ScrollEvent | Fired when the browser window is scrolled. | ||||||||||
Window.ScrollHandler | Handler for Window.ScrollEvent events. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a
CloseEvent handler. | |||||||||||
Adds a
ResizeEvent handler. | |||||||||||
This method is deprecated.
use
addWindowClosingHandler(ClosingHandler) and
addCloseHandler(CloseHandler) instead | |||||||||||
Adds a
Window.ClosingEvent handler. | |||||||||||
This method is deprecated.
use
addResizeHandler(ResizeHandler) instead
| |||||||||||
Adds a
Window.ScrollEvent handler. | |||||||||||
This method is deprecated.
use
addWindowScrollHandler(ScrollHandler)
instead
| |||||||||||
Displays a message in a modal dialog box.
| |||||||||||
Displays a message in a modal dialog box, along with the standard 'OK' and
'Cancel' buttons.
| |||||||||||
Use this method to explicitly disable the window's scrollbars.
| |||||||||||
Gets the height of the browser window's client area excluding the scroll
bar.
| |||||||||||
Gets the width of the browser window's client area excluding the vertical
scroll bar.
| |||||||||||
Gets the window's scroll left.
| |||||||||||
Get the window's scroll top.
| |||||||||||
Gets the browser window's current title.
| |||||||||||
Moves a window's left and top edge to a specified number of pixels relative
to its current coordinates.
| |||||||||||
Moves a window's left and top edge to the specified coordinates.
| |||||||||||
Opens a new browser window.
| |||||||||||
Prints the document in the window, as if the user had issued a "Print"
command.
| |||||||||||
Displays a request for information in a modal dialog box, along with the
standard 'OK' and 'Cancel' buttons.
| |||||||||||
Removes a window closing listener.
| |||||||||||
Removes a window resize listener.
| |||||||||||
Removes a window scroll listener.
| |||||||||||
Resizes the window by the specified width and height.
| |||||||||||
Resizes the window to the specified width and height.
| |||||||||||
Scroll the window to the specified position.
| |||||||||||
Sets the size of the margins used within the window's client area.
| |||||||||||
Sets the status text for the window, if permitted by the browser's
settings.
| |||||||||||
Sets the browser window's title.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method is deprecated.
use addWindowClosingHandler(ClosingHandler)
and
addCloseHandler(CloseHandler)
instead
Adds a listener to receive window closing events.
listener | the listener to be informed when the window is closing |
---|
Adds a Window.ClosingEvent
handler.
handler | the handler |
---|
This method is deprecated.
use addResizeHandler(ResizeHandler)
instead
Adds a listener to receive window resize events.
listener | the listener to be informed when the window is resized |
---|
Adds a Window.ScrollEvent
handler.
handler | the handler |
---|
This method is deprecated.
use addWindowScrollHandler(ScrollHandler)
instead
Adds a listener to receive window scroll events.
listener | the listener to be informed when the window is scrolled |
---|
Displays a message in a modal dialog box.
msg | the message to be displayed. |
---|
Displays a message in a modal dialog box, along with the standard 'OK' and 'Cancel' buttons.
msg | the message to be displayed. |
---|
true
if 'OK' is clicked, false
if
'Cancel' is clicked.
Use this method to explicitly disable the window's scrollbars. Applications that choose to resize their user-interfaces to fit within the window's client area will normally want to disable window scrolling.
enable | false to disable window scrolling
|
---|
Gets the height of the browser window's client area excluding the scroll bar.
Gets the width of the browser window's client area excluding the vertical scroll bar.
Gets the window's scroll left.
Get the window's scroll top.
Gets the browser window's current title.
Moves a window's left and top edge to a specified number of pixels relative to its current coordinates.
NOTE: In Chrome, this method only works with windows created by Window.open().
dx | A positive or a negative number that specifies how many pixels to move the left edge by |
---|---|
dy | A positive or a negative number that specifies how many pixels to move the top edge by |
Moves a window's left and top edge to the specified coordinates.
NOTE: In Chrome, this method only works with windows created by Window.open().
x | The left coordinate |
---|---|
y | The top coordinate |
Opens a new browser window. The "name" and "features" arguments are specified here.
url | the URL that the new window will display |
---|---|
name | the name of the window (e.g. "_blank") |
features | the features to be enabled/disabled on this window |
Prints the document in the window, as if the user had issued a "Print" command.
Displays a request for information in a modal dialog box, along with the standard 'OK' and 'Cancel' buttons.
msg | the message to be displayed |
---|---|
initialValue | the initial value in the dialog's text field |
null
if 'Cancel' was pressed
Removes a window closing listener.
listener | the listener to be removed |
---|
Removes a window resize listener.
listener | the listener to be removed |
---|
Removes a window scroll listener.
listener | the listener to be removed |
---|
Resizes the window by the specified width and height. This method moves the bottom right corner of the window by the specified number of pixels defined. The top left corner will not be moved (it stays in its original coordinates).
NOTE: In Chrome, this method only works with windows created by Window.open().
width | A positive or a negative number that specifies how many pixels to resize the width by |
---|---|
height | A positive or a negative number that specifies how many pixels to resize the height by |
Resizes the window to the specified width and height.
NOTE: In Chrome, this method only works with windows created by Window.open().
width | The width of the window, in pixels |
---|---|
height | The height of the window, in pixels |
Scroll the window to the specified position.
left | the left scroll position |
---|---|
top | the top scroll position |
Sets the size of the margins used within the window's client area. It is sometimes necessary to do this because some browsers, such as Internet Explorer, add margins by default, which can confound attempts to resize panels to fit exactly within the window.
size | the window's new margin size, in CSS units. |
---|
Sets the status text for the window, if permitted by the browser's settings.
status | the new message to display. |
---|
Sets the browser window's title.
title | the new window title. |
---|