Examples of FileSystemItem


Examples of org.rstudio.core.client.files.FileSystemItem

      SourceLocation sourceLocation = getSelectionAsSourceLocation(fromClick);
      if (sourceLocation == null)
         return;
     
      // compute the target pdf
      FileSystemItem editorFile = FileSystemItem.createFile(
                                              docUpdateSentinel_.getPath());
      FileSystemItem targetFile = compilePdfHelper_.getTargetFile(editorFile);
      String pdfFile =
         targetFile.getParentPath().completePath(targetFile.getStem() + ".pdf");
     
      synctex_.forwardSearch(pdfFile, sourceLocation);
   }
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

                                    String encoding,
                                    String completedAction,
                                    boolean useInternalPreview)
   {
      // first validate the path to make sure it doesn't contain spaces
      FileSystemItem file = FileSystemItem.createFile(path);
      if (file.getName().indexOf(' ') != -1)
      {
         globalDisplay_.showErrorMessage(
               "Invalid Filename",
               "The file '" + file.getName() + "' cannot be compiled to " +
               "a PDF because TeX does not understand paths with spaces. " +
               "If you rename the file to remove spaces then " +
               "PDF compilation will work correctly.");
       
         return;
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

      return new Command()
      {
         public void execute()
         {
            // fire source document saved event
            FileSystemItem file = FileSystemItem.createFile(
                                             docUpdateSentinel_.getPath());
            events_.fireEvent(new SourceFileSaveCompletedEvent(
                                             file,
                                             docUpdateSentinel_.getContents(),
                                             docDisplay_.getCursorPosition()));
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

         @Override
         public void onSourceFileSaveCompleted(SourceFileSaveCompletedEvent event)
         {
            if (currentState_ != null)
            {
               FileSystemItem file = event.getSourceFile();
               if (file.getPath().equals(currentState_.getFilePath()))
               {   
                  int index = detectSlideIndex(event.getContents(),
                                               event.getCursorPos().getRow());
                  if (index != -1)
                     currentState_.setSlideIndex(index);
                 
                  refreshPresentation();
               }
               else if (file.getParentPathString().equals(getCurrentPresDir())
                          &&
                        file.getExtension().toLowerCase().equals(".css"))
               {
                  refreshPresentation();
               }
            }
         }
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

   void onPresentationSaveAsStandalone()
   {
      // determine the default file name
      if (saveAsStandaloneDefaultPath_ == null)
      {
         FileSystemItem presFilePath = FileSystemItem.createFile(
                                             currentState_.getFilePath());
         saveAsStandaloneDefaultPath_ = FileSystemItem.createFile(
               presFilePath.getParentPath().completePath(presFilePath.getStem()
                                                  + ".html"));
      }
           
      fileDialogs_.saveFile(
         "Save Presentation As",
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

   private String getCurrentPresDir()
   {
      if (currentState_ == null)
         return "";
     
      FileSystemItem presFilePath = FileSystemItem.createFile(
                                               currentState_.getFilePath());
      return presFilePath.getParentPathString();
   }
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

   }

   public static PackageLibraryType typeOfLibrary(Session session,
                                                  String library)
   {
      FileSystemItem projectDir = null;
      SessionInfo sessionInfo = session.getSessionInfo();
      if (sessionInfo != null)
         projectDir = sessionInfo.getActiveProjectDir();

      // if there's an active project and this package is in its library or
      // the package has no recorded library (i.e. it's not installed), it
      // belongs in the project library
      if (StringUtil.isNullOrEmpty(library) ||
          (projectDir != null && library.startsWith(projectDir.getPath())))
      {
         return PackageLibraryType.Project;
      }
      else if (library.startsWith(FileSystemItem.HOME_PATH))
      {
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

      {
         return lib;
      }
      else
      {
         FileSystemItem path = FileSystemItem.createDir(getPathNative());
         return path.getParentPathString();
      }
   }  
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

   private void performSourceCommand(String param1, String param2)
   {  
      if (param1 != null)
      {
         // get filename and type
         FileSystemItem file = FileSystemItem.createFile(
                                                  getPresentationPath(param1));
         TextFileType fileType = fileTypeRegistry_.getTextTypeForFile(file);
        
         // check for a file position and/or pattern
         FilePosition pos = null;
View Full Code Here

Examples of org.rstudio.core.client.files.FileSystemItem

      eventBus_.fireEvent(event);
   }
      
   protected String getPresentationPath(String file)
   {
      FileSystemItem presentationFile = FileSystemItem.createFile(
                                         context_.getPresentationFilePath());
      return presentationFile.getParentPath().completePath(file);
   }
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.