adding option for disabling completions, fixes #10

This commit is contained in:
Manindra Moharana
2013-08-25 18:36:37 +05:30
parent d0d3648c2d
commit 285f81db65
3 changed files with 21 additions and 1 deletions

View File

@@ -166,6 +166,11 @@ public class DebugEditor extends JavaEditor implements ActionListener {
*/
protected JCheckBoxMenuItem writeErrorLog;
/**
* Enable/Disable code completion
*/
protected JCheckBoxMenuItem completionsEnabled;
public DebugEditor(Base base, String path, EditorState state, Mode mode) {
super(base, path, state, mode);
@@ -521,6 +526,17 @@ public class DebugEditor extends JavaEditor implements ActionListener {
});
debugMenu.add(showWarnings);
completionsEnabled = new JCheckBoxMenuItem("Code Completion Enabled");
completionsEnabled.setSelected(true);
completionsEnabled.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
errorCheckerService.getASTGenerator().predictionsEnabled
.set(((JCheckBoxMenuItem) e.getSource()).isSelected());
}
});
debugMenu.add(completionsEnabled);
debugMessagesEnabled = new JCheckBoxMenuItem("Show Debug Messages");
debugMessagesEnabled.setSelected(ExperimentalMode.DEBUG);
debugMessagesEnabled.addActionListener(new ActionListener() {