Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 259023 - Extend EditorCaret by Position.Bias support
Extend EditorCaret by Position.Bias support
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Painting & Printing
8.2
All All
: P2 (vote)
: 8.2
Assigned To: apireviews
issues@editor
: API, API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-26 13:02 UTC by Miloslav Metelka
Modified: 2016-09-01 01:52 UTC (History)
0 users

See Also:
Issue Type: TASK
:


Attachments
Diff of proposed Caret API changes (22.80 KB, patch)
2016-05-02 15:20 UTC, Miloslav Metelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2016-04-26 13:02:29 UTC
The EditorCaret should allow working with Position.Bias in a way that DefaultCaret does i.e. the CaretInfo should have
public Position.Bias getDotBias() {...}
public Position.Bias getMarkBias() {...}
and there should be a way to pass the bias to dot/mark modification methods.
Comment 1 Miloslav Metelka 2016-05-02 15:20:14 UTC
Created attachment 159513 [details]
Diff of proposed Caret API changes
Comment 2 Miloslav Metelka 2016-05-02 15:31:30 UTC
Asking for API review.
The proposed change adds bias to both dot and mark positions in CaretInfo and to methods where dot and mark positions are passed.

Note: the bias accompanies positions in the proposed change but it's stored and handled separately from the position objects themselves i.e. the support for backward-bias positions creation in NbDocument.createPosition() is not used because backward-bias positions cause problems when intermixed with regular positions so their use should be abandoned in the longterm.
Comment 3 Ralph Ruijs 2016-05-04 09:28:47 UTC
(In reply to Miloslav Metelka from comment #2)
> Asking for API review.
> The proposed change adds bias to both dot and mark positions in CaretInfo
> and to methods where dot and mark positions are passed.
> 
> Note: the bias accompanies positions in the proposed change but it's stored
> and handled separately from the position objects themselves i.e. the support
> for backward-bias positions creation in NbDocument.createPosition() is not
> used because backward-bias positions cause problems when intermixed with
> regular positions so their use should be abandoned in the longterm.

Api looks fine to me.

R1 - Would be good to add the info about backward-bias positions to the javadoc.
Comment 4 Miloslav Metelka 2016-05-31 10:36:07 UTC
http://hg.netbeans.org/jet-main/rev/db067f40b14d
Comment 5 Miloslav Metelka 2016-08-24 14:20:05 UTC
Unfortunately the change is incomplete since
CaretMoveContext.setDot()
CaretMoveContext.moveDot()
CaretMoveContext.setDotAndMark()
should be enhanced with bias parameter too.
Comment 6 Miloslav Metelka 2016-08-31 09:52:50 UTC
http://hg.netbeans.org/jet-main/rev/0cd1b5f12f51
Comment 7 Quality Engineering 2016-09-01 01:52:16 UTC
Integrated into 'main-silver', will be available in build *201609010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0cd1b5f12f51
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #259023 - Extend EditorCaret by Position.Bias support - additional fix of CaretMoveContext methods.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo