|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.terminal.Page
public class Page
Nested Class Summary | |
---|---|
class |
Page.BrowserWindowResizeEvent
Event that is fired when a browser window containing a root is resized. |
static interface |
Page.BrowserWindowResizeListener
Listener that gets notified when the size of the browser window containing the root has changed. |
class |
Page.FragmentChangedEvent
Event fired when uri fragment changes. |
static interface |
Page.FragmentChangedListener
Listener that listens changes in URI fragment. |
Field Summary | |
---|---|
static int |
BORDER_DEFAULT
A border style that indicates that the default border style should be used when opening resources. |
static int |
BORDER_MINIMAL
A border style used for opening resources in a window with a minimal border. |
static int |
BORDER_NONE
A border style used for opening resources in a window without a border. |
Constructor Summary | |
---|---|
Page(Root root)
|
Method Summary | |
---|---|
void |
addListener(Page.BrowserWindowResizeListener resizeListener)
Adds a new Page.BrowserWindowResizeListener to this root. |
void |
addListener(Page.FragmentChangedListener listener)
|
int |
getBrowserWindowHeight()
Gets the last known height of the browser window in which this root resides. |
int |
getBrowserWindowWidth()
Gets the last known width of the browser window in which this root resides. |
static Page |
getCurrent()
Gets the Page to which the current root belongs. |
String |
getFragment()
Gets currently set URI fragment. |
JavaScript |
getJavaScript()
|
WebBrowser |
getWebBrowser()
|
void |
init(WrappedRequest request)
|
void |
open(Resource resource)
Opens the given resource in this root. |
void |
open(Resource resource,
String windowName)
Opens the given resource in a window with the given name. |
void |
open(Resource resource,
String windowName,
int width,
int height,
int border)
Opens the given resource in a window with the given size, border and name. |
void |
paintContent(PaintTarget target)
|
void |
removeListener(Page.BrowserWindowResizeListener resizeListener)
Removes a Page.BrowserWindowResizeListener from this root. |
void |
removeListener(Page.FragmentChangedListener listener)
|
void |
setBrowserWindowSize(Integer width,
Integer height)
|
void |
setFragment(String newFragment)
Sets URI fragment. |
void |
setFragment(String newFragment,
boolean fireEvents)
Sets URI fragment. |
void |
setTitle(String title)
Sets the page title. |
void |
showNotification(Notification notification)
Deprecated. Use Notification.show(Page) instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BORDER_NONE
public static final int BORDER_MINIMAL
public static final int BORDER_DEFAULT
Constructor Detail |
---|
public Page(Root root)
Method Detail |
---|
public void addListener(Page.FragmentChangedListener listener)
public void removeListener(Page.FragmentChangedListener listener)
public void setFragment(String newFragment, boolean fireEvents)
Page.FragmentChangedEvent
newFragment
- id of the new fragmentfireEvent
- true to fire eventPage.FragmentChangedEvent
,
Page.FragmentChangedListener
public void setFragment(String newFragment)
Page.FragmentChangedEvent
newFragment
- id of the new fragmentPage.FragmentChangedEvent
,
Page.FragmentChangedListener
public String getFragment()
To listen changes in fragment, hook a
Page.FragmentChangedListener
.
public void init(WrappedRequest request)
public WebBrowser getWebBrowser()
public void setBrowserWindowSize(Integer width, Integer height)
public void addListener(Page.BrowserWindowResizeListener resizeListener)
Page.BrowserWindowResizeListener
to this root. The listener
will be notified whenever the browser window within which this root
resides is resized.
resizeListener
- the listener to addBrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent)
,
#setResizeLazy(boolean)
public void removeListener(Page.BrowserWindowResizeListener resizeListener)
Page.BrowserWindowResizeListener
from this root. The
listener will no longer be notified when the browser window is resized.
resizeListener
- the listener to removepublic int getBrowserWindowHeight()
public int getBrowserWindowWidth()
public JavaScript getJavaScript()
public void paintContent(PaintTarget target) throws PaintException
PaintException
public void open(Resource resource)
Resource
.
resource
- the resource to show in this rootpublic void open(Resource resource, String windowName)
The supplied windowName
is used as the target name in a
window.open call in the client. This means that special values such as
"_blank", "_self", "_top", "_parent" have special meaning. An empty or
null
window name is also a special case.
"", null and "_self" as windowName
all causes the resource to be
opened in the current window, replacing any old contents. For
downloadable content you should avoid "_self" as "_self" causes the
client to skip rendering of any other changes as it considers them
irrelevant (the page will be replaced by the resource). This can speed up
the opening of a resource, but it might also put the client side into an
inconsistent state if the window content is not completely replaced e.g.,
if the resource is downloaded instead of displayed in the browser.
"_blank" as windowName
causes the resource to always be opened in
a new window or tab (depends on the browser and browser settings).
"_top" and "_parent" as windowName
works as specified by the HTML
standard.
Any other windowName
will open the resource in a window with that
name, either by opening a new window/tab in the browser or by replacing
the contents of an existing window with that name.
resource
- the resource.windowName
- the name of the window.public void open(Resource resource, String windowName, int width, int height, int border)
windowName
, see
open(Resource, String)
.
resource
- the resource.windowName
- the name of the window.width
- the width of the window in pixelsheight
- the height of the window in pixelsborder
- the border style of the window. See Window.BORDER_* constants
@Deprecated public void showNotification(Notification notification)
notification
- The notification message to showNotification
public static Page getCurrent()
null
Root.getCurrent()
public void setTitle(String title)
title
- the new page title to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |