Package muntjac :: Package ui :: Module window :: Class Window
[hide private]
[frames] | no frames]

Class Window

source code

                             object --+                        
                                      |                        
                    util.IEventListener --+                    
                                          |                    
              terminal.paintable.IPaintable --+                
                                              |                
                                 object --+   |                
                                          |   |                
     terminal.variable_owner.IVariableOwner --+                
                                              |                
                                 object --+   |                
                                          |   |                
                terminal.sizeable.ISizeable --+                
                                              |                
                           component.IComponent --+            
                                                  |            
                                     object --+   |            
                                              |   |            
   event.method_event_source.IMethodEventSource --+            
                                                  |            
               abstract_component.AbstractComponent --+        
                                                      |        
                             object --+               |        
                                      |               |        
                    util.IEventListener --+           |        
                                          |           |        
              terminal.paintable.IPaintable --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
     terminal.variable_owner.IVariableOwner --+       |        
                                              |       |        
                                 object --+   |       |        
                                          |   |       |        
                terminal.sizeable.ISizeable --+       |        
                                              |       |        
                           component.IComponent --+   |        
                                                  |   |        
            component_container.IComponentContainer --+        
                                                      |        
abstract_component_container.AbstractComponentContainer --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
                        terminal.scrollable.IScrollable --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
           component_container.IComponentAttachListener --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
           component_container.IComponentDetachListener --+    
                                                          |    
                                         object --+       |    
                                                  |       |    
                            event.action.IContainer --+   |    
                                                      |   |    
                                 event.action.INotifier --+    
                                                          |    
                                 object --+               |    
                                          |               |    
                        util.IEventListener --+           |    
                                              |           |    
                  terminal.paintable.IPaintable --+       |    
                                                  |       |    
                                     object --+   |       |    
                                              |   |       |    
         terminal.variable_owner.IVariableOwner --+       |    
                                                  |       |    
                                     object --+   |       |    
                                              |   |       |    
                    terminal.sizeable.ISizeable --+       |    
                                                  |       |    
                               component.IComponent --+   |    
                                                      |   |    
                                   component.IFocusable --+    
                                                          |    
                                                panel.Panel --+
                                                              |
                                                 object --+   |
                                                          |   |
                           terminal.uri_handler.IUriHandler --+
                                                              |
                                                 object --+   |
                                                          |   |
               terminal.parameter_handler.IParameterHandler --+
                                                              |
                                                 object --+   |
                                                          |   |
                          event.field_events.IFocusNotifier --+
                                                              |
                                                 object --+   |
                                                          |   |
                           event.field_events.IBlurNotifier --+
                                                              |
                                                             Window
Known Subclasses:

A component that represents an application (browser native) window or a sub window.

If the window is a application window or a sub window depends on how it is added to the application. Adding a Window to a Window using Window.addWindow makes it a sub window and adding a Window to the Application using Application.addWindow makes it an application window.

An application window is the base of any view in a Muntjac application. All applications contain a main application window (set using ApplicationsetMainWindow which is what is initially shown to the user. The contents of a window is set using setContent. The contents can in turn contain other components. For multi-tab applications there is one window instance per opened tab.

A sub window is floating popup style window that can be added to an application window. Like the application window its content is set using setContent. A sub window can be positioned on the screen using absolute coordinates (pixels). The default content of the Window is set to be suitable for application windows. For sub windows it might be necessary to set the size of the content to work as expected.

Window caption is displayed in the browser title bar for application level windows and in the window header for sub windows.

Certain methods in this class are only meaningful for sub windows and other parts only for application windows. These are marked using Sub window only and Application window only respectively in the API doc.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, caption='', content=None)
Creates a new unnamed window with the given content and title.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
addComponent(self, c)
Adds the component into this container.
source code
 
addListener(self, listener, iface=None)
Adds a close/resize/focus/blur listener to the window.
source code
 
addNotification(self, notification) source code
 
addParameterHandler(self, handler)
Application window only.
source code
 
addURIHandler(self, handler)
Application window only.
source code
 
addWindow(self, window)
Adds a window inside another window.
source code
 
attachWindow(self, w) source code
 
bringToFront(self)
If there are currently several sub windows visible, calling this method makes this window topmost.
source code
 
center(self)
Request to center this window on the screen.
source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
close(self)
Method that handles window closing (from UI).
source code
 
executeJavaScript(self, script)
Executes JavaScript in this window.
source code
 
fireClose(self) source code
 
fireResize(self)
Fire the resize event.
source code
 
focus(self)
If the window is a sub-window focusing will cause the sub-window to be brought on top of other sub-windows on gain keyboard focus.
source code
 
getApplication(self)
Gets the application object to which the component is attached.
source code
 
getBorder(self)
Returns the border style of the window.
source code
 
getChildWindows(self)
Get the set of all child windows.
source code
 
getName(self)
Application window only.
source code
 
getParent(self)
Gets the parent component of the window.
source code
 
getPositionX(self)
Gets the distance of Window left border in pixels from left border of the containing (main window).
source code
 
getPositionY(self)
Gets the distance of Window top border in pixels from top border of the containing (main window).
source code
 
getTerminal(self)
Application window only.
source code
 
getTheme(self)
Application window only.
source code
 
getURL(self)
Gets the full URL of the window.
source code
 
getWindow(self)
Gets the parent window of the component.
source code
 
handleParameters(self, parameters)
Application window only.
source code
 
handleURI(self, context, relativeUri)
Application window only.
source code
 
isClosable(self)
Returns the closable status of the sub window.
source code
 
isDraggable(self)
Indicates whether a sub window can be dragged or not.
source code
 
isModal(self)
Returns: true if this window is modal.
source code
 
isResizable(self)
Returns: true if window is resizable by the end-user, otherwise false.
source code
 
isResizeLazy(self)
Returns: true if a delay is used before recalculating sizes, false if sizes are recalculated immediately.
source code
 
open(self, resource, windowName=None, width=-1, height=-1, border=None)
Opens the given resource in a window with the given size, border and name.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
removeCallback(self, callback, eventType=None) source code
 
removeCloseShortcut(self)
Removes the keyboard shortcut previously set with setCloseShortcut.
source code
 
removeListener(self, listener, iface=None)
Removes the close/resize from the window.
source code
 
removeParameterHandler(self, handler)
Application window only.
source code
 
removeURIHandler(self, handler)
Application window only.
source code
 
removeWindow(self, window)
Remove the given subwindow from this window.
source code
 
scrollIntoView(self, component)
Scrolls any component between the component and window to a suitable position so the component is visible to the user.
source code
 
setApplication(self, application)
Sets the application this window is attached to.
source code
 
setBorder(self, border)
Sets the border style for this window.
source code
 
setClosable(self, closable)
Sets the closable status for the sub window.
source code
 
setCloseShortcut(self, keyCode, *modifiers)
Makes is possible to close the window by pressing the given KeyCode and (optional) ModifierKeys.
source code
 
setDraggable(self, draggable)
Enables or disables that a sub window can be dragged (moved) by the user.
source code
 
setFocusedComponent(self, focusable)
This method is used by Component.Focusable objects to request focus to themselves.
source code
 
setModal(self, modality)
Sets sub-window modal, so that widgets behind it cannot be accessed.
source code
 
setName(self, name)
Application window only.
source code
 
setPositionX(self, positionX, repaintRequired=True)
Sets the distance of Window left border in pixels from left border of the containing (main window).
source code
 
setPositionY(self, positionY, repaintRequired=True)
Sets the distance of Window top border in pixels from top border of the containing (main window).
source code
 
setResizable(self, resizable)
Sets sub-window resizable.
source code
 
setResizeLazy(self, resizeLazy)
Should resize operations be lazy, i.e.
source code
 
setTerminal(self, typ)
Sets the user terminal.
source code
 
setTheme(self, theme)
Application window only.
source code
 
showNotification(self, *args)
Shows a notification message the window.
source code

Inherited from panel.Panel: addAction, addActionHandler, attach, componentAttachedToContainer, componentDetachedFromContainer, createDefaultContent, detach, fireClick, getActionManager, getComponentIterator, getContent, getLayout, getScrollLeft, getScrollOffsetX, getScrollOffsetY, getScrollTop, getTabIndex, isScrollable, removeAction, removeActionHandler, removeAllActionHandlers, removeAllComponents, removeComponent, replaceComponent, requestRepaintAll, setCaption, setContent, setLayout, setScrollLeft, setScrollOffsetX, setScrollOffsetY, setScrollTop, setScrollable, setTabIndex

Inherited from abstract_component_container.AbstractComponentContainer: fireComponentAttachEvent, fireComponentDetachEvent, getInvalidSizedChildren, moveComponentsFrom, repaintChangedChildTrees, repaintChildTrees, setEnabled, setHeight, setWidth

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getStyle, getStyleName, getWidth, getWidthUnits, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaint, requestRepaintRequests, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BORDER_DEFAULT = 2
Application window only.
  BORDER_MINIMAL = 1
Application window only.
  BORDER_NONE = 0
Application window only.
  CLIENT_WIDGET = None
hash(x)

Inherited from panel.Panel: STYLE_LIGHT

Inherited from panel.Panel (private): _CLICK_EVENT

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Instance Variables [hide private]
  _application
Application window only.
  _border
Application window only. Border mode of the Window.
  _centerRequested
Sub window only.
  _draggable
Sub window only.
  _jsExecQueue
Application window only.
  _modal
Sub window only.
  _name
Application window only.
  _notifications
Application window only.
  _openList
Application window only.
  _parameterHandlerList
Application window only.
  _pendingFocus
Component that should be focused after the next repaint.
  _positionX
Sub window only.
  _positionY
Sub window only.
  _resizable
Sub window only.
  _resizeLazy
Should resize recalculate layouts lazily (as opposed to immediately)
  _scrollIntoView
The component that should be scrolled into view after the next
  _subwindows
Application window only.
  _terminal
Application window only.
  _theme
Application window only.
  _uriHandlerList
Application window only.

Inherited from panel.Panel: actionManager

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, caption='', content=None)
(Constructor)

source code 

Creates a new unnamed window with the given content and title.

Parameters:
  • caption - the title of the window.
  • content - the contents of the window
Overrides: object.__init__

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: event.field_events.IBlurNotifier.addCallback

addComponent(self, c)

source code 

Adds the component into this container.

Parameters:
  • c - the component to be added.
Overrides: component_container.IComponentContainer.addComponent
(inherited documentation)

addListener(self, listener, iface=None)

source code 

Adds a close/resize/focus/blur listener to the window.

For a sub window the ICloseListener is fired when the user closes it (clicks on the close button).

For a browser level window the ICloseListener is fired when the browser level window is closed. Note that closing a browser level window does not mean it will be destroyed.

Note, that focus/blur listeners in Window class are only supported by sub windows. Also note that Window is not considered focused if its contained component currently has focus.

Parameters:
  • listener - the listener to add.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.field_events.IBlurNotifier.addListener

addParameterHandler(self, handler)

source code 

Application window only. Adds a new parameter handler to this window. If this is a sub window the parameter handler is attached to the parent application window.

Parameters:
  • handler - the parameter handler to add.

addURIHandler(self, handler)

source code 

Application window only. Adds a new URI handler to this window. If this is a sub window the URI handler is attached to the parent application window.

Parameters:
  • handler - the URI handler to add.

addWindow(self, window)

source code 

Adds a window inside another window.

Adding windows inside another window creates "subwindows". These windows should not be added to application directly and are not accessible directly with any url. Addding windows implicitly sets their parents.

Only one level of subwindows are supported. Thus you can add windows inside such windows whose parent is None.

Raises:
  • ValueError - if a window is added inside non-application level window.

bringToFront(self)

source code 

If there are currently several sub windows visible, calling this method makes this window topmost.

This method can only be called if this window is a sub window and connected a top level window. Else an illegal state exception is thrown. Also if there are modal windows and this window is not modal, and illegal state exception is thrown.

Note, this API works on sub windows only. Browsers can't reorder OS windows.

center(self)

source code 

Request to center this window on the screen. Note: affects sub-windows only.

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

close(self)

source code 

Method that handles window closing (from UI).

By default, sub-windows are removed from their respective parent windows and thus visually closed on browser-side. Browser-level windows also closed on the client-side, but they are not implicitly removed from the application.

To explicitly close a sub-window, use removeWindow. To react to a window being closed (after it is closed), register a ICloseListener.

executeJavaScript(self, script)

source code 

Executes JavaScript in this window.

This method allows one to inject javascript from the server to client. A client implementation is not required to implement this functionality, but currently all web-based clients do implement this.

Executing javascript this way often leads to cross-browser compatibility issues and regressions that are hard to resolve. Use of this method should be avoided and instead it is recommended to create new widgets with GWT.

Parameters:
  • script - JavaScript snippet that will be executed.

focus(self)

source code 

If the window is a sub-window focusing will cause the sub-window to be brought on top of other sub-windows on gain keyboard focus.

Overrides: component.IFocusable.focus

getApplication(self)

source code 

Gets the application object to which the component is attached.

The method will return None if the component is not currently attached to an application. This is often a problem in constructors of regular components and in the initializers of custom composite components. A standard workaround is to move the problematic initialization to attach, as described in the documentation of the method.

This method is not meant to be overridden.

Returns:
the parent application of the component or None.
Overrides: component.IComponent.getApplication
(inherited documentation)

getBorder(self)

source code 

Returns the border style of the window.

Returns:
the border style for the window

See Also: setBorder

getChildWindows(self)

source code 

Get the set of all child windows.

Returns:
Set of child windows.

getName(self)

source code 

Application window only. Gets the unique name of the window. The name of the window is used to uniquely identify it.

The name also determines the URL that can be used for direct access to a window. All windows can be accessed through http://host:port/app/win where http://host:port/app is the application URL (as returned by Application.getURL and win is the window name.

Returns:
the name of the Window.

getParent(self)

source code 

Gets the parent component of the window.

The parent of an application window is always null. The parent of a sub window is the application window the sub window is attached to.

This method is not meant to be overridden.

Returns:
the parent window
Overrides: component.IComponent.getParent

getPositionX(self)

source code 

Gets the distance of Window left border in pixels from left border of the containing (main window).

Returns:
the Distance of Window left border in pixels from left border of the containing (main window). or -1 if unspecified.

getPositionY(self)

source code 

Gets the distance of Window top border in pixels from top border of the containing (main window).

Returns:
Distance of Window top border in pixels from top border of the containing (main window). or -1 if unspecified.

getTerminal(self)

source code 

Application window only. Gets the user terminal.

Returns:
the user terminal

getTheme(self)

source code 

Application window only. Gets the theme for this window.

If the theme for this window is not explicitly set, the application theme name is returned. If the window is not attached to an application, the terminal default theme name is returned. If the theme name cannot be determined, null is returned

Subwindows do not support themes and return the theme used by the parent window

Returns:
the name of the theme used for the window

getURL(self)

source code 

Gets the full URL of the window. The returned URL is window specific and can be used to directly refer to the window.

Note! This method can not be used for portlets.

Returns:
the URL of the window or null if the window is not attached to an application

getWindow(self)

source code 

Gets the parent window of the component.

This is always the window itself.

This method is not meant to be overridden.

Returns:
the window itself
Overrides: component.IComponent.getWindow

handleParameters(self, parameters)

source code 

Application window only. Handles parameters by passing the parameters to all IParameterHandlers defined using addParameterHandler. All IParameterHandlers are called for each set of parameters.

Parameters:
  • parameters - a map containing the parameter names and values
Overrides: terminal.parameter_handler.IParameterHandler.handleParameters

handleURI(self, context, relativeUri)

source code 

Application window only. Handles an URI by passing the URI to all URI handlers defined using addURIHandler. All URI handlers are called for each URI but no more than one handler may return a DownloadStream. If more than one stream is returned a RuntimeException is thrown.

Parameters:
  • context - The URL of the application
  • relativeUri - The URI relative to context
Returns:
A DownloadStream that one of the URI handlers returned, null if no DownloadStream was returned.
Overrides: terminal.uri_handler.IUriHandler.handleURI

isClosable(self)

source code 

Returns the closable status of the sub window. If a sub window is closable it typically shows an X in the upper right corner. Clicking on the X sends a close event to the server. Setting closable to false will remove the X from the sub window and prevent the user from closing the window.

Note! For historical reasons readonly controls the closability of the sub window and therefore readonly and closable affect each other. Setting readonly to true will set closable to false and vice versa.

Closable only applies to sub windows, not to browser level windows.

Returns:
true if the sub window can be closed by the user.

isDraggable(self)

source code 

Indicates whether a sub window can be dragged or not. By default a sub window is draggable.

Draggable only applies to sub windows, not to browser level windows.

isModal(self)

source code 
Returns:
true if this window is modal.

isResizable(self)

source code 
Returns:
true if window is resizable by the end-user, otherwise false.

isResizeLazy(self)

source code 
Returns:
true if a delay is used before recalculating sizes, false if sizes are recalculated immediately.

open(self, resource, windowName=None, width=-1, height=-1, border=None)

source code 

Opens the given resource in a window with the given size, border and name.

The supplied windowName is used as the target name in a window.open call in the client. This means that special values such as "_blank", "_self", "_top", "_parent" have special meaning. An empty or None window name is also a special case.

"", null and "_self" as windowName all causes the resource to be opened in the current window, replacing any old contents. For downloadable content you should avoid "_self" as "_self" causes the client to skip rendering of any other changes as it considers them irrelevant (the page will be replaced by the resource). This can speed up the opening of a resource, but it might also put the client side into an inconsistent state if the window content is not completely replaced e.g., if the resource is downloaded instead of displayed in the browser.

"_blank" as windowName causes the resource to always be opened in a new window or tab (depends on the browser and browser settings).

"_top" and "_parent" as windowName works as specified by the HTML standard.

Any other windowName will open the resource in a window with that name, either by opening a new window/tab in the browser or by replacing the contents of an existing window with that name.

Parameters:
  • resource - the resource.
  • windowName - the name of the window.
  • width - the width of the window in pixels
  • height - the height of the window in pixels
  • border - the border style of the window. See Window.BORDER_* constants

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)

removeCallback(self, callback, eventType=None)

source code 
Overrides: event.field_events.IBlurNotifier.removeCallback

removeListener(self, listener, iface=None)

source code 

Removes the close/resize from the window.

For more information on CloseListeners see ICloseListener.

Parameters:
  • listener - the listener to remove.
Overrides: event.field_events.IBlurNotifier.removeListener

removeParameterHandler(self, handler)

source code 

Application window only. Removes the parameter handler from this window. If this is a sub window the parameter handler is removed from the parent application window.

Parameters:
  • handler - the parameter handler to remove.

removeURIHandler(self, handler)

source code 

Application window only. Removes the URI handler from this window. If this is a sub window the URI handler is removed from the parent application window.

Parameters:
  • handler - the URI handler to remove.

removeWindow(self, window)

source code 

Remove the given subwindow from this window.

ICloseListeners are called also when explicitly removing a window by calling this method.

Returns a boolean indicating if the window was removed or not.

Parameters:
  • window - Window to be removed.
Returns:
true if the subwindow was removed, false otherwise

scrollIntoView(self, component)

source code 

Scrolls any component between the component and window to a suitable position so the component is visible to the user. The given component must be inside this window.

Parameters:
  • component - the component to be scrolled into view
Raises:
  • ValueError - if component is not inside this window

setApplication(self, application)

source code 

Sets the application this window is attached to.

This method is called by the framework and should not be called directly from application code. Application.addWindow should be used to add the window to an application and Application.removeWindow to remove the window from the application.

This method invokes IComponent.attach and IComponent.detach methods when necessary.

Parameters:
  • application - the application the window is attached to

setBorder(self, border)

source code 

Sets the border style for this window. Valid values are Window.BORDER_NONE, Window.BORDER_MINIMAL, Window.BORDER_DEFAULT.

Note! Setting this seems to currently have no effect whatsoever on the window.

Parameters:
  • border - the border style to set

setClosable(self, closable)

source code 

Sets the closable status for the sub window. If a sub window is closable it typically shows an X in the upper right corner. Clicking on the X sends a close event to the server. Setting closable to false will remove the X from the sub window and prevent the user from closing the window.

Note! For historical reasons readonly controls the closability of the sub window and therefore readonly and closable affect each other. Setting readonly to true will set closable to false and vice versa.

Closable only applies to sub windows, not to browser level windows.

Parameters:
  • closable - determines if the sub window can be closed by the user.

setCloseShortcut(self, keyCode, *modifiers)

source code 

Makes is possible to close the window by pressing the given KeyCode and (optional) ModifierKeys.

Note that this shortcut only reacts while the window has focus, closing itself - if you want to close a subwindow from a parent window, use addAction of the parent window instead.

Parameters:
  • keyCode - the keycode for invoking the shortcut
  • modifiers - the (optional) modifiers for invoking the shortcut, null for none

setDraggable(self, draggable)

source code 

Enables or disables that a sub window can be dragged (moved) by the user. By default a sub window is draggable.

Draggable only applies to sub windows, not to browser level windows.

Parameters:
  • draggable - true if the sub window can be dragged by the user

setFocusedComponent(self, focusable)

source code 

This method is used by Component.Focusable objects to request focus to themselves. Focus renders must be handled at window level (instead of IFocusable) due we want the last focused component to be focused in client too. Not the one that is rendered last (the case we'd get if implemented in Focusable only).

To focus component from Muntjac application, use IFocusable.focus(). See IFocusable.

Parameters:
  • focusable - to be focused on next paint

setModal(self, modality)

source code 

Sets sub-window modal, so that widgets behind it cannot be accessed. Note: affects sub-windows only.

Parameters:
  • modality - true if modality is to be turned on

setName(self, name)

source code 

Application window only. Sets the unique name of the window. The name of the window is used to uniquely identify it inside the application.

The name also determines the URL that can be used for direct access to a window. All windows can be accessed through http://host:port/app/win where http://host:port/app is the application URL (as returned by Application.getURL and win is the window name.

This method can only be called before the window is added to an application.

Parameters:
  • name - the new name for the window or null if the application should automatically assign a name to it
Raises:
  • ValueError - if the window is attached to an application

setPositionX(self, positionX, repaintRequired=True)

source code 

Sets the distance of Window left border in pixels from left border of the containing (main window).

Parameters:
  • positionX - the distance of window left border in pixels from left border of the containing (main window). or -1 if unspecified.
  • repaintRequired - true if the window needs to be repainted, false otherwise

setPositionY(self, positionY, repaintRequired=True)

source code 

Sets the distance of Window top border in pixels from top border of the containing (main window).

Parameters:
  • positionY - the distance of window top border in pixels from top border of the containing (main window). or -1 if unspecified
  • repaintRequired - true if the window needs to be repainted, false otherwise

setResizable(self, resizable)

source code 

Sets sub-window resizable. Note: affects sub-windows only.

Parameters:
  • resizable - true if resizability is to be turned on

setResizeLazy(self, resizeLazy)

source code 

Should resize operations be lazy, i.e. should there be a delay before layout sizes are recalculated. Speeds up resize operations in slow UIs with the penalty of slightly decreased usability.

Note, some browser send false resize events for the browser window and are therefore always lazy.

Parameters:
  • resizeLazy - true to use a delay before recalculating sizes, false to calculate immediately.

setTerminal(self, typ)

source code 

Sets the user terminal. Used by the terminal adapter, should never be called from application code.

Parameters:
  • typ - the terminal to set.

setTheme(self, theme)

source code 

Application window only. Sets the name of the theme to use for this window. Changing the theme will cause the page to be reloaded.

Parameters:
  • theme - the name of the new theme for this window or null to use the application theme.

showNotification(self, *args)

source code 

Shows a notification message the window. The position and behavior of the message depends on the type, which is one of the basic types defined in Notification, for instance Notification.TYPE_WARNING_MESSAGE, defaults to "humanized".

Care should be taken to to avoid XSS vulnerabilities as the caption is rendered as html.

Parameters:
  • args - tuple of the form
    • (caption)
      1. The message
    • (caption, type)
      1. The message
      2. The message type
    • (caption, description)
      1. The message
      2. The message description
    • (caption, description, type)
      1. The message
      2. The message description
      3. The message type
    • (notification)
      1. The notification message to show
    • (caption, description, type, htmlContentAllowed)
      1. The message
      2. The message description
      3. The message type
      4. Whether html in the caption and description should be displayed as html or as plain text

Class Variable Details [hide private]

BORDER_DEFAULT

Application window only. A border style that indicates that

Value:
2

BORDER_MINIMAL

Application window only. A border style used for opening

Value:
1

BORDER_NONE

Application window only. A border style used for opening

Value:
0

Instance Variable Details [hide private]

_application

Application window only. The application this window is

_centerRequested

Sub window only. Flag which is true if the window is

_draggable

Sub window only. Controls if the end user can move the

_jsExecQueue

Application window only. A list of javascript commands that

_modal

Sub window only. Modality flag for sub window.

_name

Application window only. Unique name of the window used to

_notifications

Application window only. A list of notifications that are

_openList

Application window only. Resources to be opened automatically

_parameterHandlerList

Application window only. List of parameter handlers for

_pendingFocus

Component that should be focused after the next repaint. Null if no

_positionX

Sub window only. Left offset in pixels for the sub window

_positionY

Sub window only. Top offset in pixels for the sub window

_resizable

Sub window only. Controls if the end user can resize the

_subwindows

Application window only. List of sub windows in this window.

_terminal

Application window only. The user terminal for this window.

_theme

Application window only. Explicitly specified theme of this

_uriHandlerList

Application window only. List of URI handlers for this