Package io.jmix.tabbedmode
Class JmixUI
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.UI
io.jmix.tabbedmode.JmixUI
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.PollNotifier,com.vaadin.flow.router.RouterLayout,Serializable
@Component("tabmod_JmixUI")
@Scope("prototype")
public class JmixUI
extends com.vaadin.flow.component.UI
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classprotected static classNested classes/interfaces inherited from class com.vaadin.flow.component.UI
com.vaadin.flow.component.UI.BrowserLeaveNavigationEvent, com.vaadin.flow.component.UI.BrowserNavigateEvent, com.vaadin.flow.component.UI.BrowserRefreshEvent, com.vaadin.flow.component.UI.ClientViewPlaceholder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.springframework.context.ApplicationContextprotected com.vaadin.flow.router.NavigationStateprotected EventListenerDependencyInjectorprotected booleanprotected Stringprotected com.vaadin.flow.component.internal.UIInternalUpdaterprotected Stringprotected booleanprotected RedirectHandlerstatic final Stringprotected View<?>protected UiEventPublisherprotected intprotected ViewNavigationSupportprotected final ViewsFields inherited from class com.vaadin.flow.component.UI
CLIENT_NAVIGATE_TO, wrapperElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidConnect a client with the server side UI.protected voidvoidconnectClient(String flowRoutePath, String flowRouteQuery, String appShellTitle, elemental.json.JsonValue historyState, String trigger) Deprecated.protected RedirectHandlercreateRedirectHandler(Views views) voidprotected EventListenerDependencyInjectorFinds the current active view within this UI context.protected Stringstatic JmixUIGets the currently used UI.View<?>Returns the current activeViewwithin this UI context.protected com.vaadin.flow.router.NavigationStateReturns the jmix id of this UI, used to link this UI with a browser tab.getPreservedViewCache(String jmixUiId) Returns theRedirectHandlerassociated with this instance.com.vaadin.flow.server.VaadinSessionprotected com.vaadin.flow.server.VaadinSessionView<?>Returns the root view of the UI.Returns the root view of the UI if present.intgetUIId()protected voidhandleErrorNavigation(com.vaadin.flow.router.Location location) protected voidhandleException(com.vaadin.flow.router.Location location, Exception exception) protected voidhandleNavigation(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected voidhandleNavigationInternal(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected voidhandlePageLoad(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected ViewOpenModeinferOpenMode(Class<? extends View<?>> viewClass) protected booleanvoidCheck that the view can be leave.voidleaveNavigation(String route, String query) Deprecated.protected voidmovePreservedViewCache(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger, View<?> preservedView) <C extends com.vaadin.flow.component.Component>
Optional<C>navigate(Class<? extends C> navigationTarget, com.vaadin.flow.router.RouteParameters routeParameter, com.vaadin.flow.router.QueryParameters queryParameters) <T,C extends com.vaadin.flow.component.Component & com.vaadin.flow.router.HasUrlParameter<T>>
Optional<C>navigate(Class<? extends C> navigationTarget, T parameter, com.vaadin.flow.router.QueryParameters queryParameters) <T extends com.vaadin.flow.component.Component>
Optional<T>navigate(Class<? extends T> navigationTarget, com.vaadin.flow.router.QueryParameters queryParameters) voidprotected voidnavigateToPlaceholder(com.vaadin.flow.router.Location location) protected voidobtainJmixUiId(Consumer<String> resultHandler) protected voidremovePreservedViewCache(String jmixUiId) voidremoveRouterLayoutContent(com.vaadin.flow.component.HasElement oldContent) protected voidprotected voidrenderViewForRoute(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationTrigger trigger) protected voidreplaceStateIfDiffersAndNoReplacePending(String route, com.vaadin.flow.router.Location location) Do a history replaceState if the trimmed route differs from the event route and there is no pending replaceState command.protected booleansameLocation(com.vaadin.flow.router.Location oldLocation, com.vaadin.flow.router.Location newLocation) protected voidserverConnected(boolean cancel) protected voidprotected voidsetPreservedViewCache(String jmixUiId, View<?> topLevelView) voidsetTopLevelView(View<?> topLevelView) protected booleanshouldHandleNavigation(com.vaadin.flow.router.Location location) protected booleanshouldSkipNavigation(com.vaadin.flow.router.NavigationTrigger trigger) voidshowRouterLayoutContent(com.vaadin.flow.component.HasElement content) protected voidskipNavigation(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationTrigger trigger) protected UiEventPublisherprotected booleanuiWithSameJmixUiIdExists(String jmixUiId) protected ViewNavigationSupportMethods inherited from class com.vaadin.flow.component.UI
access, accessLater, accessLater, accessSynchronously, add, addAfterNavigationListener, addBeforeEnterListener, addBeforeLeaveListener, addHeartbeatListener, addModal, addShortcutListener, addShortcutListener, addToModalComponent, beforeClientResponse, browserNavigate, close, doInit, getActiveDragSourceComponent, getActiveRouterTargetsChain, getActiveViewLocation, getChildren, getCsrfToken, getElement, getInternals, getLoadingIndicatorConfiguration, getLocale, getNavigationListeners, getPage, getPollInterval, getPushConfiguration, getReconnectDialogConfiguration, getRouter, getUI, hasModalComponent, init, isClosing, isNavigationSupported, leaveNavigation, navigate, navigate, navigate, navigate, navigate, navigateToClient, onAttach, onDetach, push, refreshCurrentRoute, setChildComponentModal, setCurrent, setDirection, setLocale, setPollIntervalMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.PollNotifier
addPollListener
-
Field Details
-
STORAGE_KEY
- See Also:
-
uiId
protected int uiId -
internalsHandler
protected com.vaadin.flow.component.internal.UIInternalUpdater internalsHandler -
jmixUiId
-
applicationContext
protected final org.springframework.context.ApplicationContext applicationContext -
views
-
redirectHandler
-
uiEventPublisher
-
eventListenerDependencyInjector
-
topLevelView
-
forwardToClientUrl
-
-
Constructor Details
-
JmixUI
-
JmixUI
protected JmixUI(org.springframework.context.ApplicationContext context, Views views, com.vaadin.flow.component.internal.UIInternalUpdater internalsHandler)
-
-
Method Details
-
createRedirectHandler
-
getRedirectHandler
Returns theRedirectHandlerassociated with this instance.- Returns:
- the
RedirectHandlerresponsible for handling navigation redirects
-
getJmixUiId
Returns the jmix id of this UI, used to link this UI with a browser tab. When this UI is initialized and a browser tab already has another UI with the same jmix id associated, the content of the previous UI is moved to this.- Returns:
- the jmix id of this UI
-
getUIId
public int getUIId()- Overrides:
getUIIdin classcom.vaadin.flow.component.UI
-
getCurrent
Gets the currently used UI. The current UI is automatically defined when processing requests to the server. In other cases, (e.g. from background threads), the current UI is not automatically defined.The UI is stored using a weak reference to avoid leaking memory in case it is not explicitly cleared.
- Returns:
- the current UI instance if available, otherwise
null - See Also:
-
UI.setCurrent(UI)
-
getSession
@Nullable public com.vaadin.flow.server.VaadinSession getSession()- Overrides:
getSessionin classcom.vaadin.flow.component.UI
-
getSessionNN
protected com.vaadin.flow.server.VaadinSession getSessionNN() -
getForwardToClientUrl
- Overrides:
getForwardToClientUrlin classcom.vaadin.flow.component.UI
-
doInit
- Overrides:
doInitin classcom.vaadin.flow.component.UI
-
connectClient
@Deprecated public void connectClient(String flowRoutePath, String flowRouteQuery, String appShellTitle, elemental.json.JsonValue historyState, String trigger) Deprecated.- Overrides:
connectClientin classcom.vaadin.flow.component.UI
-
replaceStateIfDiffersAndNoReplacePending
protected void replaceStateIfDiffersAndNoReplacePending(String route, com.vaadin.flow.router.Location location) Do a history replaceState if the trimmed route differs from the event route and there is no pending replaceState command.- Parameters:
route- the event.routelocation- the location with the trimmed route
-
acknowledgeClient
protected void acknowledgeClient() -
cancelClient
protected void cancelClient() -
serverPaused
protected void serverPaused() -
serverConnected
protected void serverConnected(boolean cancel) -
sameLocation
protected boolean sameLocation(com.vaadin.flow.router.Location oldLocation, com.vaadin.flow.router.Location newLocation) -
isPostponed
protected boolean isPostponed() -
handleException
-
obtainJmixUiId
-
uiWithSameJmixUiIdExists
-
findCurrentViewLocationString
-
inferOpenMode
-
getTopLevelView
Returns the root view of the UI.- Returns:
- the root view of the UI
- Throws:
IllegalStateException- in case there is no root view in UI
-
getTopLevelViewOptional
Returns the root view of the UI if present.- Returns:
- the root view of the UI if present
-
setTopLevelView
-
getCurrentView
Returns the current activeViewwithin this UI context. This method searches for the current view using a prioritized approach:- Dialog windows
- Views of the currently opened tab of a
WorkArea - The root view
- Overrides:
getCurrentViewin classcom.vaadin.flow.component.UI- Returns:
- the current active
View - Throws:
IllegalStateException- if the currentViewis not found- See Also:
-
findCurrentView
Finds the current active view within this UI context. This method searches for the current view using a prioritized approach:- Dialog windows
- Views of the currently opened tab of a
WorkArea - The root view
-
showRouterLayoutContent
public void showRouterLayoutContent(com.vaadin.flow.component.HasElement content) -
removeRouterLayoutContent
public void removeRouterLayoutContent(com.vaadin.flow.component.HasElement oldContent) -
renderTopLevelView
protected void renderTopLevelView() -
getPreservedViewCache
-
setPreservedViewCache
-
removePreservedViewCache
-
uiEventPublisher
-
eventListenerDependencyInjector
-