本文整理汇总了Java中com.intellij.execution.ui.RunnerLayoutUi.addContent方法的典型用法代码示例。如果您正苦于以下问题:Java RunnerLayoutUi.addContent方法的具体用法?Java RunnerLayoutUi.addContent怎么用?Java RunnerLayoutUi.addContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ui.RunnerLayoutUi
的用法示例。
在下文中一共展示了RunnerLayoutUi.addContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initEduConsole
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
private static void initEduConsole(@NotNull final XDebugSession session,
@NotNull final RunnerLayoutUi ui) {
Project project = session.getProject();
final Sdk sdk = PythonSdkType.findPythonSdk(ModuleManager.getInstance(project).getModules()[0]);
final PythonDebugLanguageConsoleView view = new PythonDebugLanguageConsoleView(project, sdk);
final ProcessHandler processHandler = session.getDebugProcess().getProcessHandler();
view.attachToProcess(processHandler);
view.addMessageFilter(new PythonTracebackFilter(project));
view.addMessageFilter(new UrlFilter());
view.enableConsole(false);
Content eduConsole =
ui.createContent("EduConsole", view.getComponent(),
XDebuggerBundle.message("debugger.session.tab.console.content.name"),
AllIcons.Debugger.ToolConsole, view.getPreferredFocusableComponent());
eduConsole.setCloseable(false);
ui.addContent(eduConsole, 0, PlaceInGrid.right, false);
PyDebugProcess process = (PyDebugProcess)session.getDebugProcess();
PyDebugRunner.initDebugConsoleView(project, process, view, processHandler, session);
patchLeftToolbar(session, ui);
}
示例2: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
//Create runner UI layout
RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);
// Adding actions
DefaultActionGroup group = new DefaultActionGroup();
layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
Content console = layoutUi.createContent(GradleConsoleToolWindowFactory.ID, myConsoleView.getComponent(), "", null, null);
AnAction[] consoleActions = myConsoleView.createConsoleActions();
for (AnAction action : consoleActions) {
if (!shouldIgnoreAction(action)) {
group.add(action);
}
}
layoutUi.addContent(console, 0, PlaceInGrid.right, false);
JComponent layoutComponent = layoutUi.getComponent();
myConsolePanel.add(layoutComponent, BorderLayout.CENTER);
//noinspection ConstantConditions
Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
toolWindow.getContentManager().addContent(content);
}
示例3: setUpToolWindow
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
private Content setUpToolWindow() {
//Create runner UI layout
final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
final RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);
// Adding actions
DefaultActionGroup group = new DefaultActionGroup();
group.add(myKillAction);
group.addSeparator();
layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
final Content console = layoutUi.createContent(CONSOLE_ID, myConsole.getComponent(), "", null, null);
layoutUi.addContent(console, 0, PlaceInGrid.right, false);
final JComponent uiComponent = layoutUi.getComponent();
myPanel.add(uiComponent, BorderLayout.CENTER);
final ContentManager manager = myToolWindow.getContentManager();
final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
final Content content = contentFactory.createContent(uiComponent, null, true);
manager.addContent(content);
return content;
}
示例4: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
/**
* Creats the tool window content
* @param toolWindow
*/
public void createToolWindowContent(@NotNull ToolWindow toolWindow) {
//Create runner UI layout
RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(project);
RunnerLayoutUi layoutUi = factory.create("", "", "session", project);
// Adding actions
DefaultActionGroup group = new DefaultActionGroup();
layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
Content console = layoutUi.createContent(EmbeddedLinuxJVMToolWindowFactory.ID, consoleView.getComponent(), "", null, null);
AnAction[] consoleActions = consoleView.createConsoleActions();
for (AnAction action : consoleActions) {
if (!shouldIgnoreAction(action)) {
group.add(action);
}
}
layoutUi.addContent(console, 0, PlaceInGrid.right, false);
JComponent layoutComponent = layoutUi.getComponent();
myConsolePanel.add(layoutComponent, BorderLayout.CENTER);
Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
toolWindow.getContentManager().addContent(content);
}
示例5: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(
@NotNull final Project project, @NotNull ToolWindow toolWindow) {
toolWindow.setAvailable(true, null);
toolWindow.setToHideOnEmptyContent(true);
RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project);
Content consoleContent = createConsoleContent(runnerLayoutUi, project);
runnerLayoutUi.addContent(consoleContent, 0, PlaceInGrid.center, false);
runnerLayoutUi.getOptions().setLeftToolbar(
getLeftToolbarActions(project), ActionPlaces.UNKNOWN);
runnerLayoutUi.updateActionsNow();
final ContentManager contentManager = toolWindow.getContentManager();
Content content = contentManager.getFactory().createContent(
runnerLayoutUi.getComponent(), "", true);
contentManager.addContent(content);
updateBuckToolWindowTitle(project);
}
示例6: createTabLayouter
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@NotNull
@Override
public XDebugTabLayouter createTabLayouter()
{
return new XDebugTabLayouter()
{
@Override
public void registerAdditionalContent(@NotNull RunnerLayoutUi ui)
{
Content content = ui.createContent("ScriptListView", myScriptListPanel, "Scripts", JavaScriptIcons.JavaScript, null);
content.setCloseable(false);
ui.addContent(content);
}
};
}
示例7: addThreadDump
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
public static void addThreadDump(Project project, List<ThreadState> threads, final RunnerLayoutUi ui, DebuggerSession session) {
final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
consoleBuilder.filters(ExceptionFilters.getFilters(session.getSearchScope()));
final ConsoleView consoleView = consoleBuilder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
consoleView.allowHeavyFilters();
final ThreadDumpPanel panel = new ThreadDumpPanel(project, consoleView, toolbarActions, threads);
final String id = THREAD_DUMP_CONTENT_PREFIX + " #" + myCurrentThreadDumpId;
final Content content = ui.createContent(id, panel, id, null, null);
content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
content.setCloseable(true);
content.setDescription("Thread Dump");
ui.addContent(content);
ui.selectAndFocus(content, true, true);
myThreadDumpsCount++;
myCurrentThreadDumpId++;
Disposer.register(content, new Disposable() {
@Override
public void dispose() {
myThreadDumpsCount--;
if (myThreadDumpsCount == 0) {
myCurrentThreadDumpId = 1;
}
}
});
Disposer.register(content, consoleView);
ui.selectAndFocus(content, true, false);
if (threads.size() > 0) {
panel.selectStackFrame(0);
}
}
示例8: registerConsoleContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
/**
* Registers tab for the given {@code console}.
*
* @param console {@code ExecutionConsole} instance
* @param ui {@code RunnerLayoutUi} instance
* @return registered {@code Content} instance
*/
@NotNull
public Content registerConsoleContent(@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) {
Content content = ui.createContent(DebuggerContentInfo.CONSOLE_CONTENT, console.getComponent(),
XDebuggerBundle.message("debugger.session.tab.console.content.name"),
AllIcons.Debugger.Console,
console.getPreferredFocusableComponent());
content.setCloseable(false);
ui.addContent(content, 1, PlaceInGrid.bottom, false);
return content;
}
示例9: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
public void createToolWindowContent(ToolWindow toolWindow) {
// Create runner UI layout
RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(project);
RunnerLayoutUi layoutUi = factory.create("", "", "session", project);
Content console =
layoutUi.createContent(
BlazeConsoleToolWindowFactory.ID, consoleView.getComponent(), "", null, null);
console.setCloseable(false);
layoutUi.addContent(console, 0, PlaceInGrid.right, false);
// Adding actions
DefaultActionGroup group = new DefaultActionGroup();
layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
AnAction[] consoleActions = consoleView.createConsoleActions();
for (AnAction action : consoleActions) {
if (!shouldIgnoreAction(action)) {
group.add(action);
}
}
group.add(new StopAction());
JComponent layoutComponent = layoutUi.getComponent();
//noinspection ConstantConditions
Content content =
ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);
content.setCloseable(false);
toolWindow.getContentManager().addContent(content);
}
示例10: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(final Project project, ToolWindow toolWindow) {
toolWindow.setAvailable(true, null);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setIcon(BuckIcons.BUCK_TOOL_WINDOW_ICON);
RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project);
BuckSettingsProvider settingsProvider = BuckSettingsProvider.getInstance();
// Debug Console
if (settingsProvider.isShowDebugWindow()) {
Content consoleContent = createConsoleContent(runnerLayoutUi, project);
consoleContent.setCloseable(false);
consoleContent.setPinnable(false);
runnerLayoutUi.addContent(consoleContent, 0, PlaceInGrid.center, false);
}
// Build Tree Events
Content treeViewContent =
runnerLayoutUi.createContent(
BUILD_OUTPUT_PANEL, createBuildInfoPanel(project), "Build", null, null);
treeViewContent.setCloseable(false);
treeViewContent.setPinnable(false);
runnerLayoutUi.addContent(treeViewContent, 0, PlaceInGrid.center, false);
runnerLayoutUi
.getOptions()
.setLeftToolbar(getLeftToolbarActions(project), ActionPlaces.UNKNOWN);
runnerLayoutUi.updateActionsNow();
final ContentManager contentManager = toolWindow.getContentManager();
Content content =
contentManager.getFactory().createContent(runnerLayoutUi.getComponent(), "", true);
contentManager.addContent(content);
updateBuckToolWindowTitle(project);
}
示例11: registerConsoleContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
/**
* Registers tab for the given {@code console}.
*
* @param console {@code ExecutionConsole} instance
* @param ui {@code RunnerLayoutUi} instance
* @return registered {@code Content} instance
*/
@Nonnull
public Content registerConsoleContent(@Nonnull RunnerLayoutUi ui, @Nonnull ExecutionConsole console) {
Content content = ui.createContent(DebuggerContentInfo.CONSOLE_CONTENT, console.getComponent(),
XDebuggerBundle.message("debugger.session.tab.console.content.name"),
AllIcons.Debugger.Console,
console.getPreferredFocusableComponent());
content.setCloseable(false);
ui.addContent(content, 1, PlaceInGrid.bottom, false);
return content;
}
示例12: addThreadDump
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
public static void addThreadDump(Project project, List<ThreadState> threads, final RunnerLayoutUi ui, DebuggerSession session)
{
final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
consoleBuilder.filters(ExceptionFilters.getFilters(session.getSearchScope()));
final ConsoleView consoleView = consoleBuilder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
consoleView.allowHeavyFilters();
final ThreadDumpPanel panel = new ThreadDumpPanel(project, consoleView, toolbarActions, threads);
final String id = THREAD_DUMP_CONTENT_PREFIX + " #" + myCurrentThreadDumpId;
final Content content = ui.createContent(id, panel, id, null, null);
content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
content.setCloseable(true);
content.setDescription("Thread Dump");
ui.addContent(content);
ui.selectAndFocus(content, true, true);
myThreadDumpsCount++;
myCurrentThreadDumpId++;
Disposer.register(content, new Disposable()
{
@Override
public void dispose()
{
myThreadDumpsCount--;
if(myThreadDumpsCount == 0)
{
myCurrentThreadDumpId = 1;
}
}
});
Disposer.register(content, consoleView);
ui.selectAndFocus(content, true, false);
if(threads.size() > 0)
{
panel.selectStackFrame(0);
}
}
示例13: createToolWindowContent
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
final File adb = AndroidSdkUtils.getAdb(project);
ExecutionManager.getInstance(project).getContentManager();
RunnerLayoutUi layoutUi = RunnerLayoutUi.Factory.getInstance(project).create("LogViewer", TOOL_WINDOW_ID, "Logview Tools", project);
toolWindow.setIcon(LogviewerPluginIcons.TOOL_ICON);
toolWindow.setAvailable(true, null);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setTitle(TOOL_WINDOW_ID);
DeviceContext deviceContext = new DeviceContext();
Content logcatContent = createLogcatContent(layoutUi, project, deviceContext);
final LogView logcatView = logcatContent.getUserData(LOG_VIEW_KEY);
layoutUi.addContent(logcatContent, 0, PlaceInGrid.center, false);
final JBLoadingPanel loadingPanel = new JBLoadingPanel(new BorderLayout(), project);
loadingPanel.add(layoutUi.getComponent(), BorderLayout.CENTER);
final ContentManager contentManager = toolWindow.getContentManager();
Content c = contentManager.getFactory().createContent(loadingPanel, "", true);
c.putUserData(LOG_VIEW_KEY, logcatView);
contentManager.addContent(c);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
logcatView.activate();
}
}, project.getDisposed());
if (adb != null) {
loadingPanel.setLoadingText("Initializing ADB");
loadingPanel.startLoading();
ListenableFuture<AndroidDebugBridge> future = AdbService.getInstance().getDebugBridge(adb);
Futures.addCallback(future, new FutureCallback<AndroidDebugBridge>() {
@Override
public void onSuccess(@Nullable AndroidDebugBridge bridge) {
Logger.getInstance(LogviewFactory.class).info("Successfully obtained debug bridge");
loadingPanel.stopLoading();
}
@Override
public void onFailure(@NotNull Throwable t) {
loadingPanel.stopLoading();
Logger.getInstance(LogviewFactory.class).info("Unable to obtain debug bridge", t);
String msg;
if (t.getMessage() != null) {
msg = t.getMessage();
} else {
msg = String.format("Unable to establish a connection to adb",
ApplicationNamesInfo.getInstance().getProductName(), adb.getAbsolutePath());
}
Messages.showErrorDialog(msg, "ADB Connection Error");
}
}, EdtExecutor.INSTANCE);
} else {
logcatView.showHint("No adb connection!.\n\nDrag and drop log files to view them.");
}
}
示例14: createTabLayouter
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@Override
@NotNull
public XDebugTabLayouter createTabLayouter() {
final CloudDebugProcessHandler handler = (CloudDebugProcessHandler) getProcessHandler();
return new XDebugTabLayouter() {
@Override
public void registerAdditionalContent(@NotNull RunnerLayoutUi layout) {
layout.removeContent(layout.findContent(DebuggerContentInfo.WATCHES_CONTENT), false);
// remove console since the cloud debugger doesn't use it
// https://github.com/GoogleCloudPlatform/gcloud-intellij/issues/141
Content consoleContent = layout.findContent(DebuggerContentInfo.CONSOLE_CONTENT);
if (consoleContent != null) {
layout.removeContent(consoleContent, false);
}
Content frameContent = layout.findContent(DebuggerContentInfo.FRAME_CONTENT);
if (frameContent != null) {
layout.removeContent(frameContent, false);
layout.addContent(frameContent, 0, PlaceInGrid.center, false);
}
Content variablesContent = layout.findContent(DebuggerContentInfo.VARIABLES_CONTENT);
if (variablesContent != null) {
layout.removeContent(variablesContent, false);
layout.addContent(variablesContent, 0, PlaceInGrid.right, false);
}
CloudDebugHistoricalSnapshots timeline = new CloudDebugHistoricalSnapshots(handler);
timeline.onBreakpointListChanged(getProcessState());
Content snapshots =
layout.createContent(
timeline.getTabTitle(),
(ComponentWithActions) timeline,
timeline.getTabTitle(),
GoogleCloudToolsIcons.STACKDRIVER_DEBUGGER,
null);
layout.addContent(snapshots, 0, PlaceInGrid.left, false);
layout
.getDefaults()
.initFocusContent(
timeline.getTabTitle(),
LayoutViewOptions.STARTUP,
new LayoutAttractionPolicy.FocusOnce(false));
}
};
}
示例15: startUploadingProcess
import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
private void startUploadingProcess() {
final Process process;
final GeneralCommandLine commandLine;
try {
JavaParameters parameters = new JavaParameters();
parameters.configureByModule(myAppEngineFacet.getModule(), JavaParameters.JDK_ONLY);
parameters.setMainClass("com.google.appengine.tools.admin.AppCfg");
parameters.getClassPath().add(mySdk.getToolsApiJarFile().getAbsolutePath());
final List<KeyValue<String,String>> list = HttpConfigurable.getJvmPropertiesList(false, null);
if (! list.isEmpty()) {
final ParametersList parametersList = parameters.getVMParametersList();
for (KeyValue<String, String> value : list) {
parametersList.defineProperty(value.getKey(), value.getValue());
}
}
final ParametersList programParameters = parameters.getProgramParametersList();
programParameters.add("--email=" + myEmail);
programParameters.add("update");
programParameters.add(FileUtil.toSystemDependentName(myArtifact.getOutputPath()));
commandLine = CommandLineBuilder.createFromJavaParameters(parameters);
process = commandLine.createProcess();
}
catch (ExecutionException e) {
Messages.showErrorDialog(myProject, "Cannot start uploading: " + e.getMessage(), CommonBundle.getErrorTitle());
return;
}
final Executor executor = DefaultRunExecutor.getRunExecutorInstance();
final ConsoleView console = TextConsoleBuilderFactory.getInstance().createBuilder(myProject).getConsole();
final RunnerLayoutUi ui = RunnerLayoutUi.Factory.getInstance(myProject).create("Upload", "Upload Application", "Upload Application", myProject);
final DefaultActionGroup group = new DefaultActionGroup();
ui.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
ui.addContent(ui.createContent("upload", console.getComponent(), "Upload Application", null, console.getPreferredFocusableComponent()));
final ProcessHandler processHandler = new OSProcessHandler(process, commandLine.getCommandLineString());
processHandler.addProcessListener(new MyProcessListener(processHandler, console));
console.attachToProcess(processHandler);
final RunContentDescriptor contentDescriptor = new RunContentDescriptor(console, processHandler, ui.getComponent(), "Upload Application");
group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM));
group.add(new CloseAction(executor, contentDescriptor, myProject));
ExecutionManager.getInstance(myProject).getContentManager().showRunContent(executor, contentDescriptor);
processHandler.startNotify();
}