Revision 44831 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/impl/DefaultFilesystemServerExplorer.java
DefaultFilesystemServerExplorer.java | ||
---|---|---|
28 | 28 |
import java.util.Iterator; |
29 | 29 |
import java.util.List; |
30 | 30 |
import java.util.Set; |
31 |
import java.util.function.Predicate; |
|
31 | 32 |
import org.apache.commons.io.FilenameUtils; |
32 | 33 |
|
33 | 34 |
import org.gvsig.fmap.dal.DALFileLocator; |
... | ... | |
59 | 60 |
import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension; |
60 | 61 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
61 | 62 |
import org.gvsig.tools.resourcesstorage.FilesResourcesStorage; |
63 |
import org.gvsig.tools.util.FilteredIterator; |
|
62 | 64 |
|
63 | 65 |
@SuppressWarnings("UseSpecificCatch") |
64 | 66 |
public class DefaultFilesystemServerExplorer extends AbstractDataServerExplorer |
... | ... | |
418 | 420 |
return providers; |
419 | 421 |
} |
420 | 422 |
|
423 |
@Override |
|
421 | 424 |
public Iterator getFilters(int mode) { |
422 |
return this.getProviders(mode).iterator(); |
|
425 |
final Iterator<FilesystemServerExplorerProvider> it = this.getProviders(mode).iterator(); |
|
426 |
return new FilteredIterator(it, new Predicate<FilesystemServerExplorerProvider>() { |
|
427 |
@Override |
|
428 |
public boolean test(FilesystemServerExplorerProvider p) { |
|
429 |
if( p instanceof AbstractFilesystemServerExplorerProvider ) { |
|
430 |
FilesystemServerExplorerProviderFactory factory = ((AbstractFilesystemServerExplorerProvider)p).getFactory(); |
|
431 |
if( factory!=null ) { |
|
432 |
return !factory.isHidden(); |
|
433 |
} |
|
434 |
} |
|
435 |
return true; |
|
436 |
} |
|
437 |
}); |
|
423 | 438 |
} |
424 | 439 |
|
440 |
@Override |
|
425 | 441 |
public Iterator<FilesystemServerExplorerProvider> getFilters() { |
426 |
return this.getProviders().iterator(); |
|
442 |
final Iterator<FilesystemServerExplorerProvider> it = this.getProviders().iterator(); |
|
443 |
return new FilteredIterator(it, new Predicate<FilesystemServerExplorerProvider>() { |
|
444 |
@Override |
|
445 |
public boolean test(FilesystemServerExplorerProvider p) { |
|
446 |
if( p instanceof AbstractFilesystemServerExplorerProvider ) { |
|
447 |
FilesystemServerExplorerProviderFactory factory = ((AbstractFilesystemServerExplorerProvider)p).getFactory(); |
|
448 |
if( factory!=null ) { |
|
449 |
return !factory.isHidden(); |
|
450 |
} |
|
451 |
} |
|
452 |
return true; |
|
453 |
} |
|
454 |
}); |
|
427 | 455 |
} |
428 | 456 |
|
457 |
@Override |
|
429 | 458 |
public FilesystemFileFilter getFilter(int mode, final String description) { |
430 | 459 |
|
431 | 460 |
final List filters = new ArrayList(); |
... | ... | |
435 | 464 |
} |
436 | 465 |
FilesystemFileFilter filter = new FilesystemFileFilter() { |
437 | 466 |
|
467 |
@Override |
|
438 | 468 |
public boolean accept(File f) { |
439 | 469 |
if (f.isDirectory()) { |
440 | 470 |
return true; |
... | ... | |
447 | 477 |
return false; |
448 | 478 |
} |
449 | 479 |
|
480 |
@Override |
|
450 | 481 |
public String getDescription() { |
451 | 482 |
return description; |
452 | 483 |
} |
453 | 484 |
|
485 |
@Override |
|
454 | 486 |
public String getDataStoreProviderName() { |
455 | 487 |
return null; |
456 | 488 |
} |
... | ... | |
458 | 490 |
return filter; |
459 | 491 |
} |
460 | 492 |
|
493 |
@Override |
|
461 | 494 |
public FilesystemFileFilter getGenericFilter() { |
462 | 495 |
// FIXME: Este metodo, getGenericFilter, no tengo claro que deba existir (jjdc) |
463 | 496 |
return this; |
464 | 497 |
} |
465 | 498 |
|
499 |
@Override |
|
466 | 500 |
public String getDataStoreProviderName() { |
467 | 501 |
return null; |
468 | 502 |
} |
Also available in: Unified diff