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
AWidgetAdaptertypically ties aWidgetControllerand aWidgetModeltogether. Widget adapters are registered as event subscribers with aWidgetController. When aWidgetEventis published, the adapter contains the logic to determine how a widget'smodelshould be updated i.e. it "translates" the event into concrete model method calls.- See Also:
WidgetController,WidgetModel,WidgetConfig
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetControllerCtx()Returns the widget controller context code.UgetWidgetController()Returns the widget controller.TgetWidgetModel()Returns the widget model.booleanisAutoControllerEnabled()Returns whether this adapter allowsWidgetControllerto be set automatically.voidsetAutoControllerEnabled(boolean autoController)Sets whether this adapter allows theWidgetControllerto be set automatically.voidsetControllerCtx(java.lang.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 Detail
-
setWidgetModel
void setWidgetModel(T model)
Sets the widget model tomodel.- Parameters:
model- widget model
-
getWidgetModel
T getWidgetModel()
Returns the widget model.- Returns:
- the widget model
-
setWidgetController
void setWidgetController(U controller)
Sets the widget controller tocontroller.- Parameters:
controller- the widget controller
-
getWidgetController
U getWidgetController()
Returns the widget controller.- Returns:
- the widget controller
-
setControllerCtx
void setControllerCtx(java.lang.String ctx)
Sets the widget controller context code toctx.- Parameters:
ctx- widget controller context code
-
getControllerCtx
java.lang.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
-
-