Search in sources :

Example 1 with FolderObjFilter

use of org.talend.dataprofiler.core.ui.filters.FolderObjFilter 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 FolderObjFilter

use of org.talend.dataprofiler.core.ui.filters.FolderObjFilter in project tdq-studio-se by Talend.

the class UDIUtils method createUdiCheckedTreeSelectionDialog.

/**
 * DOC xqliu Comment method "createUdiCheckedTreeSelectionDialog".
 *
 * @param meIndicator
 * @return
 */
public static CheckedTreeSelectionDialog createUdiCheckedTreeSelectionDialog(ModelElementIndicator meIndicator) {
    CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(null, new DQRepositoryViewLabelProvider(), new ResourceViewContentProvider());
    dialog.addFilter(new FolderObjFilter());
    DQRepositoryNode udiDialogInputData = AnalysisUtils.getSelectDialogInputData(EResourceConstant.USER_DEFINED_INDICATORS);
    dialog.setInput(udiDialogInputData);
    dialog.setValidator(new ISelectionStatusValidator() {

        public IStatus validate(Object[] selection) {
            for (Object patte : selection) {
                if (patte instanceof SysIndicatorDefinitionRepNode) {
                    SysIndicatorDefinitionRepNode udiNode = (SysIndicatorDefinitionRepNode) patte;
                    IndicatorDefinition indicatorDefinition = udiNode.getIndicatorDefinition();
                    boolean validStatus = TaggedValueHelper.getValidStatus(indicatorDefinition);
                    if (!validStatus) {
                        return new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, DefaultMessagesImpl.getString(// $NON-NLS-1$
                        "AnalysisColumnTreeViewer.chooseValidUdis"));
                    }
                }
            }
            return new // $NON-NLS-1$
            Status(// $NON-NLS-1$
            IStatus.OK, // $NON-NLS-1$
            PlatformUI.PLUGIN_ID, // $NON-NLS-1$
            IStatus.OK, // $NON-NLS-1$
            "", null);
        }
    });
    dialog.setContainerMode(true);
    dialog.setInitialSelections(getUDIFilesByIndicator(udiDialogInputData, meIndicator));
    // $NON-NLS-1$
    dialog.setTitle(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.udiSelector"));
    // $NON-NLS-1$
    dialog.setMessage(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.udis"));
    dialog.setSize(80, 30);
    return dialog;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) CheckedTreeSelectionDialog(org.eclipse.ui.dialogs.CheckedTreeSelectionDialog) ResourceViewContentProvider(org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider) UDIndicatorDefinition(org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition) DQRepositoryNode(org.talend.dq.nodes.DQRepositoryNode) FolderObjFilter(org.talend.dataprofiler.core.ui.filters.FolderObjFilter) SysIndicatorDefinitionRepNode(org.talend.dq.nodes.SysIndicatorDefinitionRepNode) ISelectionStatusValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator) DQRepositoryViewLabelProvider(org.talend.dataprofiler.core.ui.views.provider.DQRepositoryViewLabelProvider)

Aggregations

FolderObjFilter (org.talend.dataprofiler.core.ui.filters.FolderObjFilter)2 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 CheckedTreeSelectionDialog (org.eclipse.ui.dialogs.CheckedTreeSelectionDialog)1 ISelectionStatusValidator (org.eclipse.ui.dialogs.ISelectionStatusValidator)1 AbstractViewerFilter (org.talend.dataprofiler.core.ui.filters.AbstractViewerFilter)1 EMFObjFilter (org.talend.dataprofiler.core.ui.filters.EMFObjFilter)1 ReportingFilter (org.talend.dataprofiler.core.ui.filters.ReportingFilter)1 DQRepositoryViewLabelProvider (org.talend.dataprofiler.core.ui.views.provider.DQRepositoryViewLabelProvider)1 ResourceViewContentProvider (org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider)1 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)1 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)1 DQRepositoryNode (org.talend.dq.nodes.DQRepositoryNode)1 SysIndicatorDefinitionRepNode (org.talend.dq.nodes.SysIndicatorDefinitionRepNode)1