use of org.eclipse.ui.ResourceWorkingSetFilter in project translationstudio8 by heartsome.
the class WorkingSetActionProvider method setWorkingSetFilter.
private void setWorkingSetFilter(IWorkingSet workingSet, boolean firstTime) {
ResourceWorkingSetFilter workingSetFilter = null;
ViewerFilter[] filters = viewer.getFilters();
for (int i = 0; i < filters.length; i++) {
if (filters[i] instanceof ResourceWorkingSetFilter) {
workingSetFilter = (ResourceWorkingSetFilter) filters[i];
break;
}
}
if (workingSetFilter == null) {
if (firstTime) {
filterService.addActiveFilterIds(new String[] { WORKING_SET_FILTER_ID });
filterService.updateViewer();
setWorkingSetFilter(workingSet, !FIRST_TIME);
return;
}
WorkbenchNavigatorPlugin.log(//$NON-NLS-1$
"Required filter " + WORKING_SET_FILTER_ID + //$NON-NLS-1$
" is not present. Working set support will not function correctly.", //$NON-NLS-1$
new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, ""));
return;
}
workingSetFilter.setWorkingSet(emptyWorkingSet ? null : workingSet);
}
use of org.eclipse.ui.ResourceWorkingSetFilter in project pmd-eclipse-plugin by pmd.
the class BaseVisitor method isFileInWorkingSet.
/**
* Test if a file is in the PMD working set
*
* @param file
* @return true if the file should be checked
*/
private boolean isFileInWorkingSet(final IFile file) throws PropertiesException {
boolean fileInWorkingSet = true;
IWorkingSet workingSet = projectProperties.getProjectWorkingSet();
if (workingSet != null) {
ResourceWorkingSetFilter filter = new ResourceWorkingSetFilter();
filter.setWorkingSet(workingSet);
fileInWorkingSet = filter.select(null, null, file);
}
return fileInWorkingSet;
}
use of org.eclipse.ui.ResourceWorkingSetFilter in project pmd-eclipse-plugin by pmd.
the class CPDVisitor method setWorkingSet.
/**
* @param workingSet
* WorkingSet of the visited project.
*/
public void setWorkingSet(IWorkingSet workingSet) {
this.workingSetFilter = new ResourceWorkingSetFilter();
this.workingSetFilter.setWorkingSet(workingSet);
}
Aggregations