//# 0 errors, 23 messages
//#
/*
    //#ExecutableFileFilter.java:1:1: class: com.dmdirc.addons.ui_swing.components.ExecutableFileFilter
    //#ExecutableFileFilter.java:1:1: method: com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.ui_swing.components;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 * Filters non executable files.
 */
public class ExecutableFileFilter extends FileFilter {
    //#ExecutableFileFilter.java:31: method: void com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.com.dmdirc.addons.ui_swing.components.ExecutableFileFilter()
    //#input(void com.dmdirc.addons.ui_swing.components.ExecutableFileFilter()): this
    //#ExecutableFileFilter.java:31: end of method: void com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.com.dmdirc.addons.ui_swing.components.ExecutableFileFilter()

    /**
     * {@inheritDoc}
     * 
     * @param file File to check
     */
    @Override
    public boolean accept(final File file) {
        return (file.isDirectory() || file.canExecute());
    //#ExecutableFileFilter.java:40: method: bool com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.accept(File)
    //#input(bool accept(File)): file
    //#output(bool accept(File)): return_value
    //#pre[1] (bool accept(File)): file != null
    //#post(bool accept(File)): init'ed(return_value)
    //#ExecutableFileFilter.java:40: end of method: bool com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.accept(File)
    }

    /** 
     * {@inheritDoc}
     * 
     * @return Description
     */
    @Override
    public String getDescription() {
        return "Executable files";
    //#ExecutableFileFilter.java:50: method: String com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.getDescription()
    //#output(String getDescription()): return_value
    //#post(String getDescription()): return_value == &"Executable files"
    //#ExecutableFileFilter.java:50: end of method: String com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.getDescription()
    }
}    //#output(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/ExecutableFileFilter]
    //#output(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Dispatch_Table.accept(Ljava/io/File;)Z
    //#output(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Dispatch_Table.getDescription()Ljava/lang/String;
    //#post(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/ExecutableFileFilter] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Dispatch_Table.accept(Ljava/io/File;)Z == &accept
    //#post(com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init): __Dispatch_Table.getDescription()Ljava/lang/String; == &getDescription
    //#ExecutableFileFilter.java:: end of method: com.dmdirc.addons.ui_swing.components.ExecutableFileFilter.com.dmdirc.addons.ui_swing.components.ExecutableFileFilter__static_init
    //#ExecutableFileFilter.java:: end of class: com.dmdirc.addons.ui_swing.components.ExecutableFileFilter
