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

Make gravity of virtual flow styleable and dynamically alterable #35

Merged
merged 3 commits into from
Oct 3, 2017

Conversation

neilccbrown
Copy link

This is the code described in issue #34, see there for more details


@SuppressWarnings("unchecked") // Because of the cast we have to perform, below
private static final CssMetaData<VirtualFlow, Gravity> GRAVITY = new CssMetaData<VirtualFlow, Gravity>(
"-fx-gravity",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RTFX, we use the prefix -rtfx for any RTFX-specific CSS. So should this use the standard JavaFX prefix or a Flowless specific case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a plausible use case to use Flowless outside RichTextFX. We could use a Flowless specific prefix, e.g. -flfx-gravity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm.... See this SO question.

What if it's just -flowless-gravity? or even -flow-gravity? -flfx is hard to read partly because the l can be misread as an i, and it doesn't immediately relate back to this project (since it's not called FlowlessFX). fx appears in the -rtfx because that project name does end in FX (See afester's comment on that issue)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I like -flowless-gravity (slightly more distinguishing), but either that or -flow-gravity seems fine to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since gravity is short, why not use -flowless-gravity?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - done.

};

@Override
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return a static list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should also be another method public static getClassCssMetaData() that returns the same static list

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I copied the naming conventions for this from the Region class.

@JordanMartinez
Copy link
Contributor

The wiki page documents the CSS you added here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants