com.vaadin.server
Class BrowserPopupOpener

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.server.BrowserPopupOpener
All Implemented Interfaces:
ClientConnector, Extension, RpcTarget, com.vaadin.shared.Connector, java.io.Serializable

public class BrowserPopupOpener
extends AbstractExtension

Component extension that opens a browser popup window when the extended component is clicked.

Since:
7.0.0
Author:
Vaadin Ltd
See Also:
Serialized Form

Constructor Summary
BrowserPopupOpener(java.lang.Class<? extends UI> uiClass)
          Creates a popup opener that will open popups containing the provided UI class
BrowserPopupOpener(java.lang.Class<? extends UI> uiClass, java.lang.String path)
          Creates a popup opener that will open popups containing the provided UI using the provided path
BrowserPopupOpener(Resource resource)
          Creates a popup opener that will open popups to the provided resource
BrowserPopupOpener(java.lang.String url)
          Creates a popup opener that will open popups to the provided URL
 
Method Summary
 void attach()
          Notifies the connector that it is connected to an application.
 void detach()
          Notifies the component that it is detached from the application.
 void extend(AbstractComponent target)
           
 java.lang.String getFeatures()
          Gets the popup features.
 java.lang.String getPopupName()
          Gets the popup target name.
protected  com.vaadin.shared.ui.BrowserPopupExtensionState getState()
           
 void setFeatures(java.lang.String features)
          Sets the features for opening the popup.
 void setPopupName(java.lang.String popupName)
          Sets the target window name that will be used when opening the popup.
 
Methods inherited from class com.vaadin.server.AbstractExtension
extend, getSupportedParentType, removeFromTarget, setParent
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addExtension, addMethodInvocationToQueue, beforeClientResponse, createState, encodeState, getAllChildrenIterable, getConnectorId, getExtensions, getParent, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.server.ClientConnector
beforeClientResponse, encodeState, getExtensions, getParent, getStateType, getUI, handleConnectorRequest, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.RpcTarget
getRpcManager
 

Constructor Detail

BrowserPopupOpener

public BrowserPopupOpener(java.lang.Class<? extends UI> uiClass)
Creates a popup opener that will open popups containing the provided UI class

Parameters:
uiClass - the UI class that should be opened when the extended component is clicked

BrowserPopupOpener

public BrowserPopupOpener(java.lang.Class<? extends UI> uiClass,
                          java.lang.String path)
Creates a popup opener that will open popups containing the provided UI using the provided path

Parameters:
uiClass - the UI class that should be opened when the extended component is clicked
path - the path that the UI should be bound to

BrowserPopupOpener

public BrowserPopupOpener(java.lang.String url)
Creates a popup opener that will open popups to the provided URL

Parameters:
url - the URL to open in the popup

BrowserPopupOpener

public BrowserPopupOpener(Resource resource)
Creates a popup opener that will open popups to the provided resource

Parameters:
resource - the resource to open in the popup
Method Detail

extend

public void extend(AbstractComponent target)

setPopupName

public void setPopupName(java.lang.String popupName)
Sets the target window name that will be used when opening the popup. If a popup has already been opened with the same name, the contents of that window will be replaced instead of opening a new window. If the name is null or "blank", the popup will always be opened in a new window.

Parameters:
popupName - the target name for the popups

getPopupName

public java.lang.String getPopupName()
Gets the popup target name.

Returns:
the popup target string
See Also:
setPopupName(String)

setFeatures

public void setFeatures(java.lang.String features)
Sets the features for opening the popup. See e.g. https://developer.mozilla.org/en-US/docs/DOM/window.open#Position_and_size_features for a description of the commonly supported features.

Parameters:
features - a string with popup features, or null to use the default features.

getFeatures

public java.lang.String getFeatures()
Gets the popup features.

Returns:
See Also:
setFeatures(String)

getState

protected com.vaadin.shared.ui.BrowserPopupExtensionState getState()
Overrides:
getState in class AbstractClientConnector

attach

public void attach()
Description copied from interface: ClientConnector
Notifies the connector that it is connected to an application.

The caller of this method is ClientConnector.setParent(ClientConnector) if the parent is itself already attached to the application. If not, the parent will call the ClientConnector.attach() for all its children when it is attached to the application. This method is always called before the connector's data is sent to the client-side for the first time.

The attachment logic is implemented in AbstractClientConnector.

Specified by:
attach in interface ClientConnector
Overrides:
attach in class AbstractClientConnector

detach

public void detach()
Description copied from class: AbstractClientConnector
Notifies the component that it is detached from the application.

The caller of this method is ClientConnector.setParent(ClientConnector) if the parent is in the application. When the parent is detached from the application it is its response to call ClientConnector.detach() for all the children and to detach itself from the terminal.

The AbstractClientConnector.getSession() and AbstractClientConnector.getUI() methods might return null after this method is called.

Specified by:
detach in interface ClientConnector
Overrides:
detach in class AbstractClientConnector


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.