@Deprecated public class LegacyWindow extends UI
LegacyApplication
UI.WindowOrderUpdateEvent, UI.WindowOrderUpdateListener
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
actionManager
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
LegacyWindow()
Deprecated.
Create a new legacy window.
|
LegacyWindow(String caption)
Deprecated.
Creates a new legacy window with the given caption.
|
LegacyWindow(String caption,
ComponentContainer content)
Deprecated.
Creates a legacy window with the given caption and content layout.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component)
Deprecated.
Adds a component to this UI.
|
void |
addListener(Page.BrowserWindowResizeListener resizeListener)
Deprecated.
As of 7.0, use the similarly named api in Page instead
|
void |
executeJavaScript(String script)
Deprecated.
As of 7.0, use JavaScript.getCurrent().execute(String)
instead
|
LegacyApplication |
getApplication()
Deprecated.
|
int |
getBrowserWindowHeight()
Deprecated.
As of 7.0, use the similarly named api in Page instead
|
int |
getBrowserWindowWidth()
Deprecated.
As of 7.0, use the similarly named api in Page instead
|
ComponentContainer |
getContent()
Deprecated.
Gets the content of this container.
|
String |
getName()
Deprecated.
Gets the unique name of the window.
|
URL |
getURL()
Deprecated.
Gets the full URL of the window.
|
protected void |
init(VaadinRequest request)
Deprecated.
Initializes this UI.
|
void |
open(Resource resource)
Deprecated.
As of 7.0, use getPage().setLocation instead
|
void |
open(Resource resource,
String windowName)
Deprecated.
As of 7.0, use getPage().open instead
|
void |
open(Resource resource,
String windowName,
boolean tryToOpenAsPopup)
Deprecated.
Opens the given resource in a window with the given name and optionally
tries to force the resource to open in a new window instead of a new tab.
|
void |
open(Resource resource,
String windowName,
int width,
int height,
BorderStyle border)
Deprecated.
As of 7.0, use getPage().open instead
|
void |
removeAllComponents()
Deprecated.
This implementation removes the components from the content container (
getContent() ) instead of from the actual UI. |
void |
removeComponent(Component component)
Deprecated.
This implementation removes the component from the content container (
getContent() ) instead of from the actual UI. |
void |
removeListener(Page.BrowserWindowResizeListener resizeListener)
Deprecated.
As of 7.0, use the similarly named api in Page instead
|
void |
replaceComponent(Component oldComponent,
Component newComponent)
Deprecated.
This implementation replaces a component in the content container (
getContent() ) instead of in the actual UI. |
void |
setApplication(LegacyApplication application)
Deprecated.
|
void |
setCaption(String caption)
Deprecated.
Setting the caption of a UI is not supported.
|
void |
setContent(Component content)
Deprecated.
Set the content of the window.
|
void |
setName(String name)
Deprecated.
Sets the unique name of the window.
|
access, accessSynchronously, addAction, addActionHandler, addClickListener, addPollListener, addWindow, addWindowOrderUpdateListener, attach, changeVariables, close, detach, doInit, doRefresh, focus, getActionManager, getActiveDragSource, getComponentCount, getConnectorTracker, getCurrent, getEmbedId, getLastHeartbeatTimestamp, getLastProcessedClientToServerId, getLoadingIndicatorConfiguration, getLocaleService, getNavigator, getNotificationConfiguration, getOverlayContainerLabel, getPage, getPollInterval, getPushConfiguration, getPushConnection, getReconnectDialogConfiguration, getScrollLeft, getScrollTop, getSession, getState, getState, getStateType, getTabIndex, getTheme, getTooltipConfiguration, getUI, getUIId, getUiPathInfo, getUiRootPath, getWindows, isClosing, isConnectorEnabled, isMobileHtml5DndEnabled, isResizeLazy, iterator, paintContent, push, refresh, removeAction, removeActionHandler, removeClickListener, removePollListener, removeWindow, scrollIntoView, setActiveDragSource, setCurrent, setFocusedComponent, setLastHeartbeatTimestamp, setLastProcessedClientToServerId, setMobileHtml5DndEnabled, setNavigator, setOverlayContainerLabel, setPollInterval, setPushConnection, setResizeLazy, setScrollLeft, setScrollTop, setSession, setTabIndex, setTheme, showNotification, showNotification, showNotification, showNotification, showNotification, showNotification
addComponentAttachListener, addComponentDetachListener, fireComponentAttachEvent, fireComponentDetachEvent, readDesign, readDesignChildren, removeComponentAttachListener, removeComponentDetachListener, removeFromParent, setHeight, setWidth, writeDesign
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, findAncestor, fireComponentErrorEvent, fireComponentEvent, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
markAsDirty
isEnabled
addListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesign
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, handleConnectorRequest, isAttached, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
public LegacyWindow()
public LegacyWindow(String caption)
caption
- the caption of the windowpublic LegacyWindow(String caption, ComponentContainer content)
caption
- content
- protected void init(VaadinRequest request)
UI
The VaadinRequest
can be used to get information about the
request that caused this UI to be created.
public void setApplication(LegacyApplication application)
public LegacyApplication getApplication()
public String getName()
The name also determines the URL that can be used for direct access to a
window. All windows can be accessed through
http://host:port/app/win
where http://host:port/app
is
the application URL (as returned by LegacyApplication.getURL()
and win
is the window name.
Note! Portlets do not support direct window access through URLs.
public void setName(String name)
The name also determines the URL that can be used for direct access to a
window. All windows can be accessed through
http://host:port/app/win
where http://host:port/app
is
the application URL (as returned by LegacyApplication.getURL()
and win
is the window name.
This method can only be called before the window is added to an application.
Note! Portlets do not support direct window access through URLs.
name
- the new name for the window or null if the application should
automatically assign a name to itIllegalStateException
- if the window is attached to an applicationpublic URL getURL()
Note! This method can not be used for portlets.
@Deprecated public void open(Resource resource)
Resource
.resource
- the resource to show in this UI@Deprecated public 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.
As of Vaadin 7.0.0, the functionality for opening a Resource in a Page
has been replaced with similar methods based on a String URL. This is
because the usage of Resource is problematic with memory management and
with security features in some browsers. Is is recommended to instead use
Link
for starting downloads.
resource
- the resource.windowName
- the name of the window.public void open(Resource resource, String windowName, boolean tryToOpenAsPopup)
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.
If windowName
is set to open the resource in a new window or tab
and tryToOpenAsPopup
is true, this method attempts to force the
browser to open a new window instead of a tab. NOTE: This is a
best-effort attempt and may not work reliably with all browsers and
different pop-up preferences. With most browsers using default settings,
tryToOpenAsPopup
works properly.
As of Vaadin 7.0.0, the functionality for opening a Resource in a Page
has been replaced with similar methods based on a String URL. This is
because the usage of Resource is problematic with memory management and
with security features in some browsers. Is is recommended to instead use
Link
for starting downloads.
resource
- the resource.windowName
- the name of the window.tryToOpenAsPopup
- Whether to try to force the resource to be opened in a new
window@Deprecated public void open(Resource resource, String windowName, int width, int height, BorderStyle border)
windowName
, see
open(Resource, String)
.
As of Vaadin 7.0.0, the functionality for opening a Resource in a Page
has been replaced with similar methods based on a String URL. This is
because the usage of Resource is problematic with memory management and
with security features in some browsers. Is is recommended to instead use
Link
for starting downloads.
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.@Deprecated public void addListener(Page.BrowserWindowResizeListener resizeListener)
Page.BrowserWindowResizeListener
to this UI. The listener
will be notified whenever the browser window within which this UI resides
is resized.resizeListener
- the listener to addBrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent)
,
UI.setResizeLazy(boolean)
@Deprecated public void removeListener(Page.BrowserWindowResizeListener resizeListener)
Page.BrowserWindowResizeListener
from this UI. The listener
will no longer be notified when the browser window is resized.resizeListener
- the listener to remove@Deprecated public int getBrowserWindowHeight()
@Deprecated public int getBrowserWindowWidth()
@Deprecated public void executeJavaScript(String script)
This method allows one to inject javascript from the server to client. A client implementation is not required to implement this functionality, but currently all web-based clients do implement this.
Executing javascript this way often leads to cross-browser compatibility issues and regressions that are hard to resolve. Use of this method should be avoided and instead it is recommended to create new widgets with GWT. For more info on creating own, reusable client-side widgets in Java, read the corresponding chapter in Book of Vaadin.
script
- JavaScript snippet that will be executed.public void setCaption(String caption)
UI
setCaption
in interface Component
setCaption
in class UI
caption
- the new caption for the component. If the caption is
null
, no caption is shown and it does not normally
take any spacepublic ComponentContainer getContent()
SingleComponentContainer
getContent
in interface SingleComponentContainer
getContent
in class AbstractSingleComponentContainer
SingleComponentContainer.setContent(Component)
public void setContent(Component content)
LegacyWindow
, the content
must be a ComponentContainer
.setContent
in interface SingleComponentContainer
setContent
in class UI
content
- public void replaceComponent(Component oldComponent, Component newComponent)
getContent()
) instead of in the actual UI.
This method should only be called when the content is a
ComponentContainer
(default VerticalLayout
or explicitly
set).public void addComponent(Component component)
getContent()
).
This method should only be called when the content is a
ComponentContainer
(default VerticalLayout
or explicitly
set).component
- the component to add to this UIgetContent()
public void removeComponent(Component component)
getContent()
) instead of from the actual UI.
This method should only be called when the content is a
ComponentContainer
(default VerticalLayout
or explicitly
set).public void removeAllComponents()
getContent()
) instead of from the actual UI.
This method should only be called when the content is a
ComponentContainer
(default VerticalLayout
or explicitly
set).Copyright © 2018 Vaadin Ltd. All rights reserved.