public class DefaultWidgetController extends ViewAnnotationAwareComposer implements WidgetController, WidgetInstanceManagerAware, WidgetDragAndDropAware
| Constructor and Description |
|---|
DefaultWidgetController() |
| Modifier and Type | Method and Description |
|---|---|
void |
doAfterCompose(org.zkoss.zk.ui.Component comp)
This method is final, use
initialize(Component) instead. |
org.zkoss.zk.ui.metainfo.ComponentInfo |
doBeforeCompose(org.zkoss.zk.ui.Page page,
org.zkoss.zk.ui.Component parent,
org.zkoss.zk.ui.metainfo.ComponentInfo compInfo) |
void |
doBeforeComposeChildren(org.zkoss.zk.ui.Component comp) |
protected 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.l |
DragAndDropStrategy |
getDragAndDropStrategy() |
String |
getLabel(String key)
|
String |
getLabel(String key,
Object[] args)
|
WidgetModel |
getModel() |
<T> T |
getValue(String key,
Class<T> expectedClass) |
protected WidgetDragAndDropStrategyRepository |
getWidgetDragAndDropStrategyRepository() |
WidgetInstanceManager |
getWidgetInstanceManager() |
String |
getWidgetRoot()
Returns root path prefix for the given widget.
|
TypedSettingsMap |
getWidgetSettings() |
Widgetslot |
getWidgetslot() |
String |
getWidgetTitle()
Gets the title of the current widget instance
|
WidgetUtils |
getWidgetUtils() |
protected void |
initDragAndDropAwareness()
Deprecated.
since 6.6 we don't put beans to Widget Model
|
void |
initialize(org.zkoss.zk.ui.Component comp)
Override this method to do initialization stuff for your widget, like initialize widget settings, restore view
state from viewmodel, etc.
|
protected void |
initWidgetSetting(String key)
Same as initWidgetSetting(key, "").
|
protected void |
initWidgetSetting(String key,
boolean initialValue)
Same as initWidgetSetting(key, Boolean.valueOf(initialValue)).
|
protected void |
initWidgetSetting(String key,
double initialValue)
Same as initWidgetSetting(key, Double.valueOf(initialValue)).
|
protected void |
initWidgetSetting(String key,
int initialValue)
Same as initWidgetSetting(key, Integer.valueOf(initialValue)).
|
protected void |
initWidgetSetting(String key,
Object initialValue)
Initializes a widget setting and sets an initial value if there is none, i.e.
|
protected void |
invokeListenerMethod(Method method,
org.zkoss.zk.ui.event.Event event,
ViewEvent viewAnnotation)
Override to intercept listener calls
|
void |
onSocketInput(org.zkoss.zk.ui.event.Event event)
Override this method to handle all input socket events.
|
void |
preInitialize(org.zkoss.zk.ui.Component comp)
Override this method to initialize widget settings.
|
void |
sendOutput(String id,
Object data)
Sends an output event to the output socket with the given id.
|
protected void |
sendOutputAfterOperation(String id,
Operation operation)
Same as sendOutputAfterOperation(id, operation, null, null).
|
protected 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. |
protected void |
sendOutputAfterOperation(String id,
Operation operation,
String busyMessage)
Same as sendOutputAfterOperation(id, operation, null, busyMessage).
|
void |
setValue(String key,
Object value) |
void |
setWidgetInstanceManager(WidgetInstanceManager widgetInstanceManager) |
void |
setWidgetTitle(String title)
Sets the title of the current widget instance
|
scanEventListenersalert, didActivate, getPage, willClone, willPassivatepublic WidgetInstanceManager getWidgetInstanceManager()
public void setWidgetInstanceManager(WidgetInstanceManager widgetInstanceManager)
setWidgetInstanceManager in interface WidgetInstanceManagerAwarepublic void preInitialize(org.zkoss.zk.ui.Component comp)
public void initialize(org.zkoss.zk.ui.Component comp)
doAfterCompose(Component) everytime your widget
view is created. See GenericForwardComposer.doAfterCompose(Component) for more details.public void doBeforeComposeChildren(org.zkoss.zk.ui.Component comp)
throws Exception
doBeforeComposeChildren in interface org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>doBeforeComposeChildren in class org.zkoss.zk.ui.util.GenericComposer<org.zkoss.zk.ui.Component>Exceptionpublic org.zkoss.zk.ui.metainfo.ComponentInfo doBeforeCompose(org.zkoss.zk.ui.Page page,
org.zkoss.zk.ui.Component parent,
org.zkoss.zk.ui.metainfo.ComponentInfo compInfo)
doBeforeCompose in interface org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>doBeforeCompose in class org.zkoss.zk.ui.util.GenericComposer<org.zkoss.zk.ui.Component>public final void doAfterCompose(org.zkoss.zk.ui.Component comp)
throws Exception
initialize(Component) instead.doAfterCompose in interface org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>doAfterCompose in class ViewAnnotationAwareComposerExceptionpublic String getWidgetRoot()
public Widgetslot getWidgetslot()
public WidgetModel getModel()
getModel in interface WidgetControllerprotected final void invokeListenerMethod(Method method, org.zkoss.zk.ui.event.Event event, ViewEvent viewAnnotation) throws IllegalAccessException, InvocationTargetException
ViewAnnotationAwareComposerinvokeListenerMethod in class ViewAnnotationAwareComposerIllegalAccessExceptionInvocationTargetExceptionprotected void initWidgetSetting(String key, Object initialValue)
initialize(Component).protected void initWidgetSetting(String key)
protected void initWidgetSetting(String key, int initialValue)
protected void initWidgetSetting(String key, boolean initialValue)
protected void initWidgetSetting(String key, double initialValue)
public final void sendOutput(String id, Object data)
id - The output socket id.data - The data to send or null.protected final void sendOutputAfterOperation(String id, Operation operation)
protected final void sendOutputAfterOperation(String id, Operation operation, String busyMessage)
protected final 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.protected final void executeOperation(Operation operation, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent, String busyMessage)
Operation in a separate thread.loperation - 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.public void onSocketInput(org.zkoss.zk.ui.event.Event event)
event - Usually an instance of ForwardEvent. Use ForwardEvent.getOrigin() to get the original
event.public TypedSettingsMap getWidgetSettings()
getWidgetSettings in interface WidgetControllerpublic WidgetUtils getWidgetUtils()
public String getWidgetTitle()
public void setWidgetTitle(String title)
@Deprecated protected void initDragAndDropAwareness()
public DragAndDropStrategy getDragAndDropStrategy()
getDragAndDropStrategy in interface WidgetDragAndDropAwareprotected WidgetDragAndDropStrategyRepository getWidgetDragAndDropStrategyRepository()
Copyright © 2018. All rights reserved.