Package com.mucommander.ui.main.table

Examples of com.mucommander.ui.main.table.FileTable$FilenameEditor


        while(run) {
            if(random.nextInt(2)==0)
                ActionManager.performAction(com.mucommander.ui.action.impl.SwitchActiveTableAction.Descriptor.ACTION_ID, mainFrame);   

            FolderPanel folderPanel = mainFrame.getActivePanel();
            FileTable fileTable = mainFrame.getActiveTable();
            AbstractFile currentFolder = folderPanel.getCurrentFolder();

            try {
                AbstractFile parentFolder = currentFolder.getParent();
                AbstractFile children[] = currentFolder.ls();
                // 1 in 3 chance to go up if folder has children
                if(children.length==0 || (random.nextInt(3)==0 && parentFolder!=null)) {
                    fileTable.selectRow(0);
                    ActionManager.performAction(com.mucommander.ui.action.impl.OpenAction.Descriptor.ACTION_ID, mainFrame);
                }
                else {
                    AbstractFile randomChild = children[random.nextInt(children.length)];
                    if(!randomChild.isBrowsable())
                        continue;
                    // Try to ls() in RandomChild to trigger an IOException if folder is not readable
                    // so that no error dialog pops up when calling tryChangeCurrentFolder()
                    randomChild.ls();
                    fileTable.selectFile(randomChild);
                    ActionManager.performAction(com.mucommander.ui.action.impl.OpenAction.Descriptor.ACTION_ID, mainFrame);
                    //          folderPanel.tryChangeCurrentFolder(randomChild, true);
                }
            }
            catch(Exception e) {
View Full Code Here


        // Abort if the focus is not in the MainFrame this action is tied to
        if(focusOwner==null)
            return;

        FolderPanel folderPanel = mainFrame.getActivePanel();
        FileTable fileTable = folderPanel.getFileTable();
        JTextField locationField = folderPanel.getLocationTextField();
        JTree tree = folderPanel.getFoldersTreePanel().getTree();

        // Request focus on the 'previous' component, the cycle order being from right to left, bottom to top.
        Component previousComponent;
View Full Code Here

        super(mainFrame, properties);
    }

    @Override
    public void performAction() {
        FileTable activeTable = mainFrame.getActiveTable();
        FileTable leftTable = mainFrame.getLeftPanel().getFileTable();
        FileTable rightTable = mainFrame.getRightPanel().getFileTable();
        if(activeTable == leftTable)
            rightTable.requestFocus();
        else if(activeTable == rightTable)
            leftTable.requestFocus();
    }
View Full Code Here

        this(mainFrame, properties, true);
    }

    @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();
    }
View Full Code Here

    /**
     * This method is public as a side-effect of this class implementing <code>Runnable</code>.
     */
    public final void run() {
        FileTable activeTable = getMainFrame().getActiveTable();
        AbstractFile currentFile;

        // Notify that this job has started
        jobStarted();

//this.nbFilesDiscovered += nbFiles;

        // Loop on all source files, checking that job has not been interrupted
        for(int i=0; i<nbFiles; i++) {
            currentFile = files.elementAt(i);

            // Change current file and advance file index
            currentFileIndex = i;
            nextFile(currentFile);

            // Process current file
            boolean success = processFile(currentFile, null);

            // Stop if job was interrupted
            if(getState()==INTERRUPTED)
                break;

            // Unmark file in active table if 'auto unmark' is enabled
            // and file was processed successfully
            if(autoUnmark && success) {
                // Do not repaint rows individually as it would be too expensive
                activeTable.setFileMarked(currentFile, false, false);
            }

            // If last file was reached without any user interruption, all files have been processed with or
            // without errors, switch to FINISHED state and notify listeners
            if(i==nbFiles-1) {
View Full Code Here

    public void dragGestureRecognized(DragGestureEvent event) {
        if(folderPanel.getMainFrame().getNoEventsMode())
            return;

        FileTable fileTable = folderPanel.getFileTable();
        FileTableModel tableModel = fileTable.getFileTableModel();

        // Return (do not initiate drag) if mouse button2 or button3 was used
        if((event.getTriggerEvent().getModifiers() & (InputEvent.BUTTON2_MASK|InputEvent.BUTTON3_MASK))!=0)
            return;

// Do not use that to retrieve the current selected file as it is inaccurate: the selection could have changed since the
// the mouse was clicked.        
//        AbstractFile selectedFile = fileTable.getSelectedFile(false);
//        // Return if selected file is null (could happen if '..' is selected)
//        if(selectedFile==null)
//            return;

        // Find out which row was clicked
        int clickedRow = fileTable.rowAtPoint(event.getDragOrigin());
        // Return (do not initiate drag) if the selected file is the parent folder '..'
        if (clickedRow==-1 || fileTable.isParentFolder(clickedRow))
            return;

        // Retrieve the file corresponding to the clicked row
        AbstractFile selectedFile = tableModel.getFileAtRow(clickedRow);

        // Find out which files are to be dragged, based on the selected file and currenlty marked files.
        // If there are some files marked, drag marked files only if the selected file is one of the marked files.
        // In any other case, only drag the selected file.
        FileSet markedFiles;
        FileSet draggedFiles;
        if(tableModel.getNbMarkedFiles()>0 && (markedFiles=fileTable.getSelectedFiles()).contains(selectedFile)) {
            draggedFiles = markedFiles;
        }
        else {
            draggedFiles = new FileSet(folderPanel.getCurrentFolder(), selectedFile);
        }
View Full Code Here

        ));
    }

    @Override
    public void performAction() {
        FileTable activeTable = mainFrame.getActiveTable();
        AbstractFile selectedFile = activeTable.getSelectedFile(false);

        // Trigger in-table editing only if a file other than parent folder '..' is selected
        if(selectedFile!=null) {
            // Trigger in-table renaming
            activeTable.editCurrentFilename();
        }
    }
View Full Code Here

    // MuAction implementation //
    /////////////////////////////

    @Override
    public void performAction() {
        FileTable activeTable = mainFrame.getActiveTable();

        activeTable.selectRow(Math.min(activeTable.getSelectedRow()+getRowIncrement(), activeTable.getRowCount()-1));
    }
View Full Code Here

    // MuAction implementation //
    /////////////////////////////

    @Override
    public void performAction() {
        FileTable activeTable = mainFrame.getActiveTable();

        activeTable.selectRow(Math.max(activeTable.getSelectedRow()-getRowDecrement(), 0));
    }
View Full Code Here

        // Abort if the focus is not in the MainFrame this action is tied to
        if(focusOwner==null)
            return;

        FolderPanel folderPanel = mainFrame.getActivePanel();
        FileTable fileTable = folderPanel.getFileTable();
        JTextField locationField = folderPanel.getLocationTextField();
        JTree tree = folderPanel.getFoldersTreePanel().getTree();

        // Request focus on the 'next' component, the cycle order being from left to right, top to bottom.
        Component nextComponent;
View Full Code Here

TOP

Related Classes of com.mucommander.ui.main.table.FileTable$FilenameEditor

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.