This commit is contained in:
Alexey Kudravtsev
2017-07-12 14:45:14 +03:00
parent 263cef5134
commit 5ff6fa79b6
6 changed files with 25 additions and 21 deletions
@@ -15,21 +15,23 @@
*/
package com.intellij.openapi.vfs;
import org.jetbrains.annotations.NotNull;
import java.io.File;
/**
* @author max
*/
public class InvalidVirtualFileAccessException extends RuntimeException {
public InvalidVirtualFileAccessException(final VirtualFile file) {
public InvalidVirtualFileAccessException(@NotNull VirtualFile file) {
super(composeMessage(file));
}
public InvalidVirtualFileAccessException(String message) {
public InvalidVirtualFileAccessException(@NotNull String message) {
super(message);
}
private static String composeMessage(VirtualFile file) {
private static String composeMessage(@NotNull VirtualFile file) {
String url = file.getUrl();
String message = "Accessing invalid virtual file: " + url;
@@ -52,6 +54,6 @@ public class InvalidVirtualFileAccessException extends RuntimeException {
}
private static String hashCode(Object o) {
return o != null ? String.valueOf(o.hashCode()) : "-";
return o == null ? "-" : String.valueOf(o.hashCode());
}
}
@@ -131,6 +131,7 @@ public class DiffLineSeparatorRenderer implements LineMarkerRendererEx, LineSepa
draw(g, shiftX, y, lineHeight, myEditor.getColorsScheme());
}
@NotNull
@Override
public LineMarkerRendererEx.Position getPosition() {
return LineMarkerRendererEx.Position.CUSTOM;
@@ -72,6 +72,7 @@ public class DiffLineMarkerRenderer implements LineMarkerRendererEx {
}
}
@NotNull
@Override
public LineMarkerRendererEx.Position getPosition() {
return LineMarkerRendererEx.Position.CUSTOM;
@@ -69,7 +69,7 @@ public interface EditorEx extends Editor {
*
* @return the markup model instance.
* @see com.intellij.openapi.editor.markup.MarkupEditorFilter
* @see com.intellij.openapi.editor.impl.EditorImpl#setHighlightingFilter(Condition<RangeHighlighter>)
* @see com.intellij.openapi.editor.impl.EditorImpl#setHighlightingFilter(Condition)
* @see com.intellij.openapi.editor.impl.DocumentMarkupModel#forDocument(Document, Project, boolean)
*/
@NotNull
@@ -214,7 +214,7 @@ public interface EditorEx extends Editor {
void setSoftWrapAppliancePlace(@NotNull SoftWrapAppliancePlaces place);
/**
* Allows to define <code>'placeholder text'</code> for the current editor, i.e. virtual text that will be represented until
* Allows to define {@code 'placeholder text'} for the current editor, i.e. virtual text that will be represented until
* any user data is entered.
*
* Feel free to see the detailed feature
@@ -226,14 +226,14 @@ public interface EditorEx extends Editor {
/**
* Sets text attributes for a placeholder. Font style and color are currently supported.
* <code>null</code> means default values should be used.
* {@code null} means default values should be used.
*
* @see #setPlaceholder(CharSequence)
*/
void setPlaceholderAttributes(@Nullable TextAttributes attributes);
/**
* Controls whether <code>'placeholder text'</code> is visible when editor is focused.
* Controls whether {@code 'placeholder text'} is visible when editor is focused.
*
* @param show flag indicating whether placeholder is visible when editor is focused.
*
@@ -245,16 +245,16 @@ public interface EditorEx extends Editor {
* Allows to answer if 'sticky selection' is active for the current editor.
* <p/>
* 'Sticky selection' means that every time caret position changes, selection end offset is automatically set to the same position.
* Selection start is always caret offset on {@link #setStickySelection(boolean)} call with <code>'true'</code> argument.
* Selection start is always caret offset on {@link #setStickySelection(boolean)} call with {@code 'true'} argument.
*
* @return <code>true</code> if 'sticky selection' mode is active at the current editor; <code>false</code> otherwise
* @return {@code true} if 'sticky selection' mode is active at the current editor; {@code false} otherwise
*/
boolean isStickySelection();
/**
* Allows to set current {@link #isStickySelection() sticky selection} mode.
*
* @param enable flag that identifies if <code>'sticky selection'</code> mode should be enabled
* @param enable flag that identifies if {@code 'sticky selection'} mode should be enabled
*/
void setStickySelection(boolean enable);
@@ -313,7 +313,7 @@ public interface EditorEx extends Editor {
/**
* Sets id of action group what will be used to construct context menu displayed on mouse right button's click. Setting this to
* <code>null</code> disables built-in logic for showing context menu (it can still be achieved by implementing corresponding mouse
* {@code null} disables built-in logic for showing context menu (it can still be achieved by implementing corresponding mouse
* event listener).
*
* @see #getContextMenuGroupId()
@@ -321,7 +321,7 @@ public interface EditorEx extends Editor {
void setContextMenuGroupId(@Nullable String groupId);
/**
* Returns id of action group what will be used to construct context menu displayed on mouse right button's click. <code>null</code>
* Returns id of action group what will be used to construct context menu displayed on mouse right button's click. {@code null}
* value means built-in logic for showing context menu is disabled.
*
* @see #setContextMenuGroupId(String)
@@ -39,11 +39,11 @@ public interface SoftWrapModelEx extends SoftWrapModel {
/**
* Tries to find index of the target soft wrap at {@link #getRegisteredSoftWraps() soft wraps collection}.
* <code>'Target'</code> soft wrap is the one that starts at the given offset.
* {@code 'Target'} soft wrap is the one that starts at the given offset.
*
* @param offset target offset
* @return index that conforms to {@link Collections#binarySearch(List, Object)} contract, i.e. non-negative returned
* index points to soft wrap that starts at the given offset; <code>'-(negative value) - 1'</code> points
* index points to soft wrap that starts at the given offset; {@code '-(negative value) - 1'} points
* to position at {@link #getRegisteredSoftWraps() soft wraps collection} where soft wrap for the given index
* should be inserted
*/
@@ -54,8 +54,8 @@ public interface SoftWrapModelEx extends SoftWrapModel {
*
* @param g target graphics buffer to draw in
* @param drawingType target drawing type
* @param x target <code>'x'</code> coordinate to use
* @param y target <code>'y'</code> coordinate to use
* @param x target {@code 'x'} coordinate to use
* @param y target {@code 'y'} coordinate to use
* @param lineHeight line height used at editor
* @return painted drawing width
*/
@@ -73,7 +73,7 @@ public interface SoftWrapModelEx extends SoftWrapModel {
* Registers given listener within the current model
*
* @param listener listener to register
* @return <code>true</code> if given listener was not registered before; <code>false</code> otherwise
* @return {@code true} if given listener was not registered before; {@code false} otherwise
*/
boolean addSoftWrapChangeListener(@NotNull SoftWrapChangeListener listener);
@@ -84,13 +84,13 @@ public interface SoftWrapModelEx extends SoftWrapModel {
* <p/>
* The main idea of soft wraps is to avoid horizontal scrolling, so, when soft wrapping is enabled and succeeds (so that resulting
* text layout fits view area's width), additional columns wont be added to the preferred editor width.
* This method answers whether the above behaviour should be overridden, and additional columns setting should be respected regardless of
* This method answers whether the above behaviour should be overridden, and additional columns setting should be respected regardless of
* soft wrapping success. This happens when {@link #forceAdditionalColumnsUsage()} has been invoked previously.
*/
boolean isRespectAdditionalColumns();
/**
* Allows to instruct current model to return <code>'true'</code> from {@link #isRespectAdditionalColumns()}.
* Allows to instruct current model to return {@code 'true'} from {@link #isRespectAdditionalColumns()}.
*/
void forceAdditionalColumnsUsage();
@@ -37,7 +37,6 @@ import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.editor.impl.EditorImpl;
import com.intellij.openapi.editor.markup.ActiveGutterRenderer;
import com.intellij.openapi.editor.markup.LineMarkerRendererEx;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.SearchableConfigurable;
@@ -269,6 +268,7 @@ public class CoverageLineMarkerRenderer implements ActiveGutterRenderer, LineMar
return editor.getColorsScheme().getAttributes(myKey).getErrorStripeColor();
}
@NotNull
@Override
public Position getPosition() {
return Position.LEFT;