本文整理汇总了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();
}
示例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();
}
}
}
示例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");
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例8: onCancelClick
import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("confirm-cancel")
public void onCancelClick(final @ForEvent("click") MouseEvent event) {
hide();
}
示例9: onCloseClick
import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("confirm-close")
public void onCloseClick(final @ForEvent("click") MouseEvent event) {
hide();
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例14: onItemClick
import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("item")
private void onItemClick(@ForEvent("click") Event event) {
presenter.onClick();
}
示例15: onNameChange
import org.jboss.errai.ui.shared.api.annotations.ForEvent; //导入依赖的package包/类
@EventHandler("name")
private void onNameChange(@ForEvent("change") final Event event) {
presenter.onNameChange();
}