本文整理汇总了Java中com.google.gwt.uibinder.client.UiHandler类的典型用法代码示例。如果您正苦于以下问题:Java UiHandler类的具体用法?Java UiHandler怎么用?Java UiHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UiHandler类属于com.google.gwt.uibinder.client包,在下文中一共展示了UiHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onButtonClick
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("refreshButton")
public void onButtonClick(final ClickEvent event) {
// Event handling in GWT UiBinder
logger.info("Click Detected by GWT UiBinder");
// Both buttons disable
refreshButton.setEnabled(false);
filterButton.setEnabled(false);
List<Option> items = foodMultipleSelect.getSelectedItems();
if (items.size() != 0 && items.get(0).getValue().equalsIgnoreCase("Mustard")) {
logger.info("We have mustard...");
filterButton.setText("Mustard");
}
boolean result = runTimerRefreshButton();
if (result == false) {
filterButton.setEnabled(false);
}
logger.info("Result runTimerRefreshButton: " + result);
}
示例2: onClick
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("submit")
void onClick(ClickEvent e) {
if (date.getValue().isEmpty()) {
date.setInvalid(date.getValue().isEmpty());
return;
}
if (title.validate() && descr.validate()) {
Todo todo = new Todo();
todo.date = date.getValue();
todo.title = title.getValue();
todo.description = descr.getValue();
Polymer.apply(grid.getElement(), "push", "items", todo);
form.reset();
}
}
示例3: handleMouseMove
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("self")
void handleMouseMove(MouseMoveEvent e) {
Element top = self.getElement();
Element target;
target = e.getNativeEvent().getEventTarget().cast();
while (!top.equals(target)) {
if (DigestDomImpl.KIND_DIGEST.equals(target.getAttribute(BuilderHelper.KIND_ATTRIBUTE)) ) {
handleTouch(byId.get(target.getAttribute(DigestDomImpl.DIGEST_ID_ATTRIBUTE)) );
return;
}
target = target.getParentElement();
if (target == null) {
break;
}
}
handleTouch(null);
}
示例4: handleClick
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("self")
void handleClick(ClickEvent e) {
final Element top = getElement();
Element target;
target = e.getNativeEvent().getEventTarget().cast();
while (!top.equals(target)) {
if (REFRESH_ATTRIBUTE_VAL.equals(target.getAttribute(REFRESH_ATTRIBUTE))) {
listener.refresh();
e.stopPropagation();
return;
}
target = target.getParentElement();
if (target == null) {
break;
}
}
}
示例5: onPermButtonClick
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("permbutton")
void onPermButtonClick(ClickEvent event) {
permissiondialog.show();
userlist.setVisible(true);
permlist.setVisible(true);
if (userlist.getItemCount() == 1)
setUserList();
if (permlist.getItemCount() == 1)
setPermissionList();
initAgents();
initMaterial();
setBrowsePermissionHeader();
Window.scrollTo(0, 0);
}
示例6: onFitToPageClicked
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("fitToPage")
public void onFitToPageClicked(final ClickEvent event) {
removeOverlays();
if (!fitToPageImage) {
final int viewPortHeight = getViewPortHeight();
final int viewPortWidth = getViewPortWidth();
heightBeforeFitToHeight = pageImage.getHeight();
widthBeforeFitToWidth = pageImage.getWidth();
double imageWidth = 0;
double imageHeight = getViewPortHeight();
float count = 53.0f;
while (imageHeight > viewPortHeight * 72 / 100) {
imageWidth = viewPortWidth * count / 100;
imageHeight = pageImage.getHeight() * imageWidth / pageImage.getWidth();
count -= 0.1f;
}
pageImage.setWidth(Double.toString(imageWidth));
pageImage.setHeight(Double.toString(imageHeight));
fitToPageImage = Boolean.TRUE;
} else {
fitToPageImage = Boolean.FALSE;
pageImage.setHeight(heightBeforeFitToHeight.toString());
pageImage.setWidth(widthBeforeFitToWidth.toString());
}
}
示例7: onDeleteDocumentButtonClicked
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
/**
* To perform operations on Delete Document button clicked.
*
* @param clickEvent ClickEvent
*/
@UiHandler("deleteDocumentButton")
public void onDeleteDocumentButtonClicked(ClickEvent clickEvent) {
final String rowIndex = docTypeListView.listView.getSelectedRowIndex();
int rowCount = docTypeListView.listView.getTableRecordCount();
if (rowIndex == null || rowIndex.isEmpty()) {
if (rowCount == 0) {
ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get().getMessageValue(
BatchClassManagementMessages.NO_RECORD_TO_DELETE), LocaleDictionary.get().getConstantValue(
BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.TRUE);
} else {
ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get().getMessageValue(
BatchClassManagementMessages.NONE_SELECTED_WARNING), LocaleDictionary.get().getConstantValue(
BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.TRUE);
}
return;
}
final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get()
.getMessageValue(BatchClassManagementMessages.DELETE_DOCUMENT_TYPE_CONFORMATION), LocaleDictionary.get()
.getConstantValue(BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.FALSE);
confirmationDialog.addDialogListener(new DialogListener() {
@Override
public void onOkClick() {
confirmationDialog.hide();
presenter.onDeleteDocumentButtonClicked(rowIndex);
}
@Override
public void onCancelClick() {
confirmationDialog.hide();
}
});
}
示例8: onSearchKeyUp
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("searchTextBox")
public void onSearchKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE) {
startTimer();
} else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
showExplanationOfFirstItem(true);
}
}
示例9: titleKeyDownHandler
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("titleTextBox")
public void titleKeyDownHandler(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
presenter.applyBookmark();
} else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
presenter.discardChanges();
}
}
示例10: contentTextKeyPressHandler
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("contentText")
public void contentTextKeyPressHandler(KeyPressEvent event) {
if (takeOverKeyInput) {
if (firstFocusDone) {
contentText.setText(contentText.getText() + event.getCharCode());
event.preventDefault();
takeOverKeyInput = false;
firstKeyInputAfterClick = false;
} else {
firstFocusDone = true;
}
}
}
示例11: onInfo
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("iconInfo")
void onInfo(ClickEvent e) {
if(toggle){
// show the right nav
mainHeader.setRight(334);
mainPanel.setGrid("l9 m9 s12");
rightPanel.setRight(0);
toggle = false;
}else{
hidePanel();
}
}
示例12: handleClick
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("self")
void handleClick(ClickEvent e) {
Element target = e.getNativeEvent().getEventTarget().cast();
if (play.equals(target)) {
if (active) {
setActive(false);
play.setInnerText("Resume");
} else {
setActive(true);
play.setInnerText("Pause");
}
} else if (clear.equals(target)) {
entries.setInnerHTML("");
}
}
示例13: handleSubmit
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("submit")
void handleSubmit(ClickEvent e) {
Preconditions.checkState(stage == Stage.HAVE_TOKEN);
// The browser's default action can not be relied upon to submit the form,
// because this handler is removing the form from the DOM, so a manual
// submit is required (before hiding the popup).
e.stopPropagation();
form.submit();
popup.hide();
stage = Stage.UPLOADING_FILE;
log.log(Level.INFO, "posting file");
if (listener != null) {
listener.onUploadStarted(fixFilename(file.getFilename()));
}
}
示例14: onSearch
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("searchBtn")
void onSearch(ClickEvent e){
if (advSearchTextBox.getText().equalsIgnoreCase("")){
advSearchTextBox.setText(" ");
}
DateTimeFormat fmt = DateTimeFormat.getFormat("/yyyy/M/d");
String endDate = null;
String startDate = null;
if (searchdpStart.getDate() != null) {
startDate = fmt.format(searchdpStart.getDate());
}
if (searchdpEnd.getDate() != null) {
endDate = fmt.format(searchdpEnd.getDate());
}
String account = searchAccountPicker.getSelectedItemText();
int searchType = Integer.valueOf(searchTypePicker.getSelectedValue());
String searchTerm = advSearchTextBox.getText();
int media = (mediaOnly.getValue() ? 1 : 0);
SearchEvent searchEvent = new SearchEvent(searchTerm, searchType, account, media, startDate, endDate);
this.clientFactory.getEventBus().fireEvent(searchEvent);
advSearch.closeModal();
}
示例15: onMore
import com.google.gwt.uibinder.client.UiHandler; //导入依赖的package包/类
@UiHandler("moreSearchBtn")
public void onMore(ClickEvent e){
int nextPage = pageNum + 1;
searchLoader.setVisible(true);
JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
// Set timeout for 30 seconds (30000 milliseconds)
jsonp.setTimeout(30000);
jsonp.requestObject(url + nextPage, new AsyncCallback<Mention>() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Failure: " + caught.getMessage());
searchLoader.setVisible(false);
}
@Override
public void onSuccess(Mention mention) {
if (mention.getMentions() != null) {
pageNum++;
updateSearch(mention.getMentions());
searchLoader.setVisible(false);
}
}
});
}