本文整理汇总了Java中com.google.gwt.event.shared.HandlerManager.fireEvent方法的典型用法代码示例。如果您正苦于以下问题:Java HandlerManager.fireEvent方法的具体用法?Java HandlerManager.fireEvent怎么用?Java HandlerManager.fireEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.shared.HandlerManager
的用法示例。
在下文中一共展示了HandlerManager.fireEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: FolderSelectionWidget
import com.google.gwt.event.shared.HandlerManager; //导入方法依赖的package包/类
public FolderSelectionWidget(final Map<String, String> batchClassesNameMap, final HandlerManager eventBus) {
super();
initWidget(BINDER.createAndBindUi(this));
mainPanel.addStyleName(FolderManagementConstants.OPTIONS_BOX);
batchClassSelectionListBox.setWidth(_150PX);
batchClassSelectionListBox.addStyleName(FolderManagementConstants.CUSTOM_LIST_BOX);
if (null != batchClassesNameMap && !batchClassesNameMap.isEmpty()) {
Set<Entry<String, String>> entrySet = batchClassesNameMap.entrySet();
for (Entry<String, String> entry : entrySet) {
batchClassSelectionListBox.addItem(entry.getKey());
}
fireEventForFolderSelection(batchClassesNameMap, eventBus);
batchClassSelectionListBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
fireEventForFolderSelection(batchClassesNameMap, eventBus);
}
});
} else {
eventBus.fireEvent(new BatchClassChangeEvent());
}
}
示例3: fireEventForFolderSelection
import com.google.gwt.event.shared.HandlerManager; //导入方法依赖的package包/类
private void fireEventForFolderSelection(final Map<String, String> batchClassesNameMap, final HandlerManager eventBus) {
String itemText = batchClassSelectionListBox.getItemText(batchClassSelectionListBox.getSelectedIndex());
if (eventBus != null) {
eventBus.fireEvent(new BatchClassChangeEvent(itemText, batchClassesNameMap.get(itemText)));
}
}