public abstract class XdevUI extends UI implements XdevComponent
The UI is the server side entry point for various client side features that are not represented as components added to a layout, e.g notifications, sub windows, and executing javascript in the browser.
When a new UI instance is needed, typically because the user opens a URL in a
browser window which points to e.g. VaadinServlet
, all
UIProvider
s registered to the current VaadinSession
are
queried for the UI class that should be used. The selection is by default
based on the UI
init parameter from web.xml.
After a UI has been created by the application, it is initialized using
UI.init(VaadinRequest)
. This method is intended to be overridden by the
developer to add components to the user interface and initialize
non-component functionality. The component hierarchy must be initialized by
passing a Component
with the main layout or other content of the view
to setContent(Component)
or to the constructor of the UI.
UI.init(VaadinRequest)
,
UIProvider
,
Serialized FormExtendableObject.Extensions
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
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
XdevUI()
Creates a new empty UI without a caption.
|
XdevUI(Component content)
Creates a new UI with the given component (often a layout) as its
content.
|
Modifier and Type | Method and Description |
---|---|
Future<Void> |
access(Runnable runnable)
Ensures
UI.access(Runnable) runs inside an
UIAccessWrapper . |
Future<Void> |
accessDefault(Runnable runnable)
Calls
UI.access(Runnable) without an UIAccessWrapper . |
void |
accessSynchronously(Runnable runnable)
Ensures
UI.accessSynchronously(Runnable) runs inside an
UIAccessWrapper . |
void |
accessSynchronouslyDefault(Runnable runnable)
Calls
UI#accessSynchronouslyDefault(Runnable) without an
UIAccessWrapper . |
<E> E |
addExtension(Class<? super E> type,
E extension)
Adds an extension to this component.
|
void |
addFocusChangeListener(FocusChangeListener listener) |
<E> E |
getExtension(Class<E> type)
Gets the registered extension for the specified type.
|
XdevActionManager |
getXdevActionManager() |
void |
removeFocusChangeListener(FocusChangeListener listener) |
void |
setContent(Component content) |
addAction, addActionHandler, addClickListener, addListener, addPollListener, addWindow, attach, changeVariables, close, detach, doInit, doRefresh, focus, getComponentCount, getConnectorTracker, getCurrent, getEmbedId, getLastHeartbeatTimestamp, getLastProcessedClientToServerId, getLoadingIndicatorConfiguration, getLocaleService, getNavigator, getNotificationConfiguration, getOverlayContainerLabel, getPage, getPollInterval, getPushConfiguration, getPushConnection, getReconnectDialogConfiguration, getScrollLeft, getScrollTop, getSession, getStateType, getTabIndex, getTheme, getTooltipConfiguration, getUI, getUIId, getWindows, isClosing, isConnectorEnabled, isResizeLazy, iterator, paintContent, push, removeAction, removeActionHandler, removeClickListener, removeListener, removePollListener, removeWindow, scrollIntoView, setCaption, setCurrent, setFocusedComponent, setLastHeartbeatTimestamp, setLastProcessedClientToServerId, setNavigator, setOverlayContainerLabel, setPollInterval, setPushConnection, setResizeLazy, setScrollLeft, setScrollTop, setSession, setTabIndex, setTheme, showNotification, showNotification, showNotification, showNotification, showNotification, showNotification
addComponentAttachListener, addComponentDetachListener, getContent, readDesign, removeComponentAttachListener, removeComponentDetachListener, removeFromParent, setHeight, setWidth, writeDesign
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, findAncestor, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isEnabled, isImmediate, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addListener, addListener, encodeState, equals, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getRpcManager, handleConnectorRequest, hashCode, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getClass, notify, notifyAll, toString, wait, wait, wait
isEnabled, isReadOnly, isVisible, setEnabled, setReadOnly, setVisible
markAsDirty
isEnabled, isImmediate
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, 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 XdevUI()
setContent(Component)
before using the UI.public XdevUI(Component content)
content
- the component to use as this UIs content.setContent(Component)
public <E> E addExtension(Class<? super E> type, E extension)
addExtension
in interface ExtendableObject
type
- the type to register the extension forextension
- the extensionnull
ExtendableObject.getExtension(Class)
public <E> E getExtension(Class<E> type)
getExtension
in interface ExtendableObject
type
- the type the extension was registered withnull
if none was added before for
this typeExtendableObject.addExtension(Class, Object)
public Future<Void> access(Runnable runnable)
UI.access(Runnable)
runs inside an
UIAccessWrapper
.
If you don't want a wrapper use accessDefault(Runnable)
.
public void accessSynchronously(Runnable runnable) throws UIDetachedException
UI.accessSynchronously(Runnable)
runs inside an
UIAccessWrapper
.
If you don't want a wrapper use
accessSynchronouslyDefault(Runnable)
.
accessSynchronously
in class UI
UIDetachedException
public Future<Void> accessDefault(Runnable runnable)
UI.access(Runnable)
without an UIAccessWrapper
.access(Runnable)
,
UI.access(Runnable)
public void accessSynchronouslyDefault(Runnable runnable) throws UIDetachedException
UI#accessSynchronouslyDefault(Runnable)
without an
UIAccessWrapper
.UIDetachedException
accessSynchronouslyDefault(Runnable)
,
UI#accessSynchronouslyDefault(Runnable)
public XdevActionManager getXdevActionManager()
public void addFocusChangeListener(FocusChangeListener listener)
public void removeFocusChangeListener(FocusChangeListener listener)
public void setContent(Component content)
setContent
in interface SingleComponentContainer
setContent
in class UI