Search in sources :

Example 1 with TextEditorHolder

use of com.intellij.diff.tools.holders.TextEditorHolder in project intellij-community by JetBrains.

the class OnesideTextDiffViewer method createEditorHolder.

@NotNull
@Override
protected TextEditorHolder createEditorHolder(@NotNull EditorHolderFactory<TextEditorHolder> factory) {
    TextEditorHolder holder = super.createEditorHolder(factory);
    boolean[] forceReadOnly = TextDiffViewerUtil.checkForceReadOnly(myContext, myRequest);
    if (forceReadOnly[0])
        holder.getEditor().setViewer(true);
    return holder;
}
Also used : TextEditorHolder(com.intellij.diff.tools.holders.TextEditorHolder) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with TextEditorHolder

use of com.intellij.diff.tools.holders.TextEditorHolder in project intellij-community by JetBrains.

the class TwosideTextDiffViewer method createEditorHolders.

@NotNull
@Override
protected List<TextEditorHolder> createEditorHolders(@NotNull EditorHolderFactory<TextEditorHolder> factory) {
    List<TextEditorHolder> holders = super.createEditorHolders(factory);
    boolean[] forceReadOnly = TextDiffViewerUtil.checkForceReadOnly(myContext, myRequest);
    for (int i = 0; i < 2; i++) {
        if (forceReadOnly[i])
            holders.get(i).getEditor().setViewer(true);
    }
    Side.LEFT.select(holders).getEditor().setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
    for (TextEditorHolder holder : holders) {
        DiffUtil.disableBlitting(holder.getEditor());
    }
    return holders;
}
Also used : TextEditorHolder(com.intellij.diff.tools.holders.TextEditorHolder) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with TextEditorHolder

use of com.intellij.diff.tools.holders.TextEditorHolder in project intellij-community by JetBrains.

the class ThreesideTextDiffViewer method createEditorHolders.

@NotNull
@Override
protected List<TextEditorHolder> createEditorHolders(@NotNull EditorHolderFactory<TextEditorHolder> factory) {
    List<TextEditorHolder> holders = super.createEditorHolders(factory);
    boolean[] forceReadOnly = TextDiffViewerUtil.checkForceReadOnly(myContext, myRequest);
    for (int i = 0; i < 3; i++) {
        if (forceReadOnly[i])
            holders.get(i).getEditor().setViewer(true);
    }
    ThreeSide.LEFT.select(holders).getEditor().setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
    ((EditorMarkupModel) ThreeSide.BASE.select(holders).getEditor().getMarkupModel()).setErrorStripeVisible(false);
    for (TextEditorHolder holder : holders) {
        DiffUtil.disableBlitting(holder.getEditor());
    }
    return holders;
}
Also used : TextEditorHolder(com.intellij.diff.tools.holders.TextEditorHolder) EditorMarkupModel(com.intellij.openapi.editor.ex.EditorMarkupModel) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

TextEditorHolder (com.intellij.diff.tools.holders.TextEditorHolder)3 NotNull (org.jetbrains.annotations.NotNull)3 EditorMarkupModel (com.intellij.openapi.editor.ex.EditorMarkupModel)1