document listener added

This commit is contained in:
Manindra Moharana
2013-08-18 13:51:27 +05:30
parent fdd42b4544
commit a5a9f1417b
3 changed files with 58 additions and 21 deletions

View File

@@ -161,6 +161,11 @@ public class DebugEditor extends JavaEditor implements ActionListener {
*/
protected JMenuItem showOutline;
/**
* Enable/Disable error logging
*/
protected JCheckBoxMenuItem writeErrorLog;
public DebugEditor(Base base, String path, EditorState state, Mode mode) {
super(base, path, state, mode);
@@ -313,10 +318,12 @@ public class DebugEditor extends JavaEditor implements ActionListener {
// Added temporarily to dump error log. TODO: Remove this later
public void internalCloseRunner(){
writeErrorsToFile();
if(enableErrorLogging) writeErrorsToFile();
super.internalCloseRunner();
}
protected boolean enableErrorLogging = false;
private void writeErrorsToFile(){
if (errorCheckerService.tempErrorLog.size() == 0)
return;
@@ -528,6 +535,17 @@ public class DebugEditor extends JavaEditor implements ActionListener {
showOutline.addActionListener(this);
debugMenu.add(showOutline);
writeErrorLog = new JCheckBoxMenuItem("Write Errors to Log");
writeErrorLog.setSelected(enableErrorLogging);
writeErrorLog.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
enableErrorLogging = !enableErrorLogging;
}
});
debugMenu.add(writeErrorLog);
return debugMenu;
}