Class FacadeHandlerContextImpl
java.lang.Object
ch.tocco.nice2.netui.impl.bind.form.FacadeHandlerContextImpl
- All Implemented Interfaces:
FacadeHandlerContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current component, which in fact is just the one you expect, because you already have told the system within the method.<T extends Component>
TgetComponent(Class<T> clazz) Type-safe equivalent to theFacadeHandlerContext.getComponent()method<T extends ComponentFacade>
TgetCurrentFacade(Class<T> clazz) Get the parent facade.@Nullable StringGet the current path identifiert.booleanmatchesScope(Set<String> scopes) Compares if the current form scope is included in @param scopes.voidsetComponent(Component component) voidsetFormScope(String formScope) voidsetParentFacade(@Nullable ComponentFacade parentFacade) voidsetPathIdentifier(@Nullable String pathIdentifier) voidsetTextResources(TextResources textResources)
-
Constructor Details
-
FacadeHandlerContextImpl
public FacadeHandlerContextImpl()
-
-
Method Details
-
getFormScope
- Specified by:
getFormScopein interfaceFacadeHandlerContext
-
matchesScope
Compares if the current form scope is included in @param scopes.- Parameters:
scopes- The scopes to compare to with the current form scope.- Returns:
trueif it is included, or scopes is empty which means all are ok.
-
setFormScope
-
getTextResources
- Specified by:
getTextResourcesin interfaceFacadeHandlerContext
-
setTextResources
-
setComponent
-
getComponent
Description copied from interface:FacadeHandlerContextReturns the current component, which in fact is just the one you expect, because you already have told the system within the method. UseFacadeHandlerContext.getComponent(Class)when you don't want to cast. This is save because you know the type.- Specified by:
getComponentin interfaceFacadeHandlerContext- Returns:
- the current component
-
getParentFacade
Description copied from interface:FacadeHandlerContextGet the parent facade. When we need it, we can extend theComponentFacadeinterface so we can browse the already constructed structure a bit better. But in some cases (eg. the table column) we know exacly what the parent must be and thus we can cast or useFacadeHandlerContext.getCurrentFacade(Class)to retrieve facade.- Specified by:
getParentFacadein interfaceFacadeHandlerContext- Returns:
- the parent facade
-
setPathIdentifier
-
getPathIdentifier
Description copied from interface:FacadeHandlerContextGet the current path identifiert. eg. 'firstname', 'relPrincipal', 'Address' ...- Specified by:
getPathIdentifierin interfaceFacadeHandlerContext- Returns:
- The identifier, or null if it's not a data component.
-
setParentFacade
-
getComponent
Description copied from interface:FacadeHandlerContextType-safe equivalent to theFacadeHandlerContext.getComponent()method- Specified by:
getComponentin interfaceFacadeHandlerContext- Type Parameters:
T- type parameter- Parameters:
clazz- the class- Returns:
- component in expected type
- Throws:
RuntimeException- with cause ClassCastException
-
getCurrentFacade
Description copied from interface:FacadeHandlerContextSeeFacadeHandlerContext.getParentFacade(). Additional possibility to move the cast into the context.- Specified by:
getCurrentFacadein interfaceFacadeHandlerContext- Type Parameters:
T- the type in which we expect the facade to be- Parameters:
clazz- the class in which we expect the facade to be- Returns:
- the facade in the specific type
-