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();
});
}
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");
}
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();
}
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();
}
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));
}
Aggregations