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


Java ForEvent类代码示例

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


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

示例1: onOkClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("confirm-ok")
public void onOkClick(final @ForEvent("click") MouseEvent event) {
    if (okCommand != null) {
        okCommand.execute();
    }
    hide();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:ConfirmPopup.java

示例2: onModalSubmitClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
/**
 * This is an Errai UI event handler. The element for which this handler is regsitered is in this class's HTML
 * template file and has the {@code modal-submit} CSS class.
 * <p>
 * The parameter is a JS interop wrapper for a native DOM {@link MouseEvent}. The {@code MouseEvent} interface like many
 * DOM event interfaces is used for multiple browser event types (i.e. "click", "dblclick", "mouseover", etc.). In order
 * to only listen for "click" events we use the {@link ForEvent} annotation.
 * <p>
 * This method displays and persists changes made to a {@link Contact} in the {@link ContactEditor}, whether it is a
 * newly created or an previously existing {@link Contact}.
 */
@EventHandler("modal-submit")
public void onModalSubmitClick(final @ForEvent("click") MouseEvent event) {
  if (modal.checkValidity()) {

    modal.classList.remove("displayed");

    if (binder.getModel().contains(editor.getValue())) {
      updateContactFromEditor();
    } else {
      createNewContactFromEditor();
    }
  }
}
 
开发者ID:errai,项目名称:errai-tutorial,代码行数:25,代码来源:ContactListPage.java

示例3: onModalDeleteClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
/**
 * This is an Errai UI native event handler. The element for which this handler is regsitered is in this class's HTML
 * template file and has the {@code modal-delete} CSS class.
 * <p>
 * The parameter is a JS interop wrapper for a native DOM {@link MouseEvent}. The {@code MouseEvent} interface like many
 * DOM event interfaces is used for multiple browser event types (i.e. "click", "dblclick", "mouseover", etc.). In order
 * to only listen for "click" events we use the {@link ForEvent} annotation.
 * <p>
 * This method removes a {@link Contact} from the displayed table and makes an HTTP request to delete the contact from
 * persistent storage on the server.
 */
@EventHandler("modal-delete")
public void onModalDeleteClick(final @ForEvent("click") MouseEvent event) {
  if (binder.getModel().contains(editor.getValue())) {
    final Contact deleted = editor.getValue();
    contactService.call((final Response response) -> {
      if (response.getStatusCode() >= 200 && response.getStatusCode() < 300) {
        binder.getModel().remove(deleted);
      }
    }).delete(editor.getValue().getId());
    editor.setValue(new Contact());

    modal.classList.remove("displayed");
  }
}
 
开发者ID:errai,项目名称:errai-tutorial,代码行数:26,代码来源:ContactListPage.java

示例4: onScroll

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("sessionContainer")
protected void onScroll(@ForEvent("scroll") ScrollEvent e) {
    // on the editor scroll recalculate palette position to be fixed on the screen
    palettePanel.getElement().getStyle().setTop(paletteInitialTop + e.getRelativeElement().getScrollTop(), Style.Unit.PX);
    palettePanel.getElement().getStyle().setLeft(paletteInitialLeft + e.getRelativeElement().getScrollLeft(), Style.Unit.PX);

    e.preventDefault();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:9,代码来源:SessionPresenterView.java

示例5: onOkClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("ok-button")
private void onOkClick(final @ForEvent("click") MouseEvent event) {
    presenter.onOk();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:ErrorPopupView.java

示例6: onCloseClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("close-button")
private void onCloseClick(final @ForEvent("click") MouseEvent event) {
    presenter.onClose();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:ErrorPopupView.java

示例7: onDetailClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("detail-anchor")
private void onDetailClick(final @ForEvent("click") MouseEvent event) {
    presenter.onDetail();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:ErrorPopupView.java

示例8: onCancelClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("confirm-cancel")
public void onCancelClick(final @ForEvent("click") MouseEvent event) {
    hide();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:ConfirmPopup.java

示例9: onCloseClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("confirm-close")
public void onCloseClick(final @ForEvent("click") MouseEvent event) {
    hide();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:ConfirmPopup.java

示例10: onClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
/**
 * Called for single-click events on the {@link DataField @DataField} {@link #contact}. The CDI event fired here is
 * observed by {@link ContactListPage#selectComponent(ContactDisplay)}.
 */
@EventHandler("contact")
public void onClick(final @ForEvent("click") MouseEvent event) {
  click.fire(this);
}
 
开发者ID:errai,项目名称:errai-tutorial,代码行数:9,代码来源:ContactDisplay.java

示例11: onDoubleClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
/**
 * Called for double-click events on the {@link DataField @DataField} {@link #contact}. The CDI event fired here is
 * observed by {@link ContactListPage#editComponent(ContactDisplay)}.
 */
@EventHandler("contact")
public void onDoubleClick(final @ForEvent("dblclick") MouseEvent event) {
  dblClick.fire(this);
}
 
开发者ID:errai,项目名称:errai-tutorial,代码行数:9,代码来源:ContactDisplay.java

示例12: onAddNewDataSource

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("add-new-datasource")
private void onAddNewDataSource(@ForEvent("click") Event event) {
    presenter.onAddDataSource();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:5,代码来源:DefExplorerContentViewImpl.java

示例13: onAddNewDriver

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("add-new-driver")
private void onAddNewDriver(@ForEvent("click") Event event) {
    presenter.onAddDriver();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:5,代码来源:DefExplorerContentViewImpl.java

示例14: onItemClick

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("item")
private void onItemClick(@ForEvent("click") Event event) {
    presenter.onClick();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:5,代码来源:DefItemViewImpl.java

示例15: onNameChange

import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("name")
private void onNameChange(@ForEvent("change") final Event event) {
    presenter.onNameChange();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:5,代码来源:DataSourceDefMainPanelViewImpl.java


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