Examples of VcsContext


Examples of com.intellij.openapi.vcs.actions.VcsContext

    }
  }

  public boolean isSelected(AnActionEvent e)
  {
    VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
    Editor editor = context.getEditor();
    if (editor == null)
    {
      return false;
    }
View Full Code Here

Examples of com.intellij.openapi.vcs.actions.VcsContext

    return annotations != null && !annotations.isEmpty();
  }

  public void setSelected(AnActionEvent e, boolean state)
  {
    VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
    Editor editor = context.getEditor();
    if (!state)
    {
      if (editor != null)
      {
        editor.getGutter().closeAllAnnotations();
      }
    }
    else
    {
      if (editor == null)
      {
        VirtualFile selectedFile = context.getSelectedFile();
        if (selectedFile == null)
        {
          return;
        }

        FileEditor[] fileEditors = FileEditorManager.getInstance(context.getProject()).openFile(selectedFile, false);
        for (FileEditor fileEditor : fileEditors)
        {
          if (fileEditor instanceof TextEditor)
          {
            editor = ((TextEditor) fileEditor).getEditor();
          }
        }
      }

      LOGGER.assertTrue(editor != null);

      doAnnotate(editor, context.getProject());
    }
  }
View Full Code Here

Examples of com.intellij.openapi.vcs.actions.VcsContext

    }
  }

  public boolean isSelected(AnActionEvent e)
  {
    VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
    Editor editor = context.getEditor();
    if (editor == null)
    {
      return false;
    }
View Full Code Here

Examples of com.intellij.openapi.vcs.actions.VcsContext

    return annotations != null && !annotations.isEmpty();
  }

  public void setSelected(AnActionEvent e, boolean state)
  {
    VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
    Editor editor = context.getEditor();
    if (!state)
    {
      if (editor != null)
      {
        editor.getGutter().closeAllAnnotations();
      }
    }
    else
    {
      if (editor == null)
      {
        VirtualFile selectedFile = context.getSelectedFile();
        FileEditor[] fileEditors = FileEditorManager.getInstance(context.getProject()).openFile(selectedFile, false);
        for (FileEditor fileEditor : fileEditors)
        {
          if (fileEditor instanceof TextEditor)
          {
            editor = ((TextEditor) fileEditor).getEditor();
          }
        }
      }

      LOGGER.assertTrue(editor != null);

      doAnnotate(editor, context.getProject());

    }
  }
View Full Code Here

Examples of org.netbeans.modules.versioning.spi.VCSContext

            for (int i = 0; i < projects.length; i++) {
                AbstractNode node = new AbstractNode(new Children.Array(), projects[i].getLookup());
                allNodes.add(node);
            }

            final VCSContext ctx = VCSContext.forNodes(allNodes.toArray(new Node[allNodes.size()]));
            final String title;
            if (projects.length == 1) {
                Project project = projects[0];
                ProjectInformation pinfo = ProjectUtils.getInformation(project);
                title = pinfo.getDisplayName();
View Full Code Here

Examples of org.netbeans.modules.versioning.spi.VCSContext

        }
        return status;
    }

    public void performAction(ActionEvent e) {
        final VCSContext ctx = context;
        RequestProcessor rp = Git.getInstance().getRequestProcessor();
        GitProgressSupport support = new GitProgressSupport() {

            public void perform() {
                GitModuleConfig config = GitModuleConfig.getDefault();
                int status = getActionStatus(ctx);
                Set<File> files = ctx.getRootFiles();
                List<String> paths = new ArrayList<String>(files.size());
                for (File file : files) {
                    paths.add(file.getAbsolutePath());
                }
                if (isCanceled()) {
View Full Code Here

Examples of org.netbeans.modules.versioning.spi.VCSContext

     * @param includingFileStatus if any activated file does not have this CVS status, an empty array is returned
     * @param includingFolderStatus if any activated folder does not have this CVS status, an empty array is returned
     * @return File [] array of activated files, or an empty array if any of examined files/folders does not have given status
     */
    public static VCSContext getCurrentContext(Node[] nodes, int includingFileStatus, int includingFolderStatus) {
        VCSContext context = getCurrentContext(nodes);
        StatusCache cache = Git.getInstance().getStatusCache();
        for (File file : context.getRootFiles()) {
            StatusInfo fi = cache.getStatus(file);
            if (file.isDirectory()) {
                if ((fi.getStatus() & includingFolderStatus) == 0) {
                    return VCSContext.EMPTY;
                }
View Full Code Here

Examples of org.netbeans.modules.versioning.spi.VCSContext

     */
    private JPopupMenu getPopup() {

        JPopupMenu menu = new JPopupMenu();
        JMenuItem item;
        VCSContext context = GitUtils.getCurrentContext(null);
        ResourceBundle loc = NbBundle.getBundle(Git.class);

        item = menu.add(new OpenInEditorAction());
        Mnemonics.setLocalizedText(item, item.getText());
        menu.add(new JSeparator());
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.