Skip to content

Commit 69f8511

Browse files
committed
Removed unnecessary settings. Code clean-up.
1 parent 40c7fbb commit 69f8511

5 files changed

Lines changed: 34 additions & 337 deletions

File tree

src/de/halirutan/mathematica/settings/MathematicaSettings.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016 Patrick Scheibe
2+
* Copyright (c) 2017 Patrick Scheibe
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights
@@ -60,8 +60,7 @@ public enum SmartEnterResult {
6060
INSERT_TEMPLATE
6161
}
6262

63-
public SmartEnterResult smartEnterResult = SmartEnterResult.INSERT_TEMPLATE;
64-
public boolean sortCompletionEntriesLexicographically = false;
63+
public SmartEnterResult smartEnterResult = SmartEnterResult.INSERT_BRACES;
6564

6665
public static MathematicaSettings getInstance() {
6766
return ServiceManager.getService(MathematicaSettings.class);
@@ -88,15 +87,12 @@ public boolean equals(Object obj) {
8887
}
8988

9089
final MathematicaSettings settings = (MathematicaSettings) obj;
91-
if(smartEnterResult != settings.smartEnterResult) return false;
92-
return sortCompletionEntriesLexicographically == settings.sortCompletionEntriesLexicographically;
90+
return smartEnterResult == settings.smartEnterResult;
9391
}
9492

9593
@Override
9694
public int hashCode() {
97-
int result = (smartEnterResult.ordinal());
98-
result = 29 * result + (sortCompletionEntriesLexicographically ? 1 : 0);
99-
return result;
95+
return (smartEnterResult.ordinal());
10096
}
10197

10298
public SmartEnterResult getSmartEnterResult() {
@@ -107,11 +103,4 @@ public void setSmartEnterResult(SmartEnterResult result) {
107103
this.smartEnterResult = result;
108104
}
109105

110-
public boolean isSortCompletionEntriesLexicographically() {
111-
return sortCompletionEntriesLexicographically;
112-
}
113-
114-
public void setSortCompletionEntriesLexicographically(boolean shouldSort) {
115-
this.sortCompletionEntriesLexicographically = shouldSort;
116-
}
117106
}

src/de/halirutan/mathematica/settings/MathematicaSettingsConfigurable.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
public class MathematicaSettingsConfigurable extends BaseConfigurable {
3535

36-
private SettingsUI settingsUI;
36+
private SettingsUI mySettingsUI = null;
3737

3838
@Nls
3939
@Override
@@ -44,37 +44,37 @@ public String getDisplayName() {
4444
@Nullable
4545
@Override
4646
public String getHelpTopic() {
47-
return "xpath.settings";
47+
return null;
4848
}
4949

5050
@Nullable
5151
@Override
5252
public JComponent createComponent() {
53-
settingsUI = new SettingsUI();
54-
settingsUI.setSettings(MathematicaSettings.getInstance());
55-
return settingsUI;
53+
mySettingsUI = new SettingsUI();
54+
mySettingsUI.setSettings(MathematicaSettings.getInstance());
55+
return mySettingsUI;
5656
}
5757

5858
@Override
5959
public void apply() throws ConfigurationException {
60-
if (settingsUI != null) {
60+
if (mySettingsUI != null) {
6161
final MathematicaSettings instance = MathematicaSettings.getInstance();
62-
instance.loadState(settingsUI.getSettings());
62+
instance.loadState(mySettingsUI.getSettings());
6363
}
6464

6565
}
6666

6767
@Override
6868
public void reset() {
69-
if (settingsUI != null) {
70-
settingsUI.setSettings(MathematicaSettings.getInstance());
69+
if (mySettingsUI != null) {
70+
mySettingsUI.setSettings(MathematicaSettings.getInstance());
7171
}
7272
}
7373

7474
@Override
7575
public boolean isModified() {
76-
if (settingsUI != null) {
77-
return !settingsUI.getSettings().equals(MathematicaSettings.getInstance());
76+
if (mySettingsUI != null) {
77+
return !mySettingsUI.getSettings().equals(MathematicaSettings.getInstance());
7878
}
7979
return false;
8080
}

src/de/halirutan/mathematica/settings/MathematicaSettingsPanel.form

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/de/halirutan/mathematica/settings/MathematicaSettingsPanel.java

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)