use of com.vaadin.flow.component.ClickEvent in project aire-components by aire-ux.
the class TopologyView method createStopButtonMenu.
private Button createStopButtonMenu() {
val button = new Button("Stop", VaadinIcon.STOP.create());
button.addThemeVariants(ButtonVariant.LUMO_TERTIARY, ButtonVariant.LUMO_ERROR);
registerLifecycleItem(button, Lifecycle.State.Resolved, Lifecycle.State.Installed, Lifecycle.State.Uninstalled);
button.addClickListener((ComponentEventListener<ClickEvent<Button>>) event -> {
Overlays.open(this, ModuleScheduleOverlay.class, Mode.Scheduling, getZephyr().getKernel(), getSelectedModule(), Actions.Stop);
});
return button;
}
use of com.vaadin.flow.component.ClickEvent in project testbench by vaadin.
the class ButtonWrapTest method clickWithMeta_metaKeysMarkedAsUsed.
@Test
public void clickWithMeta_metaKeysMarkedAsUsed() {
Button button = new Button();
AtomicReference<ClickEvent> event = new AtomicReference<>(null);
button.addClickListener(clickEvent -> event.set(clickEvent));
getCurrentView().getElement().appendChild(button.getElement());
final ButtonWrap button_ = wrap(ButtonWrap.class, button);
button_.click(new MetaKeys(true, true, true, true));
Assertions.assertNotNull(event.get(), "event should have fired and recorded");
Assertions.assertTrue(event.get().isCtrlKey(), "Ctrl should have been used");
Assertions.assertTrue(event.get().isShiftKey(), "Shift should have been used");
Assertions.assertTrue(event.get().isAltKey(), "Alt should have been used");
Assertions.assertTrue(event.get().isMetaKey(), "Meta should have been used");
button_.click(new MetaKeys(true, true, false, false));
Assertions.assertTrue(event.get().isCtrlKey(), "Ctrl should have been used");
Assertions.assertTrue(event.get().isShiftKey(), "Shift should have been used");
Assertions.assertFalse(event.get().isAltKey(), "Alt should not have been used");
Assertions.assertFalse(event.get().isMetaKey(), "Meta should not have been used");
}
use of com.vaadin.flow.component.ClickEvent in project karnak by OsiriX-Foundation.
the class DicomWorkListView method buildSelectWorkListBtn.
@SuppressWarnings("serial")
private void buildSelectWorkListBtn() {
selectWorkListBtn = new Button("Select Worklist");
selectWorkListBtn.getStyle().set("cursor", "pointer");
selectWorkListBtn.addClickListener(new ComponentEventListener<ClickEvent<Button>>() {
@Override
public void onComponentEvent(ClickEvent<Button> event) {
openDicomWorklistSelectionDialog();
}
});
}
use of com.vaadin.flow.component.ClickEvent in project karnak by OsiriX-Foundation.
the class WarningConfirmDialog method createButtonValidate.
@SuppressWarnings("serial")
private void createButtonValidate() {
buttonValidate = new Button();
buttonValidate.setText(valueValidate);
buttonValidate.addThemeVariants(ButtonVariant.LUMO_ERROR, ButtonVariant.LUMO_PRIMARY);
buttonValidate.setWidth("90px");
buttonValidate.focus();
buttonValidate.addClickListener((ComponentEventListener<ClickEvent<Button>>) event -> {
fireConfirmationEvent();
dialog.close();
});
buttonValidate.addClickShortcut(Key.ENTER);
}
use of com.vaadin.flow.component.ClickEvent in project karnak by OsiriX-Foundation.
the class DicomWorkListSelectionDialog method buildSelectBtn.
@SuppressWarnings("serial")
private void buildSelectBtn() {
selectBtn = new Button("Select");
selectBtn.addClassName("stroked-button");
selectBtn.addClickListener(new ComponentEventListener<ClickEvent<Button>>() {
@Override
public void onComponentEvent(ClickEvent<Button> event) {
fireWorkListSelectionEvent();
dialog.close();
}
});
}
Aggregations