清除eclipse插件控制台时出错

时间:2016-04-05 06:36:49

标签: java eclipse-plugin

我正在尝试清除eclipse插件项目控制台,但每当我运行我的代码清除时,整个项目都会挂起。请帮我找到我做错的地方。 以下是创建控制台的代码

@Override
public void openConsole() {
    socConsole = createConsole1();
}

private IOConsole createConsole1() {

    // creating a console with title Welcome to SoC Console.
    IOConsole ioconsole = new IOConsole("Welcome to SoC Console.", null);
    // adding created console to console list in console view.
    ConsolePlugin.getDefault().getConsoleManager()
            .addConsoles(new IConsole[] { ioconsole });
    ConsolePlugin.getDefault().getConsoleManager()
            .showConsoleView(ioconsole);

    OPstream = ioconsole.newOutputStream();
    System.setOut(new PrintStream(OPstream));
    System.setErr(new PrintStream(OPstream));
    //System.out.print("SoC>");
    System.out.print("%");
    /*System.out.print("tcl%");
    TclConsole.tclShell=true;*/
    IOConsoleInputStream IPstream = ioconsole.getInputStream();
    System.setIn(IPstream);
    return ioconsole;
}

以及我如何清除控制台

ConsoleFactory.socConsole.clearConsole();

0 个答案:

没有答案