use of com.vaadin.flow.component.textfield.NumberField in project karnak by OsiriX-Foundation.
the class CSVDialog method setElement.
private void setElement() {
divTitle = new Div();
divTitle.setText(TITLE);
divTitle.getStyle().set("font-size", "large").set("font-weight", "bolder").set("padding-bottom", "10px");
divGridContent = new Div();
errorMsg = new Div();
errorMsg.getStyle().set("font-weight", "bolder").set("padding-bottom", "10px").set("color", "red");
fromLineField = new NumberField("From line ");
fromLineField.setValue(1d);
fromLineField.setHasControls(true);
fromLineField.setMin(1);
fromLineField.setMax((double) allRows.size() + 1);
readCSVButton = new Button("Upload CSV", event -> {
if (selectValuesPositionHashMap.get(EXTERNAL_PSEUDONYM).equals(-1) || selectValuesPositionHashMap.get(PATIENT_ID).equals(-1) || selectValuesPositionHashMap.get(PATIENT_FIRST_NAME).equals(-1) || selectValuesPositionHashMap.get(PATIENT_LAST_NAME).equals(-1)) {
generateErrorMsg();
} else {
readCSVPatients();
close();
}
});
readCSVButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
readCSVButton.setIcon(VaadinIcon.PLUS_CIRCLE.create());
cancelButton = new Button("Cancel", event -> close());
}
use of com.vaadin.flow.component.textfield.NumberField in project karnak by OsiriX-Foundation.
the class PseudonymInDicomTagComponent method setElements.
public void setElements() {
delimiter = new TextField("Delimiter");
tag = new TextField("Tag");
position = new NumberField("Position");
position.setHasControls(true);
position.setMin(0);
position.setStep(1);
savePseudonym = new Checkbox("Save pseudonym in Mainzelliste");
savePseudonym.getStyle().set("margin-top", "30px");
savePseudonym.setValue(true);
}
use of com.vaadin.flow.component.textfield.NumberField in project flow-components by vaadin.
the class HasLabelTest method numberField.
@Test
public void numberField() {
NumberField c = new NumberField();
Assert.assertTrue(c instanceof HasLabel);
}
use of com.vaadin.flow.component.textfield.NumberField in project flow-components by vaadin.
the class NumberFieldTest method testValuePropertyFormatting.
private void testValuePropertyFormatting(double value, String expected) {
final NumberField numberField = new NumberField();
numberField.setValue(value);
assertEquals(expected, numberField.getElement().getProperty("value"));
}
use of com.vaadin.flow.component.textfield.NumberField in project flow-components by vaadin.
the class NumberFieldPage method addNumberFields.
private void addNumberFields() {
NumberField dollarField = new NumberField("Dollars");
dollarField.setPrefixComponent(new Span("$"));
NumberField euroField = new NumberField("Euros");
euroField.setSuffixComponent(new Span("€"));
NumberField stepperField = new NumberField("Stepper");
stepperField.setValue(1d);
stepperField.setMin(0);
stepperField.setMax(10);
stepperField.setHasControls(true);
euroField.setSuffixComponent(new Span("€"));
dollarField.setId("dollar-field");
euroField.setId("euro-field");
stepperField.setId("step-number-field");
add(dollarField, euroField, stepperField);
}
Aggregations