diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/ClassPatternsPanel.java b/java/java-impl/src/com/intellij/codeInspection/ex/ClassPatternsPanel.java index 52665f885e76..1d6dae09c686 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/ClassPatternsPanel.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/ClassPatternsPanel.java @@ -24,14 +24,13 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.ui.InputValidatorEx; -import com.intellij.openapi.ui.Messages; +import com.intellij.openapi.ui.ex.MultiLineLabel; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiNameHelper; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.ui.*; import com.intellij.ui.table.JBTable; -import com.intellij.util.IconUtil; import com.intellij.util.ui.ItemRemovable; import com.intellij.util.ui.JBDimension; import com.intellij.util.ui.UIUtil; @@ -51,7 +50,6 @@ class ClassPatternsPanel extends JPanel { super(new BorderLayout()); myModifiedPatterns = patterns; myTable = createTableForPatterns(); - final String addPatternMessage = "Add Class Name Pattern"; final String addClassMessage = "Add Class"; final ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(myTable) .setAddAction(new AnActionButtonRunnable() { @@ -69,18 +67,6 @@ class ClassPatternsPanel extends JPanel { } }) .setAddActionName(addClassMessage) - .setAddIcon(IconUtil.getAddClassIcon()) - .addExtraAction(new AnActionButton(addPatternMessage, IconUtil.getAddPatternIcon()) { - @Override - public void actionPerformed(AnActionEvent e) { - final PsiNameHelper nameHelper = PsiNameHelper.getInstance(e.getProject()); - String selectedPattern = Messages.showInputDialog("Pattern:", "Class Name Pattern", Messages.getQuestionIcon(), null, - new ClassPatternValidator(nameHelper)); - if (selectedPattern != null) { - insertRow(selectedPattern); - } - } - }) .setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { @@ -93,10 +79,11 @@ class ClassPatternsPanel extends JPanel { public boolean isEnabled(AnActionEvent e) { return myTable.getSelectedRow() >= 0; } - }) - .setButtonComparator(addClassMessage, addPatternMessage, "Remove"); + }); add(SeparatorFactory.createSeparator("Mark code as entry point if qualified name matches", null), BorderLayout.NORTH); add(toolbarDecorator.createPanel(), BorderLayout.CENTER); + add(new MultiLineLabel("Leave method blank to represent constructors\n" + + "Any * will match against one ore more characters in the qualified name (including dots)"), BorderLayout.SOUTH); setPreferredSize(new JBDimension(-1, 250)); } @@ -124,7 +111,7 @@ class ClassPatternsPanel extends JPanel { int row, int column) { final Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (!hasFocus && !isSelected && value instanceof String && ((String)value).isEmpty()) { + if (value instanceof String && ((String)value).isEmpty()) { setText("constructors"); setForeground(UIUtil.getInactiveTextColor()); } diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerImpl.java b/java/java-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerImpl.java index f5cda4cdcefd..cb2511d34389 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerImpl.java @@ -55,7 +55,7 @@ public class EntryPointsManagerImpl extends EntryPointsManagerBase implements Pe final List writeList = new ArrayList<>(myWriteAnnotations); final JPanel listPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(list, "Mark as entry point if annotated by", true); - final JPanel writeAnnotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(writeList, "Mark field as implicitly write if annotated by", false); + final JPanel writtenAnnotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(writeList, "Mark field as implicitly written if annotated by", false); new DialogWrapper(myProject) { { init(); @@ -66,7 +66,7 @@ public class EntryPointsManagerImpl extends EntryPointsManagerBase implements Pe protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new VerticalFlowLayout()); panel.add(listPanel); - panel.add(writeAnnotationsPanel); + panel.add(writtenAnnotationsPanel); return panel; } diff --git a/resources-en/src/inspectionDescriptions/UnusedAssignment.html b/resources-en/src/inspectionDescriptions/UnusedAssignment.html index a4474424f357..7279ce9921d2 100644 --- a/resources-en/src/inspectionDescriptions/UnusedAssignment.html +++ b/resources-en/src/inspectionDescriptions/UnusedAssignment.html @@ -4,7 +4,6 @@ This inspection points out the cases where a variable value is never used after its assignment, i.e.:
 - the variable never gets read after assignment OR
 - the value is always overwritten with another assignment before the next variable read OR
- - the variable initializer is redundant (for one of the above two reasons) OR
- - the variable is never used. + - the variable initializer is redundant (for one of the above two reasons) diff --git a/resources-en/src/inspectionDescriptions/unused.html b/resources-en/src/inspectionDescriptions/unused.html index 8687538f6d3f..9109539f38cc 100644 --- a/resources-en/src/inspectionDescriptions/unused.html +++ b/resources-en/src/inspectionDescriptions/unused.html @@ -2,10 +2,13 @@ This inspection reports classes, methods or fields in the specified inspection scope that are not used or not reachable from entry points. It also reports parameters that are not used by their methods and all method -implementations/overriders. -In editor, it also detects local variables that are declared but not used as well as private members that are never accessed for reading or not initialized in a class.

+implementations/overriders and local variables that are declared but not used.

+Use visibility settings below to configure what members should be reported, e.g. configuring report private methods only means +that public methods of private inner class would be reported though protected methods of top level class would be ignored. +
Use check boxes in the inspection options below, to specify what should be automatically assumed entry points. You will -also have a possibility to add entry points manually when inspection results are ready. +also have a possibility to add entry points manually when inspection results are ready. You may also configure annotations to mark members as entry points as well +as code patterns.