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)); } }
public void onEvent(Event event) throws Exception { @SuppressWarnings("unchecked") T evt = (T) event.getData(); for (Iterator<ListenerInfo<T>> it = CollectionsX.comodifiableIterator(_listenerInfos); it.hasNext(); ) { final ListenerInfo<T> inf = it.next(); if (inf.async) new AsyncListenerThread<T>(DesktopEventQueue.this, inf, evt).start(); else inf.listener.onEvent(evt); } }
/** * 编辑TOP_N报告 * * @param section * @throws Exception */ public void onTpenEditTop_NReport(Event section) throws Exception { View view = Toolkit.getToolkit().getSvdbView(Executions.getCurrent().getDesktop()); if (this.editFlag) { final Window win = (Window) Executions.createComponents(EditTOPN, null, null); win.setAttribute("isedit", true); win.setAttribute("tTopNReportComposer", this); win.setAttribute("iniFile", iniFile); win.setAttribute("currsection", section.getData()); try { win.doModal(); } catch (Exception e) { return; } refreshInifile(); String loginname = view.getLoginName(); String minfo = loginname + " " + "在" + OpObjectId.topn_report.name + "中进行了 " + OpTypeId.edit.name + "操作。"; AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.edit, OpObjectId.topn_report); } else { try { Messagebox.show( "用户:" + view.getLoginName() + " 没有 编辑TopN报告 的权限!", "提示", Messagebox.OK, Messagebox.INFORMATION); return; } catch (Exception e) { } } }
public void onEvent(Event event) { Component comp = event.getTarget(); String eventName = event.getName(); if (eventName.equals(Events.ON_CLICK)) { if (comp == max) { if (layout.getNorth().isVisible()) { collapseHeader(); } else { restoreHeader(); } } else if (comp == showHeader) { showHeader.setPressed(true); if (pnlHead.getParent() != headerPopup) headerPopup.appendChild(pnlHead); LayoutUtils.openPopupWindow(showHeader, headerPopup, "after_start"); } else if (comp == contextHelp) { layout.getEast().setVisible(true); layout.getEast().setOpen(true); contextHelp.setVisible(false); updateHelpCollapsedPreference(false); } else if (comp instanceof ToolBarButton) { ToolBarButton btn = (ToolBarButton) comp; if (btn.getAttribute("AD_Menu_ID") != null) { int menuId = (Integer) btn.getAttribute("AD_Menu_ID"); if (menuId > 0) onMenuSelected(menuId); } } } else if (eventName.equals(ON_ACTIVITIES_CHANGED_EVENT)) { @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) event.getData(); Integer notice = (Integer) map.get("notice"); Integer request = (Integer) map.get("request"); Integer workflow = (Integer) map.get("workflow"); Integer unprocessed = (Integer) map.get("unprocessed"); boolean change = false; if (notice != null && notice.intValue() != noOfNotice) { noOfNotice = notice.intValue(); change = true; } if (request != null && request.intValue() != noOfRequest) { noOfRequest = request.intValue(); change = true; } if (workflow != null && workflow.intValue() != noOfWorkflow) { noOfWorkflow = workflow.intValue(); change = true; } if (unprocessed != null && unprocessed.intValue() != noOfUnprocessed) { noOfUnprocessed = unprocessed.intValue(); change = true; } if (change) updateUI(); } else if (event instanceof ZoomEvent) { Clients.clearBusy(); ZoomEvent ze = (ZoomEvent) event; if (ze.getData() != null && ze.getData() instanceof MQuery) { AEnv.zoom((MQuery) ze.getData()); } } else if (event instanceof DrillEvent) { Clients.clearBusy(); DrillEvent de = (DrillEvent) event; if (de.getData() != null && de.getData() instanceof MQuery) { MQuery query = (MQuery) de.getData(); executeDrill(query); } } }