use of com.intellij.openapi.ui.SimpleToolWindowPanel in project flutter-intellij by flutter.
the class FlutterConsole method create.
@NotNull
static FlutterConsole create(@NotNull Project project, @Nullable Module module) {
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
builder.setViewer(true);
if (module != null) {
builder.addFilter(new FlutterConsoleFilter(module));
}
final ConsoleView view = builder.getConsole();
final SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
panel.setContent(view.getComponent());
final String title = module != null ? "[" + module.getName() + "] Flutter" : "Flutter";
final Content content = ContentFactory.SERVICE.getInstance().createContent(panel.getComponent(), title, true);
Disposer.register(content, view);
return new FlutterConsole(view, content, project, module);
}
use of com.intellij.openapi.ui.SimpleToolWindowPanel in project freeline by alibaba.
the class FreelineTerminal method getTerminalWidget.
public JBTabbedTerminalWidget getTerminalWidget(ToolWindow window) {
window.show(null);
if (myTerminalWidget == null) {
JComponent parentPanel = window.getContentManager().getContents()[0].getComponent();
if (parentPanel instanceof SimpleToolWindowPanel) {
SimpleToolWindowPanel panel = (SimpleToolWindowPanel) parentPanel;
JPanel jPanel = (JPanel) panel.getComponents()[0];
myTerminalWidget = (JBTabbedTerminalWidget) jPanel.getComponents()[0];
} else {
NotificationUtils.infoNotification("Wait for Freeline to initialize");
}
}
return myTerminalWidget;
}
Aggregations