fix(ProjectSettingsComponent): add ScrollPane
This commit is contained in:
@@ -7,7 +7,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class EnumDoc {
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -123,9 +123,9 @@ public class LineEndCacheUtils {
|
||||
if (list != null) {
|
||||
list.add(lineExt);
|
||||
} else {
|
||||
lineCache.map.put(info.text, new ArrayList<>() {{
|
||||
add(lineExt);
|
||||
}});
|
||||
ArrayList<LineExtensionInfo> lineExtList = new ArrayList<>();
|
||||
lineExtList.add(lineExt);
|
||||
lineCache.map.put(info.text, lineExtList);
|
||||
}
|
||||
}
|
||||
lineCache.updated();
|
||||
|
||||
@@ -39,7 +39,7 @@ public abstract class AbstractSettingsState {
|
||||
public transient Map<String, Pattern[]> dirDoc = new LinkedHashMap<>() {{
|
||||
put("pom.xml", new Pattern[]{
|
||||
Pattern.compile("<description>([^<]++)</description>"),
|
||||
Pattern.compile("<name>\\$\\{[^}]*+\\}([^<]++)</name>"),
|
||||
Pattern.compile("<name>\\$\\{[^}]*+}([^<]++)</name>"),
|
||||
});
|
||||
put("build.gradle", new Pattern[]{Pattern.compile("(?m)^description[^'\"]*+['\"]([^'\"]++)['\"]")});
|
||||
put("build.gradle.kts", new Pattern[]{Pattern.compile("(?m)^description[^'\"]*+['\"]([^'\"]++)['\"]")});
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.github.linwancen.plugin.show.settings;
|
||||
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.util.ui.FormBuilder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -9,14 +10,14 @@ import javax.swing.*;
|
||||
|
||||
public class ProjectSettingsComponent extends AbstractSettingsComponent {
|
||||
|
||||
private final JPanel myMainPanel;
|
||||
private final JBScrollPane myMainPanel;
|
||||
private final JBCheckBox globalFilterEffective = new JBCheckBox(ShowBundle.message("global.settings.effective"));
|
||||
private final JBCheckBox projectFilterEffective = new JBCheckBox(ShowBundle.message("project.settings.effective"));
|
||||
|
||||
public ProjectSettingsComponent() {
|
||||
@NotNull JButton resetDefault = new JButton(ShowBundle.message("reset.default"));
|
||||
resetDefault.addActionListener(e -> ProjectSettingsConfigurable.reset(ProjectSettingsState.DEFAULT_SETTING, this));
|
||||
myMainPanel = FormBuilder.createFormBuilder()
|
||||
JPanel panel = FormBuilder.createFormBuilder()
|
||||
.addComponent(JPanelFactory.of(resetDefault,
|
||||
new JBLabel(ShowBundle.message("line.count")), lineEndCount,
|
||||
globalFilterEffective, projectFilterEffective
|
||||
@@ -24,9 +25,12 @@ public class ProjectSettingsComponent extends AbstractSettingsComponent {
|
||||
.addComponent(commonPanel(), 1)
|
||||
.addComponentFillVertically(new JPanel(), 0)
|
||||
.getPanel();
|
||||
JBScrollPane scrollPane = new JBScrollPane(panel);
|
||||
scrollPane.setBorder(null);
|
||||
myMainPanel = scrollPane;
|
||||
}
|
||||
|
||||
public JPanel getPanel() {
|
||||
public JBScrollPane getPanel() {
|
||||
return myMainPanel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user