LPEX
3.6.5

com.ibm.lpex.core
Class LpexMultiWindow

java.lang.Object
  extended by SashForm
      extended by com.ibm.lpex.core.LpexMultiWindow

public class LpexMultiWindow
extends SashForm

The split-window parent of one or more LpexWindows. The windows may be stacked side by side (vertical split orientation, the borders between multiple editing views running vertically), or top to bottom (horizontal split orientation, the borders between multiple views running horizontally). The first window is the leftmost or top window.

See also the splitWindow and splitWindow.orientation editor parameters.


Constructor Summary
LpexMultiWindow(Composite parent, int style)
          Constructs a new multiwindow.
 
Method Summary
 void addActiveWindowListener(LpexActiveWindowListener activeWindowListener)
          Adds an active-window listener to this multi-window.
 void closeWindow(LpexWindow lpexWindow)
          Convenience method to close the specified window and dispose of its associates view, if any.
 LpexWindow createLpexWindow(int style)
          Creates a new LpexWindow.
 LpexView getActiveView()
          Convenience method to return the active document view.
 LpexWindow getFirstWindow()
          Returns the first window.
 int getMaxWindows()
          Returns the maximum number of split windows that can be created.
 LpexWindow getWindow()
          Returns the window that has the input focus, if any, otherwise the first window.
 LpexWindow getWindow(int x, int y)
          Returns the window which contains the point specified, if any.
 LpexWindow[] getWindows()
          Returns an array of the windows currently managed by this multiwindow.
 LpexWindow newWindow(LpexView lpexView, int style)
          Creates a new window for the given document view.
 void removeActiveWindowListener(LpexActiveWindowListener activeWindowListener)
          Removes an active-window listener from this multi-window.
 boolean setFocus()
          Gives this multiwindow the keyboard input focus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexMultiWindow

public LpexMultiWindow(Composite parent,
                       int style)
Constructs a new multiwindow. The new multiwindow created has no LpexWindows. Its initial split orientation is determined by the default.splitWindow.orientation editor parameter. Disposing of this multiwindow will also dispose of its associated views, if any.

Parameters:
parent - parent Composite
style - SWT style flags for the multiwindow Composite
Method Detail

newWindow

public LpexWindow newWindow(LpexView lpexView,
                            int style)
Creates a new window for the given document view.

A new LpexWindow may not be created in certain circumstances. For example, you cannot create more than a preset number getMaxWindows() of split windows to be managed by one multiwindow. In such a case null will be returned.

Parameters:
lpexView - the document view to associate with the new window
style - SWT style flags for the LpexWindow Composite
Returns:
the new LpexWindow created, or
null if a new LpexWindow could not be created

createLpexWindow

public LpexWindow createLpexWindow(int style)
Creates a new LpexWindow.

Called by newWindow(), which will also associate this window with the specified document view.


addActiveWindowListener

public void addActiveWindowListener(LpexActiveWindowListener activeWindowListener)
Adds an active-window listener to this multi-window. A listener is only registered once, subsequent calls to add the same listener have no effect.

See Also:
removeActiveWindowListener(com.ibm.lpex.core.LpexActiveWindowListener), setFocus()

removeActiveWindowListener

public void removeActiveWindowListener(LpexActiveWindowListener activeWindowListener)
Removes an active-window listener from this multi-window. Removes the specified listener if it is registered with this multi-window.


setFocus

public boolean setFocus()
Gives this multiwindow the keyboard input focus. This method sets the input focus to the window that is, or was, previously active. That is the window that one of its child controls has, or had, input focus last. If none of our windows was active yet, it sets focus to the first window.


getFirstWindow

public LpexWindow getFirstWindow()
Returns the first window. The first window is the leftmost or top window in the current list of windows.

Returns:
the first window, or
null if no windows are currently managed

getWindow

public LpexWindow getWindow()
Returns the window that has the input focus, if any, otherwise the first window.

Returns:
the active window, or
null if no windows are currently managed

getActiveView

public LpexView getActiveView()
Convenience method to return the active document view. The active view is that which has the input focus, or otherwise had it lately and will be given the input focus when this multiwindow regains focus.

Returns:
the active view, or null if no view is associated with any valid active window

getWindow

public LpexWindow getWindow(int x,
                            int y)
Returns the window which contains the point specified, if any.

Parameters:
x - x coordinate of a point inside this multiwindow
y - y coordinate of a point inside this multiwindow
Returns:
the window for the given coordinates, or
null if outside point or no windows are currently managed

getWindows

public LpexWindow[] getWindows()
Returns an array of the windows currently managed by this multiwindow.

Returns:
an array of LpexWindows, or an empty array if no windows are available

getMaxWindows

public int getMaxWindows()
Returns the maximum number of split windows that can be created.


closeWindow

public void closeWindow(LpexWindow lpexWindow)
Convenience method to close the specified window and dispose of its associates view, if any. If the closed window had the input focus or was the active window, the next window, if any, or else the first window is given focus.

Parameters:
lpexWindow - the window to close and dispose

LPEX
3.6.5

Copyright © 2012 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.