Search in sources :

Example 21 with FileTable

use of com.mucommander.ui.main.table.FileTable 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 22 with FileTable

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

the class MarkBackwardAction method performAction.

// ///////////////////////////
// MuAction implementation //
// ///////////////////////////
@Override
public void performAction() {
    FileTable fileTable = mainFrame.getActiveTable();
    int currentRow = fileTable.getSelectedRow();
    int endRow = Math.max(0, currentRow - getRowDecrement() + 1);
    fileTable.setRangeMarked(currentRow, endRow, !fileTable.getFileTableModel().isRowMarked(currentRow));
    fileTable.selectRow(Math.max(0, endRow - 1));
}
Also used : FileTable(com.mucommander.ui.main.table.FileTable)

Example 23 with FileTable

use of com.mucommander.ui.main.table.FileTable 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)

Example 24 with FileTable

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

the class SelectForwardAction method performAction.

// ///////////////////////////
// MuAction implementation //
// ///////////////////////////
@Override
public void performAction() {
    FileTable activeTable = mainFrame.getActiveTable();
    activeTable.selectRow(Math.min(activeTable.getSelectedRow() + getRowIncrement(), activeTable.getRowCount() - 1));
}
Also used : FileTable(com.mucommander.ui.main.table.FileTable)

Example 25 with FileTable

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

the class SelectLastRowAction method performAction.

@Override
public void performAction() {
    FileTable fileTable = mainFrame.getActiveTable();
    fileTable.selectRow(fileTable.getFileTableModel().getRowCount() - 1);
}
Also used : FileTable(com.mucommander.ui.main.table.FileTable)

Aggregations

FileTable (com.mucommander.ui.main.table.FileTable)25 AbstractFile (com.mucommander.commons.file.AbstractFile)10 FileTableModel (com.mucommander.ui.main.table.FileTableModel)8 FolderPanel (com.mucommander.ui.main.FolderPanel)3 MainFrame (com.mucommander.ui.main.MainFrame)2 TablePopupMenu (com.mucommander.ui.main.menu.TablePopupMenu)2 Component (java.awt.Component)2 Rectangle (java.awt.Rectangle)2 JTextField (javax.swing.JTextField)2 JTree (javax.swing.JTree)2 AbstractFilenameFilter (com.mucommander.commons.file.filter.AbstractFilenameFilter)1 AndFileFilter (com.mucommander.commons.file.filter.AndFileFilter)1 AttributeFileFilter (com.mucommander.commons.file.filter.AttributeFileFilter)1 ContainsFilenameFilter (com.mucommander.commons.file.filter.ContainsFilenameFilter)1 EndsWithFilenameFilter (com.mucommander.commons.file.filter.EndsWithFilenameFilter)1 EqualsFilenameFilter (com.mucommander.commons.file.filter.EqualsFilenameFilter)1 ExtensionFilenameFilter (com.mucommander.commons.file.filter.ExtensionFilenameFilter)1 FileFilter (com.mucommander.commons.file.filter.FileFilter)1 FilenameFilter (com.mucommander.commons.file.filter.FilenameFilter)1 PassThroughFileFilter (com.mucommander.commons.file.filter.PassThroughFileFilter)1