Package org.rstudio.core.client.files

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


   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

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

   }

   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

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

   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

      eventBus_.fireEvent(event);
   }
      
   protected String getPresentationPath(String file)
   {
      FileSystemItem presentationFile = FileSystemItem.createFile(
                                         context_.getPresentationFilePath());
      return presentationFile.getParentPath().completePath(file);
   }
View Full Code Here

      final ProgressIndicator indicator =
         globalDisplay_.getProgressIndicator("Error");
      indicator.onProgress("Preparing to export plot...");

      // get the default directory
      FileSystemItem defaultDir = ExportPlotUtils.getDefaultSaveDirectory(
            workbenchContext_.getCurrentWorkingDir());

      // get context
      server_.getViewerExportContext(
         defaultDir.getPath(),
         new SimpleRequestCallback<SavePlotAsImageContext>() {

            @Override
            public void onResponseReceived(SavePlotAsImageContext context)
            {
View Full Code Here

         {
            dialogState_ = input;

            stopAndClear();

            FileSystemItem searchPath =
                                      FileSystemItem.createDir(input.getPath());

            JsArrayString filePatterns = JsArrayString.createArray().cast();
            for (String pattern : input.getFilePatterns())
               filePatterns.push(pattern);
View Full Code Here

      String htmlFile = null;
      if (rmdPreviewParams_ != null)
         htmlFile = rmdPreviewParams_.getOutputFile();
      if (htmlFile != null)
      {
         FileSystemItem fsi = FileSystemItem.createFile(htmlFile);
         return fsi.getStem();
      }
      else
      {
         return "(Untitled)";
      }
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.files.FileSystemItem

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.