当前位置: 首页>>代码示例>>Java>>正文


Java Content.putUserData方法代码示例

本文整理汇总了Java中com.intellij.ui.content.Content.putUserData方法的典型用法代码示例。如果您正苦于以下问题:Java Content.putUserData方法的具体用法?Java Content.putUserData怎么用?Java Content.putUserData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.content.Content的用法示例。


在下文中一共展示了Content.putUserData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createContent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Override
@NotNull
public Content createContent(@NotNull final String contentId, @NotNull final ComponentWithActions withActions, @NotNull final String displayName,
                             @Nullable final Icon icon,
                             @Nullable final JComponent toFocus) {
  final Content content = getContentFactory().createContent(withActions.getComponent(), displayName, false);
  content.putUserData(CONTENT_TYPE, contentId);
  content.putUserData(ViewImpl.ID, contentId);
  content.setIcon(icon);
  if (toFocus != null) {
    content.setPreferredFocusableComponent(toFocus);
  }

  if (!withActions.isContentBuiltIn()) {
    content.setSearchComponent(withActions.getSearchComponent());
    content.setActions(withActions.getToolbarActions(), withActions.getToolbarPlace(), withActions.getToolbarContextComponent());
  }

  return content;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:RunnerLayoutUiImpl.java

示例2: createToolWindowContent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {

    final ToolWindowPanel toolWindowPanel = new ToolWindowPanel(project);

    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(toolWindowPanel, project.getName(), false);
    content.setIcon(Icons.LIVINGDOC);
    content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);
    content.setCloseable(true);
    toolWindow.getContentManager().addContent(content);
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:13,代码来源:ToolWindowFactoryImpl.java

示例3: addThreadDump

import com.intellij.ui.content.Content; //导入方法依赖的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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:DebuggerUtilsEx.java

示例4: addContent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
void addContent(@NotNull UsageViewImpl usageView, @NotNull UsageViewPresentation presentation) {
  Content content = com.intellij.usageView.UsageViewManager.getInstance(myProject).addContent(
    presentation.getTabText(),
    presentation.getTabName(),
    presentation.getToolwindowTitle(),
    true,
    usageView.getComponent(),
    presentation.isOpenInNewTab(),
    true
  );
  usageView.setContent(content);
  content.putUserData(USAGE_VIEW_KEY, usageView);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:UsageViewManagerImpl.java

示例5: getOrCreateContentId

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
@NotNull
private static String getOrCreateContentId(@NotNull Content content) {
  @NonNls String id = content.getUserData(ViewImpl.ID);
  if (id == null) {
    id = "UnknownView-" + content.getDisplayName();
    content.putUserData(ViewImpl.ID, id);
  }
  return id;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:RunnerLayout.java

示例6: resetContent

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private static void resetContent(RunContentDescriptor contentDescriptor, SimpleToolWindowPanel panel, Content content) {
  RunContentDescriptor oldDescriptor = content.getDisposer() instanceof RunContentDescriptor ? (RunContentDescriptor)content.getDisposer() : null;
  if (oldDescriptor != null) Disposer.dispose(oldDescriptor);

  panel.setContent(contentDescriptor.getComponent());

  content.setComponent(panel);
  content.setDisposer(contentDescriptor);
  content.setPreferredFocusableComponent(contentDescriptor.getComponent());

  content.putUserData(CONTENT_DESCRIPTOR, contentDescriptor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PythonConsoleToolWindow.java

示例7: createToolWindowContent

import com.intellij.ui.content.Content; //导入方法依赖的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.");
    }
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:66,代码来源:LogviewFactory.java

示例8: updateContentWithInfo

import com.intellij.ui.content.Content; //导入方法依赖的package包/类
private static void updateContentWithInfo(Content content, PreviewInfo info) {
  content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);
  content.putUserData(INFO_KEY, info);
  content.setIcon(info.getIcon());
  content.setPopupIcon(info.getIcon());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:PreviewManagerImpl.java


注:本文中的com.intellij.ui.content.Content.putUserData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。