當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolWindow.setAvailable方法代碼示例

本文整理匯總了Java中com.intellij.openapi.wm.ToolWindow.setAvailable方法的典型用法代碼示例。如果您正苦於以下問題:Java ToolWindow.setAvailable方法的具體用法?Java ToolWindow.setAvailable怎麽用?Java ToolWindow.setAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.wm.ToolWindow的用法示例。


在下文中一共展示了ToolWindow.setAvailable方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateWindowAvailable

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private void updateWindowAvailable(boolean showIfAvailable) {
  boolean available = ServersToolWindowFactory.isAvailable(myProject);

  final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
  final ToolWindow toolWindow = toolWindowManager.getToolWindow(WINDOW_ID);

  if (toolWindow == null) {
    if (available) {
      toolWindowManager.invokeLater(new Runnable() {

        @Override
        public void run() {
          createToolWindow(myProject, toolWindowManager).show(null);
        }
      });
    }
    return;
  }

  boolean doShow = !toolWindow.isAvailable() && available;
  if (toolWindow.isAvailable() && !available) {
    toolWindow.hide(null);
  }
  toolWindow.setAvailable(available, null);
  if (showIfAvailable && doShow) {
    toolWindow.show(null);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:ServersToolWindowManager.java

示例2: createToolWindowContent

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
  toolWindow.setAvailable(true, null);
  toolWindow.setToHideOnEmptyContent(true);
  toolWindow.setTitle(myFramework.getDisplayName());

  MvcProjectViewPane view = new MvcProjectViewPane(project, this);
  view.setup((ToolWindowEx)toolWindow);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:MvcToolWindowDescriptor.java

示例3: projectOpened

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Override
public void projectOpened() {
  // removes the CMake tool window for blaze projects
  ToolWindowManager manager = ToolWindowManager.getInstance(myProject);
  ToolWindow tw = manager.getToolWindow(CMakeWorkspace.TOOLWINDOW_ID);
  if (tw != null) {
    tw.setAvailable(false, null);
  }
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:10,代碼來源:ClwbProjectSpecificInitializer.java

示例4: createToolWindowContent

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的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


注:本文中的com.intellij.openapi.wm.ToolWindow.setAvailable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。