Search in sources :

Example 6 with TextField

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

the class ExternalIDView method setUploadCSVElement.

public void setUploadCSVElement() {
    uploadCsvLabelDiv = new Div();
    uploadCsvLabelDiv.setText("Upload the CSV file containing the external ID associated with patient(s): ");
    uploadCsvLabelDiv.getStyle().set("font-size", "large").set("font-weight", "bolder");
    MemoryBuffer memoryBuffer = new MemoryBuffer();
    uploadCsvButton = new Upload(memoryBuffer);
    uploadCsvButton.setDropLabel(new Span("Drag and drop your CSV file here"));
    uploadCsvButton.addSucceededListener(event -> {
        inputStream = memoryBuffer.getInputStream();
        Dialog chooseSeparatorDialog = new Dialog();
        TextField separatorCSVField = new TextField("Choose the separator for reading the CSV file");
        separatorCSVField.setWidthFull();
        separatorCSVField.setMaxLength(1);
        separatorCSVField.setValue(",");
        Button openCSVButton = new Button("Open CSV");
        openCSVButton.addClickListener(buttonClickEvent -> {
            chooseSeparatorDialog.close();
            char separator = ',';
            if (!separatorCSVField.getValue().equals("")) {
                separator = separatorCSVField.getValue().charAt(0);
            }
            CSVDialog csvDialog = new CSVDialog(inputStream, separator, projectDropDown.getValue());
            csvDialog.setWidth("80%");
            csvDialog.open();
            csvDialog.getReadCSVButton().addClickListener(buttonClickEvent1 -> {
                externalIDGrid.addPatientList(csvDialog.getPatientsList());
                checkDuplicatePatient();
                csvDialog.resetPatientsList();
            });
        });
        chooseSeparatorDialog.add(separatorCSVField, openCSVButton);
        chooseSeparatorDialog.open();
        separatorCSVField.focus();
    });
}
Also used : Div(com.vaadin.flow.component.html.Div) MemoryBuffer(com.vaadin.flow.component.upload.receivers.MemoryBuffer) Button(com.vaadin.flow.component.button.Button) Dialog(com.vaadin.flow.component.dialog.Dialog) Upload(com.vaadin.flow.component.upload.Upload) TextField(com.vaadin.flow.component.textfield.TextField) Span(com.vaadin.flow.component.html.Span)

Example 7 with TextField

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

the class MainzellisteAddPatient method setElements.

private void setElements() {
    externalIdField = new TextField("External Pseudonym");
    externalIdField.setWidth("25%");
    patientIdField = new TextField("Patient ID");
    patientIdField.setWidth("25%");
    patientFirstNameField = new TextField("Patient first name");
    patientFirstNameField.setWidth("25%");
    patientLastNameField = new TextField("Patient last name");
    patientLastNameField.setWidth("25%");
    issuerOfPatientIdField = new TextField("Issuer of patient ID");
    issuerOfPatientIdField.setWidth("33%");
    patientBirthDateField = new DatePicker("Patient Birth Date");
    patientBirthDateField.setWidth("33%");
    patientSexField = new Select<>();
    patientSexField.setLabel("Patient Sex");
    patientSexField.setItems("M", "F", "O");
    patientSexField.setWidth("33%");
    saveInMainzellisteButton = new Button("Save patient in Mainzelliste");
    saveInMainzellisteButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
    saveInMainzellisteButton.setIcon(new IronIcon("icons", "icons:send"));
    horizontalLayoutAddClear = new HorizontalLayout();
    horizontalLayoutAddClear.getStyle().set("margin-left", "auto");
    horizontalLayout1 = new HorizontalLayout();
    horizontalLayout2 = new HorizontalLayout();
    horizontalLayout3 = new HorizontalLayout();
    horizontalLayout1.setSizeFull();
    horizontalLayout2.setSizeFull();
    horizontalLayout3.setSizeFull();
    clearFieldsButton = new Button("Clear");
}
Also used : Button(com.vaadin.flow.component.button.Button) IronIcon(com.vaadin.flow.component.icon.IronIcon) TextField(com.vaadin.flow.component.textfield.TextField) DatePicker(com.vaadin.flow.component.datepicker.DatePicker) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 8 with TextField

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

the class FormDICOM method init.

public void init(Binder<DestinationEntity> binder, ButtonSaveDeleteCancel buttonSaveDeleteCancel) {
    this.binder = binder;
    this.deIdentificationComponent.init(this.binder);
    this.filterBySOPClassesForm.init(this.binder);
    this.destinationCondition.init(this.binder);
    notificationComponent.init(this.binder);
    transferSyntaxComponent.init(this.binder);
    transcodeOnlyUncompressedComponent.init(this.binder);
    setSizeFull();
    aeTitle = new TextField("AETitle");
    description = new TextField("Description");
    hostname = new TextField("Hostname");
    port = new TextField("Port");
    useaetdest = new Checkbox("Use AETitle destination");
    activate = new Checkbox("Enable destination");
    // Define layout
    VerticalLayout destinationLayout = new VerticalLayout(UIS.setWidthFull(new HorizontalLayout(aeTitle, description)), destinationCondition, UIS.setWidthFull(new HorizontalLayout(hostname, port)));
    VerticalLayout transferLayout = new VerticalLayout(new HorizontalLayout(transferSyntaxComponent, transcodeOnlyUncompressedComponent));
    VerticalLayout useaetdestLayout = new VerticalLayout(new HorizontalLayout(useaetdest));
    VerticalLayout activateLayout = new VerticalLayout(activate);
    // Set padding
    destinationLayout.setPadding(true);
    transferLayout.setPadding(true);
    useaetdestLayout.setPadding(true);
    activateLayout.setPadding(true);
    // Add components
    add(UIS.setWidthFull(new BoxShadowComponent(destinationLayout)), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(transferLayout))), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(useaetdestLayout))), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(notificationComponent))), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(deIdentificationComponent))), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(filterBySOPClassesForm))), UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(activateLayout))), UIS.setWidthFull(buttonSaveDeleteCancel));
    setElements();
    setBinder();
}
Also used : Checkbox(com.vaadin.flow.component.checkbox.Checkbox) TextField(com.vaadin.flow.component.textfield.TextField) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) BoxShadowComponent(org.karnak.frontend.component.BoxShadowComponent) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 9 with TextField

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

the class FormSTOW method init.

public void init(Binder<DestinationEntity> binder, ButtonSaveDeleteCancel buttonSaveDeleteCancel) {
    setSizeFull();
    this.binder = binder;
    this.deIdentificationComponent.init(this.binder);
    this.filterBySOPClassesForm.init(this.binder);
    this.destinationCondition.init(binder);
    notificationComponent.init(binder);
    transferSyntaxComponent.init(this.binder);
    transcodeOnlyUncompressedComponent.init(this.binder);
    this.description = new TextField("Description");
    this.url = new TextField("URL");
    this.urlCredentials = new TextField("URL credentials");
    this.headers = new TextArea("Headers");
    this.switchingAlbumsView = new SwitchingAlbumsView();
    this.activate = new Checkbox("Enable destination");
    // Define layout
    VerticalLayout destinationLayout = new VerticalLayout(UIS.setWidthFull(new HorizontalLayout(description)), destinationCondition, UIS.setWidthFull(new HorizontalLayout(url, urlCredentials)), UIS.setWidthFull(headers));
    VerticalLayout transferLayout = new VerticalLayout(new HorizontalLayout(transferSyntaxComponent, transcodeOnlyUncompressedComponent));
    VerticalLayout activateLayout = new VerticalLayout(activate);
    VerticalLayout switchingLayout = new VerticalLayout(switchingAlbumsView);
    // Set padding
    transferLayout.setPadding(true);
    destinationLayout.setPadding(true);
    activateLayout.setPadding(true);
    activateLayout.setPadding(true);
    // Add components
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(destinationLayout))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(transferLayout))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(notificationComponent))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(deIdentificationComponent))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(filterBySOPClassesForm))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(switchingLayout))));
    add(UIS.setWidthFull(new BoxShadowComponent(UIS.setWidthFull(activateLayout))));
    add(UIS.setWidthFull(buttonSaveDeleteCancel));
    setElements();
    setBinder();
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Checkbox(com.vaadin.flow.component.checkbox.Checkbox) TextField(com.vaadin.flow.component.textfield.TextField) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) BoxShadowComponent(org.karnak.frontend.component.BoxShadowComponent) SwitchingAlbumsView(org.karnak.frontend.kheops.SwitchingAlbumsView) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 10 with TextField

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

the class NotificationComponent method buildNotifyInterval.

/**
 * Notify interval
 */
private void buildNotifyInterval() {
    notifyInterval = new TextField(String.format("Notif.: interval (Default: %s)", Notification.DEFAULT_INTERVAL));
    notifyInterval.setWidth("18%");
    notifyInterval.addThemeVariants(TextFieldVariant.LUMO_ALIGN_RIGHT);
    UIS.setTooltip(notifyInterval, String.format("Interval in seconds for sending a notification (when no new image is arrived in the archive folder). Default value: %s", Notification.DEFAULT_INTERVAL));
}
Also used : TextField(com.vaadin.flow.component.textfield.TextField)

Aggregations

TextField (com.vaadin.flow.component.textfield.TextField)227 Test (org.junit.jupiter.api.Test)61 Button (com.vaadin.flow.component.button.Button)54 Div (com.vaadin.flow.component.html.Div)38 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)32 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)29 Binder (com.vaadin.flow.data.binder.Binder)29 GeneratedVaadinTextField (com.vaadin.flow.component.textfield.GeneratedVaadinTextField)28 Element (com.vaadin.flow.dom.Element)26 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)23 Route (com.vaadin.flow.router.Route)21 Component (com.vaadin.flow.component.Component)16 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)15 BinderCrudEditor (com.vaadin.flow.component.crud.BinderCrudEditor)15 Grid (com.vaadin.flow.component.grid.Grid)15 Span (com.vaadin.flow.component.html.Span)15 List (java.util.List)15 EmailField (com.vaadin.flow.component.textfield.EmailField)14 TextArea (com.vaadin.flow.component.textfield.TextArea)14 Test (org.junit.Test)14