Skip to content

Commit 0a24603

Browse files
committed
Introduce dialog mode for import configurable
1 parent 728093e commit 0a24603

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/com/goide/codeInsight/imports/GoAutoImportConfigurable.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ public class GoAutoImportConfigurable implements SearchableConfigurable {
4343

4444
@NotNull private GoCodeInsightSettings myCodeInsightSettings;
4545
@NotNull private GoExcludedPathsSettings myExcludedSettings;
46-
private boolean myIsDefaultProject;
46+
private final boolean myIsDefaultProject;
47+
private final boolean myIsDialog;
4748

48-
public GoAutoImportConfigurable(@NotNull Project project) {
49+
public GoAutoImportConfigurable(@NotNull Project project, boolean dialogMode) {
4950
myCodeInsightSettings = GoCodeInsightSettings.getInstance();
5051
myExcludedSettings = GoExcludedPathsSettings.getInstance(project);
5152
myIsDefaultProject = project.isDefault();
53+
myIsDialog = dialogMode;
5254
}
5355

5456
@Nullable
@@ -71,6 +73,7 @@ public JComponent createComponent() {
7173

7274
JPanel result = new JPanel(new BorderLayout());
7375
result.add(builder.getPanel(), BorderLayout.NORTH);
76+
if (myIsDialog) result.setPreferredSize(new Dimension(300, -1));
7477
return result;
7578
}
7679

src/com/goide/codeInsight/imports/GoExcludePathLookupActionProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ public Result performLookupAction() {
7272
ApplicationManager.getApplication().invokeLater(new Runnable() {
7373
@Override
7474
public void run() {
75-
final GoAutoImportConfigurable configurable = new GoAutoImportConfigurable(myProject);
76-
ShowSettingsUtil.getInstance()
77-
.editConfigurable(myProject, configurable, new Runnable() {
75+
final GoAutoImportConfigurable configurable = new GoAutoImportConfigurable(myProject, true);
76+
ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, new Runnable() {
7877
@Override
7978
public void run() {
8079
configurable.focusList();

src/com/goide/configuration/GoConfigurableProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Configurable createConfigurable() {
3939
Configurable librariesConfigurable = new GoLibrariesConfigurableProvider(myProject).createConfigurable();
4040
Configurable sdkConfigurable = GoSdkService.getInstance(myProject).createSdkConfigurable();
4141
Configurable buildFlagsConfigurable = new GoBuildTargetConfigurable(myProject, false);
42-
Configurable autoImportConfigurable = new GoAutoImportConfigurable(myProject);
42+
Configurable autoImportConfigurable = new GoAutoImportConfigurable(myProject, false);
4343
if (sdkConfigurable != null) {
4444
return new GoCompositeConfigurable(sdkConfigurable, buildFlagsConfigurable, librariesConfigurable, autoImportConfigurable);
4545
}

0 commit comments

Comments
 (0)