@@ -67,8 +67,8 @@ public abstract class Field<F extends Field> {
67
67
* This property is translatable if a {@link TranslationService} is set on
68
68
* the containing form.
69
69
*/
70
- private final StringProperty label = new SimpleStringProperty ("" );
71
- private final StringProperty labelKey = new SimpleStringProperty ("" );
70
+ protected final StringProperty label = new SimpleStringProperty ("" );
71
+ protected final StringProperty labelKey = new SimpleStringProperty ("" );
72
72
73
73
/**
74
74
* The tooltip is an extension of the label. It contains additional
@@ -77,8 +77,8 @@ public abstract class Field<F extends Field> {
77
77
* This property is translatable if a {@link TranslationService} is set on
78
78
* the containing form.
79
79
*/
80
- private final StringProperty tooltip = new SimpleStringProperty ("" );
81
- private final StringProperty tooltipKey = new SimpleStringProperty ("" );
80
+ protected final StringProperty tooltip = new SimpleStringProperty ("" );
81
+ protected final StringProperty tooltipKey = new SimpleStringProperty ("" );
82
82
83
83
/**
84
84
* The placeholder is only visible in an empty field. It provides a hint to
@@ -87,31 +87,31 @@ public abstract class Field<F extends Field> {
87
87
* This property is translatable if a {@link TranslationService} is set on
88
88
* the containing form.
89
89
*/
90
- private final StringProperty placeholder = new SimpleStringProperty ("" );
91
- private final StringProperty placeholderKey = new SimpleStringProperty ("" );
90
+ protected final StringProperty placeholder = new SimpleStringProperty ("" );
91
+ protected final StringProperty placeholderKey = new SimpleStringProperty ("" );
92
92
93
93
/**
94
94
* Every field can be marked as {@code required} and {@code editable}. These
95
95
* properties can change the field's behaviour.
96
96
*/
97
- final StringProperty requiredErrorKey = new SimpleStringProperty ("" );
98
- final StringProperty requiredError = new SimpleStringProperty ("" );
99
- private final BooleanProperty required = new SimpleBooleanProperty (false );
100
- private final BooleanProperty editable = new SimpleBooleanProperty (true );
97
+ protected final StringProperty requiredErrorKey = new SimpleStringProperty ("" );
98
+ protected final StringProperty requiredError = new SimpleStringProperty ("" );
99
+ protected final BooleanProperty required = new SimpleBooleanProperty (false );
100
+ protected final BooleanProperty editable = new SimpleBooleanProperty (true );
101
101
102
102
/**
103
103
* The field's current state is represented by the value properties, as
104
104
* well as by the {@code valid} and {@code changed} flags.
105
105
*/
106
- final BooleanProperty valid = new SimpleBooleanProperty (true );
107
- final BooleanProperty changed = new SimpleBooleanProperty (false );
106
+ protected final BooleanProperty valid = new SimpleBooleanProperty (true );
107
+ protected final BooleanProperty changed = new SimpleBooleanProperty (false );
108
108
109
109
/**
110
110
* Fields can be styled using CSS through ID or class hooks.
111
111
*/
112
- private final StringProperty id = new SimpleStringProperty (UUID .randomUUID ().toString ());
113
- private final ListProperty <String > styleClass = new SimpleListProperty <>(FXCollections .observableArrayList ());
114
- private final IntegerProperty span = new SimpleIntegerProperty (12 );
112
+ protected final StringProperty id = new SimpleStringProperty (UUID .randomUUID ().toString ());
113
+ protected final ListProperty <String > styleClass = new SimpleListProperty <>(FXCollections .observableArrayList ());
114
+ protected final IntegerProperty span = new SimpleIntegerProperty (12 );
115
115
116
116
/**
117
117
* The results of the field's validation is stored in this property. After
@@ -120,8 +120,8 @@ public abstract class Field<F extends Field> {
120
120
* This property is translatable if a {@link TranslationService} is set on
121
121
* the containing form.
122
122
*/
123
- final ListProperty <String > errorMessages = new SimpleListProperty <>(FXCollections .observableArrayList ());
124
- final ListProperty <String > errorMessageKeys = new SimpleListProperty <>(FXCollections .observableArrayList ());
123
+ protected final ListProperty <String > errorMessages = new SimpleListProperty <>(FXCollections .observableArrayList ());
124
+ protected final ListProperty <String > errorMessageKeys = new SimpleListProperty <>(FXCollections .observableArrayList ());
125
125
126
126
/**
127
127
* Additional descriptions for the field's label and value are stored in these properties.
@@ -141,15 +141,15 @@ public abstract class Field<F extends Field> {
141
141
* The translation service is passed down from the containing section. It
142
142
* is used to translate all translatable values of the field.
143
143
*/
144
- TranslationService translationService ;
144
+ protected TranslationService translationService ;
145
145
146
- SimpleControl <F > renderer ;
146
+ protected SimpleControl <F > renderer ;
147
147
148
148
/**
149
149
* With the continuous binding mode, values are always directly persisted
150
150
* upon any changes.
151
151
*/
152
- final InvalidationListener bindingModeListener = (observable ) -> {
152
+ protected final InvalidationListener bindingModeListener = (observable ) -> {
153
153
if (validate ()) {
154
154
persist ();
155
155
}
@@ -166,7 +166,7 @@ public abstract class Field<F extends Field> {
166
166
* @see Field::ofMultiSelectionType
167
167
* @see Field::ofSingleSelectionType
168
168
*/
169
- Field () {
169
+ protected Field () {
170
170
171
171
// Whenever one of the translatable fields' keys change, update the
172
172
// displayed value based on the new translation.
@@ -669,11 +669,11 @@ public F span(ColSpan newValue) {
669
669
* @param newValue
670
670
* The new binding mode for the current field.
671
671
*/
672
- abstract void setBindingMode (BindingMode newValue );
672
+ public abstract void setBindingMode (BindingMode newValue );
673
673
674
- abstract void persist ();
674
+ public abstract void persist ();
675
675
676
- abstract void reset ();
676
+ public abstract void reset ();
677
677
678
678
/**
679
679
* This internal method is called by the containing section when a new
@@ -710,7 +710,7 @@ public void translate(TranslationService newValue) {
710
710
* @param keyProperty
711
711
* The internal property that holds the translation key.
712
712
*/
713
- void updateElement (StringProperty displayProperty , StringProperty keyProperty ) {
713
+ protected void updateElement (StringProperty displayProperty , StringProperty keyProperty ) {
714
714
715
715
// If the key has not yet been set that means that the translation
716
716
// service was added for the first time. We can simply set the key
@@ -760,7 +760,7 @@ void updateElement(Node node, StringProperty keyProperty) {
760
760
*
761
761
* @return Returns whether the user input is a valid value or not.
762
762
*/
763
- abstract boolean validate ();
763
+ protected abstract boolean validate ();
764
764
765
765
public String getPlaceholder () {
766
766
return placeholder .get ();
0 commit comments