Examples of ToolWindow


Examples of com.intellij.openapi.wm.ToolWindow

      }

      isPluginAccessible(project);

      // check if tool window is registered
      final ToolWindow toolWindow = isToolWindowRegistered(project);
      if (toolWindow == null) {
        presentation.setEnabled(false);
        presentation.setVisible(false);

        return;
      }

      registerEventListener(project);

      final VirtualFile[] selectedSourceFiles = IdeaUtilImpl.getVirtualFiles(_dataContext);

      if (!_running) {
        _enabled = selectedSourceFiles != null &&
            selectedSourceFiles.length > 0 &&
            selectedSourceFiles[0].isValid() &&
            IdeaUtilImpl.isValidFileType(selectedSourceFiles[0].getFileType()) &&
            IdeaUtilImpl.getCurrentClass(_dataContext) != null;
      }

      presentation.setEnabled(toolWindow.isAvailable() && isEnabled());
      presentation.setVisible(true);

    } catch (final Throwable e) {
      final FindBugsPluginException processed = FindBugsPluginImpl.processError("Action update failed", e);
      LOGGER.error("Action update failed", processed);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

      }

      isPluginAccessible(project);

      // check if tool window is registered
      final ToolWindow toolWindow = isToolWindowRegistered(project);
      if (toolWindow == null) {
        presentation.setEnabled(false);
        presentation.setVisible(false);

        return;
      }

      registerEventListener(project);

      _enabled = !isRunning();

      presentation.setEnabled(toolWindow.isAvailable() && isEnabled());
      presentation.setVisible(true);

    } catch (final Throwable e) {
      final FindBugsPluginException processed = FindBugsPluginImpl.processError("Action update failed", e);
      LOGGER.error("Action update failed", processed);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

      }

      isPluginAccessible(project);

      // check if tool window is registered
      final ToolWindow toolWindow = isToolWindowRegistered(project);
      if (toolWindow == null) {
        presentation.setEnabled(false);
        presentation.setVisible(false);

        return;
      }

      registerEventListener(project);

      final VirtualFile[] selectedSourceFiles = IdeaUtilImpl.getVirtualFiles(_dataContext);

      // enable ?
      if (!_running) {
        _enabled = selectedSourceFiles != null && selectedSourceFiles.length == 1 &&
            (IdeaUtilImpl.isValidFileType(selectedSourceFiles[0].getFileType()) || selectedSourceFiles[0].isDirectory()) &&
            null != getPackagePath(selectedSourceFiles, project);
      }
      presentation.setEnabled(toolWindow.isAvailable() && isEnabled());
      presentation.setVisible(true);

    } catch (final Throwable e) {
      final FindBugsPluginException processed = FindBugsPluginImpl.processError("Action update failed", e);
      LOGGER.error("Action update failed", processed);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

    final FindBugsPlugin findBugsPlugin = project.getComponent(FindBugsPlugin.class);
    if (findBugsPlugin == null) {
      throw new IllegalStateException("Couldn't get findbugs plugin");
    }

    final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(getPluginInterface(project).getInternalToolWindowId());
    toolWindow.hide(null);

  }
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

    return FindBugsPluginConstants.FINDBUGS_EXTERNAL_HELP_URI;
  }


  public ToolWindowPanel getToolWindowPanel() {
    final ToolWindow toolWindow = IdeaUtilImpl.getToolWindowById(FindBugsPluginConstants.TOOL_WINDOW_ID, _project);
    final Content content = toolWindow.getContentManager().getContent(0);
    if (content != null) {
      return (ToolWindowPanel) content.getComponent();
    }
    return null;
  }
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

    final CompileScope compileScope = compileContext.getCompileScope();
    final VirtualFile[] affectedFiles = compileScope.getFiles(StdFileTypes.JAVA, true);

    if (Boolean.valueOf(preferences.getProperty(FindBugsPreferences.TOOLWINDOW_TO_FRONT))) {
      final ToolWindow toolWindow = IdeaUtilImpl.getToolWindowById(findBugsPlugin.getInternalToolWindowId(), project);
      IdeaUtilImpl.activateToolWindow(toolWindow);
    }

    final FindBugsWorker worker = new FindBugsWorker(project, true);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

          final Object root = getModel().getRoot();
          final Component rendererComponent = getCellRenderer().getTreeCellRendererComponent(BugTree.this, root, true, true, false, 0, true);
          final int width = rendererComponent.getPreferredSize().width;
          final int mouseX = e.getX();
          if (mouseX <= width + 10 && mouseX >= width - 40) {
            final ToolWindow toolWindow = ToolWindowManager.getInstance(_project).getToolWindow(IdeaUtilImpl.getPluginComponent(_project).getInternalToolWindowId());
            final Content content = toolWindow.getContentManager().getContent(0);
            if (content != null) {
              final ToolWindowPanel panel = (ToolWindowPanel) content.getComponent();
              final DialogBuilder dialog = AnalysisRunDetailsDialog.create(panel.getProject(), panel.getBugTreePanel().getGroupModel().getBugCount(), panel.getBugCollection().getProjectStats(), panel.getBugsProject());
              dialog.showModal(false);
            }
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

    final FindBugsPlugin findBugsPlugin = project.getComponent(FindBugsPlugin.class);
    if (findBugsPlugin == null) {
      throw new IllegalStateException("Couldn't get findbugs plugin");
    }

    final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(getPluginInterface(project).getInternalToolWindowId());

    // toggle value
    final Content content = toolWindow.getContentManager().getContent(0);
    if (content != null) {
      final ToolWindowPanel panel = (ToolWindowPanel) content.getComponent();
      final FindBugsPreferences preferences = getPluginInterface(project).getPreferences();
      final boolean isEnabled = panel.getBugTreePanel().isScrollToSource();
      final boolean enabled = preferences.getBooleanProperty(FindBugsPreferences.TOOLWINDOW_SCROLL_TO_SOURCE, isEnabled);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

    final FindBugsPlugin findBugsPlugin = project.getComponent(FindBugsPlugin.class);
    if (findBugsPlugin == null) {
      throw new IllegalStateException("Couldn't get findbugs plugin");
    }

    final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(getPluginInterface(project).getInternalToolWindowId());

    // toggle value
    final Content content = toolWindow.getContentManager().getContent(0);
    if (content != null) {
      final ToolWindowPanel panel = (ToolWindowPanel) content.getComponent();
      final FindBugsPreferences preferences = getPluginInterface(project).getPreferences();
      preferences.setProperty(FindBugsPreferences.TOOLWINDOW_SCROLL_TO_SOURCE, selected);
      panel.getBugTreePanel().setScrollToSource(selected);
View Full Code Here

Examples of com.intellij.openapi.wm.ToolWindow

      }

      isPluginAccessible(project);

      // check if tool window is registered
      final ToolWindow toolWindow = isToolWindowRegistered(project);
      if (toolWindow == null) {
        presentation.setEnabled(false);
        presentation.setVisible(false);

        return;
      }

      registerEventListener(project);

      // enable ?
      final List<VirtualFile> modifiedFiles = IdeaUtilImpl.getAllModifiedFiles(_dataContext);
      if (!_running && !modifiedFiles.isEmpty()) {
        for (final VirtualFile virtualFile : modifiedFiles) {
          if (IdeaUtilImpl.isValidFileType(virtualFile.getFileType())) {
            _enabled = true;
            break;
          } else {
            _enabled = false;
          }
        }
      } else {
        _enabled = false;
      }

      presentation.setEnabled(toolWindow.isAvailable() && isEnabled());
      presentation.setVisible(true);

    } catch (final Throwable e) {
      final FindBugsPluginException processed = FindBugsPluginImpl.processError("Action update failed", e);
      LOGGER.error("Action update failed", processed);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.