Search in sources :

Example 6 with FileTableModel

use of com.mucommander.ui.main.table.FileTableModel in project mucommander by mucommander.

the class InternalViewAction method performInternalAction.

// - AbstractViewerAction implementation ---------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------------------
@Override
protected void performInternalAction(AbstractFile file) {
    if (file.isDirectory()) {
        FileTable activeTable = mainFrame.getActiveTable();
        FileTableModel fileTableModel = (FileTableModel) activeTable.getModel();
        fileTableModel.startDirectorySizeCalculation(activeTable, file);
    } else {
        ViewerRegistrar.createViewerFrame(mainFrame, file, getIcon().getImage());
    }
}
Also used : FileTableModel(com.mucommander.ui.main.table.FileTableModel) FileTable(com.mucommander.ui.main.table.FileTable)

Example 7 with FileTableModel

use of com.mucommander.ui.main.table.FileTableModel in project mucommander by mucommander.

the class InvertSelectionAction method performAction.

@Override
public void performAction() {
    FileTable fileTable = mainFrame.getActiveTable();
    FileTableModel tableModel = fileTable.getFileTableModel();
    // Starts at 1 if current folder is not root so that '..' is not marked
    AbstractFile file;
    int nbRows = tableModel.getRowCount();
    for (int i = tableModel.getFirstMarkableRow(); i < nbRows; i++) {
        file = tableModel.getFileAtRow(i);
        tableModel.setRowMarked(i, !tableModel.isRowMarked(i));
    }
    fileTable.repaint();
    // Notify registered listeners that currently marked files have changed on the FileTable
    fileTable.fireMarkedFilesChangedEvent();
}
Also used : FileTableModel(com.mucommander.ui.main.table.FileTableModel) AbstractFile(com.mucommander.commons.file.AbstractFile) FileTable(com.mucommander.ui.main.table.FileTable)

Example 8 with FileTableModel

use of com.mucommander.ui.main.table.FileTableModel in project mucommander by mucommander.

the class MarkAllAction method performAction.

@Override
public void performAction() {
    FileTable fileTable = mainFrame.getActiveTable();
    FileTableModel tableModel = fileTable.getFileTableModel();
    int nbRows = tableModel.getRowCount();
    for (int i = tableModel.getFirstMarkableRow(); i < nbRows; i++) tableModel.setRowMarked(i, mark);
    fileTable.repaint();
    // Notify registered listeners that currently marked files have changed on the FileTable
    fileTable.fireMarkedFilesChangedEvent();
}
Also used : FileTableModel(com.mucommander.ui.main.table.FileTableModel) FileTable(com.mucommander.ui.main.table.FileTable)

Example 9 with FileTableModel

use of com.mucommander.ui.main.table.FileTableModel in project mucommander by mucommander.

the class MarkExtensionAction method performAction.

/**
 * Marks all files whose extension matches the current selection.
 */
@Override
public void performAction() {
    FileTable fileTable;
    FileTableModel tableModel;
    FilenameFilter filter;
    int rowCount;
    boolean mark;
    // Initialization. Aborts if there is no selected file.
    fileTable = mainFrame.getActiveTable();
    if ((filter = getFilter(fileTable.getSelectedFile(false, true))) == null)
        return;
    tableModel = fileTable.getFileTableModel();
    rowCount = tableModel.getRowCount();
    mark = !tableModel.isRowMarked(fileTable.getSelectedRow());
    // Goes through all files in the active table, marking all that match 'filter'.
    for (int i = tableModel.getFirstMarkableRow(); i < rowCount; i++) if (filter.accept(tableModel.getCachedFileAtRow(i)))
        tableModel.setRowMarked(i, mark);
    fileTable.repaint();
    // Notify registered listeners that currently marked files have changed on the FileTable
    fileTable.fireMarkedFilesChangedEvent();
}
Also used : AbstractFilenameFilter(com.mucommander.commons.file.filter.AbstractFilenameFilter) FilenameFilter(com.mucommander.commons.file.filter.FilenameFilter) ExtensionFilenameFilter(com.mucommander.commons.file.filter.ExtensionFilenameFilter) FileTableModel(com.mucommander.ui.main.table.FileTableModel) FileTable(com.mucommander.ui.main.table.FileTable)

Aggregations

FileTableModel (com.mucommander.ui.main.table.FileTableModel)9 FileTable (com.mucommander.ui.main.table.FileTable)8 AbstractFile (com.mucommander.commons.file.AbstractFile)6 AbstractFilenameFilter (com.mucommander.commons.file.filter.AbstractFilenameFilter)1 ExtensionFilenameFilter (com.mucommander.commons.file.filter.ExtensionFilenameFilter)1 FilenameFilter (com.mucommander.commons.file.filter.FilenameFilter)1 FileSet (com.mucommander.commons.file.util.FileSet)1 TablePopupMenu (com.mucommander.ui.main.menu.TablePopupMenu)1 Rectangle (java.awt.Rectangle)1