public class MultiWindow
extends java.lang.Object
RemoteWindows
. Includes APIs for:
Messaging
channels between Smart GWT windowsWithin the OpenFin environment, the underlying implementation is actually via the OpenFin class.
Reloading of child windows is in general supported (but see autoCopyDataSources
), while reloading the main window
currently is not.
Note: this is currently an experimental feature and not supported except by special arrangement.
Constructor and Description |
---|
MultiWindow() |
Modifier and Type | Method and Description |
---|---|
static void |
activate(java.lang.String name)
Activates (focuses) the existing window with the specified name,
|
static void |
activate(java.lang.String name,
RemoteWindowCallback callback)
Activates (focuses) the existing window with the specified name,
|
static void |
bringToFront(java.lang.String name)
Brings the existing window with the specified name to the top of the window stack.
|
static void |
bringToFront(java.lang.String name,
RemoteWindowCallback callback)
Brings the existing window with the specified name to the top of the window stack.
|
static void |
clearEvent(MultiWindowEvent eventType)
Unregisters a previously registered window event listener.
|
static void |
clearEvent(MultiWindowEvent eventType,
int ID)
Unregisters a previously registered window event listener.
|
static void |
close(java.lang.String name)
Closes the existing window with the specified name,
|
static void |
close(java.lang.String name,
boolean force) |
static void |
close(java.lang.String name,
boolean force,
RemoteWindowCallback callback)
Closes the existing window with the specified name,
|
static void |
deactivate(java.lang.String name)
Deactivates (blurs) the existing window with the specified name,
|
static void |
deactivate(java.lang.String name,
RemoteWindowCallback callback)
Deactivates (blurs) the existing window with the specified name,
|
static RemoteWindow |
find(java.lang.String name)
Returns window with the specified name, if it exists in the application.
|
static java.lang.Boolean |
getAutoCopyDataSources()
Should
DataSources from other OpenFin windows with Smart GWT loaded be
copied by reference into this window? Such DataSources will be copied: when a page in another window is loaded
(potentially several DataSources at once) at the moment DataSources are created in a page loaded in another window
(just that DataSource) |
static DataContext |
getDataContext()
Returns the
DataContext provided by the open() call that opened this window, or a newly created (on demand)
DataContext if this is the main application window, or no DataContext was provided. |
static RemoteWindow |
getLocalWindow()
Returns the
RemoteWindow instance for the current window (where the method
was called). |
static RemoteWindow[] |
getOtherWindows()
Returns a list of
RemoteWindow for the other currently known windows
(excluding the local window ). |
static RemoteWindow |
getParentWindow()
Returns the parent
RemoteWindow instance that opened this window. |
static java.lang.Boolean |
getShareMessageChannels()
Should this window share
Realtime Messaging channels with other windows? |
static void |
hide(java.lang.String name)
Hides the existing window with the specified name,
|
static void |
hide(java.lang.String name,
RemoteWindowCallback callback)
Hides the existing window with the specified name,
|
static boolean |
isMainWindow()
Returns whether this
RemoteWindow wraps the main application window. |
static void |
isShowing(java.lang.String name,
RemoteWindowBooleanCallback callback)
Checks whether a window with the specified name is showing.
|
static void |
maximize(java.lang.String name)
Maximizes the existing window with the specified name,
|
static void |
maximize(java.lang.String name,
RemoteWindowCallback callback)
Maximizes the existing window with the specified name,
|
static void |
minimize(java.lang.String name)
Minimizes the existing window with the specified name,
|
static void |
minimize(java.lang.String name,
RemoteWindowCallback callback)
Minimizes the existing window with the specified name,
|
static void |
move(java.lang.String name,
int x,
int y)
Moves the existing window with the specified name,
|
static void |
move(java.lang.String name,
int x,
int y,
RemoteWindowCallback callback)
Moves the existing window with the specified name,
|
static void |
open(java.lang.String url,
java.lang.String name)
Opens a new window with the specified URL, name, and
DataContext . |
static void |
open(java.lang.String url,
java.lang.String name,
DataContext dataContext) |
static void |
open(java.lang.String url,
java.lang.String name,
DataContext dataContext,
RemoteWindowBooleanCallback callback) |
static void |
open(java.lang.String url,
java.lang.String name,
DataContext dataContext,
RemoteWindowBooleanCallback callback,
BrowserWindowSettings windowSettings) |
static void |
open(java.lang.String url,
java.lang.String name,
DataContext dataContext,
RemoteWindowBooleanCallback callback,
BrowserWindowSettings windowSettings,
MultiWindowSettings classSettings)
Opens a new window with the specified URL, name, and
DataContext . |
static void |
resize(java.lang.String name,
int width,
int height)
Resizes e existing window with the specified name,
|
static void |
resize(java.lang.String name,
int width,
int height,
RemoteWindowCallback callback)
Resizes e existing window with the specified name,
|
static void |
restore(java.lang.String name)
Restores the existing window with the specified name,
|
static void |
restore(java.lang.String name,
RemoteWindowCallback callback)
Restores the existing window with the specified name,
|
static void |
setAutoCopyDataSources(java.lang.Boolean autoCopyDataSources)
Should
DataSources from other OpenFin windows with Smart GWT loaded be
copied by reference into this window? Such DataSources will be copied: when a page in another window is loaded
(potentially several DataSources at once) at the moment DataSources are created in a page loaded in another window
(just that DataSource) |
static int |
setEvent(MultiWindowEvent eventType,
MultiWindowEventCallback listener)
Registers a window event listener to be called whenever the event type occurs for any window in the application.
|
static void |
setShareMessageChannels(java.lang.Boolean shareMessageChannels)
Should this window share
Realtime Messaging channels with other windows? |
static void |
show(java.lang.String name)
Shows the existing window with the specified name,
|
static void |
show(java.lang.String name,
RemoteWindowCallback callback)
Shows the existing window with the specified name,
|
public static void setAutoCopyDataSources(java.lang.Boolean autoCopyDataSources)
DataSources
from other OpenFin windows with Smart GWT loaded be
copied by reference into this window? Such DataSources will be copied:This property will default to true if OpenFin is present; otherwise, false.
Note that reloading a page that created DataSources copied by reference into other windows (via this property) is not supported.
autoCopyDataSources
- new autoCopyDataSources. Default value is varies.public static java.lang.Boolean getAutoCopyDataSources()
DataSources
from other OpenFin windows with Smart GWT loaded be
copied by reference into this window? Such DataSources will be copied:This property will default to true if OpenFin is present; otherwise, false.
Note that reloading a page that created DataSources copied by reference into other windows (via this property) is not supported.
public static void setShareMessageChannels(java.lang.Boolean shareMessageChannels)
Realtime Messaging
channels with other windows? This property will default to true if OpenFin is present; otherwise, false.
shareMessageChannels
- new shareMessageChannels. Default value is varies.public static java.lang.Boolean getShareMessageChannels()
Realtime Messaging
channels with other windows? This property will default to true if OpenFin is present; otherwise, false.
public static void activate(java.lang.String name)
name
- unique window namepublic static void activate(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
activatedpublic static void bringToFront(java.lang.String name)
name
- unique window namepublic static void bringToFront(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
is brought to the frontpublic static void clearEvent(MultiWindowEvent eventType)
setEvent()
call should be passed.eventType
- event type to registersetEvent(com.smartgwt.client.types.MultiWindowEvent, com.smartgwt.client.browser.window.MultiWindowEventCallback)
public static void clearEvent(MultiWindowEvent eventType, int ID)
setEvent()
call should be passed.eventType
- event type to registerID
- ID of the event to clear. If not specified, all events of eventType will be
cleared.setEvent(com.smartgwt.client.types.MultiWindowEvent, com.smartgwt.client.browser.window.MultiWindowEventCallback)
public static void close(java.lang.String name)
name
- unique window namepublic static void close(java.lang.String name, boolean force)
close(java.lang.String)
public static void close(java.lang.String name, boolean force, RemoteWindowCallback callback)
name
- unique window nameforce
- whether to force it closedcallback
- callback run after RemoteWindow
closedpublic static void deactivate(java.lang.String name)
name
- unique window namepublic static void deactivate(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
deactivatedpublic static RemoteWindow find(java.lang.String name)
open()
(and the base window) can be found with
this method.name
- unique window namepublic static DataContext getDataContext()
DataContext
provided by the open()
call that opened this window, or a newly created (on demand)
DataContext
if this is the main application window, or no DataContext was provided.DataContext
for this windowpublic static RemoteWindow getLocalWindow()
RemoteWindow
instance for the current window (where the method
was called).public static RemoteWindow[] getOtherWindows()
RemoteWindow
for the other currently known windows
(excluding the local window
). This would
typically only be used to initialize logic dependent on other windows. You'd want to add a handler for the com.smartgwt.client.browser.window.events.OtherWindowsChangedEvent
. to ensure you keep things updated as
windows are opened or closed.public static RemoteWindow getParentWindow()
RemoteWindow
instance that opened this window.public static void hide(java.lang.String name)
name
- unique window namepublic static void hide(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
hiddenpublic static boolean isMainWindow()
RemoteWindow
wraps the main application window.public static void isShowing(java.lang.String name, RemoteWindowBooleanCallback callback)
name
- unique window namecallback
- callback to receive outputpublic static void maximize(java.lang.String name)
name
- unique window namepublic static void maximize(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
maximizedpublic static void minimize(java.lang.String name)
name
- unique window namepublic static void minimize(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
minimizedpublic static void move(java.lang.String name, int x, int y)
name
- unique window namex
- desired x-offset of left edgey
- desired y-offset of top edgepublic static void move(java.lang.String name, int x, int y, RemoteWindowCallback callback)
name
- unique window namex
- desired x-offset of left edgey
- desired y-offset of top edgecallback
- callback run after RemoteWindow
movedpublic static void open(java.lang.String url, java.lang.String name)
DataContext
. Note that if
the provided window name already exists, that window will just be activated
, and though the callback will be run, the supplied
url, dataContext, windowSettings, and classSettings will be ignored.
Support for passing POJOs (Java Object
references) to the child window in the DataContext
via APIs such as DataContext.setSharedJavaObject()
is "super experimental"
(beyond the feature itself, which is experimental).
url
- url to open in the window or null to reuse the current url.
See URL
name
- unique window name to open as a new windowpublic static void open(java.lang.String url, java.lang.String name, DataContext dataContext)
open(java.lang.String, java.lang.String)
public static void open(java.lang.String url, java.lang.String name, DataContext dataContext, RemoteWindowBooleanCallback callback)
open(java.lang.String, java.lang.String)
public static void open(java.lang.String url, java.lang.String name, DataContext dataContext, RemoteWindowBooleanCallback callback, BrowserWindowSettings windowSettings)
open(java.lang.String, java.lang.String)
public static void open(java.lang.String url, java.lang.String name, DataContext dataContext, RemoteWindowBooleanCallback callback, BrowserWindowSettings windowSettings, MultiWindowSettings classSettings)
DataContext
. Note that if
the provided window name already exists, that window will just be activated
, and though the callback will be run, the supplied
url, dataContext, windowSettings, and classSettings will be ignored.
Support for passing POJOs (Java Object
references) to the child window in the DataContext
via APIs such as DataContext.setSharedJavaObject()
is "super experimental"
(beyond the feature itself, which is experimental).
url
- url to open in the window or null to reuse the current url.
See URL
name
- unique window name to open as a new windowdataContext
- dataContext to apply to windowcallback
- callback run after RemoteWindow
created
or activated (parameter true if created)windowSettings
- settings applied to child browser windowclassSettings
- settings for child MultiWindow
classpublic static void resize(java.lang.String name, int width, int height)
name
- unique window namewidth
- desired new widthheight
- desired new heightpublic static void resize(java.lang.String name, int width, int height, RemoteWindowCallback callback)
name
- unique window namewidth
- desired new widthheight
- desired new heightcallback
- callback run after RemoteWindow
movedpublic static void restore(java.lang.String name)
name
- unique window namepublic static void restore(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
restoredpublic static int setEvent(MultiWindowEvent eventType, MultiWindowEventCallback listener)
eventType
- event type to registerlistener
- function to be called when event firesclearEvent(com.smartgwt.client.types.MultiWindowEvent)
public static void show(java.lang.String name)
name
- unique window namepublic static void show(java.lang.String name, RemoteWindowCallback callback)
name
- unique window namecallback
- callback run after RemoteWindow
shown