Package de.xima.fc.gui.common.bean
Class ViewIdBean
java.lang.Object
de.xima.fc.gui.common.bean.ViewIdBean
- All Implemented Interfaces:
Serializable
Bean that associates a UUID with each view. This is better that relying on the internal
java.faces.ViewState
,
which may not contain an ID in case of client-side state saving etc.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isDifferentView
(UUID viewId) static boolean
isSameView
(UUID viewId)
-
Constructor Details
-
ViewIdBean
public ViewIdBean()
-
-
Method Details
-
getViewId
- Returns:
- The ID of the current view.
-
getCurrentViewId
- Returns:
- The ID of the current view, if this method is called within a JSF context. Otherwise,returns an empty optional.
-
isSameView
- Parameters:
viewId
- A view ID against which to check.- Returns:
true
when called within a JSF context and the current view equals the given view ID,false
otherwise.
-
isDifferentView
- Parameters:
viewId
- A view ID against which to check.- Returns:
- When the given view ID is not
null
:true
when either not within a JSF context or the current view is different from the given view ID,false
otherwise. When the given view ID isnull
:true
when there is a an active view ID,false
otherwise.
-