Examples of FileSystemItem


Examples of com.adito.networkplaces.model.FileSystemItem

        try {
          ft = element.getFile().getType();
        } catch (FileSystemException e) {
        } catch (IOException e) {
        }
        FileSystemItem item = null;
        if (ft != null && element.getFile().getType().equals(FileType.FOLDER)
          && fileSystemForm.getNetworkPlace().isAllowRecursive()) {
          // if it is a folder
                    if(element.getLastModified() != null)
                        gc.setTime(element.getLastModified());
          item = new FolderItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), res.getMount()
                  .getStore()
                  .getName(), fileSystemForm.getPath(), gc, element.getFile().getType().getName(), false, i);
        } else if (ft != null && element.getFile().getType().equals(FileType.FILE)) {
          // if it is a file
                    if(element.getLastModified() != null)
                        gc.setTime(element.getLastModified());
          item = new FileItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), element.getContentLength()
                  .longValue(), gc, element.getFile().getType().getName(), false, i);
        } else {
          if (log.isInfoEnabled())
            log.info("Unable to display file " + element.getDisplayName() + " as it is an imaginary file.");
          warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
                  "vfs.imaginary.file",
                  element.getDisplayName()));

          // decrement the counter as there is no file added.
          i--;
        }
        if (item != null) {
          allFileSystemItems.add(item);
          if (request.getParameter("select" + Util.urlEncode(item.getFileName())) != null) {
            item.setChecked(true);
          }
        }
      }
      if (fileSystemForm.getPaths() == null || fileSystemForm.getPaths().isEmpty()) {
        fileSystemForm.setHome(fileSystemForm.getPath());
View Full Code Here

Examples of com.adito.networkplaces.model.FileSystemItem

     * @return Object[] of the selected resources.
     */
    public String[] getSelectedFileNames() {
        List selected = new ArrayList();
        for (Iterator i = getModel().getItems().iterator(); i.hasNext();) {
            FileSystemItem ti = (FileSystemItem) i.next();
            if (ti.getChecked())
                selected.add(ti.getFileName());
        }
        return (String[]) selected.toArray(new String[selected.size()]);
    }
View Full Code Here

Examples of com.adito.networkplaces.model.FileSystemItem

        try {
            Iterator i = allFileSystemItems.iterator();

            while (i.hasNext()) {
                FileSystemItem it = (FileSystemItem) i.next();
                it.setSortFoldersFirst(true);
                getModel().addItem(it);
            }
            getPager().setSortReverse(getSortReverse());
            getPager().rebuild(getFilterText());
        } catch (Throwable t) {
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_.stopButton().addClickHandler(new ClickHandler() {
View Full Code Here

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

         return false;
      }

      // get the directory associated with the project and see if the file is
      // inside that directory
      FileSystemItem projectDir = session_.getSessionInfo()
            .getActiveProjectDir();
      return getPath().startsWith(projectDir.getPath() + "/R");
   }
View Full Code Here

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

      if (!type.equals(SessionInfo.BUILD_TOOLS_PACKAGE))
      {
         return false;
      }
     
      FileSystemItem srcFile = FileSystemItem.createFile(getPath());
      FileSystemItem projectDir = session_.getSessionInfo()
            .getActiveProjectDir();
      if (srcFile.getPath().startsWith(projectDir.getPath() + "/vignettes"))
         return true;
      else if (srcFile.getParentPathString().equals(projectDir.getPath()) &&
               srcFile.getExtension().toLowerCase().equals(".md"))
         return true;
      else
         return false;
   }
View Full Code Here

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

                                        final String encoding,
                                        final Command executeOnSuccess)
   {
      view_.ensureVisible();
     
      FileSystemItem fsi;
      if (suggestedPath != null)
         fsi = FileSystemItem.createFile(suggestedPath);
      else
         fsi = getSaveFileDefaultDir();
View Full Code Here

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

      }
   }
  
   private FileSystemItem getSaveFileDefaultDir()
   {
      FileSystemItem fsi = null;
      SessionInfo si = session_.getSessionInfo();
       
      if (si.getBuildToolsType() == SessionInfo.BUILD_TOOLS_PACKAGE)
      {
         FileSystemItem pkg = FileSystemItem.createDir(si.getBuildTargetDir());
        
         if (fileType_.isR())
         {
            fsi = FileSystemItem.createDir(pkg.completePath("R"));
         }
         else if (fileType_.isC() && si.getHasPackageSrcDir())
         {
            fsi = FileSystemItem.createDir(pkg.completePath("src"));
         }
         else if (fileType_.isRd())
         {
            fsi = FileSystemItem.createDir(pkg.completePath("man"));
         }
         else if ((fileType_.isRnw() || fileType_.isRmd()) &&
                   si.getHasPackageVignetteDir())
         {
            fsi = FileSystemItem.createDir(pkg.completePath("vignettes"));
         }
      }
     
      if (fsi == null)
         fsi = workbenchContext_.getDefaultFileDialogDir();
View Full Code Here

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

      fireVcsViewOnGithubEvent(GitHubViewRequest.ViewType.Blame);
   }
  
   private void fireVcsViewOnGithubEvent(GitHubViewRequest.ViewType type)
   {
      FileSystemItem file =
                  FileSystemItem.createFile(docUpdateSentinel_.getPath());
     
      if (docDisplay_.getSelectionValue().length() > 0)
      {
         int start = docDisplay_.getSelectionStart().getRow() + 1;
View Full Code Here

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

   {
      // get path
      String activeDocPath = docUpdateSentinel_.getPath();
      if (activeDocPath != null)
      {      
         FileSystemItem wdPath =
            FileSystemItem.createFile(activeDocPath).getParentPath();
         consoleDispatcher_.executeSetWd(wdPath, true);
      }
      else
      {
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.