public abstract class AbstractSyncFileFilter extends Object
Modifier and Type | Class and Description |
---|---|
class |
AbstractSyncFileFilter.AbstractIgnoreRule
Abstract class for ignore rules
|
Modifier and Type | Field and Description |
---|---|
protected List<AbstractSyncFileFilter.AbstractIgnoreRule> |
rules |
Constructor and Description |
---|
AbstractSyncFileFilter() |
Modifier and Type | Method and Description |
---|---|
void |
addPattern(IResource resource,
boolean exclude)
Add the resource pattern
|
abstract void |
addPattern(IResource resource,
boolean exclude,
int index)
Add resource pattern.
|
void |
addPattern(String pattern,
boolean exclude)
Add the pattern
|
abstract void |
addPattern(String pattern,
boolean exclude,
int index)
Add pattern.
|
abstract AbstractSyncFileFilter |
clone() |
boolean |
demote(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
Swap a pattern with its higher-index neighbor
Assumes pattern appears no more than once
|
List<AbstractSyncFileFilter.AbstractIgnoreRule> |
getPatterns()
Get all patterns for this filter
|
List<AbstractSyncFileFilter.AbstractIgnoreRule> |
getRules()
Get the rules in this filter.
|
boolean |
promote(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
Swap a pattern with its lower-index neighbor
Assumes pattern only appears once
|
void |
removePattern(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
Remove a pattern from the filter
Assumes pattern appears no more than once
|
boolean |
replacePattern(AbstractSyncFileFilter.AbstractIgnoreRule oldRule,
String newPattern,
boolean exclude)
Replace pattern with another - useful for when existing patterns are edited
|
abstract void |
saveFilter()
Save filters
|
boolean |
shouldIgnore(IResource r)
Apply the filter to the given string
|
boolean |
shouldIgnore(String path,
boolean isFolder)
Apply the filter to the given string
|
protected final List<AbstractSyncFileFilter.AbstractIgnoreRule> rules
public List<AbstractSyncFileFilter.AbstractIgnoreRule> getRules()
public void addPattern(String pattern, boolean exclude)
pattern
- pattern to addexclude
- exclude flagpublic void addPattern(IResource resource, boolean exclude)
resource
- resourceexclude
- exclude flagpublic abstract void addPattern(String pattern, boolean exclude, int index)
pattern
- pattern to addexclude
- exclude flagindex
- location of pattern in the listpublic abstract void addPattern(IResource resource, boolean exclude, int index)
resource
- resource to addexclude
- true: exclude resource, false: include resourceindex
- location of pattern in the listpublic boolean demote(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
pattern
- public List<AbstractSyncFileFilter.AbstractIgnoreRule> getPatterns()
public boolean promote(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
pattern
- public void removePattern(AbstractSyncFileFilter.AbstractIgnoreRule pattern)
pattern
- public boolean replacePattern(AbstractSyncFileFilter.AbstractIgnoreRule oldRule, String newPattern, boolean exclude)
oldRule
- newPattern
- type
- public boolean shouldIgnore(IResource r)
s
- - the stringpublic boolean shouldIgnore(String path, boolean isFolder)
s
- - the stringpublic abstract void saveFilter() throws IOException
IOException
public abstract AbstractSyncFileFilter clone()
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.