mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
class naming: description & ui tweaks
This commit is contained in:
+4
-2
@@ -37,6 +37,7 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.CheckBoxList;
|
||||
import com.intellij.ui.CheckBoxListListener;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.xmlb.XmlSerializationException;
|
||||
import com.intellij.util.xmlb.XmlSerializer;
|
||||
@@ -181,11 +182,12 @@ public class NewClassNamingConventionInspection extends BaseInspection {
|
||||
@Nullable
|
||||
@Override
|
||||
public JComponent createOptionsPanel() {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JPanel panel = new JPanel(new BorderLayout(JBUI.scale(2), JBUI.scale(2)));
|
||||
JPanel descriptionPanel = new JPanel(new BorderLayout());
|
||||
descriptionPanel.setBorder(JBUI.Borders.empty(2));
|
||||
panel.add(descriptionPanel, BorderLayout.CENTER);
|
||||
CheckBoxList<NamingConvention<PsiClass>> list = new CheckBoxList<>();
|
||||
list.setBorder(JBUI.Borders.empty());
|
||||
for (NamingConvention<PsiClass> convention : myNamingConventions.values()) {
|
||||
list.addItem(convention, convention.getElementDescription(), !myDisabledShortNames.contains(convention.getShortName()));
|
||||
}
|
||||
@@ -205,7 +207,7 @@ public class NewClassNamingConventionInspection extends BaseInspection {
|
||||
}
|
||||
});
|
||||
list.setSelectedIndex(myNamingConventions.size() - 1);
|
||||
panel.add(list, BorderLayout.WEST);
|
||||
panel.add(new JBScrollPane(list), BorderLayout.WEST);
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ Reports classes whose names are either too short, too long, or do not follow
|
||||
the specified regular expression pattern.
|
||||
<!-- tooltip end -->
|
||||
<p>
|
||||
Use the fields below to specify minimum length, maximum length and regular expression expected for class names.
|
||||
Use list below to specify which classes should be checked. When unchecked, common class name patterns <b>won't be applied</b>.
|
||||
For each class type use the fields to specify minimum length, maximum length and regular expression expected for class names.
|
||||
Specify <b>0</b> to not check the length of names. Regular expressions are in standard <b>java.util.regex</b> format.
|
||||
<p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user