summaryrefslogtreecommitdiff
path: root/platform/usageView/src/com/intellij/usages/TextChunk.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/usageView/src/com/intellij/usages/TextChunk.java')
-rw-r--r--platform/usageView/src/com/intellij/usages/TextChunk.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/usageView/src/com/intellij/usages/TextChunk.java b/platform/usageView/src/com/intellij/usages/TextChunk.java
index e1c3345d41da..e74debdb97fb 100644
--- a/platform/usageView/src/com/intellij/usages/TextChunk.java
+++ b/platform/usageView/src/com/intellij/usages/TextChunk.java
@@ -18,17 +18,25 @@ package com.intellij.usages;
import com.intellij.openapi.editor.markup.AttributesFlyweight;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.ui.SimpleTextAttributes;
+import com.intellij.usages.impl.rules.UsageType;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
public class TextChunk {
public static final TextChunk[] EMPTY_ARRAY = new TextChunk[0];
private final AttributesFlyweight myAttributes;
private final String myText;
+ private final UsageType myType;
public TextChunk(@NotNull TextAttributes attributes, @NotNull String text) {
+ this(attributes, text, null);
+ }
+
+ public TextChunk(@NotNull TextAttributes attributes, @NotNull String text, @Nullable UsageType type) {
myAttributes = attributes.getFlyweight();
myText = text;
+ myType = type;
}
@NotNull
@@ -45,6 +53,10 @@ public class TextChunk {
return getText();
}
+ public @Nullable UsageType getType() {
+ return myType;
+ }
+
@NotNull
public SimpleTextAttributes getSimpleAttributesIgnoreBackground() {
SimpleTextAttributes simples = SimpleTextAttributes.fromTextAttributes(getAttributes());