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 positionCaret package-private #415

Merged
merged 1 commit into from
Jan 16, 2017
Merged
Show file tree
Hide file tree
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 @@ -1121,17 +1121,6 @@ public void selectRange(int anchor, int caretPosition) {
model.selectRange(anchor, caretPosition);
}

/**
* {@inheritDoc}
* @deprecated You probably meant to use {@link #moveTo(int)}. This method will be made
* package-private in the future
*/
@Deprecated
@Override
public void positionCaret(int pos) {
model.positionCaret(pos);
}

/* ********************************************************************** *
* *
* Public API *
Expand Down Expand Up @@ -1244,6 +1233,10 @@ public void dispose() {
};
}

private void positionCaret(int pos) {
model.positionCaret(pos);
}

private ParagraphBox<PS, SEG, S> getCell(int index) {
return virtualFlow.getCell(index).getNode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,12 @@ public void selectRange(int anchor, int caretPosition) {
}
}

@Override
/**
* Positions only the caret. Doesn't move the anchor and doesn't change
* the selection. Can be used to achieve the special case of positioning
* the caret outside or inside the selection, as opposed to always being
* at the boundary. Use with care.
*/
public void positionCaret(int pos) {
try(Guard g = suspend(caretPosition, currentParagraph, caretColumn)) {
internalCaretPosition.setValue(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,6 @@ default void replace(IndexRange range, StyledDocument<PS, SEG, S> replacement) {
replace(range.getStart(), range.getEnd(), replacement);
}

/**
* Positions only the caret. Doesn't move the anchor and doesn't change
* the selection. Can be used to achieve the special case of positioning
* the caret outside or inside the selection, as opposed to always being
* at the boundary. Use with care.
*
* @deprecated You probably meant to use {@link NavigationActions#moveTo(int)}. This method will be made
* package-private in the future
*/
@Deprecated
public void positionCaret(int pos);

/**
* Returns the absolute position (i.e. the spot in-between characters) to the left of the given column in the given paragraph.
*
Expand Down