Package com.intellij.openapi.vfs

Examples of com.intellij.openapi.vfs.VirtualFile


    public void editorReleased(EditorFactoryEvent event)
    {
      Editor editor = event.getEditor();

      VirtualFile vFile = FileDocumentManager.getInstance().getFile(editor.getDocument());
      if (vFile == null)
      {
        return;
      }
View Full Code Here


    if (issue.getFile() != null)
    {
      Editor[] editors = EditorFactory.getInstance().getAllEditors();
      for (Editor editor : editors)
      {
        VirtualFile vFile = FileDocumentManager.getInstance().getFile(editor.getDocument());
        if (issue.getFile().equals(vFile))
        {
          result.add(editor);
        }
      }
View Full Code Here

   * Retrieve virtual file from data context, by checking also current editor (in diff dialog)
   */
  @Nullable
  public static VirtualFile getVirtualFile(AnActionEvent e)
  {
    VirtualFile result = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    if (result == null)
    {
      Editor editor = e.getData(PlatformDataKeys.EDITOR);
      if (editor != null)
      {
View Full Code Here

  }

  protected void scrollToSource(Component tree)
  {
    DataContext dataContext = DataManager.getInstance().getDataContext(tree);
    final VirtualFile vFile = PlatformDataKeys.VIRTUAL_FILE.getData(dataContext);
    if (vFile != null)
    {
      // Attempt to navigate to the virtual file with unknown file type will show a modal dialog
      // asking to register some file type for this file. This behaviour is undesirable when autoscrolling.
      if (FileTypeManager.getInstance().getFileTypeByFile(vFile) == FileTypes.UNKNOWN)
View Full Code Here

    {
      public void loadFailed(final File file, Exception exception)
      {
        final String details = ((exception.getLocalizedMessage() == null)
          ? exception.toString() : exception.getLocalizedMessage());
        final VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
        ActionListener action = new ActionListener()
        {
          public void actionPerformed(ActionEvent e)
          {
            if (vFile != null)
            {
              FileEditorManager.getInstance(project).openFile(vFile, true);
            }
          }
        };
        addMessage(new StatusBarMessage(StatusBarMessage.Type.ERROR,
          RevuBundle.message("friendlyError.externalizing.load.error.title.text"),
          RevuBundle.message("friendlyError.externalizing.load.error.details.text", file, details),
          ((vFile != null) && (vFile.exists()))
            ? RevuBundle.message("friendlyError.externalizing.load.error.action.text") : null,
          action), true);
      }

      public void saveFailed(Review review, Exception exception)
View Full Code Here

  }

  protected AbstractVcs getVcs(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    if ((project == null) || (vFile == null))
    {
      return null;
    }
View Full Code Here

  public void actionPerformed(AnActionEvent e)
  {
    AbstractVcs vcs = getVcs(e);

    Project project = e.getData(PlatformDataKeys.PROJECT);
    VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);

    final FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(vFile);
    if ((filePath == null) || (!vcs.fileIsUnderVcs(filePath)))
    {
      return;
View Full Code Here

      e.getPresentation().setEnabled(false);
    }
    else
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.comparewith.review.text", review.getName()));
      VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
      e.getPresentation().setEnabled((vFile != null)
        && RevuVcsUtils.isUnderVcs(project, vFile)
        && fileScopeManager.belongsToScope(project, review, vFile));
    }
  }
View Full Code Here

    {
      return false;
    }
    PsiFile file = (PsiFile) fileSystemItem;

    VirtualFile vFile = file.getVirtualFile();
    if (vFile == null)
    {
      return false;
    }
View Full Code Here

  private boolean isLineHightlighted(final int line, final Editor editor)
  {
      Boolean aBoolean = lineHighlight.get(line);
      if (null == aBoolean) {
          final VcsRevisionNumber number = myAnnotation.getLineRevisionNumber(line);
          VirtualFile vFile = FileDocumentManager.getInstance().getFile(editor.getDocument());
          aBoolean = isRevisionHighlighted(number, editor.getProject(), vFile);
          lineHighlight.put(line, aBoolean);
      }
      return aBoolean;
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vfs.VirtualFile

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.