Skip to content

Commit 61d6fb9

Browse files
committed
Disable toolkit button group in SettingsDialog
1 parent 023a9e0 commit 61d6fb9

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

dev-assist/src/main/java/de/fraunhofer/iem/devassist/analysis/SwanBackgroundTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public void run(@NotNull ProgressIndicator indicator) {
4343

4444
indicator.setText("Configuring SWAN");
4545
SwanOptions options = new CliRunner().initializeOptions();
46-
4746
options.setTestDataDir(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.SOURCE_DIRECTORY)));
4847
options.setOutputDir(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.OUTPUT_DIRECTORY)));
49-
options.setToolkit(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.TOOLKIT)).toLowerCase());
48+
options.setToolkit("meka");
49+
options.setFeatureSet(Collections.singletonList("code"));
5050
options.setSrmClasses(List.of("all"));
5151
options.setPhase("predict");
5252
options.setTrainDataDir("");

dev-assist/src/main/java/de/fraunhofer/iem/devassist/ui/dialog/SettingsDialog.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ public SettingsDialog(Project project, boolean modal) {
6767
super(project, modal);
6868
trainingPathCheckbox.setVisible(false);
6969
trainingPanel.setVisible(false);
70+
toolkitPanel.setVisible(false);
7071
this.project = project;
7172
resourceBundle = ResourceBundle.getBundle("dialog_messages");
7273
setTitle(resourceBundle.getString("SettingsDialog.Title"));
7374

74-
toolkitButtonGroup = new ButtonGroup();
7575
mekaRadioButton.setActionCommand("meka");
76-
toolkitButtonGroup.add(mekaRadioButton);
7776
wekaRadioButton.setActionCommand("weka");
77+
78+
toolkitButtonGroup = new ButtonGroup();
79+
toolkitButtonGroup.add(mekaRadioButton);
7880
toolkitButtonGroup.add(wekaRadioButton);
7981

8082
config = new Properties();
@@ -206,25 +208,24 @@ protected void doOKAction() {
206208
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
207209
.createBalloon()
208210
.show(JBPopupFactory.getInstance().guessBestPopupLocation(sourceDirTextbox), Balloon.Position.below);
209-
} else if (outputDir.getText().isEmpty()){
211+
} else if (outputDir.getText().isEmpty()) {
210212
JBPopupFactory.getInstance()
211213
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
212214
.createBalloon()
213215
.show(JBPopupFactory.getInstance().guessBestPopupLocation(outputDir), Balloon.Position.below);
214-
} else if (trainingPathCheckbox.isSelected() && trainingTextbox.getText().isEmpty()) {
215-
216-
JBPopupFactory.getInstance()
217-
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
218-
.createBalloon()
219-
.show(JBPopupFactory.getInstance().guessBestPopupLocation(trainingPathCheckbox), Balloon.Position.below);
220-
} else {
216+
} else if (trainingPathCheckbox.isSelected() && trainingTextbox.getText().isEmpty()) {
221217

222-
setParameters();
223-
//Notification analysisCompleted = new Notification(Constants.PLUGIN_GROUP_DISPLAY_ID, "Starting Analysis", "Analysis completed", NotificationType.INFORMATION);
224-
//analysisCompleted.notify();
218+
JBPopupFactory.getInstance()
219+
.createHtmlTextBalloonBuilder(resourceBundle.getString("Messages.Error.PathNotFound"), MessageType.ERROR, null)
220+
.createBalloon()
221+
.show(JBPopupFactory.getInstance().guessBestPopupLocation(trainingPathCheckbox), Balloon.Position.below);
222+
} else {
223+
setParameters();
224+
//Notification analysisCompleted = new Notification(Constants.PLUGIN_GROUP_DISPLAY_ID, "Starting Analysis", "Analysis completed", NotificationType.INFORMATION);
225+
//analysisCompleted.notify();
226+
}
225227
}
226228
}
227-
}
228229

229230
private void setParameters() {
230231

0 commit comments

Comments
 (0)