diff --git a/RegExpSupport/src/META-INF/RegExpPlugin.xml b/RegExpSupport/src/META-INF/RegExpPlugin.xml
index 2f1803fad272..54f6f622997a 100644
--- a/RegExpSupport/src/META-INF/RegExpPlugin.xml
+++ b/RegExpSupport/src/META-INF/RegExpPlugin.xml
@@ -8,5 +8,6 @@
+
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpColorsPage.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpColorsPage.java
new file mode 100644
index 000000000000..8afcb738c59e
--- /dev/null
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpColorsPage.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2010 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.intellij.lang.regexp;
+
+import com.intellij.application.options.colors.InspectionColorSettingsPage;
+import com.intellij.openapi.editor.colors.TextAttributesKey;
+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 com.intellij.util.containers.HashMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.util.Map;
+
+/**
+ * @author traff
+ */
+public class RegExpColorsPage implements ColorSettingsPage, InspectionColorSettingsPage {
+ private static final AttributesDescriptor[] ATTRS = new AttributesDescriptor[] {
+ new AttributesDescriptor("Keywords", RegExpHighlighter.META),
+ new AttributesDescriptor("Escaped characters", RegExpHighlighter.ESC_CHARACTER),
+ new AttributesDescriptor("Braces", RegExpHighlighter.BRACES),
+ new AttributesDescriptor("Brackets", RegExpHighlighter.BRACKETS),
+ new AttributesDescriptor("Parenthesis", RegExpHighlighter.PARENTHS),
+ };
+
+ @NonNls private static final HashMap ourTagToDescriptorMap = new HashMap();
+
+ @NotNull
+ public String getDisplayName() {
+ return "RegExp";
+ }
+
+ public Icon getIcon() {
+ return RegExpFileType.INSTANCE.getIcon();
+ }
+
+ @NotNull
+ public AttributesDescriptor[] getAttributeDescriptors() {
+ return ATTRS;
+ }
+
+ @NotNull
+ public ColorDescriptor[] getColorDescriptors() {
+ return ColorDescriptor.EMPTY_ARRAY;
+ }
+
+ @NotNull
+ public SyntaxHighlighter getHighlighter() {
+ final SyntaxHighlighter highlighter = SyntaxHighlighter.PROVIDER.create(RegExpFileType.INSTANCE, null, null);
+ assert highlighter != null;
+ return highlighter;
+ }
+
+ @NotNull
+ public String getDemoText() {
+ return
+ "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
+
+ }
+
+ public Map getAdditionalHighlightingTagToDescriptorMap() {
+ return ourTagToDescriptorMap;
+ }
+}
diff --git a/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java b/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java
index 851bbd62d281..45b68cc920c9 100644
--- a/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java
+++ b/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java
@@ -14,12 +14,6 @@
* limitations under the License.
*/
-/*
- * Created by IntelliJ IDEA.
- * User: Anna.Kozlova
- * Date: 05-Nov-2006
- * Time: 18:04:58
- */
package com.intellij.codeInsight.intention;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
@@ -28,9 +22,45 @@ import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
+import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+/**
+ * @author Anna Kozlova
+ * @author Konstantin Bulenkov
+ */
public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction {
+ /**
+ * Invokes intention action for the element under cursor
+ *
+ * @param project the project in which the file is opened.
+ * @param editor the editor for the file
+ * @param element the element under cursor
+
+ * @throws com.intellij.util.IncorrectOperationException ...
+ */
+ public void invoke(Project project, Editor editor, PsiElement element) throws IncorrectOperationException {
+ throw new IncorrectOperationException();
+ }
+
+ public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
+ final PsiElement element = getElement(editor, file);
+ return element == null ? false : isAvailable(project, editor, element);
+ }
+
+ @Nullable
+ protected static PsiElement getElement(Editor editor, PsiFile file) {
+ if (!file.getManager().isInProject(file)) return null;
+ final CaretModel caretModel = editor.getCaretModel();
+ final int position = caretModel.getOffset();
+ return file.findElementAt(position);
+ }
+
+ @Override
+ public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+ invoke(project, editor, getElement(editor, file));
+ }
/**
* Checks whether this intention is available at a caret offset in file.
@@ -42,13 +72,4 @@ public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction
* @return true if the intention is available, false otherwise.
*/
public abstract boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element);
-
- public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
- if (!file.getManager().isInProject(file)) return false;
- final CaretModel caretModel = editor.getCaretModel();
- final int position = caretModel.getOffset();
- final PsiElement element = file.findElementAt(position);
- if (element == null) return false;
- return isAvailable(project, editor, element);
- }
}
\ No newline at end of file
diff --git a/plugins/devkit/resources/inspectionDescriptions/DescriptionNotFoundInspection.html b/plugins/devkit/resources/inspectionDescriptions/InspectionDescriptionNotFoundInspection.html
similarity index 94%
rename from plugins/devkit/resources/inspectionDescriptions/DescriptionNotFoundInspection.html
rename to plugins/devkit/resources/inspectionDescriptions/InspectionDescriptionNotFoundInspection.html
index 84653b4ffbdd..b6f17e3a20e4 100644
--- a/plugins/devkit/resources/inspectionDescriptions/DescriptionNotFoundInspection.html
+++ b/plugins/devkit/resources/inspectionDescriptions/InspectionDescriptionNotFoundInspection.html
@@ -2,4 +2,4 @@
This inspection detects missing html-description for an inspection.
-