public interface WidgetInstanceManager
WidgetInstanceManagerAware interface in your widget controller
(ideally you extend the DefaultWidgetController) or in your MVVM view model.| Modifier and Type | Field and Description |
|---|---|
static String |
CNG_TITLE_CHANGE_LISTENER |
| Modifier and Type | Method and Description |
|---|---|
<CONFIG> ConfigContext |
buildConfigurationContext(ConfigContext additionalContext,
Class<CONFIG> configurationType)
Builds cockpit configuration context for this widget.
|
void |
executeOperation(Operation operation,
org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent,
String busyMessage)
Executes an
Operation in a separate thread. |
default void |
executeOperationInParallel(Operation operation,
org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent)
Executes an
Operation in a separate thread regardless is there is already running another operation for
the
widget. |
String |
getLabel(String key)
Returns a localized label in the current locale.
|
String |
getLabel(String key,
Object[] args)
Returns a localized label in the current locale and formats it with the given arguments.
|
WidgetModel |
getModel()
Returns the widget view model as specified in the definition.xml of the widget.
|
String |
getTitle()
Returns the current widget title.
|
TypedSettingsMap |
getWidgetSettings()
Returns the widget settings map.
|
Widgetslot |
getWidgetslot()
Returns the widget slot the widget related to this manager is placed in.
|
void |
initWidgetSetting(String key,
Object initialValue)
Initializes a widget setting and sets an initial value if there is none, i.e.
|
<CONFIG> CONFIG |
loadConfiguration(ConfigContext context,
Class<CONFIG> configurationType)
Delegate to cockpitConfigurationService.
|
default void |
registerAfterEditorCallback(CallbackOperation callback)
Method complementary to com.hybris.cockpitng.engine.WidgetInstanceManager#registerEditorListener.
|
default void |
registerBeforeEditorCallback(CallbackOperation callback)
Method complementary to com.hybris.cockpitng.engine.WidgetInstanceManager#registerEditorListener.
|
default EditorListener |
registerEditorListener(EditorContext context,
EditorListener listener)
Whenever an editor is created in the context of a widget it may be needed to inform the parent widget that the
editor wants to interact with its model.
|
void |
sendOutput(String socketId,
Object data)
Sends data to the output socked with the given ID.
|
void |
sendOutputAfterOperation(String id,
Operation operation,
org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent,
String busyMessage)
Executes an
Operation in a separate thread and sends an output event to the output socket with the given
id after the operation has been finished. |
void |
setTitle(String title)
Changes the title of the widget dynamically.
|
<CONFIG> void |
storeConfiguration(ConfigContext context,
CONFIG configuration)
Delegate to cockpitConfigurationService.
|
static final String CNG_TITLE_CHANGE_LISTENER
void sendOutput(String socketId, Object data)
socketId - output socket ID to sent the data todata - the data to be sentTypedSettingsMap getWidgetSettings()
WidgetModel getModel()
Widgetslot getWidgetslot()
void initWidgetSetting(String key, Object initialValue)
key - initialValue - void sendOutputAfterOperation(String id, Operation operation, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent, String busyMessage)
Operation in a separate thread and sends an output event to the output socket with the given
id after the operation has been finished.id - The output socket id.operation - The operation to execute.callbackEvent - An optional callback event listener that is invoked after the output event has been sent.busyMessage - A busy message that should be displayed while the operation is executed.void executeOperation(Operation operation, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent, String busyMessage)
Operation in a separate thread.operation - The operation to execute.callbackEvent - An optional callback event listener that is invoked after the operation has been finished.busyMessage - A busy message that should be displayed while the operation is executed.default void executeOperationInParallel(Operation operation, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent)
Operation in a separate thread regardless is there is already running another operation for
the
widget.operation - The operation to execute.callbackEvent - An optional callback event listener that is invoked after the operation has been finished.String getLabel(String key)
key - localization key as specified in the locales_*.properties in your widget definition.String getLabel(String key, Object[] args)
MessageFormat.key - localization key as specified in the locales_*.properties in your widget definition.args - list of arguments for the formatingString getTitle()
void setTitle(String title)
title - the new title<CONFIG> ConfigContext buildConfigurationContext(ConfigContext additionalContext, Class<CONFIG> configurationType)
widgetConfigurationContextDecoratorList for list of
installed WidgetConfigurationContextDecorators).additionalContext - additional configuration context for the widget, this can contain dynamic context
parameters as "type" or similarconfigurationType - type of the configuration this context is to be built for. This might influence the logic
in WidgetConfigurationContextDecorators.<CONFIG> CONFIG loadConfiguration(ConfigContext context, Class<CONFIG> configurationType) throws CockpitConfigurationException
context - the context to be used to look for the configurationconfigurationType - desired configuration typeCockpitConfigurationException - if configuration could not be found or some error occured during loadingCockpitConfigurationService.loadConfiguration(ConfigContext, Class)<CONFIG> void storeConfiguration(ConfigContext context, CONFIG configuration) throws CockpitConfigurationException
context - the context to be used to store the configurationconfiguration - the configuration to be storedCockpitConfigurationException - if configuration could not be stored for some reasonCockpitConfigurationService.storeConfiguration(ConfigContext, Object)default EditorListener registerEditorListener(EditorContext context, EditorListener listener)
context - editor contextlistener - original editor listener @return wrapped listener (by default it returns the original listener,default void registerBeforeEditorCallback(CallbackOperation callback)
callback - the callback to be invokeddefault void registerAfterEditorCallback(CallbackOperation callback)
callback - the callback to be invokedCopyright © 2018. All rights reserved.