diff options
Diffstat (limited to 'platform/editor-ui-api/src/com/intellij/openapi/editor')
4 files changed, 60 insertions, 1 deletions
diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java index ba0743b4cfb0..fc824844be6e 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java @@ -198,6 +198,8 @@ public interface Caret extends UserDataHolderEx, Disposable { /** * Selects the specified range of text. + * <p> + * System selection will be updated, if such feature is supported by current editor. * * @param startOffset the start offset of the text range to select. * @param endOffset the end offset of the text range to select. @@ -205,11 +207,22 @@ public interface Caret extends UserDataHolderEx, Disposable { void setSelection(int startOffset, int endOffset); /** + * Selects the specified range of text. + * + * @param startOffset the start offset of the text range to select. + * @param endOffset the end offset of the text range to select. + * @param updateSystemSelection whether system selection should be updated (might not have any effect if current editor doesn't support such a feature) + */ + void setSelection(int startOffset, int endOffset, boolean updateSystemSelection); + + /** * Selects target range providing information about visual boundary of selection end. * <p/> * That is the case for soft wraps-aware processing where the whole soft wraps virtual space is matched to the same offset. * <p/> * Also, in column mode this method allows to create selection spanning virtual space after the line end. + * <p> + * System selection will be updated, if such feature is supported by current editor. * * @param startOffset start selection offset * @param endPosition end visual position of the text range to select (<code>null</code> argument means that @@ -224,6 +237,8 @@ public interface Caret extends UserDataHolderEx, Disposable { * That is the case for soft wraps-aware processing where the whole soft wraps virtual space is matched to the same offset. * <p/> * Also, in column mode this method allows to create selection spanning virtual space after the line end. + * <p> + * System selection will be updated, if such feature is supported by current editor. * * @param startPosition start visual position of the text range to select (<code>null</code> argument means that * no specific visual position should be used) @@ -235,6 +250,23 @@ public interface Caret extends UserDataHolderEx, Disposable { void setSelection(@Nullable VisualPosition startPosition, int startOffset, @Nullable VisualPosition endPosition, int endOffset); /** + * Selects target range based on its visual boundaries. + * <p/> + * That is the case for soft wraps-aware processing where the whole soft wraps virtual space is matched to the same offset. + * <p/> + * Also, in column mode this method allows to create selection spanning virtual space after the line end. + * + * @param startPosition start visual position of the text range to select (<code>null</code> argument means that + * no specific visual position should be used) + * @param endPosition end visual position of the text range to select (<code>null</code> argument means that + * no specific visual position should be used) + * @param startOffset start selection offset + * @param endOffset end selection offset + * @param updateSystemSelection whether system selection should be updated (might not have any effect if current editor doesn't support such a feature) + */ + void setSelection(@Nullable VisualPosition startPosition, int startOffset, @Nullable VisualPosition endPosition, int endOffset, boolean updateSystemSelection); + + /** * Removes the selection in the editor. */ void removeSelection(); diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java index df247d5be401..a5053923fa31 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java @@ -222,6 +222,8 @@ public interface CaretModel { * selection boundaries will mean that corresponding caret's position and/or selection won't be changed. * <p> * If multiple carets are not supported, the behaviour is unspecified. + * <p> + * System selection will be updated, if such feature is supported by current editor. * * @see #supportsMultipleCarets() * @see #getCaretsAndSelections() @@ -229,6 +231,20 @@ public interface CaretModel { void setCaretsAndSelections(@NotNull List<CaretState> caretStates); /** + * Sets the number of carets, their positions and selection ranges according to the provided data. Null values for caret position or + * selection boundaries will mean that corresponding caret's position and/or selection won't be changed. + * <p> + * If multiple carets are not supported, the behaviour is unspecified. + * <p> + * System selection will be updated, if such feature is supported by current editor + * and corresponding invocation parameter is set to <code>true</code>. + * + * @see #supportsMultipleCarets() + * @see #getCaretsAndSelections() + */ + void setCaretsAndSelections(@NotNull List<CaretState> caretStates, boolean updateSystemSelection); + + /** * Returns the current positions of all carets and their selections. The order of entries in the returned list does not necessarily * correspond to the order of {@link #getAllCarets()} method results. Passing the result of this method to * {@link #setCaretsAndSelections(java.util.List)} will restore the state of carets, including the internal caret order, in particular, diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/FontPreferences.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/FontPreferences.java index 557d41435878..5d2038d171ea 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/FontPreferences.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/FontPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -226,4 +226,9 @@ public class FontPreferences { } return null; } + + @Override + public String toString() { + return "Effective font families: " + myEffectiveFontFamilies; + } } diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java index b8bd41980b7c..1d8ddcc2930b 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/event/EditorFactoryListener.java @@ -23,7 +23,13 @@ import java.util.EventListener; * @see {@link com.intellij.openapi.editor.EditorFactory#addEditorFactoryListener(com.intellij.openapi.editor.event.EditorFactoryListener, com.intellij.openapi.Disposable)} */ public interface EditorFactoryListener extends EventListener { + /** + * Called after {@link com.intellij.openapi.editor.Editor} instance has been created. + */ void editorCreated(@NotNull EditorFactoryEvent event); + /** + * Called before {@link com.intellij.openapi.editor.Editor} instance will be released. + */ void editorReleased(@NotNull EditorFactoryEvent event); } |