diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/ui/MigrationPanel.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/ui/MigrationPanel.java index 0433fb97b059..52f67fb3e8fe 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/ui/MigrationPanel.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/ui/MigrationPanel.java @@ -445,7 +445,7 @@ public class MigrationPanel extends JPanel implements Disposable { final UsagePresentation presentation = UsageInfoToUsageConverter.convert(new UsageInfoToUsageConverter.TargetElementsDescriptor(typeElement), new UsageInfo(typeElement)).getPresentation(); boolean isPrefix = true; //skip usage position for (TextChunk chunk : presentation.getText()) { - if (!isPrefix) append(chunk.getText(), patchAttrs(usageInfo, SimpleTextAttributes.fromTextAttributes(chunk.getAttributes()))); + if (!isPrefix) append(chunk.getText(), patchAttrs(usageInfo, chunk.getSimpleAttributesIgnoreBackground())); isPrefix = false; } setIcon(presentation.getIcon()); diff --git a/java/java-impl/src/com/intellij/slicer/SliceLeafValueRootNode.java b/java/java-impl/src/com/intellij/slicer/SliceLeafValueRootNode.java index 91a17355d4c4..a6a403053284 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceLeafValueRootNode.java +++ b/java/java-impl/src/com/intellij/slicer/SliceLeafValueRootNode.java @@ -103,7 +103,7 @@ public class SliceLeafValueRootNode extends SliceNode implements MyColoredTreeCe false, result); for (TextChunk chunk : result) { - renderer.append(chunk.getText(), SimpleTextAttributes.fromTextAttributes(chunk.getAttributes())); + renderer.append(chunk.getText(), chunk.getSimpleAttributesIgnoreBackground()); } } } diff --git a/java/java-impl/src/com/intellij/slicer/SliceUsageCellRenderer.java b/java/java-impl/src/com/intellij/slicer/SliceUsageCellRenderer.java index eae4ae31d2bf..d2fdf1a7b187 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceUsageCellRenderer.java +++ b/java/java-impl/src/com/intellij/slicer/SliceUsageCellRenderer.java @@ -63,10 +63,9 @@ public class SliceUsageCellRenderer extends ColoredTreeCellRenderer { TextChunk[] text = sliceUsage.getPresentation().getText(); for (TextChunk textChunk : text) { - SimpleTextAttributes attributes = SimpleTextAttributes.fromTextAttributes(textChunk.getAttributes()); + SimpleTextAttributes attributes = textChunk.getSimpleAttributesIgnoreBackground(); if (isForcedLeaf) { attributes = attributes.derive(attributes.getStyle(), Color.LIGHT_GRAY, attributes.getBgColor(), attributes.getWaveColor()); - //attributes = attributes.derive(SimpleTextAttributes.STYLE_UNDERLINE, attributes.getBgColor(), attributes.getBgColor(), attributes.getWaveColor()); } append(textChunk.getText(), attributes); } diff --git a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesTableCellRenderer.java b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesTableCellRenderer.java index e4ac2e0ea15e..9aa4999b1652 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesTableCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesTableCellRenderer.java @@ -94,14 +94,14 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer { if (text.length != 0) { SimpleTextAttributes attributes = isSelected ? new SimpleTextAttributes(bg, fg, fg, SimpleTextAttributes.STYLE_ITALIC) : - deriveAttributesWithColor(SimpleTextAttributes.fromTextAttributes(text[0].getAttributes()), fileBgColor); + deriveAttributesWithColor(text[0].getSimpleAttributesIgnoreBackground(), fileBgColor); textChunks.append(text[0].getText(), attributes); } } else if (column == 2) { for (int i = 1; i < text.length; i++) { TextChunk textChunk = text[i]; - final SimpleTextAttributes attrs = SimpleTextAttributes.fromTextAttributes(textChunk.getAttributes()); + final SimpleTextAttributes attrs = textChunk.getSimpleAttributesIgnoreBackground(); SimpleTextAttributes attributes = isSelected ? new SimpleTextAttributes(bg, fg, fg, attrs.getStyle()) : deriveAttributesWithColor(attrs, fileBgColor); textChunks.append(textChunk.getText(), attributes); diff --git a/platform/lang-impl/src/com/intellij/find/actions/UsageListCellRenderer.java b/platform/lang-impl/src/com/intellij/find/actions/UsageListCellRenderer.java index dc9360143a82..de7a86a3825a 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/UsageListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/find/actions/UsageListCellRenderer.java @@ -22,7 +22,6 @@ */ package com.intellij.find.actions; -import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; @@ -65,7 +64,8 @@ public class UsageListCellRenderer extends ColoredListCellRenderer { TextChunk[] text = presentation.getText(); for (TextChunk textChunk : text) { - append(textChunk.getText(), SimpleTextAttributes.fromTextAttributes(textChunk.getAttributes())); + SimpleTextAttributes simples = textChunk.getSimpleAttributesIgnoreBackground(); + append(textChunk.getText(), simples); } } diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/UsageProjectTreeNode.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/UsageProjectTreeNode.java index e079d1d53250..15d00277f4fa 100644 --- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/UsageProjectTreeNode.java +++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/UsageProjectTreeNode.java @@ -17,12 +17,10 @@ package com.intellij.ide.favoritesTreeView; import com.intellij.ide.projectView.PresentationData; import com.intellij.ide.projectView.ViewSettings; -import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; -import com.intellij.ui.SimpleTextAttributes; import com.intellij.usageView.UsageInfo; import com.intellij.usages.TextChunk; import com.intellij.usages.UsageInfo2UsageAdapter; @@ -75,9 +73,7 @@ public class UsageProjectTreeNode extends ProjectViewNodeWithChildrenList