BiWindowManager

This class can be used with internal windows to provide more features.

This class extends BiEventTarget and therefore all methods and fields available for BiEventTarget are also available for BiWindowManager .

Constructor

new BiWindowManager ( [ oComponent ] )

Parameters

NameTypeOptionalDefaultDescripton
oComponentBiComponentcheckedThis is the component that is the container for the windows. Do not use the window manager before a valid component is set.

Properties

NameTypegetsetDescripton
activeWindowBiWindowcheckedcheckedThe window that is currently active. This might be null if no window is active.
componentBiComponentcheckedcheckedThe component that the windows are added to
stringBundleBiStringBundlecheckedcheckedThe string bundle to use for this window manager. If this is set to null then the string bundle for application is used.
windowsBiWindow[]checkedReturns an array with the windows managed by the window manager.
windowsMenuBiMenucheckedThis returns a menu that contains items for commands as well as menu items for all the windows. This can be used to switch between the windows and organize the windows.

This menu can be added to a menu bar, as a sub menu or used as a context menu.

Methods

NameDescription
activateNextActivates the next logical window
activatePreviousActivates the previous logical window
addAdds a window to the window manager. Added windows are then managed by the window manager.
cascadeCascades the visible windows.
closeAllCloses all the windows.
getLastStateReturns the last state (non minimized state) for the window. This is used to know to what state the window should return to once it is restored from minimized.
minimizeAllMinimizes all the windows.
removeRemoves a window from the window manager. The window is no longer managed by the window manager. Closing a window automatically removes it from the window manager. The method returns the removed window.
tileHorizontallyTiles the visible windows horizontally.
tileVerticallyTiles the visible windows vertically.

Events

NameTypeBubblesDescripton
activationBiEventThe window manager has become activated. E.g. one of its windows is activated.
deactivationBiEventThe window manager is deactivated. You have left it and can no longer manipulate its windows via keyboard shortcuts etc..

Static Methods

None.

Static Fields

None.

Remarks

Adding a window to a component that has a window manager does not automatically add the window to the window manager. The window needs to be added to the parent component as well as to the window manager. You might want to use the BiDesktopPane which is a component that handles the adding and removing of the windows for you. The labels for the windows menu items are provided by a BiStringBundle and the following keys are used: WindowManagerCascade - Cascade label text WindowManagerCascadeMnemonic - Cascade label mnemonic WindowManagerTileHorizontally - Tile horizontally label text WindowManagerTileHorizontallyMnemonic - Tile horizontally label mnemonic WindowManagerTileVertically - Tile vertically label text WindowManagerTileVerticallyMnemonic - Tile vertically label mnemonic WindowManagerMinimizeAll - Minimize all label text WindowManagerMinimizeAllMnemonic - Minimize all label mnemonic WindowManagerCloseAll - Close all label text WindowManagerCloseAllMnemonic - Close all label mnemonic

Method Details

activateNext

Activates the next logical window

Syntax

object.activateNext ( oWindow )

Parameters

NameTypeOptionalDefaultDescripton
oWindowBiWindowThe window to activate the next from

Return Type

void

activatePrevious

Activates the previous logical window

Syntax

object.activatePrevious ( oWindow )

Parameters

NameTypeOptionalDefaultDescripton
oWindowBiWindowThe window to activate the previous from

Return Type

void

add

Adds a window to the window manager. Added windows are then managed by the window manager.

Syntax

object.add ( oWindow )

Parameters

NameTypeOptionalDefaultDescripton
oWindowBiWindowThe window to add to the window manager

Return Type

void

cascade

Cascades the visible windows.

Syntax

object.cascade ( )

Parameters

No arguments.

Return Type

void

closeAll

Closes all the windows.

Syntax

object.closeAll ( )

Parameters

No arguments.

Return Type

void

getLastState

Returns the last state (non minimized state) for the window. This is used to know to what state the window should return to once it is restored from minimized.

Syntax

object.getLastState ( oWindow )

Parameters

NameTypeOptionalDefaultDescripton
oWindowBiWindowThe window to get the state for

Return Type

String

minimizeAll

Minimizes all the windows.

Syntax

object.minimizeAll ( )

Parameters

No arguments.

Return Type

void

remove

Removes a window from the window manager. The window is no longer managed by the window manager. Closing a window automatically removes it from the window manager. The method returns the removed window.

Syntax

object.remove ( oWindow )

Parameters

NameTypeOptionalDefaultDescripton
oWindowBiWindowThe window to remove from the window manager

Return Type

BiWindow

tileHorizontally

Tiles the visible windows horizontally.

Syntax

object.tileHorizontally ( )

Parameters

No arguments.

Return Type

void

tileVertically

Tiles the visible windows vertically.

Syntax

object.tileVertically ( )

Parameters

No arguments.

Return Type

void