Package edu.harvard.wcfia.yoshikoder

Source Code of edu.harvard.wcfia.yoshikoder.ShowConsoleAction

package edu.harvard.wcfia.yoshikoder;

import java.awt.event.ActionEvent;
import java.io.File;

import edu.harvard.wcfia.yoshikoder.ui.dialog.MessageDialog;
import edu.harvard.wcfia.yoshikoder.util.DialogUtil;
import edu.harvard.wcfia.yoshikoder.util.DialogWorker;
import edu.harvard.wcfia.yoshikoder.util.FileUtil;

public class ShowConsoleAction extends YoshikoderAction {

    File logFile;
   
    public ShowConsoleAction(Yoshikoder yk) {
        super(yk, ShowConsoleAction.class.getName());
        logFile = YKFS.getYKFS().getLogFile();
    }

    public void actionPerformed(ActionEvent e) {
        dworker = new DialogWorker(yoshikoder){
            protected void doWork() throws Exception {
                String messages = FileUtil.slurp(logFile);
                dia = new MessageDialog(yoshikoder, "Console", messages);
            }
            protected void onError() {
                DialogUtil.yelp(yoshikoder, "Failed to launch logging console", e);
            }
        };
        dworker.start();
    }

}
TOP

Related Classes of edu.harvard.wcfia.yoshikoder.ShowConsoleAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.