Examples of FileSystemItem


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

   private String confirmFileUploadOverwriteMessage(
                                              PendingFileUpload pendingUpload)
   {
      JsArray<FileSystemItem> overwrites = pendingUpload.getOverwrites();
      FileSystemItem firstFile = overwrites.get(0);
      boolean multiple = overwrites.length() > 1 ;
      StringBuilder msg = new StringBuilder();
      msg.append("The upload will overwrite ");
      if (multiple)
         msg.append("multiple files including ");
      else
         msg.append("the file ");
      msg.append("\"" + firstFile.getPath() + "\". ");

      msg.append("Are you sure you want to overwrite ");
      if (multiple)
         msg.append("these files?");
      else
View Full Code Here

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

                  // write a pref indicating this is the preferred template--
                  // we'll default to it the next time we load the template list
                  prefs_.rmdPreferredTemplatePath().setGlobalValue(
                        template.getTemplatePath());
                  prefs_.writeUIPrefs();
                  FileSystemItem file =
                        FileSystemItem.createFile(created.getPath());
                  eventBus_.fireEvent(new FileEditEvent(file));
                  progress.onCompleted();
               }
View Full Code Here

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

      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_.getSavePlotContext(
         defaultDir.getPath(),
         new SimpleRequestCallback<SavePlotAsImageContext>() {

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

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

                  if (hasNavigatedToDirectory_)
                     return;

                  // compute start dir
                  String path = transformPathStateValue(value);
                  FileSystemItem start = path != null
                                    ? FileSystemItem.createDir(path)
                                    : FileSystemItem.createDir(
                                          sessionInfo.getInitialWorkingDir());
                  navigateToDirectory(start);
               }
View Full Code Here

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

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

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

      // get context
      server_.getUniqueSavePlotStem(
         defaultDir.getPath(),
         new SimpleRequestCallback<String>() {

            @Override
            public void onResponseReceived(String stem)
            {
View Full Code Here

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

                                   final ProgressIndicator progress)
               {
                  progress.onProgress("Creating folder...");

                  String folderPath = currentPath_.completePath(input);
                  FileSystemItem folder = FileSystemItem.createDir(folderPath);

                  server_.createFolder(
                        folder,
                        new VoidServerRequestCallback(progress));
               }
View Full Code Here

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

            // check to make sure that we aren't moving any folders
            // onto themselves or moving any files into the directory
            // where they currently reside
            for (int i=0; i<selectedFiles.size(); i++)
            {
               FileSystemItem file = selectedFiles.get(i);
               FileSystemItem fileParent = file.getParentPath();
              
               if (file.getPath().equals(targetDir.getPath()) ||
                   fileParent.getPath().equals(targetDir.getPath()))
               {
                  progress.onError("Invalid target folder");
                  return ;
               }
            }
View Full Code Here

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

      // validation -- not prohibited move of public folder
      if (!validateNotRestrictedFolder(selectedFiles, "renamed"))
         return ;
     
      // prompt for new file name then execute the rename
      final FileSystemItem file = selectedFiles.get(0);
      globalDisplay_.promptForText("Rename File",
                                   "Please enter the new file name:",
                                   file.getName(),
                                   0,
                                   file.getStem().length(),
                                   null,
                                   new ProgressOperationWithInput<String>() {

                                      public void execute(String input,
                             final ProgressIndicator progress)
         {
            progress.onProgress("Renaming file...");

            String path = file.getParentPath().completePath(input);
            FileSystemItem target ;
            if (file.isDirectory())
               target = FileSystemItem.createDir(path);
            else
               target = FileSystemItem.createFile(path);
             
View Full Code Here

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

         SerializedCommandQueue openCommands = new SerializedCommandQueue();
        
         for (int i=0; i<openDocs.length(); i++)
         {
            String doc = openDocs.get(i);
            final FileSystemItem fsi = FileSystemItem.createFile(doc);
             
            openCommands.addCommand(new SerializedCommand() {

               @Override
               public void onExecute(final Command continuation)
View Full Code Here

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

     
      // check for file path navigation
      else if ((navigation.getPath() != null) &&
               !navigation.getPath().startsWith(DataItem.URI_PREFIX))
      {
         FileSystemItem file = FileSystemItem.createFile(navigation.getPath());
         TextFileType fileType = fileTypeRegistry_.getTextTypeForFile(file);
        
         // open the file and restore the position
         openFile(file,
                  fileType,
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.