Skip to content

Commit

Permalink
StyledTextField alignmentProperty API fix (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen authored Jan 13, 2020
1 parent 705eca4 commit c60e07d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract class StyledTextField<PS, S> extends StyledTextArea<PS, S>

private final static CssMetaData<StyledTextField,TextAlignment> TEXT_ALIGNMENT = new CustomCssMetaData<>(
"-fx-alignment", (StyleConverter<?,TextAlignment>) StyleConverter.getEnumConverter(TextAlignment.class),
TextAlignment.LEFT, s -> (StyleableObjectProperty) s.textAlignmentProperty()
TextAlignment.LEFT, s -> (StyleableObjectProperty) s.alignmentProperty()
);
private final static Pattern VERTICAL_WHITESPACE = Pattern.compile( "\\v+" );
private final static String STYLE_SHEET;
Expand Down Expand Up @@ -159,15 +159,15 @@ else if ( target.isVisible() && ! target.isDisabled() && target.isFocusTraversab
* Specifies how the text should be aligned when there is empty space within the TextField.
* To configure via CSS use {@code -fx-alignment:} and values from {@link javafx.scene.text.TextAlignment}.
*/
public final ObjectProperty<TextAlignment> textAlignmentProperty() {
public final ObjectProperty<TextAlignment> alignmentProperty() {
if (textAlignment == null) {
textAlignment = new CustomStyleableProperty<>( TextAlignment.LEFT, "textAlignment", this, TEXT_ALIGNMENT );
textAlignment.addListener( (ob,ov,alignment) -> changeAlignment( alignment ) );
}
return textAlignment;
}
public final TextAlignment getAlignment() { return textAlignment == null ? TextAlignment.LEFT : textAlignment.getValue(); }
public final void setAlignment( TextAlignment value ) { textAlignmentProperty().setValue( value ); }
public final void setAlignment( TextAlignment value ) { alignmentProperty().setValue( value ); }
protected abstract void changeAlignment( TextAlignment txtAlign );

/**
Expand Down

0 comments on commit c60e07d

Please sign in to comment.