本文整理匯總了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();
}