Package com.mucommander.commons.file

Examples of com.mucommander.commons.file.AbstractFile


  /**
     * This method is overridden to enable this action when the parent folder is selected.
     */
    @Override
    protected boolean getFileTableCondition(FileTable fileTable) {
        AbstractFile selectedFile = fileTable.getSelectedFile(true, true);

        return selectedFile!=null && selectedFile.isBrowsable();
    }
View Full Code Here


        return selectedFile!=null && selectedFile.isBrowsable();
    }
   
  @Override
  public void performAction() {
    AbstractFile file;

        // Retrieves the currently selected file, aborts if none (should not normally happen).
        if((file = mainFrame.getActiveTable().getSelectedFile(true, true)) == null || !file.isBrowsable())
            return;

        // Opens the currently selected file in a new tab
        mainFrame.getActivePanel().getTabs().add(file);
  }
View Full Code Here

        super(mainFrame, properties);
    }

    @Override
    public void performAction() {
      AbstractFile currentLocation = mainFrame.getActivePanel().getCurrentFolder();
      mainFrame.getInactivePanel().getTabs().add(currentLocation);
    }
View Full Code Here

        super(mainFrame, properties);
    }

    @Override
    public void performAction() {
        AbstractFile selectedFile = mainFrame.getActiveTable().getSelectedFile(true, true);

        if(selectedFile==null)
            return;

        // Copy file to a temporary local file and execute it with native file associations if
        // file is not on a local filesystem or file is an archive entry
        if(!FileProtocols.FILE.equals(selectedFile.getURL().getScheme()) || selectedFile.hasAncestor(AbstractArchiveEntryFile.class)) {
            ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("copy_dialog.copying"));
            TempExecJob job = new TempExecJob(progressDialog, mainFrame, selectedFile);
            progressDialog.start(job);
        }
        else {
View Full Code Here

     * Opens both the active and inactive folder panel's parent directories.
     */
    @Override
    public void performAction() {
        Thread       openThread;
        AbstractFile parent;

        // If the current panel has a parent file, navigate to it.
        if((parent = mainFrame.getActivePanel().getCurrentFolder().getParent()) != null) {
            openThread = mainFrame.getActivePanel().tryChangeCurrentFolder(parent);

View Full Code Here

     */
    public FileSet getSelectedFiles() {
        FileSet selectedFiles = tableModel.getMarkedFiles();
        // if no row is marked, then add selected row if there is one, and if it is not parent folder
        if(selectedFiles.size()==0)  {
            AbstractFile selectedFile = getSelectedFile();
            if(selectedFile!=null)
                selectedFiles.add(selectedFile);
        }
        return selectedFiles;
    }
View Full Code Here

    public void setCurrentFolder(AbstractFile folder, AbstractFile children[], AbstractFile fileToSelect) {
      overlayTable.setOverlayVisible(!folder.exists());
        // Stop quick search in case it was being used before folder change
        quickSearch.stop();

        AbstractFile currentFolder = folderPanel.getCurrentFolder();

        // If we're refreshing the current folder, save the current selection and marked files
        // in order to restore them properly.
        FileSet markedFiles  = null;
        if(currentFolder != null && folder.equalsCanonical(currentFolder)) {
View Full Code Here

     */
    public boolean isColumnDisplayable(Column column) {
        // Check this against the children's file implementation whenever possible: certain file implementations may
        // return different values for the current folder than for its children. For instance, this is the case for file
        // protocols that have a special file implementation for the root folder (s3 is one).
        AbstractFile file = getFileTableModel().getFileAt(0);
        if(file==null)
            file = folderPanel.getCurrentFolder();

        // The Owner and Group columns are displayable only if current folder has this information
        if(column==Column.OWNER) {
            return file.canGetOwner();
        }
        else if(column==Column.GROUP) {
            return file.canGetGroup();
        }

        return true;
    }
View Full Code Here

     * Sorts this FileTable and repaints it. Marked files and selected file will remain the same, only
     * their position will have changed in the newly sorted table.
     */
    private void sortTable() {
        // Save currently selected file
        AbstractFile selectedFile = tableModel.getFileAtRow(currentRow);

        // Sort table, doesn't affect marked files
        tableModel.sortRows();

        // Restore selected file
View Full Code Here

    public boolean isAvailable() {return CommandManager.getCommandForAlias(CommandManager.URL_OPENER_ALIAS) != null;}

    @Override
    public void execute(URL url) throws IOException {
        Command      command;
        AbstractFile target;

        if((command = CommandManager.getCommandForAlias(CommandManager.URL_OPENER_ALIAS)) == null)
            throw new UnsupportedOperationException();

        target = FileFactory.getFile(url.toString());
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.AbstractFile

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.