Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StyledTextField alignmentProperty API fix #897

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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