Interface WidgetAdapter<T extends WidgetModel,U extends WidgetController>
- Type Parameters:
T- widget model typeU- widget controller type
- All Superinterfaces:
CockpitEventAcceptor
- All Known Implementing Classes:
AbstractWidgetAdapter
public interface WidgetAdapter<T extends WidgetModel,U extends WidgetController>
extends CockpitEventAcceptor
A
WidgetAdapter typically ties a WidgetController and a WidgetModel together.
Widget adapters are registered as event subscribers with a WidgetController. When a WidgetEvent is
published, the adapter contains the logic to determine how a widget's model should be updated
i.e. it "translates" the event into concrete model method calls.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the widget controller context code.Returns the widget controller.Returns the widget model.booleanReturns whether this adapter allowsWidgetControllerto be set automatically.voidsetAutoControllerEnabled(boolean autoController) Sets whether this adapter allows theWidgetControllerto be set automatically.voidsetControllerCtx(String ctx) Sets the widget controller context code toctx.voidsetWidgetController(U controller) Sets the widget controller tocontroller.voidsetWidgetModel(T model) Sets the widget model tomodel.Methods inherited from interface de.hybris.platform.cockpit.events.CockpitEventAcceptor
onCockpitEvent
-
Method Details
-
setWidgetModel
Sets the widget model tomodel.- Parameters:
model- widget model
-
getWidgetModel
T getWidgetModel()Returns the widget model.- Returns:
- the widget model
-
setWidgetController
Sets the widget controller tocontroller.- Parameters:
controller- the widget controller
-
getWidgetController
U getWidgetController()Returns the widget controller.- Returns:
- the widget controller
-
setControllerCtx
Sets the widget controller context code toctx.- Parameters:
ctx- widget controller context code
-
getControllerCtx
String getControllerCtx()Returns the widget controller context code.- Returns:
- widget controller context code
-
setAutoControllerEnabled
void setAutoControllerEnabled(boolean autoController) Sets whether this adapter allows theWidgetControllerto be set automatically.- Parameters:
autoController- true means enabled, false disabled
-
isAutoControllerEnabled
boolean isAutoControllerEnabled()Returns whether this adapter allowsWidgetControllerto be set automatically.- Returns:
- true if enabled, false otherwise
-