Examples of FileSystemItem


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

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

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

         {
            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

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

      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

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

      initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));

      FileTypeRegistry fileTypeRegistry =
                        RStudioGinjector.INSTANCE.getFileTypeRegistry();
     
      FileSystemItem fsItem = FileSystemItem.createFile(filename2 == null ?
                                                      filename1 : filename2);
     
      fileIcon_.setResource(fileTypeRegistry.getIconForFile(fsItem));
    
      headerLabel_.setText(filename1);
View Full Code Here

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

         @Override
         public void onSelectionCommit(
                              SelectionCommitEvent<CodeNavigationTarget> event)
         {
            CodeNavigationTarget target = event.getSelectedItem();
            FileSystemItem fsi = FileSystemItem.createFile(target.getFile());
            fileTypeRegistry_.editFile(fsi, target.getPosition());
         }
      });
   }
View Full Code Here

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

         return;
      }
     
      // remove the first file from the list
      final FileSystemItem sourceFile = filesQueue.remove(0);
     
      // determine the default name and default selection
      final String COPY_PREFIX = "CopyOf";
      String defaultName = COPY_PREFIX + sourceFile.getName();
      int defaultSelectionLength = COPY_PREFIX.length()
                                   + sourceFile.getStem().length();
     
      // show prompt for new filename
      final String objectName = sourceFile.isDirectory() ? "Folder" : "File";
      globalDisplay_.promptForText(
             "Copy " + objectName,
             "Enter a name for the copy of '" + sourceFile.getName() + "':",
             defaultName,
             0,
             defaultSelectionLength,
             null,
             new ProgressOperationWithInput<String>() {

         public void execute(String input, ProgressIndicator progress)
         {
            progress.onProgress("Copying " + objectName.toLowerCase() + "...");

            String targetFilePath = targetDirectory.completePath(input);
            final FileSystemItem targetFile = FileSystemItem.createFile(
                                                            targetFilePath);

            server_.copyFile(sourceFile,
                             targetFile,
                             false,
View Full Code Here

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

   private void doOpenFiles(JsArray<FileSystemItem> items)
   {
      for (int i=0; i<items.length(); i++)
      {
         FileSystemItem item = items.get(i);
         if (!item.isDirectory())
         {
            fileTypeRegistry_.openFile(item);
         }
         else
         {
View Full Code Here

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

      int previewLoc = docUrl.indexOf(previewPrefix);
      if (previewLoc != -1)
      {
         String file = docUrl.substring(previewLoc + previewPrefix.length());
         file = URL.decodeQueryString(file);
         FileSystemItem fsi = FileSystemItem.createFile(file);
         docTitle = fsi.getName();
      }
      else if (StringUtil.isNullOrEmpty(docTitle))
      {
         String url = new String(docUrl);
         url = url.split("\\?")[0];
View Full Code Here

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

   public void onBeforeSelected()
   {
      if (needsInit)
      {
         needsInit = false;
         FileSystemItem home = FileSystemItem.home();
         observer_.onFileNavigation(home);
      }
   }
View Full Code Here

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

         {
            if (!session.getSessionInfo().isVcsEnabled())
               registrations.removeHandler();

            FileChange fileChange = event.getFileChange();
            FileSystemItem file = fileChange.getFile();

            StatusAndPath status = StatusAndPath.fromInfo(
                  getStatusFromFile(file));

            if (needsFullRefresh(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.