本文整理了Java中org.zkoss.zk.ui.event.Event.getData()
方法的一些代码示例,展示了Event.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getData()
方法的具体详情如下:
包路径:org.zkoss.zk.ui.event.Event
类名称:Event
方法名:getData
[英]Returns the data accompanies with this event, or null if not available.
[中]返回此事件伴随的数据,如果不可用,则返回null。
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.core
@Override
public String getData() {
return (String) super.getData();
}
}
代码示例来源:origin: org.zkoss.zk/zkbind
@SuppressWarnings("unchecked")
public void onEvent(Event event) throws Exception {
Object[] data = (Object[]) event.getData();
String command = (String) data[0];
Map<String, Object> args = (Map<String, Object>) data[1];
sendCommand(command, args);
}
}
代码示例来源:origin: org.zkoss.zk/zkmax
public void onEvent(Event event) throws Exception {
final Event evt = (Event)event.getData();
for (Iterator it = _listeners.iterator(); it.hasNext();)
((EventListener)it.next()).onEvent(evt);
}
});
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.security.impl
/**
* Process a close request from another controller.
*
* @param event Close event. Data field contains message to display.
*/
public void onClose(Event event) {
close((String) event.getData());
}
代码示例来源:origin: org.carewebframework/org.carewebframework.security.spring.core
/**
* Process a close request from another controller.
*
* @param event Close event. Data field contains message to display.
*/
public void onClose(Event event) {
close((String) event.getData());
}
代码示例来源:origin: org.zkoss.zk/zkplus
public void onEvent(Event event) {
final Set<BindingNode> walkedNodes = new HashSet<BindingNode>(32);
final Set<Dual> loadedComps = new HashSet<Dual>(32 * 2);
Object obj = event.getData();
if (obj instanceof List) {
for (final Iterator it = ((List) obj).iterator(); it.hasNext();) {
final Object[] data = (Object[]) it.next();
doLoad(data, walkedNodes, loadedComps);
}
} else {
doLoad((Object[]) obj, walkedNodes, loadedComps);
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.ext.performance
/**
* Create an EventInfo instance for the specified event and tag.
*
* @param event The event to be timed. If the event's data object is a RequestTime enum (which
* is the case for an onTimeEcho event), this specifies which time component is to be
* logged. If no RequestTime is specified, the time spent by the associated event
* listener is logged.
* @param tag tag.
* @param desktopId desktop id.
* @param requestId request id.
*/
public EventInfo(Event event, String tag, String desktopId, String requestId) {
this.eventName = event.getName();
this.tag = tag == null ? eventName : tag;
this.desktopId = desktopId;
this.requestId = requestId;
Component target = event.getTarget();
if (target != null) {
this.target = target.toString();
}
start = System.currentTimeMillis();
if (event.getData() instanceof RequestTime) {
rt = (RequestTime) event.getData();
}
}
代码示例来源:origin: org.zkoss.zk/zk
/** Constructor.
*
* <p>Notice that {@link #getTarget} is the same as the target of the given
* event. To retrieve the real target (passed thru the argument), please
* use {@link #getRealTarget} instead.
*
* @param realTarget the real target. If null, it means broadcast.
* @param event the proxied event.
*/
public ProxyEvent(Component realTarget, Event event) {
super(event.getName(), event.getTarget(), event.getData());
_realTarget = realTarget;
_event = event;
}
代码示例来源:origin: org.zkoss.zk/zk
@SuppressWarnings("unchecked")
public void onEvent(Event event) throws Exception {
final Component clone = event.getTarget();
final GenericAutowireComposer composerClone = (GenericAutowireComposer) event.getData();
composerClone.doAfterCompose(clone);
clone.removeEventListener(ON_CLONE_DO_AFTER_COMPOSE, this);
}
}
代码示例来源:origin: org.zkoss.zk/zk
/** Echos an event.
* By echo we mean the event is fired after the client receives the AU
* responses and then echoes back.
* In other words, the event won't be processed in the current execution.
* Rather, it executes after the client receives the AU responses
* and then echoes back the event back.
*
* <p>It is usually if you want to prompt the user before doing a long
* operation. A typical case is to open a highlighted window to
* prevent the user from clicking any button before the operation gets done.
*
* @since 5.0.4
* @see #sendEvent
*/
public static final void echoEvent(Event event) {
echoEvent(event.getName(), event.getTarget(), event.getData());
}
代码示例来源:origin: org.zkoss.zk/zkplus
public void onEvent(Event event) {
if (event instanceof AfterEvent) {
handleEvent((Event) event.getData());
} else { //post AfterEvent to make sure it is called after
//enforce the event is the last processed
Events.postEvent(-10100, new AfterEvent(event.getName() + "LoadAfter", event));
}
}
}
代码示例来源:origin: org.zkoss.zk/zkplus
public void onEvent(Event event) {
if (event instanceof AfterEvent) {
handleEvent((Event) event.getData());
} else { //post AfterEvent to make sure it is called after
//enforce the event is the last processed
Events.postEvent(-10100, new AfterEvent(event.getName() + "SaveAfter", event));
}
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.documents
/**
* Opening the display view after a double-click is deferred to avoid anomalies with selection
* of the associated list item.
*
* @param event The deferred open event.
*/
public void onDeferredOpen$listBox(Event event) {
Listitem item = (Listitem) ZKUtil.getEventOrigin(event).getData();
item.setSelected(true);
onSelect$listBox();
onClick$btnView();
}
代码示例来源:origin: org.carewebframework/org.carewebframework.ui.infopanel
/**
* Handles onAlertAction event which an alert container sends after it has processed an action.
*
* @param event The onAlertAction event.
*/
public void onAlertAction$alertRoot(Event event) {
event = ZKUtil.getEventOrigin(event);
Action action = (Action) event.getData();
openAlertPanel(null);
if (action == Action.TOP) {
alertGrid.setActivePage(0);
alertGrid.invalidate();
}
}
代码示例来源:origin: org.zkoss.zk/zul
final ListModel subset = syncModel(data.getData() != null ? data.getData() : getRawText());
try {
int pgsz = subset.getSize(), ofs = 0, j = 0;
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.documents
public void onViewOpen(Event event) {
boolean open = (Boolean) ZKUtil.getEventOrigin(event).getData();
displayController.setDocuments(!open ? null : listController.getSelectedDocuments());
documentList.setVisible(!open);
documentDisplay.setVisible(open);
}
代码示例来源:origin: org.zkoss.zk/zul
public void onClose(Event evt) {
if (evt.getData() == null)
_result.clear();
else {
final Desktop desktop = Executions.getCurrent().getDesktop();
final Configuration config = desktop.getWebApp().getConfiguration();
if (!config.isEventThreadEnabled()) {
if (_listener != null)
try {
_listener.onEvent(new UploadEvent(Events.ON_UPLOAD, null, getResult()));
} catch (Exception e) {
throw new UiException(e);
}
else
Events.postEvent(new UploadEvent(Events.ON_UPLOAD,
(Component) desktop.getAttribute(ATTR_FILEUPLOAD_TARGET), getResult()));
}
}
detach();
}
代码示例来源:origin: org.zkoss.zk/zkplus
@SuppressWarnings("unchecked")
public void onEvent(T event) {
//fetch old Event stored in Session and post again
final Component comp = event.getTarget();
final Page page = comp.getPage();
final String url = (String) event.getData();
final Execution exec = Executions.getCurrent();
try {
doModal(page, url);
} finally {
if (comp.isListenerAvailable(event.getName(), true)) {
EventListener listener = (EventListener) comp.getAttribute(event.getName());
if (listener != null) {
comp.removeEventListener(event.getName(), listener);
comp.removeAttribute(event.getName());
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!