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);
}
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();
}
}
Aggregations