Class RemoteWindow

java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.browser.window.RemoteWindow
All Implemented Interfaces:
HasHandlers, HasOtherWindowsChangedHandlers
Direct Known Subclasses:
OpenFinWindow

public class RemoteWindow extends BaseClass implements HasOtherWindowsChangedHandlers
Note: this is currently an experimental feature and not covered by normal support guarantees. See Experimental Features for more information.

Provides APIs that manipulate a Smart GWT browser window. Within the OpenFin environment, the underlying implementation is actually via the OpenFinWindow class.
See Also:
  • Constructor Details

    • RemoteWindow

      public RemoteWindow()
    • RemoteWindow

      public RemoteWindow(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static RemoteWindow getOrCreateRef(JavaScriptObject jsObj)
    • setJavaScriptObject

      public void setJavaScriptObject(JavaScriptObject jsObj)
      Overrides:
      setJavaScriptObject in class BaseClass
    • create

      public JavaScriptObject create()
      Specified by:
      create in class BaseClass
    • isCreated

      public boolean isCreated()
      Overrides:
      isCreated in class BaseClass
    • getJsObj

      public JavaScriptObject getJsObj()
      Overrides:
      getJsObj in class BaseClass
    • getOrCreateJsObj

      public JavaScriptObject getOrCreateJsObj()
      Overrides:
      getOrCreateJsObj in class BaseClass
    • activate

      public void activate()
      Focuses (activates) this RemoteWindow.
    • activate

      public void activate(RemoteWindowCallback callback)
      Focuses (activates) this RemoteWindow.
      Parameters:
      callback - callback run after it's activated
    • blur

      public void blur()
      Blurs (deactivates) this RemoteWindow.
    • blur

      public void blur(RemoteWindowCallback callback)
      Blurs (deactivates) this RemoteWindow.
      Parameters:
      callback - callback run after it's deactivated
    • bringToFront

      public void bringToFront()
      Brings this RemoteWindow to the front in window stacking order.
    • bringToFront

      public void bringToFront(RemoteWindowCallback callback)
      See Also:
    • bringToFront

      public void bringToFront(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Brings this RemoteWindow to the front in window stacking order.
      Parameters:
      callback - callback run after raising window
      errorCallback - callback run if raising fails
    • close

      public void close()
      Closes this RemoteWindow.
    • close

      public void close(boolean force)
      See Also:
    • close

      public void close(boolean force, RemoteWindowCallback callback)
      Closes this RemoteWindow.
      Parameters:
      force - whether to force it closed
      callback - callback run after it's closed
    • deactivate

      public void deactivate()
      Blurs (deactivates) this RemoteWindow.
    • deactivate

      public void deactivate(RemoteWindowCallback callback)
      Blurs (deactivates) this RemoteWindow.
      Parameters:
      callback - callback run after it's deactivated
    • focus

      public void focus()
      Focuses (activates) this RemoteWindow.
    • focus

      public void focus(RemoteWindowCallback callback)
      Focuses (activates) this RemoteWindow.
      Parameters:
      callback - callback run after it's activated
    • getBrowserHeight

      public int getBrowserHeight()
      Get the height of the entire browser window, including browser chrome.
      Returns:
      height of the browser
    • getBrowserWidth

      public int getBrowserWidth()
      Get the width of the entire browser window, including browser chrome.
      Returns:
      width of the browser
    • getContainerWindow

      public Map getContainerWindow()
      Returns the container window, if present, wrapping the browser window for this RemoteWindow. If OpenFin is present, this will return the associated OpenFin Window.
      Returns:
      OpenFin window
    • getInfo

      public void getInfo(RemoteWindowMapCallback callback)
      Checks whether this RemoteWindow is showing.
      Parameters:
      callback - callback to receive output
    • getName

      public String getName()
      Returns the name of this RemoteWindow.
      Returns:
      window name
    • getPageHeight

      public int getPageHeight()
      Get the height of the visible portion of the window, not including browser chrome or the scrollbar area.
      Returns:
      height of the page
    • getPageWidth

      public int getPageWidth()
      Get the width of the visible portion of the window, not including browser chrome or the scrollbar area.
      Returns:
      width of the page
    • getParent

      public RemoteWindow getParent()
      Returns the parent RemoteWindow instance that opened this RemoteWindow.
      Returns:
      instance wrapping the parent window or null
    • getWindow

      public Map getWindow()
      Returns the browser window object associated with this RemoteWindow.
      Returns:
      browser window
    • hide

      public void hide()
      Hides this RemoteWindow.
    • hide

      public void hide(RemoteWindowCallback callback)
      See Also:
    • hide

      public void hide(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Hides this RemoteWindow.
      Parameters:
      callback - callback run after hiding the window
      errorCallback - callback run if hiding fails
    • isShowing

      public void isShowing(RemoteWindowBooleanCallback callback)
      Checks whether this RemoteWindow is showing.
      Parameters:
      callback - callback to receive output
    • maximize

      public void maximize()
      Maximizes this RemoteWindow.
    • maximize

      public void maximize(RemoteWindowCallback callback)
      See Also:
    • maximize

      public void maximize(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Maximizes this RemoteWindow.
      Parameters:
      callback - callback run after maximization
      errorCallback - callback run if maximizing fails
    • minimize

      public void minimize()
      Minimizes this RemoteWindow.
    • minimize

      public void minimize(RemoteWindowCallback callback)
      See Also:
    • minimize

      public void minimize(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Minimizes this RemoteWindow.
      Parameters:
      callback - callback run after minimization
      errorCallback - callback run if minimizing fails
    • move

      public void move(int x, int y)
      Moves this RemoteWindow.
      Parameters:
      x - desired x-offset of left edge
      y - desired y-offset of top edge
    • move

      public void move(int x, int y, RemoteWindowCallback callback)
      Moves this RemoteWindow.
      Parameters:
      x - desired x-offset of left edge
      y - desired y-offset of top edge
      callback - callback run after it's moved
    • addOtherWindowsChangedHandler

      public HandlerRegistration addOtherWindowsChangedHandler(OtherWindowsChangedHandler handler)
      Add a otherWindowsChanged handler.

      Notification fired when the set of other RemoteWindows changes or requires re-synchronization due a call to create(), close(), or a page reload in a different RemoteWindow.

      This method has no default implementation.

      Specified by:
      addOtherWindowsChangedHandler in interface HasOtherWindowsChangedHandlers
      Parameters:
      handler - the otherWindowsChanged handler
      Returns:
      HandlerRegistration used to remove this handler
    • resize

      public void resize(int width, int height)
      Resizes this RemoteWindow.
      Parameters:
      width - desired new width
      height - desired new height
    • resize

      public void resize(int width, int height, RemoteWindowCallback callback)
      Resizes this RemoteWindow.
      Parameters:
      width - desired new width
      height - desired new height
      callback - callback run after it's resized
    • restore

      public void restore()
      Restores this RemoteWindow from being maximized or minimized.
    • restore

      public void restore(RemoteWindowCallback callback)
      See Also:
    • restore

      public void restore(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Restores this RemoteWindow from being maximized or minimized.
      Parameters:
      callback - callback run after restoration
      errorCallback - callback run if restoring fails
    • show

      public void show()
      Shows this RemoteWindow.
    • show

      public void show(RemoteWindowCallback callback)
      See Also:
    • show

      public void show(RemoteWindowCallback callback, RemoteWindowErrorCallback errorCallback)
      Shows this RemoteWindow.
      Parameters:
      callback - callback run after showing the window
      errorCallback - callback run if showing fails
    • hasCreationContextWindow

      protected boolean hasCreationContextWindow()