當前位置: 首頁>>代碼示例>>Java>>正文


Java UiHandler類代碼示例

本文整理匯總了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);
}
 
開發者ID:interseroh,項目名稱:demo-gwt-springboot,代碼行數:25,代碼來源:PersonPanelView.java

示例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();
  }
}
 
開發者ID:manolo,項目名稱:gwt-pwa-archetype,代碼行數:17,代碼來源:View3.java

示例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);    
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:18,代碼來源:SearchPanelWidget.java

示例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;
    }
  }
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:18,代碼來源:UpdateIndicatorWidget.java

示例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);
}
 
開發者ID:KnowledgeCaptureAndDiscovery,項目名稱:ontosoft,代碼行數:20,代碼來源:PublishView.java

示例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());
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:26,代碼來源:ImageOverlayPanel.java

示例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();
		}
	});

}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:41,代碼來源:BatchClassView.java

示例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);
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:9,代碼來源:MenuView.java

示例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();
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:9,代碼來源:BookmarkPopupContents.java

示例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;
        }
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:14,代碼來源:StickieView.java

示例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();
    }
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material-patterns,代碼行數:13,代碼來源:GoogleDriveView.java

示例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("");
  }
}
 
開發者ID:ArloJamesBarnes,項目名稱:walkaround,代碼行數:16,代碼來源:LogPanel.java

示例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()));
  }
}
 
開發者ID:ArloJamesBarnes,項目名稱:walkaround,代碼行數:16,代碼來源:UploadFormPopup.java

示例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();

}
 
開發者ID:WSDOT,項目名稱:social-analytics,代碼行數:33,代碼來源:AdvSearchView.java

示例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);
            }
        }
    });
}
 
開發者ID:WSDOT,項目名稱:social-analytics,代碼行數:29,代碼來源:SearchView.java


注:本文中的com.google.gwt.uibinder.client.UiHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。