Skip to content

Make gravity of virtual flow styleable and dynamically alterable#35

Merged
JordanMartinez merged 3 commits intoFXMisc:masterfrom
neilccbrown:styleable_gravity
Oct 3, 2017
Merged

Make gravity of virtual flow styleable and dynamically alterable#35
JordanMartinez merged 3 commits intoFXMisc:masterfrom
neilccbrown:styleable_gravity

Conversation

@neilccbrown
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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