pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: FileBrowserSheet with filter
Date Sun, 18 Apr 2010 19:51:32 GMT
> Actualy, With FileBrowserSheet can i use a filter to select only *.xls files ?

You can do this by setting a disabled file filter on your file browser sheet:

    fileBrowserSheet.setDisabledFileFilter(new Filter<File>() {                    
        @Override
        public boolean include(File file) {
            return (file.isFile()
                && !file.getName().endsWith(".xls"));
        }
    });

By default, disabled files will still appear but will not be selectable. To hide them, you
can set the "hideDisabledFiles" style:
    
    fileBrowserSheet.getStyles().put("hideDisabledFiles", true);

Note that, while these examples are written in Java, you can also do this in WTKX.

Hope this helps.

Greg


Mime
View raw message