Search in sources :

Example 6 with FolderPanel

use of com.mucommander.ui.main.FolderPanel in project mucommander by mucommander.

the class FileJob method refreshTables.

/**
 * Check and if needed, refreshes both file tables's current folders, based on the job's refresh policy.
 */
protected void refreshTables() {
    FolderPanel inactivePanel = getMainFrame().getInactivePanel();
    AbstractFile inactiveFolder = inactivePanel.getCurrentFolder();
    if (hasFolderChanged(inactiveFolder))
        inactivePanel.tryRefreshCurrentFolder();
    FolderPanel activePanel = getMainFrame().getActivePanel();
    AbstractFile activeFolder = activePanel.getCurrentFolder();
    if (hasFolderChanged(activeFolder)) {
        // Select file specified by selectFileWhenFinished (if any) only if the file exists in the active table's folder
        if (fileToSelect != null && activeFolder.equalsCanonical(fileToSelect.getParent()) && fileToSelect.exists())
            activePanel.tryRefreshCurrentFolder(fileToSelect);
        else
            activePanel.tryRefreshCurrentFolder();
    }
    // Repaint the status bar as marked files have changed
    mainFrame.getStatusBar().updateSelectedFilesInfo();
}
Also used : AbstractFile(com.mucommander.commons.file.AbstractFile) FolderPanel(com.mucommander.ui.main.FolderPanel)

Example 7 with FolderPanel

use of com.mucommander.ui.main.FolderPanel in project mucommander by mucommander.

the class LocalCopyAction method performAction.

@Override
public void performAction() {
    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();
    }
}
Also used : AbstractFile(com.mucommander.commons.file.AbstractFile) FileSet(com.mucommander.commons.file.util.FileSet) LocalCopyDialog(com.mucommander.ui.dialog.file.LocalCopyDialog) FolderPanel(com.mucommander.ui.main.FolderPanel)

Example 8 with FolderPanel

use of com.mucommander.ui.main.FolderPanel in project mucommander by mucommander.

the class GoToRootAction method performAction.

@Override
public void performAction() {
    // Changes the current folder to make it the current folder's root folder.
    // Does nothing if the current folder already is the root.
    FolderPanel folderPanel = mainFrame.getActivePanel();
    AbstractFile currentFolder = folderPanel.getCurrentFolder();
    folderPanel.tryChangeCurrentFolder(currentFolder.getRoot());
}
Also used : AbstractFile(com.mucommander.commons.file.AbstractFile) FolderPanel(com.mucommander.ui.main.FolderPanel)

Aggregations

FolderPanel (com.mucommander.ui.main.FolderPanel)8 AbstractFile (com.mucommander.commons.file.AbstractFile)5 FileTable (com.mucommander.ui.main.table.FileTable)3 MainFrame (com.mucommander.ui.main.MainFrame)2 Component (java.awt.Component)2 JTextField (javax.swing.JTextField)2 JTree (javax.swing.JTree)2 FileSet (com.mucommander.commons.file.util.FileSet)1 CoreService (com.mucommander.os.api.CoreService)1 AboutDialog (com.mucommander.ui.dialog.about.AboutDialog)1 LocalCopyDialog (com.mucommander.ui.dialog.file.LocalCopyDialog)1 IOException (java.io.IOException)1 Random (java.util.Random)1