diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java index a6a33e009be5..f4c1c099faa6 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java @@ -369,7 +369,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { QuickFixAction.registerQuickFixAction(info, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field), null); SpecialAnnotationsUtil.createAddToSpecialAnnotationFixes(field, new Processor() { public boolean process(final String annoName) { - QuickFixAction.registerQuickFixAction(info, myUnusedSymbolInspection.createQuickFix(annoName, field)); + QuickFixAction.registerQuickFixAction(info, myUnusedSymbolInspection.createQuickFix(annoName, "fields")); return true; } }); @@ -377,7 +377,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { } } else if (!myRefCountHolder.isReferenced(field) && weAreSureThereAreNoUsages(field)) { - return formatUnusedSymbolHighlightInfo("field.is.not.used", field); + return formatUnusedSymbolHighlightInfo("field.is.not.used", field, "fields"); } return null; } @@ -471,14 +471,12 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { PsiIdentifier identifier = method.getNameIdentifier(); final HighlightInfo highlightInfo = createUnusedSymbolInfo(identifier, message); QuickFixAction.registerQuickFixAction(highlightInfo, new SafeDeleteFix(method), myUnusedSymbolKey); - if (PropertyUtil.isSimplePropertySetter(method)) { - SpecialAnnotationsUtil.createAddToSpecialAnnotationFixes(method, new Processor() { - public boolean process(final String annoName) { - QuickFixAction.registerQuickFixAction(highlightInfo, myUnusedSymbolInspection.createQuickFix(annoName, method)); - return true; - } - }); - } + SpecialAnnotationsUtil.createAddToSpecialAnnotationFixes(method, new Processor() { + public boolean process(final String annoName) { + QuickFixAction.registerQuickFixAction(highlightInfo, myUnusedSymbolInspection.createQuickFix(annoName, "methods")); + return true; + } + }); return highlightInfo; } @@ -529,19 +527,20 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { @Nullable private HighlightInfo processClass(PsiClass aClass) { if (!isClassUnused(aClass)) return null; + String element = "classes"; if (aClass.getContainingClass() != null && aClass.hasModifierProperty(PsiModifier.PRIVATE)) { String pattern = aClass.isInterface() ? "private.inner.interface.is.not.used" : "private.inner.class.is.not.used"; - return formatUnusedSymbolHighlightInfo(pattern, aClass); + return formatUnusedSymbolHighlightInfo(pattern, aClass, element); } if (aClass.getParent() instanceof PsiDeclarationStatement) { // local class - return formatUnusedSymbolHighlightInfo("local.class.is.not.used", aClass); + return formatUnusedSymbolHighlightInfo("local.class.is.not.used", aClass, element); } if (aClass instanceof PsiTypeParameter) { - return formatUnusedSymbolHighlightInfo("type.parameter.is.not.used", aClass); + return formatUnusedSymbolHighlightInfo("type.parameter.is.not.used", aClass, element); } - return formatUnusedSymbolHighlightInfo("class.is.not.used", aClass); + return formatUnusedSymbolHighlightInfo("class.is.not.used", aClass, element); } private final Map unusedClassCache = new THashMap(); @@ -564,12 +563,18 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { } private HighlightInfo formatUnusedSymbolHighlightInfo(@PropertyKey(resourceBundle = JavaErrorMessages.BUNDLE) String pattern, - PsiNameIdentifierOwner aClass) { + PsiNameIdentifierOwner aClass, final String element) { String symbolName = aClass.getName(); String message = JavaErrorMessages.message(pattern, symbolName); PsiElement identifier = aClass.getNameIdentifier(); - HighlightInfo highlightInfo = createUnusedSymbolInfo(identifier, message); + final HighlightInfo highlightInfo = createUnusedSymbolInfo(identifier, message); QuickFixAction.registerQuickFixAction(highlightInfo, new SafeDeleteFix(aClass), myUnusedSymbolKey); + SpecialAnnotationsUtil.createAddToSpecialAnnotationFixes((PsiModifierListOwner)aClass, new Processor() { + public boolean process(final String annoName) { + QuickFixAction.registerQuickFixAction(highlightInfo, myUnusedSymbolInspection.createQuickFix(annoName, element)); + return true; + } + }); return highlightInfo; } diff --git a/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/OptionsPanel.form b/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/OptionsPanel.form index 190aa4bcbc8f..85ad51f4ba1c 100644 --- a/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/OptionsPanel.form +++ b/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/OptionsPanel.form @@ -1,45 +1,28 @@
- + - + - + + + - - - - - - - - - - - - - - - - - - - - - - + + + @@ -47,7 +30,9 @@ - + + + @@ -55,7 +40,7 @@ - + @@ -63,12 +48,28 @@ - + + + + + + + + + + + + + + + + + diff --git a/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java b/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java index 554ccf0ad53e..a655ba271153 100644 --- a/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java @@ -11,16 +11,15 @@ import com.intellij.codeInsight.daemon.QuickFixBundle; import com.intellij.codeInsight.daemon.impl.HighlightInfoType; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInspection.BaseJavaLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.deadCode.UnusedCodeExtension; import com.intellij.codeInspection.ex.UnfairLocalInspectionTool; import com.intellij.codeInspection.util.SpecialAnnotationsUtil; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.util.JDOMExternalizableStringList; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiModifierListOwner; import com.intellij.psi.util.PropertyUtil; +import org.intellij.lang.annotations.Pattern; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -74,6 +73,7 @@ public class UnusedSymbolLocalInspection extends BaseJavaLocalInspectionTool imp return SHORT_NAME; } + @Pattern("[a-zA-Z_0-9.]+") @NotNull @NonNls public String getID() { @@ -100,20 +100,26 @@ public class UnusedSymbolLocalInspection extends BaseJavaLocalInspectionTool imp private JPanel myPanel; public OptionsPanel() { + myCheckLocalVariablesCheckBox.setSelected(LOCAL_VARIABLE); myCheckClassesCheckBox.setSelected(CLASS); myCheckFieldsCheckBox.setSelected(FIELD); myCheckMethodsCheckBox.setSelected(METHOD); + myCheckParametersCheckBox.setSelected(PARAMETER); myReportUnusedParametersInPublics.setSelected(REPORT_PARAMETER_FOR_PUBLIC_METHODS); + myReportUnusedParametersInPublics.setEnabled(PARAMETER); + final ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { LOCAL_VARIABLE = myCheckLocalVariablesCheckBox.isSelected(); CLASS = myCheckClassesCheckBox.isSelected(); FIELD = myCheckFieldsCheckBox.isSelected(); - PARAMETER = myCheckParametersCheckBox.isSelected(); METHOD = myCheckMethodsCheckBox.isSelected(); - REPORT_PARAMETER_FOR_PUBLIC_METHODS = myReportUnusedParametersInPublics.isSelected(); + + PARAMETER = myCheckParametersCheckBox.isSelected(); + REPORT_PARAMETER_FOR_PUBLIC_METHODS = PARAMETER && myReportUnusedParametersInPublics.isSelected(); + myReportUnusedParametersInPublics.setEnabled(PARAMETER); } }; myCheckLocalVariablesCheckBox.addActionListener(listener); @@ -123,7 +129,7 @@ public class UnusedSymbolLocalInspection extends BaseJavaLocalInspectionTool imp myCheckParametersCheckBox.addActionListener(listener); myReportUnusedParametersInPublics.addActionListener(listener); - String title = InspectionsBundle.message("dependency.injection.annotations.list"); + String title = "Do not check if annotated by"; final JPanel listPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(INJECTION_ANNOS, title); myAnnos.add(listPanel, BorderLayout.CENTER); @@ -139,11 +145,11 @@ public class UnusedSymbolLocalInspection extends BaseJavaLocalInspectionTool imp return new OptionsPanel().getPanel(); } - public IntentionAction createQuickFix(final String qualifiedName, final PsiElement context) { + public IntentionAction createQuickFix(final String qualifiedName, String element) { return SpecialAnnotationsUtil.createAddToSpecialAnnotationsListIntentionAction( - QuickFixBundle.message("fix.unused.symbol.injection.text", qualifiedName), + QuickFixBundle.message("fix.unused.symbol.injection.text", element, qualifiedName), QuickFixBundle.message("fix.unused.symbol.injection.family"), - INJECTION_ANNOS, qualifiedName, context); + INJECTION_ANNOS, qualifiedName); } private static List getRegisteredAnnotations() { diff --git a/java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java b/java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java index 8a279e362bf0..181b5aee85a3 100644 --- a/java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java +++ b/java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java @@ -15,6 +15,7 @@ import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.ActionPlaces; import com.intellij.openapi.actionSystem.DefaultActionGroup; +import com.intellij.openapi.actionSystem.ActionToolbar; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; @@ -24,6 +25,7 @@ import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.ui.ReorderableListController; import com.intellij.ui.ScrollPaneFactory; +import com.intellij.ui.SeparatorFactory; import com.intellij.ui.SortedListModel; import com.intellij.util.IncorrectOperationException; import com.intellij.util.Processor; @@ -83,24 +85,34 @@ public class SpecialAnnotationsUtil { listChanged(); } }); + final JScrollPane listScrollPane = ScrollPaneFactory.createScrollPane(injectionList); - listScrollPane.setBorder(BorderFactory.createEtchedBorder()); +// listScrollPane.setBorder(BorderFactory.createEtchedBorder()); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); final FontMetrics fontMetrics = injectionList.getFontMetrics(injectionList.getFont()); listScrollPane.setPreferredSize(new Dimension(0, fontMetrics.getHeight() * 5)); + listScrollPane.setMinimumSize(new Dimension(0, fontMetrics.getHeight() * 3)); + //int height = injectionList.getCellRenderer().getListCellRendererComponent(injectionList, "foo", 0, false, false).getSize().height; + //injectionList.setFixedCellHeight(height); + //injectionList.setPreferredSize(new Dimension(0, height * 3)); + //injectionList.setMinimumSize(new Dimension(0, height * 3)); +// injectionList.setVisibleRowCount(3); final JPanel listPanel = new JPanel(new BorderLayout()); - listPanel.setBorder(BorderFactory.createTitledBorder(borderTitle)); - listPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, true).getComponent(), BorderLayout.NORTH); - listPanel.add(listScrollPane, BorderLayout.SOUTH); - return listPanel; + ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, true); + listPanel.add(actionToolbar.getComponent(), BorderLayout.NORTH); + listPanel.add(listScrollPane, BorderLayout.CENTER); + + JPanel panel = new JPanel(new BorderLayout()); + panel.add(SeparatorFactory.createSeparator(borderTitle, null), BorderLayout.NORTH); + panel.add(listPanel, BorderLayout.CENTER); + return panel; } public static IntentionAction createAddToSpecialAnnotationsListIntentionAction(final String text, final String family, final List targetList, - final String qualifiedName, - final PsiElement context) { + final String qualifiedName) { return new IntentionAction() { @NotNull public String getText() { @@ -117,7 +129,7 @@ public class SpecialAnnotationsUtil { } public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { - doQuickFixInternal(project, targetList, qualifiedName, context); + doQuickFixInternal(project, targetList, qualifiedName); } public boolean startInWriteAction() { @@ -141,12 +153,12 @@ public class SpecialAnnotationsUtil { } public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { - doQuickFixInternal(project, targetList, qualifiedName, context); + doQuickFixInternal(project, targetList, qualifiedName); } }; } - private static void doQuickFixInternal(final Project project, final List targetList, final String qualifiedName, final PsiElement context) { + private static void doQuickFixInternal(final Project project, final List targetList, final String qualifiedName) { targetList.add(qualifiedName); Collections.sort(targetList); final InspectionProfile inspectionProfile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile(); diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.form b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.form index ee6d9095e9f0..605f80e6c5d1 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.form +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.form @@ -1,6 +1,6 @@
- + @@ -8,52 +8,85 @@ - - - - - - - + - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java index 20883f7a57e1..9263a6bc9ef7 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionToolsConfigurable.java @@ -60,6 +60,7 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple private JButton myDeleteButton; private JButton myImportButton; private JButton myExportButton; + private JCheckBox myShareProfileCheckBox; private ArrayList myDeletedProfiles = new ArrayList(); protected final InspectionProfileManager myProfileManager; @@ -155,7 +156,6 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple private void addProfile(InspectionProfileImpl model) { final String modelName = model.getName(); final SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(myProjectProfileManager, modelName, model); - addSharedProfileListener(panel); myPanel.add(modelName, panel); if (!myPanels.containsKey(modelName)) { ((DefaultComboBoxModel)myProfiles.getModel()).addElement(model); @@ -195,9 +195,18 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple myProfiles.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final InspectionProfileImpl profile = (InspectionProfileImpl)myProfiles.getSelectedItem(); - final SingleInspectionProfilePanel panel = getSelectedPanel(); myDeleteButton.setEnabled(myProfiles.getModel().getSize() > 1); myLayout.show(myPanel, profile.getName()); + SingleInspectionProfilePanel panel = getSelectedPanel(); + if (panel != null) { + myShareProfileCheckBox.setSelected(panel.isProfileShared()); + } + } + }); + myShareProfileCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + getSelectedPanel().setProfileShared(myShareProfileCheckBox.isSelected()); + myProfiles.repaint(); } }); @@ -243,7 +252,6 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple model.addElement(profile); final String profileName = profile.getName(); final SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(myProjectProfileManager, profileName, ((InspectionProfileImpl)profile).getModifiableModel()); - addSharedProfileListener(panel); myPanels.put(profileName, panel); panel.reset(); myPanel.add(profileName, panel); @@ -252,14 +260,10 @@ public abstract class InspectionToolsConfigurable extends BaseConfigurable imple myProfiles.setSelectedItem(inspectionProfile); myLayout.show(myPanel, inspectionProfile.getName()); myDeleteButton.setEnabled(getProfiles().size() > 1 && inspectionProfile.getProfileManager() == myProfileManager); - } - - private void addSharedProfileListener(final SingleInspectionProfilePanel panel) { - panel.addSharedProfileListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - myProfiles.repaint(); - } - }); + SingleInspectionProfilePanel panel = getSelectedPanel(); + if (panel != null) { + myShareProfileCheckBox.setSelected(panel.isProfileShared()); + } } protected Collection getProfiles() { diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java index a996c43bf38f..c290a844247b 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java @@ -27,7 +27,6 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Splitter; -import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.JDOMUtil; @@ -94,7 +93,7 @@ public class SingleInspectionProfilePanel extends JPanel { @NonNls private static final String EMPTY_HTML = ""; private boolean myIsInRestore = false; - private JCheckBox myShareProfile = new JCheckBox("Share profile"); + private boolean myShareProfile; private final InspectionProjectProfileManager myProjectProfileManager; public SingleInspectionProfilePanel(final String inspectionProfileName, final ModifiableModel profile) { @@ -121,13 +120,6 @@ public class SingleInspectionProfilePanel extends JPanel { }); myUserActivityWatcher.register(myOptionsPanel); updateSelectedProfileState(); - final JPanel sharePanel = new JPanel(new BorderLayout()); - sharePanel.add(myShareProfile, BorderLayout.EAST); - add(sharePanel, BorderLayout.NORTH); - } - - public void addSharedProfileListener(ActionListener sharedProfileListener) { - myShareProfile.addActionListener(sharedProfileListener); } private void updateSelectedProfileState() { @@ -738,6 +730,7 @@ public class SingleInspectionProfilePanel extends JPanel { } myOptionsPanel.removeAll(); + myOptionsPanel.add(SeparatorFactory.createSeparator("Options", null), BorderLayout.NORTH); final NamedScope scope = node.getScope(); if (scope != null || node.isInspectionNode()) { @@ -773,7 +766,7 @@ public class SingleInspectionProfilePanel extends JPanel { new Insets(0, 0, 0, 0), 0, 0)); } - myOptionsPanel.add(withSeverity); + myOptionsPanel.add(withSeverity, BorderLayout.CENTER); } myOptionsPanel.validate(); GuiUtils.enableChildren(myOptionsPanel, node.isChecked()); @@ -786,6 +779,7 @@ public class SingleInspectionProfilePanel extends JPanel { private void initOptionsAndDescriptionPanel() { myOptionsPanel.removeAll(); + myOptionsPanel.add(SeparatorFactory.createSeparator("Options", null)); myOptionsPanel.add(new JPanel()); try { myBrowser.read(new StringReader(EMPTY_HTML), null); @@ -856,19 +850,17 @@ public class SingleInspectionProfilePanel extends JPanel { initDescriptors(); fillTreeData(myProfileFilter != null ? myProfileFilter.getFilter() : null, true); - JPanel descriptionPanel = new JPanel(); - descriptionPanel.setBorder(IdeBorderFactory.createTitledBorder(InspectionsBundle.message("inspection.description.title"))); - descriptionPanel.setLayout(new BorderLayout()); + JPanel descriptionPanel = new JPanel(new BorderLayout()); + descriptionPanel.add(SeparatorFactory.createSeparator(InspectionsBundle.message("inspection.description.title"), null), BorderLayout.NORTH); descriptionPanel.add(ScrollPaneFactory.createScrollPane(myBrowser), BorderLayout.CENTER); - JPanel rightPanel = new JPanel(new GridLayout(2, 1, 0, 5)); - rightPanel.add(descriptionPanel); + Splitter rightPanel = new Splitter(true); + rightPanel.setFirstComponent(descriptionPanel); - JPanel panel1 = new JPanel(new VerticalFlowLayout()); - panel1.setBorder(IdeBorderFactory.createTitledBorder(InspectionsBundle.message("inspection.export.options.panel.title"))); - myOptionsPanel = panel1; + myOptionsPanel = new JPanel(new BorderLayout()); initOptionsAndDescriptionPanel(); - rightPanel.add(myOptionsPanel); + rightPanel.setSecondComponent(myOptionsPanel); + rightPanel.setHonorComponentsMinimumSize(true); final JPanel treePanel = new JPanel(new BorderLayout()); treePanel.add(initTreeScrollPane(), BorderLayout.CENTER); @@ -894,7 +886,7 @@ public class SingleInspectionProfilePanel extends JPanel { public boolean isModified() { if (myModified) return true; if (mySelectedProfile.isChanged()) return true; - if (myShareProfile.isSelected() != (mySelectedProfile.getProfileManager() == myProjectProfileManager)) return true; + if (myShareProfile != (mySelectedProfile.getProfileManager() == myProjectProfileManager)) return true; if (!Comparing.strEqual(myInitialProfile, mySelectedProfile.getName())) return true; if (descriptorsAreChanged()) { return setSelectedProfileModified(true); @@ -909,18 +901,13 @@ public class SingleInspectionProfilePanel extends JPanel { final String filter = myProfileFilter.getFilter(); myProfileFilter.reset(); myProfileFilter.setSelectedItem(filter); - myShareProfile.setVisible(myProjectProfileManager != null); - myShareProfile.setSelected(mySelectedProfile.getProfileManager() == myProjectProfileManager); - } - - public void setSharedEnabled(boolean enabled) { - myShareProfile.setEnabled(enabled); + myShareProfile = mySelectedProfile.getProfileManager() == myProjectProfileManager; } public void apply() throws ConfigurationException { final ModifiableModel selectedProfile = getSelectedProfile(); final ProfileManager profileManager = - myShareProfile.isSelected() ? myProjectProfileManager : InspectionProfileManager.getInstance(); + myShareProfile ? myProjectProfileManager : InspectionProfileManager.getInstance(); if (selectedProfile.getProfileManager() != profileManager) { if (selectedProfile.getProfileManager().getProfile(selectedProfile.getName(), false) != null) { selectedProfile.getProfileManager().deleteProfile(selectedProfile.getName()); @@ -986,7 +973,11 @@ public class SingleInspectionProfilePanel extends JPanel { } public boolean isProfileShared() { - return myShareProfile.isSelected(); + return myShareProfile; + } + + public void setProfileShared(boolean profileShared) { + myShareProfile = profileShared; } private class LevelSelection implements ActionListener { diff --git a/resources-en/src/messages/QuickFixBundle.properties b/resources-en/src/messages/QuickFixBundle.properties index 46f72198044e..ac90cd7caa52 100644 --- a/resources-en/src/messages/QuickFixBundle.properties +++ b/resources-en/src/messages/QuickFixBundle.properties @@ -214,7 +214,7 @@ change.new.operator.type.text=Change ''{0}'' to ''new {1}{2}'' change.new.operator.type.family=Change new operator type fix.unused.symbol.injection.family=Add to Dependency Injection Annotations -fix.unused.symbol.injection.text=Add ''{0}'' to dependency injection annotations list +fix.unused.symbol.injection.text=Suppress for {0} annotated by ''{1}'' fix.add.special.annotation.family=Add to Special Annotations fix.add.special.annotation.text=Add ''{0}'' to special annotations list