Package com.mucommander.desktop

Examples of com.mucommander.desktop.AbstractTrash


public class EmptyTrashAction extends MuAction {

    public EmptyTrashAction(MainFrame mainFrame, Map<String,Object> properties) {
        super(mainFrame, properties);

        AbstractTrash trash = DesktopManager.getTrash();
        setEnabled(trash!=null && trash.canEmpty());
    }
View Full Code Here


public class OpenTrashAction extends MuAction {

    public OpenTrashAction(MainFrame mainFrame, Map<String,Object> properties) {
        super(mainFrame, properties);

        AbstractTrash trash = DesktopManager.getTrash();
        setEnabled(trash!=null && trash.canOpen());
    }
View Full Code Here

    @Override
    public JPopupMenu getPopupMenu() {
        JPopupMenu popupMenu = new JPopupMenu();

        AbstractTrash trash = DesktopManager.getTrash();
        if(trash!=null) {
            if(trash.canOpen())
                popupMenu.add(ActionManager.getActionInstance(OpenTrashAction.Descriptor.ACTION_ID, mainFrame));

            if(trash.canEmpty()) {
                JMenuItem emptyTrashItem = new JMenuItem(ActionManager.getActionInstance(EmptyTrashAction.Descriptor.ACTION_ID, mainFrame));

                // Retrieve the number of items that the trash contains, -1 if this information is not available.
                int itemCount = trash.getItemCount();
                if(itemCount==0) {
                    // Disable the 'empty trash' action if the trash contains no item
                    emptyTrashItem.setEnabled(false);
                }
                else if(itemCount>0) {
View Full Code Here

        // Allow 'Move to trash' option only if:
        // - the current platform has a trash
        // - the base folder is not an archive
        // - the base folder of the to-be-deleted files is not a trash folder or one of its children
        // - the base folder can be moved to the trash (the eligibility conditions should be the same as the files to-be-deleted)
        AbstractTrash trash = DesktopManager.getTrash();
        AbstractFile baseFolder = files.getBaseFolder();
        if(trash!=null && !baseFolder.isArchive() && !trash.isTrashFile(baseFolder) && trash.canMoveToTrash(baseFolder)) {
            moveToTrash = !deletePermanently;

            moveToTrashCheckBox = new JCheckBox(Translator.get("delete_dialog.move_to_trash.option"), moveToTrash);
            moveToTrashCheckBox.addItemListener(this);
        }
View Full Code Here

TOP

Related Classes of com.mucommander.desktop.AbstractTrash

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.