Search in sources :

Example 1 with NewMatchRuleWizard

use of org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard in project tdq-studio-se by Talend.

the class ExportMatchRuleAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    // if there are no match rule, or no keys in the match rule.
    if ((matchRule == null) || ((matchRule.getBlockKeys() == null || matchRule.getBlockKeys().size() < 1) && (matchRule.getMatchRules() == null || matchRule.getMatchRules().size() < 1))) {
        // $NON-NLS-1$
        MessageDialog.openWarning(// $NON-NLS-1$
        null, // $NON-NLS-1$
        DefaultMessagesImpl.getString("ExportMatchRuleAction.noRule"), // $NON-NLS-1$
        DefaultMessagesImpl.getString("ExportMatchRuleAction.noKeys"));
        return;
    }
    DQMatchRuleParameter parameter = new DQMatchRuleParameter();
    FolderProvider folderProvider = new FolderProvider();
    folderProvider.setFolderResource(ResourceManager.getRulesMatcherFolder());
    parameter.setFolderProvider(folderProvider);
    NewMatchRuleWizard matchWizard = WizardFactory.createNewMatchRuleWizard(parameter);
    matchWizard.setWindowTitle(getText());
    // TDQ-8236 used for display related help
    // $NON-NLS-1$
    matchWizard.setHelpContextId("org.talend.help.export_match_rule");
    matchWizard.setMatchRule(matchRule);
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), matchWizard);
    dialog.open();
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) NewMatchRuleWizard(org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard) DQMatchRuleParameter(org.talend.dq.analysis.parameters.DQMatchRuleParameter) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 2 with NewMatchRuleWizard

use of org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard in project tdq-studio-se by Talend.

the class CreateMatcherRuleAction method doRun.

public boolean doRun() {
    DQMatchRuleParameter parameter = new DQMatchRuleParameter();
    FolderProvider folderProvider = new FolderProvider();
    folderProvider.setFolderResource(folder);
    parameter.setFolderProvider(folderProvider);
    parameter.setDefaultAlgorithmType(defaultAlgorithmType);
    NewMatchRuleWizard matchWizard = WizardFactory.createNewMatchRuleWizard(parameter);
    matchWizard.setWindowTitle(getText());
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), matchWizard);
    if (WizardDialog.OK == dialog.open()) {
        ProxyRepositoryManager.getInstance().save();
        return true;
    }
    return false;
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) NewMatchRuleWizard(org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard) DQMatchRuleParameter(org.talend.dq.analysis.parameters.DQMatchRuleParameter) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)2 FolderProvider (org.talend.cwm.management.api.FolderProvider)2 NewMatchRuleWizard (org.talend.dataprofiler.core.ui.wizard.matchrule.NewMatchRuleWizard)2 DQMatchRuleParameter (org.talend.dq.analysis.parameters.DQMatchRuleParameter)2