use of com.intellij.ui.content.Content in project android by JetBrains.
the class BuildVariantsToolWindowFixture method getTestArtifactComboBox.
@NotNull
private JComboBoxFixture getTestArtifactComboBox() {
activate();
Content[] contents = myToolWindow.getContentManager().getContents();
assertThat(contents.length).isAtLeast(1);
Content content = contents[0];
JComboBox comboBox = myRobot.finder().findByType(content.getComponent(), JComboBox.class, true);
return new JComboBoxFixture(myRobot, comboBox);
}
use of com.intellij.ui.content.Content in project intellij-plugins by JetBrains.
the class DartPubActionBase method showPubOutputConsole.
private static void showPubOutputConsole(@NotNull final Module module, @NotNull final GeneralCommandLine command, @NotNull final OSProcessHandler processHandler, @NotNull final VirtualFile pubspecYamlFile, @NotNull final String actionTitle) {
final ConsoleView console;
PubToolWindowContentInfo info = findExistingInfoForCommand(module.getProject(), command);
if (info != null) {
// rerunning the same pub command in the same tool window tab (corresponding tool window action invoked)
console = info.console;
console.clear();
} else {
console = createConsole(module.getProject(), pubspecYamlFile);
info = new PubToolWindowContentInfo(module, pubspecYamlFile, command, actionTitle, console);
final ActionToolbar actionToolbar = createToolWindowActionsBar(info);
final SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
toolWindowPanel.setContent(console.getComponent());
toolWindowPanel.setToolbar(actionToolbar.getComponent());
final Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel.getComponent(), actionTitle, true);
content.putUserData(PUB_TOOL_WINDOW_CONTENT_INFO_KEY, info);
Disposer.register(content, console);
final ContentManager contentManager = MessageView.SERVICE.getInstance(module.getProject()).getContentManager();
removeOldTabs(contentManager);
contentManager.addContent(content);
contentManager.setSelectedContent(content);
final ToolWindow toolWindow = ToolWindowManager.getInstance(module.getProject()).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
toolWindow.activate(null, true);
}
info.rerunPubCommandAction.setProcessHandler(processHandler);
info.stopProcessAction.setProcessHandler(processHandler);
processHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(final ProcessEvent event) {
console.print(IdeBundle.message("finished.with.exit.code.text.message", event.getExitCode()), ConsoleViewContentType.SYSTEM_OUTPUT);
}
});
console.print(DartBundle.message("working.dir.0", FileUtil.toSystemDependentName(pubspecYamlFile.getParent().getPath())) + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
console.attachToProcess(processHandler);
processHandler.startNotify();
}
use of com.intellij.ui.content.Content in project android by JetBrains.
the class BuildVariantView method createToolWindowContent.
/**
* Creates the contents of the "Build Variants" tool window.
*
* @param toolWindow the tool window whose contents will be created.
*/
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(myToolWindowPanel, "", false);
toolWindow.getContentManager().addContent(content);
updateContents();
}
use of com.intellij.ui.content.Content in project android by JetBrains.
the class AndroidDebuggerImplBase method activateDebugSessionWindow.
protected static boolean activateDebugSessionWindow(@NotNull Project project, @NotNull RunContentDescriptor descriptor) {
final ProcessHandler processHandler = descriptor.getProcessHandler();
final Content content = descriptor.getAttachedContent();
if (processHandler == null || content == null) {
return false;
}
final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
if (processHandler.isProcessTerminated()) {
ExecutionManager.getInstance(project).getContentManager().removeRunContent(executor, descriptor);
return false;
}
content.getManager().setSelectedContent(content);
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(executor.getToolWindowId());
window.activate(null, false, true);
return true;
}
use of com.intellij.ui.content.Content in project android by JetBrains.
the class CapturesToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
CapturesToolWindow view = new CapturesToolWindow(project);
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(view.getComponent(), "", false);
toolWindow.getContentManager().addContent(content);
}
Aggregations