Package com.mucommander.commons.file.util

Examples of com.mucommander.commons.file.util.FileSet


     * </p>
     *
     * @return a FileSet containing all the files that are currently marked
     */
    public synchronized FileSet getMarkedFiles() {
        FileSet markedFiles = new FileSet(currentFolder, nbRowsMarked);
        int nbRows = getRowCount();

        if(parent==null) {
            for(int i=0; i<nbRows; i++) {
                if(rowMarked[fileArrayIndex[i]])
                    markedFiles.add(getFileAtRow(i));
            }
        }
        else {
            for(int i=1, iMinusOne=0; i<nbRows; i++) {
                if(rowMarked[fileArrayIndex[iMinusOne]])
                    markedFiles.add(getFileAtRow(i));

                iMinusOne = i;
            }
        }

View Full Code Here


     *
     * @param originalFiles files as selected by the user which may contain folders
     */
    private FileSet getFlattenedFiles(FileSet originalFiles) throws IOException {
        int nbFiles = originalFiles.size();
        FileSet flattenedFiles = new FileSet(originalFiles.getBaseFolder());
        for(int i=0; i<nbFiles; i++)
            recurseOnFolder(originalFiles.elementAt(i), flattenedFiles);

        return flattenedFiles;
    }
View Full Code Here

       
                // Starts by disposing the dialog
                dispose();

                // Creates new FileSet with files that have been selected
                FileSet filesToSend = new FileSet(flattenedFiles.getBaseFolder());
                int nbFiles = fileCheckboxes.length;
                for(int i=0; i<nbFiles; i++)
                    if(fileCheckboxes[i].isSelected())
                        filesToSend.add(flattenedFiles.elementAt(i));

                // Starts sending files
                ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("email_dialog.sending"));
                SendMailJob mailJob = new SendMailJob(progressDialog, mainFrame, filesToSend, to, subject, body);
                progressDialog.start(mailJob);
View Full Code Here

        FolderPanel activePanel = mainFrame.getActivePanel();
        AbstractFile selectedFile = activePanel.getFileTable().getSelectedFile(false, true);

        // Display local copy dialog only if a file other than '..' is currently selected
        if(selectedFile!=null) {
            new LocalCopyDialog(mainFrame, new FileSet(activePanel.getCurrentFolder(), selectedFile)).showDialog();
        }
    }
View Full Code Here

    // - Action code -----------------------------------------------------------
    // -------------------------------------------------------------------------
    @Override
    public void performAction() {
        FileSet selectedFiles;

        // Retrieves the current selection.
        selectedFiles = mainFrame.getActiveTable().getSelectedFiles();

        // If no files are either selected or marked, aborts.
        if(selectedFiles.size() == 0)
            return;

        // If we're working with local files, go ahead and runs the command.
        if(selectedFiles.getBaseFolder().getURL().getScheme().equals(FileProtocols.FILE) && (selectedFiles.getBaseFolder().hasAncestor(LocalFile.class))) {
            try {ProcessRunner.execute(command.getTokens(selectedFiles), selectedFiles.getBaseFolder());}
            catch(Exception e) {
                InformationDialog.showErrorDialog(mainFrame);

                LOGGER.debug("Failed to execute command: " + command.getCommand(), e);
            }
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.util.FileSet

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.