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 class
static class
protected static class
Nested 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.ApplicationContext
protected com.vaadin.flow.router.NavigationState
protected EventListenerDependencyInjector
protected boolean
protected String
protected com.vaadin.flow.component.internal.UIInternalUpdater
protected String
protected boolean
protected RedirectHandler
static final String
protected View<?>
protected UiEventPublisher
protected int
protected ViewNavigationSupport
protected final Views
Fields inherited from class com.vaadin.flow.component.UI
CLIENT_NAVIGATE_TO, wrapperElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
Connect a client with the server side UI.protected void
void
connectClient
(String flowRoutePath, String flowRouteQuery, String appShellTitle, elemental.json.JsonValue historyState, String trigger) Deprecated.protected RedirectHandler
createRedirectHandler
(Views views) void
protected EventListenerDependencyInjector
Finds the current active view within this UI context.protected String
static JmixUI
Gets the currently used UI.View<?>
Returns the current activeView
within this UI context.protected com.vaadin.flow.router.NavigationState
Returns the jmix id of this UI, used to link this UI with a browser tab.getPreservedViewCache
(String jmixUiId) Returns theRedirectHandler
associated with this instance.com.vaadin.flow.server.VaadinSession
protected com.vaadin.flow.server.VaadinSession
View<?>
Returns the root view of the UI.Returns the root view of the UI if present.int
getUIId()
protected void
handleErrorNavigation
(com.vaadin.flow.router.Location location) protected void
handleException
(com.vaadin.flow.router.Location location, Exception exception) protected void
handleNavigation
(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected void
handleNavigationInternal
(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected void
handlePageLoad
(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationState navigationState, com.vaadin.flow.router.NavigationTrigger trigger) protected ViewOpenMode
inferOpenMode
(Class<? extends View<?>> viewClass) protected boolean
void
Check that the view can be leave.void
leaveNavigation
(String route, String query) Deprecated.protected void
movePreservedViewCache
(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) void
protected void
navigateToPlaceholder
(com.vaadin.flow.router.Location location) protected void
obtainJmixUiId
(Consumer<String> resultHandler) protected void
removePreservedViewCache
(String jmixUiId) void
removeRouterLayoutContent
(com.vaadin.flow.component.HasElement oldContent) protected void
protected void
renderViewForRoute
(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationTrigger trigger) 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.protected boolean
sameLocation
(com.vaadin.flow.router.Location oldLocation, com.vaadin.flow.router.Location newLocation) protected void
serverConnected
(boolean cancel) protected void
protected void
setPreservedViewCache
(String jmixUiId, View<?> topLevelView) void
setTopLevelView
(View<?> topLevelView) protected boolean
shouldHandleNavigation
(com.vaadin.flow.router.Location location) protected boolean
shouldSkipNavigation
(com.vaadin.flow.router.NavigationTrigger trigger) void
showRouterLayoutContent
(com.vaadin.flow.component.HasElement content) protected void
skipNavigation
(com.vaadin.flow.router.Location location, com.vaadin.flow.router.NavigationTrigger trigger) protected UiEventPublisher
protected boolean
uiWithSameJmixUiIdExists
(String jmixUiId) protected ViewNavigationSupport
Methods 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, setPollInterval
Methods 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, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods 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 theRedirectHandler
associated with this instance.- Returns:
- the
RedirectHandler
responsible 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:
getUIId
in 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:
getSession
in classcom.vaadin.flow.component.UI
-
getSessionNN
protected com.vaadin.flow.server.VaadinSession getSessionNN() -
getForwardToClientUrl
- Overrides:
getForwardToClientUrl
in classcom.vaadin.flow.component.UI
-
doInit
- Overrides:
doInit
in classcom.vaadin.flow.component.UI
-
connectClient
@Deprecated public void connectClient(String flowRoutePath, String flowRouteQuery, String appShellTitle, elemental.json.JsonValue historyState, String trigger) Deprecated.- Overrides:
connectClient
in 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 activeView
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
- Overrides:
getCurrentView
in classcom.vaadin.flow.component.UI
- Returns:
- the current active
View
- Throws:
IllegalStateException
- if the currentView
is 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
-