mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-80056 Column selection mode improvement
small API change, as per review - partial revert
This commit is contained in:
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Provides services for moving the caret and retrieving information about caret position.
|
||||
@@ -221,7 +222,7 @@ public interface CaretModel {
|
||||
*
|
||||
* @see #supportsMultipleCarets()
|
||||
*/
|
||||
void setCaretsAndSelections(@NotNull Collection<LogicalPosition> caretPositions, @NotNull Collection<? extends Segment> selections);
|
||||
void setCaretsAndSelections(@NotNull List<LogicalPosition> caretPositions, @NotNull List<? extends Segment> selections);
|
||||
|
||||
/**
|
||||
* Executes the given task for each existing caret. Carets are iterated in their position order. Set of carets to iterate over is
|
||||
|
||||
@@ -205,7 +205,7 @@ public class CaretModelWindow implements CaretModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaretsAndSelections(@NotNull Collection<LogicalPosition> caretPositions, @NotNull Collection<? extends Segment> selections) {
|
||||
public void setCaretsAndSelections(@NotNull List<LogicalPosition> caretPositions, @NotNull List<? extends Segment> selections) {
|
||||
List<LogicalPosition> convertedPositions = new ArrayList<LogicalPosition>(caretPositions);
|
||||
for (LogicalPosition position : caretPositions) {
|
||||
convertedPositions.add(myEditorWindow.injectedToHost(position));
|
||||
|
||||
@@ -452,7 +452,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaretsAndSelections(@NotNull final Collection<LogicalPosition> caretPositions, @NotNull final Collection<? extends Segment> selections) {
|
||||
public void setCaretsAndSelections(@NotNull final List<LogicalPosition> caretPositions, @NotNull final List<? extends Segment> selections) {
|
||||
myEditor.assertIsDispatchThread();
|
||||
if (caretPositions.isEmpty()) {
|
||||
throw new IllegalArgumentException("At least one caret should exist");
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ public class TextComponentCaretModel implements CaretModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaretsAndSelections(@NotNull Collection<LogicalPosition> caretPositions, @NotNull Collection<? extends Segment> selections) {
|
||||
public void setCaretsAndSelections(@NotNull List<LogicalPosition> caretPositions, @NotNull List<? extends Segment> selections) {
|
||||
throw new UnsupportedOperationException("Multiple carets are not supported");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user