Skip to content

Commit 7780e45

Browse files
committed
Move incremental action logic further down
Soon, that logic will need more UI elements to be defined.
1 parent 4b09e42 commit 7780e45

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/main/java/org/scijava/ui/swing/script/TextEditorTab.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,6 @@ public void actionPerformed(final ActionEvent ae) {
192192
incremental = new JCheckBox("persistent");
193193
incremental.setEnabled(true);
194194
incremental.setSelected(false);
195-
incremental.addActionListener(ae -> {
196-
if (incremental.isSelected() && null == textEditor.getCurrentLanguage()) {
197-
incremental.setSelected(false);
198-
JOptionPane.showMessageDialog(TextEditorTab.this,
199-
"Select a language first!");
200-
return;
201-
}
202-
textEditor.setIncremental(incremental.isSelected());
203-
prompt_title.setText(incremental.isSelected() ? //
204-
"REPL: " + textEditor.getCurrentLanguage().getLanguageName() : "");
205-
prompt.setEnabled(incremental.isSelected());
206-
});
207195
bottom.add(incremental, bc);
208196

209197
bc.gridx = 4;
@@ -316,6 +304,19 @@ public void actionPerformed(ActionEvent a) {
316304
bc.gridwidth = 4;
317305
prompt_panel.add(prompt, bc);
318306

307+
incremental.addActionListener(ae -> {
308+
if (incremental.isSelected() && null == textEditor.getCurrentLanguage()) {
309+
incremental.setSelected(false);
310+
JOptionPane.showMessageDialog(TextEditorTab.this,
311+
"Select a language first!");
312+
return;
313+
}
314+
textEditor.setIncremental(incremental.isSelected());
315+
prompt_title.setText(incremental.isSelected() ? //
316+
"REPL: " + textEditor.getCurrentLanguage().getLanguageName() : "");
317+
prompt.setEnabled(incremental.isSelected());
318+
});
319+
319320
screenAndPromptSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, bottom, prompt_panel);
320321

321322
super.setLeftComponent(editorPane.wrappedInScrollbars());

0 commit comments

Comments
 (0)