Package com.intellij.openapi.vcs.actions

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


    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

    }
  }

  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

    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

TOP

Related Classes of com.intellij.openapi.vcs.actions.VcsContext

Copyright © 2018 www.massapicom. 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.