IDEA-80056 Column selection mode improvement

small API change, as per review - partial revert
This commit is contained in:
Dmitry Batrak
2014-02-21 11:38:01 +04:00
parent fe84447e66
commit 7058ea244a
4 changed files with 5 additions and 4 deletions
@@ -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");
@@ -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");
}