Package org.rstudio.core.client.files

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


      display.showModal();
   }
  
   private String projPathToFullPath(String projPath)
   {
      FileSystemItem projDir = session_.getSessionInfo().getActiveProjectDir();
      return projPath.length() > 0 ? projDir.completePath(projPath) :
                                     projDir.getPath();
   }
View Full Code Here


      // parent path and return an empty list
      if (paths.size() == 0)
         return new IgnoreList("", new ArrayList<String>());
      
      // get the parent path of the first element
      FileSystemItem firstPath = FileSystemItem.createFile(paths.get(0));
      String parentPath = firstPath.getParentPathString();
     
      // confirm that all of the elements start with that path and take the
      // remainder of their paths for our list
      ArrayList<String> ignored = new ArrayList<String>();
      for (String path : paths)
      {
         String thisParent =
                      FileSystemItem.createFile(path).getParentPathString();
        
         if (!parentPath.equals(thisParent))
         {
            GlobalDisplay gDisp = RStudioGinjector.INSTANCE.getGlobalDisplay();
            gDisp.showMessage(
                  MessageDialog.ERROR,
                  "Error: Multiple Directories",
                  "The selected files are not all within the same directory " +
                  "(you can only ignore multiple files in one operation if " +
                  "they are located within the same directory).");
               
            return null;
         }
        
         // apply a filter if we have one
         if (filter != null)
         {
            FileSystemItem file = FileSystemItem.createFile(path);
            if (!filter.includeFile(file))
               continue;
         }
        
         // compute the parent relative directory
View Full Code Here

   }
  
   public String packratProjectArg()
   {
      String projectArg = "";
      FileSystemItem projectDir = session_.getSessionInfo()
                                       .getActiveProjectDir();
      FileSystemItem workingDir = workbenchContext_
                                       .getCurrentWorkingDir();
      if (!projectDir.equalTo(workingDir))
         projectArg = "project = '" + projectDir.getPath() + "'";
      return projectArg;
   }
View Full Code Here

   @Override
   public void onSelection(SelectionEvent<FileSystemItem> event)
   {
      super.onSelection(event);
      FileSystemItem item = event.getSelectedItem();
      if (item != null && item.isDirectory())
         filename_.setText(item.getName());
   }
View Full Code Here

         return context_.combine(context_.pwd(), name);

      // If an item is selected (highlighted) in the browse control, then
      // only use it IF it is the same as the name in the name textbox. The
      // name textbox takes precedence.
      FileSystemItem selectedItem = directory_.getSelectedItem();
      if (selectedItem != null && selectedItem.getName().equals(name))
            return selectedItem.getPath();

      if (name.equals(context_.pwdItem().getName()))
      {
         // The identity condition
         return context_.pwd();
      }

      FileSystemItem item = context_.itemForName(name,
                                                 true,
                                                 false);
      if (item == null)
      {
         onError("The folder does not exist.");
         return null;
      }

      return item.getPath();
   }
View Full Code Here

  
   // Private methods ---------------------------------------------------------

   private void highlightDebugPosition(LineData lineData, boolean finished)
   {
      FileSystemItem sourceFile = FileSystemItem.createFile(debugFile_);
      DebugFilePosition position = DebugFilePosition.create(
            lineData.getLineNumber(),
            lineData.getEndLineNumber(),
            lineData.getCharacterNumber(),
            lineData.getEndCharacterNumber());
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.