use of org.talend.dataprofiler.core.pattern.CreatePatternWizard 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