SplitOptionsPane() { super(Style.DEFAULT_SPACING); getStyleClass().addAll(Style.CONTAINER.css()); I18nContext ctx = DefaultI18nContext.getInstance(); levelCombo.setId("bookmarksLevel"); regexpField.setId("bookmarksRegexp"); regexpField.setPromptText(ctx.i18n("Regular expression the bookmark has to match")); regexpField.setPrefWidth(350); getChildren().addAll(createLine(new Label(ctx.i18n("Split at this bookmark level:")), levelCombo), createLine(new Label(ctx.i18n("Matching regular expression:")), regexpField, helpIcon(new TextFlow(new Text(ctx.i18n("A regular expression the bookmark text has to match") + System.lineSeparator()), new Text(ctx.i18n( "Example: use .*Chapter.* to match bookmarks containing the word \"Chapter\"")))))); }
private void createMaxCount(VBox parent, MaxCountFilterModel maxCountFilterModel) { TextField maxCount = new NumberOnlyTextField(); maxCount.setPrefWidth(100); Bindings.bindBidirectional(maxCount.textProperty(), maxCountFilterModel.maxCount, new IntegerStringConverter()); parent.getChildren().add(createDescriptionVale("limit",maxCount)); }
public TagArea() { this.getStylesheets().add(getClass().getResource("style.css").toExternalForm()); getStyleClass().setAll("tag-area"); textField.setMinSize(80, 30); textField.setPrefWidth(80); textField.setOnAction(event -> { this.addTag(textField.getText()); textField.clear(); }); textField.setOnKeyReleased(event -> { System.out.println("[Pressed] Pressed Key: " + event.getCode() + ", Character is: " + event.getCharacter()); if (event.getCode() == KeyCode.BACK_SPACE && textField.getText().length() == 0) { List<Tag> tags = this.getTags(); if (tags.size() != 0) { Tag lastTag = tags.get(tags.size() - 1); removeTag(lastTag); textField.setText(lastTag.getValue()); textField.positionCaret(lastTag.getValue().length()); event.consume(); } } else if (event.getCode() == KeyCode.COMMA) { System.out.println("TextField value is: " + textField.getText()); addTag(textField.getText().replaceAll(",", "")); textField.clear(); event.consume(); } }); this.getChildren().add(textField); }
public static void addCalculatedAreaField(MigPane root, PresentationModel model) { root.add(label(Bundle.fieldsets_label_area_in_ha())); final TextField areaField = new TextField(); areaField.setPrefWidth(FieldSets.PREF_WIDTH); // areaField.setEditable(false); areaField.setDisable(true); root.add(areaField); Model.withAt(model, HasArea.PROP_AREA_IN_HECTARES, HasGeometry.PROP_GEOMETRY); areaField.setText(Double.toString(wktArea(PM.getStringAttr(model, HasGeometry.PROP_GEOMETRY)))); model.getAt(HasGeometry.PROP_GEOMETRY).addPropertyChangeListener(Attribute.VALUE, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent pce) { String wkt = (String) pce.getNewValue(); areaField.setText(Double.toString(wktArea(wkt))); //TODO: round/format } }); //TODO: // - extract rule class tht can be applied to both client and server side models // -use plain binding once area is automatically updated server side: // JFXBinder.bind(HasArea.PROP_AREA_IN_HECTARES).of(model).to("text").of(areaField);// }
public static void addIdField(MigPane root, PresentationModel model) { root.add(label(Bundle.fieldsets_label_id())); TextField idField = new TextField(); idField.setPrefWidth(PREF_WIDTH); idField.setDisable(true); root.add(idField); JFXBinder.bind(AgroEntity.PROP_URI).of(Model.withAt(model,AgroEntity.PROP_URI)).to("text").of(idField); // JFXBinder.bind("text").of(idField).to(Entity.PROP_URI).of(model); }
public static void addDescriptionField(MigPane root, PresentationModel model) { root.add(label(Bundle.fieldsets_label_description())); TextField descriptionField = new TextField(); // TODO: multiline? descriptionField.setPrefWidth(PREF_WIDTH); root.add(descriptionField); JFXBinder.bind(HasDescription.PROP_DESCRIPTION).of(Model.withAt(model, HasDescription.PROP_DESCRIPTION)).to("text").of(descriptionField); JFXBinder.bind("text").of(descriptionField).to(HasDescription.PROP_DESCRIPTION).of(model); }
public static void addNameField(MigPane root, PresentationModel model) { root.add(label(Bundle.fieldsets_label_name())); TextField nameField = new TextField(); nameField.setPrefWidth(PREF_WIDTH); root.add(nameField); JFXBinder.bind(HasName.PROP_NAME).of(Model.withAt(model, HasName.PROP_NAME)).to("text").of(nameField); JFXBinder.bind("text").of(nameField).to(HasName.PROP_NAME).of(model); }
private void initComponents() { FieldSets.addIdField(this, model); FieldSets.addNameField(this, model); add(FieldSets.label("External GUID")); TextField externalGuidField = new TextField(); externalGuidField.setPrefWidth(FieldSets.PREF_WIDTH); add(externalGuidField); JFXBinder.bind(Customer.PROP_EXTERNAL_GUID).of(Model.withAt(model, Customer.PROP_EXTERNAL_GUID)).to("text").of(externalGuidField); JFXBinder.bind("text").of(externalGuidField).to(Customer.PROP_EXTERNAL_GUID).of(model); add(FieldSets.label("Token")); TextField tokenField = new TextField(); tokenField.setPrefWidth(FieldSets.PREF_WIDTH); add(tokenField); JFXBinder.bind(Customer.PROP_TOKEN).of(Model.withAt(model, Customer.PROP_TOKEN)).to("text").of(tokenField); JFXBinder.bind("text").of(tokenField).to(Customer.PROP_TOKEN).of(model); FieldSets.addAddressFieldSet(this, model); }
public static void addSourceRefFieldSet(MigPane root, PresentationModel model) { //TODO: make immutable for (some?) imported files. root.add(label(Bundle.fieldsets_label_source_ref_system())); TextField sourceRefSystemField = new TextField(); sourceRefSystemField.setPrefWidth(FieldSets.PREF_WIDTH); root.add(sourceRefSystemField); JFXBinder.bind(HasSourceReference.PROP_SOURCE_REF_SYSTEM).of(Model.withAt(model,HasSourceReference.PROP_SOURCE_REF_SYSTEM)).to("text").of(sourceRefSystemField); JFXBinder.bind("text").of(sourceRefSystemField).to(HasSourceReference.PROP_SOURCE_REF_SYSTEM).of(model); root.add(label(Bundle.fieldsets_label_source_ref_table())); TextField sourceRefTableField = new TextField(); sourceRefTableField.setPrefWidth(FieldSets.PREF_WIDTH); root.add(sourceRefTableField); JFXBinder.bind(HasSourceReference.PROP_SOURCE_REF_TABLE).of(Model.withAt(model,HasSourceReference.PROP_SOURCE_REF_TABLE)).to("text").of(sourceRefTableField); JFXBinder.bind("text").of(sourceRefTableField).to(HasSourceReference.PROP_SOURCE_REF_TABLE).of(model); root.add(label(Bundle.fieldsets_label_source_ref_code())); TextField sourceRefCodeField = new TextField(); sourceRefCodeField.setPrefWidth(FieldSets.PREF_WIDTH); root.add(sourceRefCodeField); JFXBinder.bind(HasSourceReference.PROP_SOURCE_REF_CODE).of(Model.withAt(model,HasSourceReference.PROP_SOURCE_REF_CODE)).to("text").of(sourceRefCodeField); JFXBinder.bind("text").of(sourceRefCodeField).to(HasSourceReference.PROP_SOURCE_REF_CODE).of(model); }
typeField.setPrefWidth(PREF_WIDTH); root.add(typeField); JFXBinder.bind(Machine.PROP_TYPE).of(Model.withAt(model, Machine.PROP_TYPE)).to("text").of(typeField); brandField.setPrefWidth(PREF_WIDTH); root.add(brandField); JFXBinder.bind(Machine.PROP_BRAND).of(Model.withAt(model, Machine.PROP_BRAND)).to("text").of(brandField); modelNumberField.setPrefWidth(PREF_WIDTH); root.add(modelNumberField); JFXBinder.bind(Machine.PROP_MODEL_NUMBER).of(Model.withAt(model, Machine.PROP_MODEL_NUMBER)).to("text").of(modelNumberField); serialNumberField.setPrefWidth(PREF_WIDTH); root.add(serialNumberField); JFXBinder.bind(Machine.PROP_SERIAL_NUMBER).of(Model.withAt(model, Machine.PROP_SERIAL_NUMBER)).to("text").of(serialNumberField);
titleField.setPrefWidth(PREF_WIDTH); root.add(titleField); JFXBinder.bind(NaturalPerson.PROP_TITLE).of(Model.withAt(model, NaturalPerson.PROP_TITLE)).to("text").of(titleField); firstNameField.setPrefWidth(PREF_WIDTH); root.add(firstNameField); JFXBinder.bind(NaturalPerson.PROP_FIRST_NAME).of(Model.withAt(model, NaturalPerson.PROP_FIRST_NAME)).to("text").of(firstNameField); prefixField.setPrefWidth(PREF_WIDTH); root.add(prefixField); JFXBinder.bind(NaturalPerson.PROP_PREFIX).of(Model.withAt(model, NaturalPerson.PROP_PREFIX)).to("text").of(prefixField); surnameField.setPrefWidth(PREF_WIDTH); root.add(surnameField); JFXBinder.bind(NaturalPerson.PROP_SURNAME).of(Model.withAt(model, NaturalPerson.PROP_SURNAME)).to("text").of(surnameField);
@Override public void run() { MigPane root = new MigPane("wrap 2"); // // adding name label and field // Label nameLabel = new Label(Bundle.new_worker_view_label_name()); root.add(nameLabel); TextField nameField = new TextField(); nameField.setPrefWidth(150.0d); root.add(nameField); JFXBinder.bind("text").of(nameField).to(Worker.PROP_NAME).of(Model.withAt(model, Worker.PROP_NAME)); FieldSets.addNaturalPersonFieldSet(root, model); FieldSets.addAddressFieldSet(root, model); Scene scene = new Scene(root, SCENE_WIDTH, SCENE_HEIGHT); StyleManager.Default.applyFormStyle(scene); fxPanel.setScene(scene); } }
/** * {@inheritDoc} */ @Override protected void initView() { super.initView(); node().setStyle("-fx-background-color:white"); node().setPadding(new Insets(10, 20, 10, 20)); node().setSpacing(40); node().setAlignment(Pos.CENTER); this.selectAll = new CheckBox(); this.todoText = new TextField(); this.todoText.setPrefWidth(Integer.MAX_VALUE); HBox.setHgrow(this.todoText, Priority.ALWAYS); node().getChildren().addAll(this.selectAll, this.todoText); this.todoText.focusedProperty().addListener(this::textFocused); }
idField.setPrefWidth(150.0d); idField.setDisable(true); root.add(idField); nameField.setPrefWidth(150.0d); root.add(nameField); JFXBinder.bind(Worker.PROP_NAME).of(Model.withAt(model, Worker.PROP_NAME)).to("text").of(nameField);
averageValueField.setPrefWidth(FieldSets.PREF_WIDTH); add(averageValueField); JFXBinder.bind(ActivityField.PROP_AVERAGE_VALUE).of(model).to("text").of(averageValueField, NumberConverters.numberToString()); defaultValueField.setPrefWidth(FieldSets.PREF_WIDTH); add(defaultValueField); JFXBinder.bind(ActivityField.PROP_DEFAULT_VALUE).of(model).to("text").of(defaultValueField, NumberConverters.numberToString()); unitField.setPrefWidth(FieldSets.PREF_WIDTH); add(unitField); JFXBinder.bind(ActivityField.PROP_UNIT).of(model).to("text").of(unitField);
private void initComponents() { FieldSets.addIdField(this, model); FieldSets.addNameField(this, model); FieldSets.addPeriodFieldSet(this, model); // // adding planned area label and field // add(FieldSets.label(Bundle.cropproductionunit_view_label_planned_area())); TextField plannedAreaField = new TextField(); plannedAreaField.setPrefWidth(FieldSets.PREF_WIDTH); add(plannedAreaField); JFXBinder.bind(CropProductionUnit.PROP_PLANNED_AREA_IN_HECTARES).of(Model.withAt(model, CropProductionUnit.PROP_PLANNED_AREA_IN_HECTARES)).to("text").of(plannedAreaField, NumberConverters.numberToString()); JFXBinder.bind("text").of(plannedAreaField).to(CropProductionUnit.PROP_PLANNED_AREA_IN_HECTARES).of(model, NumberConverters.stringToDouble()); //todo: NonNegativeDoubleConverter? add(FieldSets.label(Bundle.cropproductionunit_view_label_crop_year())); TextField cropYearField = new TextField(); cropYearField.setPrefWidth(FieldSets.PREF_WIDTH); add(cropYearField); JFXBinder.bind(CropProductionUnit.PROP_CROP_YEAR).of(Model.withAt(model,CropProductionUnit.PROP_CROP_YEAR)).to("text").of(cropYearField, NumberConverters.numberToString()); JFXBinder.bind("text").of(cropYearField).to(CropProductionUnit.PROP_CROP_YEAR).of(model, NumberConverters.stringToInteger()); // Customer ComboBox: CustomerSelector.addFieldSet(this, model); // Crop selection ComboBoxes: CropSelector.addFieldSet(this, model); }
streetField.setPrefWidth(PREF_WIDTH); root.add(streetField); JFXBinder.bind(HasAddress.PROP_STREET_NAME).of(Model.withAt(model, HasAddress.PROP_STREET_NAME)).to("text").of(streetField); houseNumberField.setPrefWidth(PREF_WIDTH); root.add(houseNumberField); JFXBinder.bind(HasAddress.PROP_HOUSE_NUMBER).of(Model.withAt(model, HasAddress.PROP_HOUSE_NUMBER)).to("text").of(houseNumberField, NumberConverters.numberToString()); houseNumberExtField.setPrefWidth(PREF_WIDTH); root.add(houseNumberExtField); JFXBinder.bind(HasAddress.PROP_HOUSE_NUMBER_EXT).of(Model.withAt(model, HasAddress.PROP_HOUSE_NUMBER_EXT)).to("text").of(houseNumberExtField); postalCodeField.setPrefWidth(PREF_WIDTH); root.add(postalCodeField); JFXBinder.bind(HasAddress.PROP_POSTAL_CODE).of(Model.withAt(model, HasAddress.PROP_POSTAL_CODE)).to("text").of(postalCodeField); cityField.setPrefWidth(PREF_WIDTH); root.add(cityField); JFXBinder.bind(HasAddress.PROP_CITY).of(Model.withAt(model, HasAddress.PROP_CITY)).to("text").of(cityField);
fileLocation.setPrefWidth(525); grid.add(fileLocation, 1, row++);
idField.setPrefWidth(150.0d); idField.setDisable(true); root.add(idField); nameField.setPrefWidth(150.0d); root.add(nameField); JFXBinder.bind(Field.PROP_NAME).of(Model.withAt(model, Field.PROP_NAME)).to("text").of(nameField);
pathHBox.getChildren().addAll(pathsField, browseButton); browseButton.setPrefWidth(-1); pathsField.setPrefWidth(400); DialogPane dialogPane = new DialogPane(); dialogPane.setHeaderText("Add RRD file(s)");