diff --git a/platform/lang-impl/src/com/intellij/application/options/editor/ErrorHighlightingPanel.java b/platform/lang-impl/src/com/intellij/application/options/editor/ErrorHighlightingPanel.java index a073a9a77de9..0945b54feab1 100644 --- a/platform/lang-impl/src/com/intellij/application/options/editor/ErrorHighlightingPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/editor/ErrorHighlightingPanel.java @@ -17,11 +17,13 @@ package com.intellij.application.options.editor; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings; -import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.options.AbstractConfigurableEP; import com.intellij.openapi.options.ConfigurationException; import com.intellij.profile.codeInspection.ui.ErrorOptionsProvider; +import com.intellij.profile.codeInspection.ui.ErrorOptionsProviderEP; import javax.swing.*; +import java.util.List; public class ErrorHighlightingPanel { private JTextField myAutoreparseDelayField; @@ -30,9 +32,11 @@ public class ErrorHighlightingPanel { private JPanel myPanel; private JPanel myErrorsPanel; private JCheckBox myNextErrorGoesToErrorsFirst; + private final List myExtensions; public ErrorHighlightingPanel() { - for (ErrorOptionsProvider optionsProvider : Extensions.getExtensions(ErrorOptionsProvider.EP_NAME)) { + myExtensions = AbstractConfigurableEP.createConfigurables(ErrorOptionsProviderEP.EP_NAME); + for (ErrorOptionsProvider optionsProvider : myExtensions) { myErrorsPanel.add(optionsProvider.createComponent()); } } @@ -44,7 +48,7 @@ public class ErrorHighlightingPanel { myMarkMinHeight.setText(Integer.toString(settings.ERROR_STRIPE_MARK_MIN_HEIGHT)); myNextErrorGoesToErrorsFirst.setSelected(settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST); - for (ErrorOptionsProvider optionsProvider : Extensions.getExtensions(ErrorOptionsProvider.EP_NAME)) { + for (ErrorOptionsProvider optionsProvider : myExtensions) { optionsProvider.reset(); } } @@ -59,7 +63,7 @@ public class ErrorHighlightingPanel { settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST = myNextErrorGoesToErrorsFirst.isSelected(); - for (ErrorOptionsProvider optionsProvider : Extensions.getExtensions(ErrorOptionsProvider.EP_NAME)) { + for (ErrorOptionsProvider optionsProvider : myExtensions) { optionsProvider.apply(); } } @@ -78,7 +82,7 @@ public class ErrorHighlightingPanel { isModified |= getErrorStripeMarkMinHeight() != settings.ERROR_STRIPE_MARK_MIN_HEIGHT; isModified |= myNextErrorGoesToErrorsFirst.isSelected() != settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST; - for (ErrorOptionsProvider optionsProvider : Extensions.getExtensions(ErrorOptionsProvider.EP_NAME)) { + for (ErrorOptionsProvider optionsProvider : myExtensions) { isModified |= optionsProvider.isModified(); } if (isModified) return true; @@ -87,7 +91,7 @@ public class ErrorHighlightingPanel { public void disposeUIResources() { - for (ErrorOptionsProvider optionsProvider : Extensions.getExtensions(ErrorOptionsProvider.EP_NAME)) { + for (ErrorOptionsProvider optionsProvider : myExtensions) { optionsProvider.disposeUIResources(); } } diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProvider.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProvider.java index 46c625d2d300..9e2a4c3593f9 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProvider.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProvider.java @@ -20,9 +20,7 @@ */ package com.intellij.profile.codeInspection.ui; -import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.options.UnnamedConfigurable; public interface ErrorOptionsProvider extends UnnamedConfigurable { - ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.errorOptionsProvider"); } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProviderEP.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProviderEP.java new file mode 100644 index 000000000000..b272a7677620 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/ErrorOptionsProviderEP.java @@ -0,0 +1,26 @@ +/* + * 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 com.intellij.profile.codeInspection.ui; + +import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.openapi.options.AbstractConfigurableEP; + +/** + * @author nik + */ +public class ErrorOptionsProviderEP extends AbstractConfigurableEP { + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.errorOptionsProvider"); +} diff --git a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml index e7d58bf54125..bec8a3036383 100644 --- a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml @@ -1,5 +1,5 @@ - + diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index c31a9c323284..8b33ec7f8c2b 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -186,7 +186,7 @@ - +