use of org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter in project tdq-studio-se by Talend.
the class DQRespositoryView method addViewerFilter.
public void addViewerFilter(int viewerFilterId) {
if (filterMap.containsKey(String.valueOf(viewerFilterId))) {
return;
}
AbstractViewerFilter filter = null;
switch(viewerFilterId) {
case EMFObjFilter.FILTER_ID:
filter = new EMFObjFilter();
filterMap.put(String.valueOf(EMFObjFilter.FILTER_ID), filter);
break;
case ReportingFilter.FILTER_ID:
filter = new ReportingFilter();
filterMap.put(String.valueOf(ReportingFilter.FILTER_ID), filter);
break;
case FolderObjFilter.FILTER_ID:
filter = new FolderObjFilter();
filterMap.put(String.valueOf(FolderObjFilter.FILTER_ID), filter);
break;
default:
filter = new ReportingFilter();
filterMap.put(String.valueOf(ReportingFilter.FILTER_ID), filter);
}
getCommonViewer().addFilter(filter);
}
use of org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter in project tdq-studio-se by Talend.
the class TwoPartCheckSelectionDialog method addConnFilterListener.
/**
* DOC mzhao 2009-05-05 bug: 6587, Add connection metadata filter.
*/
private void addConnFilterListener() {
AbstractViewerFilter connFiler = new AbstractViewerFilter() {
@Override
public int getId() {
return 0;
}
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof DBConnectionRepNode) {
DBConnectionRepNode node = (DBConnectionRepNode) element;
Integer selectIndex = metadataFormPage.getConnCombo().getSelectionIndex();
Integer connectionIndex = null;
Property property = (node.getObject()).getProperty();
ModelElement modelelement = PropertyHelper.getModelElement(property);
String dataKey = property.getDisplayName() + RepositoryNodeHelper.getConnectionType(node);
// $NON-NLS-1$
Object value = metadataFormPage.getConnCombo().getData(modelelement == null ? "" : dataKey);
if (value != null && value instanceof Integer) {
connectionIndex = (Integer) value;
}
return (connectionIndex != null && selectIndex.intValue() == connectionIndex.intValue());
}
return true;
}
};
addFilter(connFiler);
}
Aggregations