use of org.eclipse.wst.common.project.facet.core.util.AbstractFilter in project webtools.sourceediting by eclipse.
the class DataModelFacetCreationWizardPage method createPresetPanel.
protected void createPresetPanel(Composite top) {
final IFacetedProjectWorkingCopy workingCopy = ((ModifyFacetedProjectWizard) getWizard()).getFacetedProjectWorkingCopy();
final IFilter<IPreset> filter = new AbstractFilter<IPreset>() {
{
IFacetedProjectListener fpjwcListenerForPreset = new IFacetedProjectListener() {
@Override
public void handleEvent(final IFacetedProjectEvent event) {
handleProjectFacetsChangedEvent((IProjectFacetsChangedEvent) event);
}
};
facetedProjectListeners.add(fpjwcListenerForPreset);
workingCopy.addListener(fpjwcListenerForPreset, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
}
@Override
public boolean check(final IPreset preset) {
final IProjectFacetVersion primaryFacetVersion = getPrimaryFacetVersion();
return preset.getProjectFacets().contains(primaryFacetVersion);
}
private void handleProjectFacetsChangedEvent(final IProjectFacetsChangedEvent event) {
for (IProjectFacetVersion fv : event.getFacetsWithChangedVersions()) {
if (fv.getProjectFacet() == getPrimaryFacet()) {
final IFilterEvent<IPreset> filterEvent = new FilterEvent<IPreset>(this, IFilterEvent.Type.FILTER_CHANGED);
notifyListeners(filterEvent);
}
}
}
};
final PresetSelectionPanel ppanel = new PresetSelectionPanel(top, workingCopy, filter);
ppanel.setLayoutData(gdhfill());
}
Aggregations