IDEA-79964: Throwable at com.intellij.openapi.editor.impl.DocumentImpl.b

Added dedicated gradle colors settings page
This commit is contained in:
Denis.Zhdanov
2012-01-24 07:41:32 +04:00
parent d94ace75e7
commit a5656670a1
4 changed files with 124 additions and 0 deletions
@@ -47,6 +47,10 @@ gradle.import.text.error.file.module.test.output.location=Module test output loc
gradle.import.text.incomplete.tooling.api=Gradle version contains incomplete tooling API
gradle.sync.title.tab=Changes
gradle.sync.change.type.gradle=Gradle local setting
gradle.sync.change.type.intellij={0} local setting
gradle.sync.change.type.conflict=Settings conflict
gradle.sync.change.type.confirmed=Confirmed settings diff
gradle.library.resolve.progress.text=Resolving gradle libraries
+1
View File
@@ -32,6 +32,7 @@
<library.presentationProvider implementation="org.jetbrains.plugins.gradle.config.GradleLibraryPresentationProvider" order="last"/>
<java.elementFinder implementation="org.jetbrains.plugins.gradle.config.GradleClassFinder"/>
<projectOpenProcessor implementation="org.jetbrains.plugins.gradle.importing.GradleProjectOpenProcessor"/>
<colorSettingsPage implementation="org.jetbrains.plugins.gradle.config.GradleColorSettingsPage"/>
<applicationService serviceImplementation="org.jetbrains.plugins.gradle.remote.GradleApiFacadeManager"/>
<applicationService serviceImplementation="org.jetbrains.plugins.gradle.util.GradleLibraryManager"/>
@@ -0,0 +1,30 @@
package org.jetbrains.plugins.gradle.config;
import com.intellij.openapi.editor.colors.ColorKey;
import com.intellij.ui.Gray;
import java.awt.*;
/**
* Holds keys to the colors used at gradle-specific processing.
* <p/>
* Thread-safe.
*
* @author Denis Zhdanov
* @since 1/18/12 4:19 PM
*/
public class GradleColorKeys {
/**
* References color to use for indication of particular change that exists only at the gradle side.
* <p/>
* Example: particular dependency is added at the gradle side but not at intellij.
*/
public static final ColorKey GRADLE_LOCAL_CHANGE = ColorKey.createColorKey("GRADLE_LOCAL_CHANGE", new Color(130, 184, 22));
public static final ColorKey GRADLE_INTELLIJ_LOCAL_CHANGE = ColorKey.createColorKey("GRADLE_INTELLIJ_LOCAL_CHANGE", new Color(16, 102, 248));
public static final ColorKey GRADLE_CHANGE_CONFLICT = ColorKey.createColorKey("GRADLE_CHANGE_CONFLICT", new Color(255, 187, 255));
public static final ColorKey GRADLE_CONFIRMED_CONFLICT = ColorKey.createColorKey("GRADLE_CONFIRMED_CONFLICT", Gray._208);
private GradleColorKeys() {
}
}
@@ -0,0 +1,89 @@
package org.jetbrains.plugins.gradle.config;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.PlainSyntaxHighlighter;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.options.colors.AttributesDescriptor;
import com.intellij.openapi.options.colors.ColorDescriptor;
import com.intellij.openapi.options.colors.ColorSettingsPage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.gradle.ui.GradleIcons;
import org.jetbrains.plugins.gradle.util.GradleBundle;
import javax.swing.*;
import java.util.Map;
/**
* Provides support for defining gradle-specific color settings.
* <p/>
* Not thread-safe.
*
* @author Denis Zhdanov
* @since 1/18/12 4:15 PM
*/
public class GradleColorSettingsPage implements ColorSettingsPage {
private static final ColorDescriptor[] DESCRIPTORS = {
new ColorDescriptor(
GradleBundle.message("gradle.sync.change.type.gradle"),
GradleColorKeys.GRADLE_LOCAL_CHANGE,
ColorDescriptor.Kind.FOREGROUND
),
new ColorDescriptor(
GradleBundle.message("gradle.sync.change.type.intellij", ApplicationNamesInfo.getInstance().getProductName()),
GradleColorKeys.GRADLE_INTELLIJ_LOCAL_CHANGE,
ColorDescriptor.Kind.FOREGROUND
),
new ColorDescriptor(
GradleBundle.message("gradle.sync.change.type.conflict"),
GradleColorKeys.GRADLE_CHANGE_CONFLICT,
ColorDescriptor.Kind.FOREGROUND
),
new ColorDescriptor(
GradleBundle.message("gradle.sync.change.type.confirmed"),
GradleColorKeys.GRADLE_CONFIRMED_CONFLICT,
ColorDescriptor.Kind.FOREGROUND
)
};
@NotNull
@Override
public String getDisplayName() {
return GradleBundle.message("gradle.name");
}
@Override
public Icon getIcon() {
return GradleIcons.GRADLE_ICON;
}
@NotNull
@Override
public AttributesDescriptor[] getAttributeDescriptors() {
return new AttributesDescriptor[0];
}
@NotNull
@Override
public ColorDescriptor[] getColorDescriptors() {
return DESCRIPTORS;
}
@NotNull
@Override
public SyntaxHighlighter getHighlighter() {
return new PlainSyntaxHighlighter();
}
@NotNull
@Override
public String getDemoText() {
return "";
}
@Override
public Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap() {
return null;
}
}