org.cruxframework.crux.core.client.screen
Class JSWindow

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by org.cruxframework.crux.core.client.screen.JSWindow

public class JSWindow
extends com.google.gwt.core.client.JavaScriptObject

A Window JavaScriptObject. Useful for accessing foreign native JS objects and functions.

Author:
Gesse S. F. Dafe

Constructor Summary
protected JSWindow()
          Obeying to GWT JSNI restrictions
 
Method Summary
 void changeLocation(String newURL)
          Changes the location of the window
static JSWindow currentWindow()
          Returns the current window native object;
static JSWindow getAbsoluteTop()
          Returns the topmost window native object.
static String getLocation(JSWindow jsWindow)
          Gets the URL of the given window.
static JSWindow getParentWindow(JSWindow jsWindow)
          Gets the parent of the given window, if it exists.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSWindow

protected JSWindow()
Obeying to GWT JSNI restrictions

Method Detail

currentWindow

public static JSWindow currentWindow()
Returns the current window native object;

Returns:

getAbsoluteTop

public static JSWindow getAbsoluteTop()
Returns the topmost window native object. No matter if the current window is a frame, a popup or whatever.

Returns:

changeLocation

public final void changeLocation(String newURL)
Changes the location of the window

Parameters:
newURL -

getParentWindow

public static final JSWindow getParentWindow(JSWindow jsWindow)
Gets the parent of the given window, if it exists. Returns null otherwise.

Parameters:
jsWindow -

getLocation

public static final String getLocation(JSWindow jsWindow)
Gets the URL of the given window.

Parameters:
jsWindow -


Copyright © 2014. All rights reserved.