Class Window

Application window component.

Window()

Parameters

caption

Title of the window

Create new empty unnamed window with default layout.

To show the window in application, it must be added to application with Application.addWindow() method.

The windows are scrollable by default.

Window(String)

Parameters

caption

Title of the window

Create new empty window with default layout.

To show the window in application, it must be added to application with Application.addWindow() method.

The windows are scrollable by default.

Window(String, Layout)

Parameters

caption

Title of the window

layout

Layout of the window

Create new window.

To show the window in application, it must be added to application with Application.addWindow() method.

The windows are scrollable by default.

BORDER_DEFAULT

Window with default borders

BORDER_MINIMAL

Window with only minimal border

BORDER_NONE

Window with no border

addParameterHandler(ParameterHandler)

Add new parameter handler to this window.

addURIHandler(URIHandler)

Add new URI handler to this window

changeVariables(Object, Map)

getApplication()

Parameters

return

parent application of the component.

Get application instance of the component. Returns the application where this component belongs to. If the component does not yet belong to a application the returns null.

getBorder()

Parameters

return

int

Returns the border.

getFocusableById(long)

Map focusable id back to focusable component.

getFocusedComponent()

Parameters

return

Focused component or null if none is focused.

Get currently focused component in this window.

getName()

Parameters

return

String

Get the unique name of the window that indentifies it on the terminal.

getNewFocusableId(Component.Focusable)

Get an id for focusable component.

getParent()

Parameters

return

Value of property parent.

Getter for property parent. Parent is the visual parent of a component. Each component can belong to only one ComponentContainer at time.

getTag()

Parameters

return

Component UIDL tag as string.

Get component UIDL tag.

getTerminal()

Parameters

return

Value of property terminal.

Get terminal type.

getTheme()

Parameters

return

Name of the theme used in window. If the theme for this individual window is not explicitly set, the application theme is used instead. If application is not assigned the terminal.getDefaultTheme is used. If terminal is not set, null is returned

Get theme for this window.

getURL()

Parameters

return

String

Returns the full url of the window, this returns window specific url even for the main window.

getWindow()

Parameters

return

parent window of the component.

Get window of the component. Returns the window where this component belongs to. If the component does not yet belong to a window the returns null.

handleParameters(Map)

Parameters

parameters

Inmodifiable name to value[] mapping.

Description copied from interface: handleParameters

Handle parameters.

Handle the given parameters. The parameters are given as inmodifieable name to value map. All parameters names are of type: java.lang.String. All the parameter values are arrays of strings.

handleURI(URL, String)

Handle uri recursively.

open(Resource)

Open the given resource in this window.

open(Resource, String)

Open the given resource in named terminal window. Empty or null window name results the resource to be opened in this window.

open(Resource, String, int, int, int)

Open the given resource in named terminal window with given size and border properties. Empty or null window name results the resource to be opened in this window.

paintContent(PaintTarget)

Parameters

event

PaintEvent.

Exceptions

PaintException

The paint operation failed.

Paint the content of this component.

removeFocusableId(long)

Release focusable component id when not used anymore.

removeParameterHandler(ParameterHandler)

Remove given URI handler from this window.

removeURIHandler(URIHandler)

Remove given URI handler from this window

setApplication(Application)

Parameters

application

The application to set

Sets the application this window is connected to.

This method should not be invoked directly. Instead the addWindow(com.itmill.toolkit.ui.Window) method should be used to add the window to an application and removeWindow(com.itmill.toolkit.ui.Window) method for removing the window from the applicion. These methods call this method implicitly.

The method invokes attach() and detach() methods when necessary.

setBorder(int)

Parameters

border

The border to set

Sets the border.

setFocusedComponent(Component.Focusable)

Parameters

focusable

Focused component or null if none is focused.

Set currently focused component in this window.

setHeightUnits(int)

Window only supports pixels as unit.

setName(String)

Parameters

name

The name to set

Sets the name.

The name of the window must be unique inside the application. Also the name may only contain the following characters: a-z, A-Z and 0-9.

If the name is null, the the window is given name automatically when it is added to an application.

setParent(Component)

Parameters

parent

New value of property parent.

Setter for property parent. Parent is the visual parent of a component. This is mostly called by containers add method. Setting parent is not allowed for the window, and thus this call should newer be called.

setTerminal(Terminal)

Parameters

type

terminal type to set

Set terminal type. The terminal type is set by the the terminal adapter and may change from time to time.

setTheme(String)

Parameters

theme

New theme for this window. Null implies the default theme.

Set theme for this window.

setWidthUnits(int)

Window only supports pixels as unit.