Search in sources :

Example 11 with ClickEvent

use of com.vaadin.flow.component.ClickEvent in project karnak by OsiriX-Foundation.

the class DicomWorkListSelectionDialog method buildCancelBtn.

@SuppressWarnings("serial")
private void buildCancelBtn() {
    cancelBtn = new Button("Cancel");
    cancelBtn.addClickListener(new ComponentEventListener<ClickEvent<Button>>() {

        @Override
        public void onComponentEvent(ClickEvent<Button> event) {
            dialog.close();
        }
    });
}
Also used : Button(com.vaadin.flow.component.button.Button) ClickEvent(com.vaadin.flow.component.ClickEvent)

Example 12 with ClickEvent

use of com.vaadin.flow.component.ClickEvent in project karnak by OsiriX-Foundation.

the class ConfirmDialog method createYesBtn.

@SuppressWarnings("serial")
private void createYesBtn() {
    yesBtn = new Button();
    yesBtn.addClassName("stroked-button");
    yesBtn.addClassName("primary");
    yesBtn.setText("Oui");
    yesBtn.setWidth("90px");
    yesBtn.focus();
    yesBtn.addClickListener(new ComponentEventListener<ClickEvent<Button>>() {

        @Override
        public void onComponentEvent(ClickEvent<Button> event) {
            fireConfirmationEvent();
            dialog.close();
        }
    });
    yesBtn.addClickShortcut(Key.ENTER);
}
Also used : Button(com.vaadin.flow.component.button.Button) ClickEvent(com.vaadin.flow.component.ClickEvent)

Example 13 with ClickEvent

use of com.vaadin.flow.component.ClickEvent in project aire-components by aire-ux.

the class TopologyView method createStartMenuButton.

private Button createStartMenuButton() {
    val button = new Button("Start", VaadinIcon.PLAY.create());
    button.addThemeVariants(ButtonVariant.LUMO_TERTIARY, ButtonVariant.LUMO_SUCCESS);
    registerLifecycleItem(button, Lifecycle.State.Active);
    button.addClickListener((ComponentEventListener<ClickEvent<Button>>) event -> {
        Overlays.open(this, ModuleScheduleOverlay.class, Mode.Scheduling, getZephyr().getKernel(), getSelectedModule(), Actions.Activate);
    });
    return button;
}
Also used : lombok.val(lombok.val) ComponentEventListener(com.vaadin.flow.component.ComponentEventListener) Mode(io.sunshower.zephyr.management.ModuleScheduleOverlay.Mode) MenuBar(com.vaadin.flow.component.menubar.MenuBar) Getter(lombok.Getter) MenuBarVariant(com.vaadin.flow.component.menubar.MenuBarVariant) CanvasEvent(io.sunshower.zephyr.ui.canvas.listeners.CanvasEvent) Registration(com.vaadin.flow.shared.Registration) CondensationUtilities(io.sunshower.zephyr.condensation.CondensationUtilities) SetAllCellAttributesAction(io.sunshower.zephyr.ui.canvas.actions.SetAllCellAttributesAction) HashMap(java.util.HashMap) ContextMenu(io.sunshower.zephyr.ui.components.ContextMenu) Route(com.vaadin.flow.router.Route) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) EventType(io.sunshower.zephyr.ui.canvas.listeners.VertexEvent.EventType) Coordinate(io.zephyr.kernel.Coordinate) Vertex(io.sunshower.zephyr.ui.canvas.Vertex) Overlays(io.sunshower.zephyr.ui.components.Overlays) Map(java.util.Map) Canvas(io.sunshower.zephyr.ui.canvas.Canvas) CellAttributes(io.sunshower.zephyr.ui.canvas.CellAttributes) Zephyr(io.zephyr.cli.Zephyr) ButtonVariant(com.vaadin.flow.component.button.ButtonVariant) AddVerticesAction(io.sunshower.zephyr.ui.canvas.actions.AddVerticesAction) EnumMap(java.util.EnumMap) lombok.val(lombok.val) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Breadcrumb(io.sunshower.zephyr.ui.controls.Breadcrumb) ClickEvent(com.vaadin.flow.component.ClickEvent) VertexTemplate(io.sunshower.zephyr.ui.canvas.VertexTemplate) Actions(io.zephyr.kernel.module.ModuleLifecycle.Actions) CanvasReadyEvent(io.sunshower.zephyr.ui.canvas.CanvasReadyEvent) Edge(io.sunshower.zephyr.ui.canvas.Edge) Serializable(java.io.Serializable) Model(io.sunshower.zephyr.ui.canvas.Model) Objects(java.util.Objects) Button(com.vaadin.flow.component.button.Button) List(java.util.List) ConnectVerticesAction(io.sunshower.zephyr.ui.canvas.actions.ConnectVerticesAction) Lifecycle(io.zephyr.kernel.Lifecycle) ModuleCoordinate(io.zephyr.kernel.core.ModuleCoordinate) MainView(io.sunshower.zephyr.MainView) AddVertexTemplateAction(io.sunshower.zephyr.ui.canvas.actions.AddVertexTemplateAction) EdgeTemplate(io.sunshower.zephyr.ui.canvas.EdgeTemplate) Module(io.zephyr.kernel.Module) Button(com.vaadin.flow.component.button.Button) ClickEvent(com.vaadin.flow.component.ClickEvent)

Aggregations

ClickEvent (com.vaadin.flow.component.ClickEvent)13 Button (com.vaadin.flow.component.button.Button)12 ComponentEventListener (com.vaadin.flow.component.ComponentEventListener)5 ButtonVariant (com.vaadin.flow.component.button.ButtonVariant)5 Registration (com.vaadin.flow.shared.Registration)5 ItemClickEvent (com.vaadin.flow.component.grid.ItemClickEvent)3 VaadinIcon (com.vaadin.flow.component.icon.VaadinIcon)3 MenuBar (com.vaadin.flow.component.menubar.MenuBar)3 MenuBarVariant (com.vaadin.flow.component.menubar.MenuBarVariant)3 Route (com.vaadin.flow.router.Route)3 MainView (io.sunshower.zephyr.MainView)3 CondensationUtilities (io.sunshower.zephyr.condensation.CondensationUtilities)3 Mode (io.sunshower.zephyr.management.ModuleScheduleOverlay.Mode)3 Canvas (io.sunshower.zephyr.ui.canvas.Canvas)3 CanvasReadyEvent (io.sunshower.zephyr.ui.canvas.CanvasReadyEvent)3 CellAttributes (io.sunshower.zephyr.ui.canvas.CellAttributes)3 Edge (io.sunshower.zephyr.ui.canvas.Edge)3 EdgeTemplate (io.sunshower.zephyr.ui.canvas.EdgeTemplate)3 Model (io.sunshower.zephyr.ui.canvas.Model)3 Vertex (io.sunshower.zephyr.ui.canvas.Vertex)3