当前位置: 首页>>代码示例>>Java>>正文


Java HandlerManager类代码示例

本文整理汇总了Java中com.google.gwt.event.shared.HandlerManager的典型用法代码示例。如果您正苦于以下问题:Java HandlerManager类的具体用法?Java HandlerManager怎么用?Java HandlerManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HandlerManager类属于com.google.gwt.event.shared包,在下文中一共展示了HandlerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setEventHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * Sets an event handler for an {@code Element}. All previous event handlers of this type of event are removed.
 * @param element The element to bind the event handler for
 * @param eventType The event type (e.g. {@code ClickEvent.getType()})
 * @param handler The handler that handler the event
 */
public static <H extends EventHandler> void setEventHandler(final Element element, DomEvent.Type<H> eventType, H handler) {
  if (element == null) {
    return;
  }
  HandlerManager hm = handlerManagers.get(element);
  if (hm == null) {
    handlerManagers.put(element, hm = new HandlerManager(element));
    DOM.setEventListener(element, new EventListener() {
      @Override
      public void onBrowserEvent(Event event) {
        DomEvent.fireNativeEvent(event, handlerManagers.get(element), element);
      }
    });
  }
  DOM.sinkBitlessEvent(element, eventType.getName());
  while (hm.getHandlerCount(eventType) > 0) {
    hm.removeHandler(eventType, hm.getHandler(eventType, 0));
  }
  hm.addHandler(eventType, handler);
}
 
开发者ID:turnsk,项目名称:gwtmvp,代码行数:27,代码来源:EventManager.java

示例2: injectEvents

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
@Override
public void injectEvents(HandlerManager eventBus) {
	// TODO Auto-generated method stub
	eventBus.addHandler(RVKeyDownEvent.type, new RVKeyDownEventHandler() {

		@Override
		public void onKeyDown(RVKeyDownEvent event) {

			KeyDownEvent keyDownEvent = event.getEvent();
			if (keyDownEvent.isControlKeyDown() && keyDownEvent.isShiftKeyDown()
					&& keyDownEvent.getNativeEvent().getKeyCode() == 39) {
				// Ctrl + Shift + ->
				keyDownEvent.getNativeEvent().preventDefault();
				nextBatchPage();
			}
		}
	});

}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:20,代码来源:TopPanel.java

示例3: addRVKeyUpEvent

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addRVKeyUpEvent(HandlerManager eventBus) {
	eventBus.addHandler(RVKeyUpEvent.type, new RVKeyUpEventHandler() {

		@Override
		public void onKeyUp(RVKeyUpEvent event) {
			KeyUpEvent keyEvent = event.getEvent();
			if (keyEvent.isControlKeyDown()) {
				int keyCode = keyEvent.getNativeEvent().getKeyCode();
				switch (keyCode) {
					case 'n':
					case 'N':
						keyNUpEvent(keyEvent);
						break;
					case 'p':
					case 'P':
						keyPUpEvent(keyEvent);
						break;
					default:
						break;
				}
			}
		}

	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:29,代码来源:DocumentTree.java

示例4: injectEvents

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * To handle events.
 * 
 * @param eventBus HandlerManager
 */
@Override
public void injectEvents(HandlerManager eventBus) {
	eventBus.addHandler(BatchListKeyDownEvent.TYPE, new BatchListKeyDownEventHandler() {

		@Override
		public void onKeyDown(BatchListKeyDownEvent event) {
			if (event.getEvent().isControlKeyDown()) {
				switch (event.getEvent().getNativeEvent().getKeyCode()) {
					case 'j':
					case 'J':
						event.getEvent().getNativeEvent().preventDefault();
						view.setReviewTableSelected();
						break;
					case 'k':
					case 'K':
						event.getEvent().getNativeEvent().preventDefault();
						view.setValidateTableSeleted();
						break;
					default:
						break;
				}
			}
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:31,代码来源:LandingPresenter.java

示例5: addPageChangeHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addPageChangeHandler(HandlerManager eventBus) {
	eventBus.addHandler(PageChangeEvent.type, new PageChangeEventHandler() {

		@Override
		public void onPageChange(PageChangeEvent event) {
			PageImage pageImage = getPageImageById(event.getPage().getIdentifier());
			if (!event.getPage().isIsRotated()) {
				pageImage.image.setUrl(presenter.batchDTO.getAbsoluteURLFor(event.getPage().getThumbnailFileName()), event
						.getPage().getDirection());
			} else {
				pageImage.image.setUrl(presenter.batchDTO.getAbsoluteURLForRotatedImage(event.getPage().getThumbnailFileName(),
						event.getPage().getDirection().toString()), event.getPage().getDirection());
			}
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:20,代码来源:DocumentTree.java

示例6: addRVKeyDownEvent

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addRVKeyDownEvent(HandlerManager eventBus) {
	eventBus.addHandler(RVKeyDownEvent.type, new RVKeyDownEventHandler() {

		@Override
		public void onKeyDown(RVKeyDownEvent event) {
			if (event.getEvent().isControlKeyDown()) {
				switch (event.getEvent().getNativeEvent().getKeyCode()) {
					case 'n':
					case 'N':
						event.getEvent().getNativeEvent().preventDefault();
						break;
					case 'p':
					case 'P':
						event.getEvent().getNativeEvent().preventDefault();
						break;
					default:
						break;
				}
			}

		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:27,代码来源:DocumentTree.java

示例7: addRVKeyDownEventHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addRVKeyDownEventHandler(HandlerManager eventBus) {
	eventBus.addHandler(RVKeyDownEvent.type, new RVKeyDownEventHandler() {

		@Override
		public void onKeyDown(RVKeyDownEvent event) {
			if (!presenter.isTableView() && event.getEvent().isControlKeyDown()) {
				switch (event.getEvent().getNativeKeyCode()) {
					case 52:
					case 100:
					case 55:
					case 103:
					case 56:
					case 104:
					case 57:
					case 105:
						event.getEvent().preventDefault();
						break;
					default:
						break;
				}
			}
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:28,代码来源:ReviewValidatePanel.java

示例8: MonitorPresenter

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
public MonitorPresenter(HandlerManager eventBus, View view, String bdaJobId, String oozieJobId) {
	this.eventBus = eventBus;
	this.view = view;
	this.headerLoader = new HeaderLoader(eventBus, view.getHeaderView(),
			MonitorPresenter.this);
	this.bdaJobMonitor = new BdaJobMonitor(this);
	this.diagramBuilder = new DiagramBuilder(this);
	this.currentJob = new BdaJob();
	this.currentJob.setJobId(bdaJobId);
	this.currentJob.setAccount(AppController.email);

	this.currentOozieJob = new OozieJob();
	this.currentOozieJob.setId(oozieJobId);
	this.currentOozieJob.setAccount(AppController.email);
	instanceFlag = true;
	this.arr = AppController.power.split("");
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:18,代码来源:MonitorPresenter.java

示例9: registerHandlers

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
private void registerHandlers() {
	HandlerManager eventBus = ConsoleUnitEventManager.getInstance().getEventBus();
	eventBus.addHandler(RotationEvent.getType(), this);
	eventBus.addHandler(WindowResizeEvent.getType(), this);
	eventBus.addHandler(SwipeEvent.getType(), this);
	eventBus.addHandler(HoldEvent.getType(), this);
	eventBus.addHandler(NavigateEvent.getType(), this);
	eventBus.addHandler(CommandSendEvent.getType(), this);
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:10,代码来源:ConsoleUnit.java

示例10: setData

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
private void setData(String dataName, String data) {
	String oldData = getObjectString(dataName);
	if (oldData == null || !data.equals(oldData)) {
		String dataNamePath = buildPathString(dataName);
		try {
			if (dataStore != null) {
				dataStore.removeItem(dataNamePath);
				dataStore.setItem(dataNamePath, data);
			} else {
				Cookies.setCookie(dataNamePath, data, new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 365 * 100)));
			}
		} catch (Exception e) {}
		HandlerManager eventBus = ConsoleUnitEventManager.getInstance().getEventBus();
		BindingDataChangeEvent event = new BindingDataChangeEvent(dataName);
		eventBus.fireEvent(event);
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:18,代码来源:LocalDataServiceImpl.java

示例11: addDocTypeChangeHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addDocTypeChangeHandler(HandlerManager eventBus) {
	eventBus.addHandler(DocTypeChangeEvent.type, new DocTypeChangeEventHandler() {

		@Override
		public void onDocumentTypeChange(DocTypeChangeEvent event) {
			handleRefreshEvent(event.getBatchDTO(), event.getDocumentType(), event.getDocumentType().getPages().getPage().get(0));
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:13,代码来源:DocumentTree.java

示例12: addRVKeyUpEventHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addRVKeyUpEventHandler(final HandlerManager eventBus) {
	eventBus.addHandler(RVKeyUpEvent.type, new RVKeyUpEventHandler() {

		@Override
		public void onKeyUp(final RVKeyUpEvent event) {
			shiftKeyPressed = false;
			ctrlKeyPressed = false;
			clickCount = 0;
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:15,代码来源:ImageOverlayPanel.java

示例13: addTreeRefreshHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addTreeRefreshHandler(HandlerManager eventBus) {
	eventBus.addHandler(TreeRefreshEvent.type, new TreeRefreshEventHandler() {

		@Override
		public void refresh(TreeRefreshEvent event) {
			handleRefreshEvent(event.getBatchDTO(), event.getDocument(), event.getPage());
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:13,代码来源:DocumentTree.java

示例14: addDocTypeChangeHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addDocTypeChangeHandler(HandlerManager eventBus) {
	eventBus.addHandler(DocTypeChangeEvent.type, new DocTypeChangeEventHandler() {

		@Override
		public void onDocumentTypeChange(DocTypeChangeEvent event) {
			presenter.document = event.getDocumentType();
			presenter.setCustomizedShortcutPanels();
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:14,代码来源:ReviewValidatePanel.java

示例15: addTableViewDisplayEventHandler

import com.google.gwt.event.shared.HandlerManager; //导入依赖的package包/类
/**
 * @param eventBus
 */
private void addTableViewDisplayEventHandler(HandlerManager eventBus) {
	eventBus.addHandler(TableViewDisplayEvent.type, new TableViewDisplayEventHandler() {

		@Override
		public void onResult(TableViewDisplayEvent event) {
			showTableViewBtn.setVisible(false);
			if (event.getTablesCount() > 0) {
				showTableViewBtn.setVisible(true);
			}
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:16,代码来源:ValidatePanel.java


注:本文中的com.google.gwt.event.shared.HandlerManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。