Search in sources :

Example 1 with AbstractViewerFilter

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);
}
Also used : AbstractViewerFilter(org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter) EMFObjFilter(org.talend.dataprofiler.core.ui.filters.EMFObjFilter) ReportingFilter(org.talend.dataprofiler.core.ui.filters.ReportingFilter) FolderObjFilter(org.talend.dataprofiler.core.ui.filters.FolderObjFilter)

Example 2 with AbstractViewerFilter

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);
}
Also used : AbstractViewerFilter(org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) DBConnectionRepNode(org.talend.dq.nodes.DBConnectionRepNode) CheckboxTableViewer(org.eclipse.jface.viewers.CheckboxTableViewer) Viewer(org.eclipse.jface.viewers.Viewer) CheckboxTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject) Property(org.talend.core.model.properties.Property)

Aggregations

AbstractViewerFilter (org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter)2 CheckboxTableViewer (org.eclipse.jface.viewers.CheckboxTableViewer)1 CheckboxTreeViewer (org.eclipse.jface.viewers.CheckboxTreeViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 Property (org.talend.core.model.properties.Property)1 ISubRepositoryObject (org.talend.core.model.repository.ISubRepositoryObject)1 EMFObjFilter (org.talend.dataprofiler.core.ui.filters.EMFObjFilter)1 FolderObjFilter (org.talend.dataprofiler.core.ui.filters.FolderObjFilter)1 ReportingFilter (org.talend.dataprofiler.core.ui.filters.ReportingFilter)1 DBConnectionRepNode (org.talend.dq.nodes.DBConnectionRepNode)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1