disable editor when no source code is showing

This commit is contained in:
Fredrik Osterlind 2012-03-28 14:53:45 +02:00
parent e3a12703da
commit 173f512f6c

View file

@ -256,7 +256,8 @@ public class CodeUI extends JPanel {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
displayedFile = null; displayedFile = null;
codeEditor.setText(null); codeEditor.setText("[no source displayed]");
codeEditor.setEnabled(false);
codeEditorLines.clear(); codeEditorLines.clear();
displayLine(-1, markCurrent); displayLine(-1, markCurrent);
} }
@ -277,6 +278,7 @@ public class CodeUI extends JPanel {
displayNoCode(markCurrent); displayNoCode(markCurrent);
return; return;
} }
codeEditor.setEnabled(true);
String[] lines = data.split("\n"); String[] lines = data.split("\n");
logger.info("Opening " + codeFile + " (" + lines.length + " lines)"); logger.info("Opening " + codeFile + " (" + lines.length + " lines)");