我已经为IntelliJ创建了一个插件,并且正在使用控制台视图来打印语句。我需要在迭代几个列表项之后创建一个表。如何在Swing中创建表并在ConsoleView中显示?
我写了一个扩展AbstractProjectComponent
的类。
public class TestConsole extends AbstractProjectComponent {
private final ConsoleView consoleView;
public TestConsole(Project project) {
super(project);
consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
}
@Override
public void projectClosed() {
Disposer.dispose(consoleView);
}
public void debug(String msg) {
getConsoleView().print(msg + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
}
public boolean debugEnabled() {
return settings.isVerboseEnabled();
}
public void info(String msg) {
getConsoleView().print(msg + "\n", ConsoleViewContentType.USER_INPUT);
}
public void clear() {
getConsoleView().clear();
}
public ConsoleView getConsoleView() {
return this.consoleView;
}
}
但是ConsoleViewContentType
只有三种类型,我无法确定如何创建秋千表并通过上面编写的info
方法显示它。