java: deprecated API usages eliminated

This commit is contained in:
Roman Shevchenko
2013-06-07 12:00:16 +04:00
parent e6b9062193
commit 1992afa3e2
7 changed files with 24 additions and 20 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.ui.impl.watch.*;
import com.intellij.debugger.ui.tree.ValueDescriptor;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.util.text.StringUtil;
@@ -193,14 +193,14 @@ public class DebuggerTreeRenderer extends ColoredTreeCellRenderer {
valueLabelAttribs = XDebuggerUIConstants.CHANGED_VALUE_ATTRIBUTES;
}
else {
TextAttributes highlightingAttribs = null;
TextAttributes attributes = null;
if (valueDescriptor.isNull()){
highlightingAttribs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(SyntaxHighlighterColors.KEYWORD);
attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(JavaHighlightingColors.KEYWORD);
}
else if (valueDescriptor.isString()) {
highlightingAttribs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(SyntaxHighlighterColors.STRING);
attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(JavaHighlightingColors.STRING);
}
valueLabelAttribs = highlightingAttribs != null? SimpleTextAttributes.fromTextAttributes(highlightingAttribs) : DEFAULT_ATTRIBUTES;
valueLabelAttribs = attributes != null? SimpleTextAttributes.fromTextAttributes(attributes) : DEFAULT_ATTRIBUTES;
}
final EvaluateException exception = descriptor.getEvaluateException();
@@ -248,7 +248,7 @@ public class DebuggerTreeRenderer extends ColoredTreeCellRenderer {
}
if (escapeAttribs == null) { // lazy init
final TextAttributes fromHighlighter = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(SyntaxHighlighterColors.VALID_STRING_ESCAPE);
TextAttributes fromHighlighter = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(JavaHighlightingColors.VALID_STRING_ESCAPE);
if (fromHighlighter != null) {
escapeAttribs = SimpleTextAttributes.fromTextAttributes(fromHighlighter);
}
@@ -64,8 +64,8 @@ public class JavaFileHighlighter extends SyntaxHighlighterBase {
ourMap1.put(StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN, JavaHighlightingColors.INVALID_STRING_ESCAPE);
ourMap1.put(JavaTokenType.CHARACTER_LITERAL, JavaHighlightingColors.STRING);
ourMap1.put(JavaTokenType.LPARENTH, JavaHighlightingColors.PARENTHS);
ourMap1.put(JavaTokenType.RPARENTH, JavaHighlightingColors.PARENTHS);
ourMap1.put(JavaTokenType.LPARENTH, JavaHighlightingColors.PARENTHESES);
ourMap1.put(JavaTokenType.RPARENTH, JavaHighlightingColors.PARENTHESES);
ourMap1.put(JavaTokenType.LBRACE, JavaHighlightingColors.BRACES);
ourMap1.put(JavaTokenType.RBRACE, JavaHighlightingColors.BRACES);
@@ -23,7 +23,7 @@ import com.intellij.openapi.editor.colors.TextAttributesKey;
*
* @author Rustam Vishnyakov
*/
@SuppressWarnings("deprecation") // Later SyntaxHighlighterColors will be moved here.
@SuppressWarnings("deprecation")
public class JavaHighlightingColors {
public static final TextAttributesKey LINE_COMMENT = SyntaxHighlighterColors.LINE_COMMENT;
public static final TextAttributesKey JAVA_BLOCK_COMMENT = SyntaxHighlighterColors.JAVA_BLOCK_COMMENT;
@@ -32,7 +32,7 @@ public class JavaHighlightingColors {
public static final TextAttributesKey NUMBER = SyntaxHighlighterColors.NUMBER;
public static final TextAttributesKey STRING = SyntaxHighlighterColors.STRING;
public static final TextAttributesKey OPERATION_SIGN = SyntaxHighlighterColors.OPERATION_SIGN;
public static final TextAttributesKey PARENTHS = SyntaxHighlighterColors.PARENTHS;
public static final TextAttributesKey PARENTHESES = SyntaxHighlighterColors.PARENTHS;
public static final TextAttributesKey BRACKETS = SyntaxHighlighterColors.BRACKETS;
public static final TextAttributesKey BRACES = SyntaxHighlighterColors.BRACES;
public static final TextAttributesKey COMMA = SyntaxHighlighterColors.COMMA;
@@ -42,4 +42,8 @@ public class JavaHighlightingColors {
public static final TextAttributesKey DOC_COMMENT_MARKUP = SyntaxHighlighterColors.DOC_COMMENT_MARKUP;
public static final TextAttributesKey VALID_STRING_ESCAPE = SyntaxHighlighterColors.VALID_STRING_ESCAPE;
public static final TextAttributesKey INVALID_STRING_ESCAPE = SyntaxHighlighterColors.INVALID_STRING_ESCAPE;
/** @deprecated use {@link #PARENTHESES} (to remove in IDEA 14) */
@SuppressWarnings("SpellCheckingInspection")
public static final TextAttributesKey PARENTHS = PARENTHESES;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ public class JavaColorSettingsPage implements ColorSettingsPage, InspectionColor
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.invalid.escape.in.string"), JavaHighlightingColors.INVALID_STRING_ESCAPE),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.operator.sign"), JavaHighlightingColors.OPERATION_SIGN),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.parentheses"), JavaHighlightingColors.PARENTHS),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.parentheses"), JavaHighlightingColors.PARENTHESES),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.braces"), JavaHighlightingColors.BRACES),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.brackets"), JavaHighlightingColors.BRACKETS),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.comma"), JavaHighlightingColors.COMMA),
@@ -177,7 +177,7 @@ public class DefaultHighlighter {
public static final TextAttributesKey BRACKETS = TextAttributesKey.createTextAttributesKey(BRACKETS_ID, JavaHighlightingColors.BRACKETS);
public static final TextAttributesKey PARENTHESES = TextAttributesKey.createTextAttributesKey(PARENTHESES_ID, JavaHighlightingColors.PARENTHS);
public static final TextAttributesKey PARENTHESES = TextAttributesKey.createTextAttributesKey(PARENTHESES_ID, JavaHighlightingColors.PARENTHESES);
public static final TextAttributesKey OPERATION_SIGN = TextAttributesKey.createTextAttributesKey(OPERATION_SIGN_ID, JavaHighlightingColors.OPERATION_SIGN);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,13 +19,13 @@ import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.codeInsight.daemon.impl.SeverityUtil;
import com.intellij.icons.AllIcons;
import com.intellij.ide.DeleteProvider;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.ide.util.EditSourceUtil;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.colors.TextAttributesKey;
@@ -346,7 +346,7 @@ public final class ComponentTree extends Tree implements DataProvider {
myHighlightAttributes = new HashMap<HighlightSeverity, Map<SimpleTextAttributes, SimpleTextAttributes>>();
final EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
final TextAttributes attributes = globalScheme.getAttributes(SyntaxHighlighterColors.STRING);
final TextAttributes attributes = globalScheme.getAttributes(JavaHighlightingColors.STRING);
myBindingAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, UIUtil.getTreeForeground());
myClassAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground());
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import com.intellij.execution.runners.ProgramRunner;
import com.intellij.execution.util.JreVersionDetector;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeView;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.LangDataKeys;
@@ -35,7 +36,6 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.markup.TextAttributes;
@@ -349,7 +349,7 @@ public class CreateSnapShotAction extends AnAction {
myFormNameTextField.setText(suggestFormName());
final EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
final TextAttributes attributes = globalScheme.getAttributes(SyntaxHighlighterColors.STRING);
final TextAttributes attributes = globalScheme.getAttributes(JavaHighlightingColors.STRING);
final SimpleTextAttributes titleAttributes =
new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, attributes.getForegroundColor());