-
Notifications
You must be signed in to change notification settings - Fork 512
8342462: TextAreaSkin: remove USE_MULTIPLE_NODES #1601
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
8342462: TextAreaSkin: remove USE_MULTIPLE_NODES #1601
Conversation
👋 Welcome back angorya! A progress list of the required criteria for merging this PR into |
@andy-goryachev-oracle This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
Either @arapte or I will review this. I think a single reviewer will be enough, given that the functionality hasn't changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks equivalent to the current code, and I couldn't see anything wrong in my testing. I left a couple questions inline.
return null; | ||
@Override | ||
protected PathElement[] getUnderlineShape(int start, int end) { | ||
return getTextNode().underlineShape(start, end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former code would return null
if start
> textNode.textProperty().getValueSafe().length()
. I think this is OK, given that the implementation of Text::underlineShape
checks -- what do you think? This applies to getRangeShape
, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok. The javadoc for TextInputControlSkin::underlineShape()
does not specify a null return value.
In fact, the javadoc for Text::rangeShape()
and ::underlineShape()
say
@return an array of {@code PathElement} which can be used to create a {@code Shape}
implying that it should never be null
as the return value is typically used in Shape::getElements().setAll()
or .addAll()
which will throw an NPE if the thing is null. In fact, Text::rangeShape()
(used for underline and range shape) always returns a non-null value.
|
||
if (y < contentView.snappedTopInset()) { | ||
// Select the character at x in the first row | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the implementation of the now-removed getNextInsertionPoint
method also returned 0
unconditionally, so this is equivalent, but... isn't the comment wrong, since x
isn't used in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is indeed wrong, will fix.
return 0; | ||
} else if (y > contentView.snappedTopInset() + contentView.getHeight()) { | ||
// Select the character at x in the last row | ||
return (textArea.getLength() - paragraphNode.getText().length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question about the comment being wrong.
/integrate |
Going to push as commit e2a3074.
Your commit was automatically rebased without conflicts. |
@andy-goryachev-oracle Pushed as commit e2a3074. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Removed "not yet fully implemented" USE_MULTIPLE_NODES and related code.
I would like to remove the early unfinished idea of using multiple Text nodes in TextAreaSkin to clean up the code, to make it easier to do fixes for JDK-8342233 and JDK-8296266.
Also some minor cleanup.
Summary of Changes
true
valueparagraphNodes
Group, keeping the latter for compatibility purposesparagraphNodes
childrengetTextNode()
in place of((Text)paragraphNodes.getChildren().get(0))
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1601/head:pull/1601
$ git checkout pull/1601
Update a local copy of the PR:
$ git checkout pull/1601
$ git pull https://git.openjdk.org/jfx.git pull/1601/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1601
View PR using the GUI difftool:
$ git pr show -t 1601
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1601.diff
Webrev
Link to Webrev Comment