Search in sources :

Example 6 with PatternParameter

use of org.talend.dq.analysis.parameters.PatternParameter in project tdq-studio-se by Talend.

the class AddPatternISBN13Task method setTagValue.

private void setTagValue(Pattern pattern, String purpose, String decription) {
    TaggedValueHelper.setTaggedValue(pattern, TaggedValueHelper.DESCRIPTION, decription);
    TaggedValueHelper.setTaggedValue(pattern, TaggedValueHelper.PURPOSE, purpose);
    TaggedValueHelper.setTaggedValue(pattern, TaggedValueHelper.VALID_STATUS, String.valueOf(true));
    if (parameter == null) {
        parameter = new PatternParameter();
    }
    MetadataHelper.setDevStatus(pattern, parameter.getStatus());
    MetadataHelper.setAuthor(pattern, parameter.getAuthor());
    MetadataHelper.setVersion(parameter.getVersion(), pattern);
}
Also used : PatternParameter(org.talend.dq.analysis.parameters.PatternParameter)

Example 7 with PatternParameter

use of org.talend.dq.analysis.parameters.PatternParameter in project tdq-studio-se by Talend.

the class CreatePatternAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    if (folder.exists()) {
        PatternParameter parameter = new PatternParameter();
        FolderProvider folderProvider = new FolderProvider();
        folderProvider.setFolderResource(folder);
        parameter.setFolderProvider(folderProvider);
        CreatePatternWizard fileWizard;
        if (this.expression != null && this.lanuage != null) {
            fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter, expression, lanuage);
        } else {
            fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter);
        }
        fileWizard.setPurpose(purpose);
        IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
        IHelpResource[] relatedTopics = context.getRelatedTopics();
        String href = relatedTopics[0].getHref();
        switch(type) {
            case SQL_LIKE:
                href = relatedTopics[1].getHref();
                break;
            default:
                break;
        }
        WizardDialog dialog = new OpeningHelpWizardDialog(Display.getDefault().getActiveShell(), fileWizard, href);
        fileWizard.setWindowTitle(getText());
        if (WizardDialog.OK == dialog.open())
            ProxyRepositoryManager.getInstance().save();
    }
}
Also used : FolderProvider(org.talend.cwm.management.api.FolderProvider) IContext(org.eclipse.help.IContext) CreatePatternWizard(org.talend.dataprofiler.core.pattern.CreatePatternWizard) IHelpResource(org.eclipse.help.IHelpResource) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) PatternParameter(org.talend.dq.analysis.parameters.PatternParameter) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

PatternParameter (org.talend.dq.analysis.parameters.PatternParameter)7 IFolder (org.eclipse.core.resources.IFolder)2 Pattern (org.talend.dataquality.domain.pattern.Pattern)2 ArrayList (java.util.ArrayList)1 IFile (org.eclipse.core.resources.IFile)1 IContext (org.eclipse.help.IContext)1 IHelpResource (org.eclipse.help.IHelpResource)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Combo (org.eclipse.swt.widgets.Combo)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 FolderProvider (org.talend.cwm.management.api.FolderProvider)1 CreatePatternWizard (org.talend.dataprofiler.core.pattern.CreatePatternWizard)1 OpeningHelpWizardDialog (org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog)1 PatternComponent (org.talend.dataquality.domain.pattern.PatternComponent)1