2 * Copyright (c) 2005 Your Corporation. All Rights Reserved.
4 package com
.intellij
.openapi
.editor
.impl
;
6 import com
.intellij
.openapi
.editor
.Document
;
7 import com
.intellij
.openapi
.editor
.ex
.MarkupModelEx
;
8 import com
.intellij
.openapi
.editor
.impl
.event
.MarkupModelListener
;
9 import com
.intellij
.openapi
.editor
.markup
.HighlighterTargetArea
;
10 import com
.intellij
.openapi
.editor
.markup
.RangeHighlighter
;
11 import com
.intellij
.openapi
.editor
.markup
.TextAttributes
;
12 import com
.intellij
.openapi
.util
.Key
;
13 import org
.jetbrains
.annotations
.NotNull
;
14 import org
.jetbrains
.annotations
.Nullable
;
17 * This is mock implementation to be used in null-object pattern where necessary.
20 public class EmptyMarkupModel
implements MarkupModelEx
{
21 private final Document myDocument
;
23 public EmptyMarkupModel(final Document document
) {
24 myDocument
= document
;
28 public Document
getDocument() {
33 public RangeHighlighter
addRangeHighlighter(int startOffset
,
36 @Nullable TextAttributes textAttributes
,
37 @NotNull HighlighterTargetArea targetArea
) {
38 return new RangeHighlighterImpl(this, startOffset
, endOffset
, layer
, targetArea
, textAttributes
, false);
42 public RangeHighlighter
addLineHighlighter(int line
, int layer
, @Nullable TextAttributes textAttributes
) {
43 return new RangeHighlighterImpl(this, 0, 0, layer
, HighlighterTargetArea
.LINES_IN_RANGE
, textAttributes
, false);
46 public void removeHighlighter(RangeHighlighter rangeHighlighter
) {
49 public void removeAllHighlighters() {
53 public RangeHighlighter
[] getAllHighlighters() {
54 return RangeHighlighter
.EMPTY_ARRAY
;
57 public <T
> T
getUserData(Key
<T
> key
) {
61 public <T
> void putUserData(Key
<T
> key
, T value
) {
64 public void dispose() {
67 public HighlighterList
getHighlighterList() {
71 public RangeHighlighter
addPersistentLineHighlighter(int lineNumber
, int layer
, TextAttributes textAttributes
) {
75 public boolean containsHighlighter(RangeHighlighter highlighter
) {
79 public void addMarkupModelListener(MarkupModelListener listener
) {
82 public void removeMarkupModelListener(MarkupModelListener listener
) {
85 public void setRangeHighlighterAttributes(final RangeHighlighter highlighter
, final TextAttributes textAttributes
) {