use of org.eclipse.help.IContext in project tdq-studio-se by Talend.
the class NewWizardSelectionPage method addListeners.
protected void addListeners() {
typeTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
AnalysisTypeNode node = (AnalysisTypeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
if (node == null) {
return;
}
AnalysisTypeNode parent = (AnalysisTypeNode) node.getParent();
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getAnalysisHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = null;
String currentLiteral = node.getLiteral();
if (AnalysisLabelParameter.FUNCTIONAL_DEPENDENCY_ANALYSIS.equals(currentLiteral)) {
currentLiteral = AnalysisType.TABLE_FUNCTIONAL_DEPENDENCY.getLiteral();
} else if (AnalysisLabelParameter.CONNECTION_OVERVIEW_ANALYSIS.equals(currentLiteral)) {
currentLiteral = AnalysisType.CONNECTION.getLiteral();
} else if (AnalysisLabelParameter.CATALOG_OVERVIEW_ANALYSIS.equals(currentLiteral)) {
currentLiteral = AnalysisType.CATALOG.getLiteral();
} else if (AnalysisLabelParameter.SCHEMA_OVERVIEW_ANALYSIS.equals(currentLiteral)) {
currentLiteral = AnalysisType.SCHEMA.getLiteral();
}
AnalysisType currentType = AnalysisType.get(currentLiteral);
if (parent == null) {
setPageComplete(false);
// MOD hcheng 2009-06-05 add help in analysis wizard
switch(currentType) {
case CONNECTION:
href = relatedTopics[0].getHref();
break;
case COLUMNS_COMPARISON:
href = relatedTopics[4].getHref();
break;
case TABLE:
href = relatedTopics[6].getHref();
break;
case MULTIPLE_COLUMN:
href = relatedTopics[11].getHref();
break;
case COLUMN_CORRELATION:
href = relatedTopics[18].getHref();
break;
default:
}
} else {
AnalysisParameter parameter = null;
AnalysisType parentType = AnalysisType.get(parent.getLiteral());
FolderProvider folderProvider = getCurrentFolderProvider() == null ? ((CreateNewAnalysisWizard) getWizard()).getCurrentFolderProvider() : getCurrentFolderProvider();
switch(parentType) {
case COLUMN_CORRELATION:
AnalysisParameter correlationColumnParam = new AnalysisLabelParameter();
((AnalysisLabelParameter) correlationColumnParam).setCategoryLabel(node.getName());
correlationColumnParam.setFolderProvider(folderProvider);
parameter = correlationColumnParam;
if (AnalysisLabelParameter.NUMBERIC_CORRELATION.equals(currentLiteral)) {
href = relatedTopics[19].getHref();
} else if (AnalysisLabelParameter.DATE_CORRELATION.equals(currentLiteral)) {
href = relatedTopics[20].getHref();
} else if (AnalysisLabelParameter.NOMINAL_CORRELATION.equals(currentLiteral)) {
href = relatedTopics[21].getHref();
} else {
href = relatedTopics[18].getHref();
}
break;
case MULTIPLE_COLUMN:
AnalysisParameter multipleColumnParam = new AnalysisLabelParameter();
((AnalysisLabelParameter) multipleColumnParam).setCategoryLabel(node.getName());
multipleColumnParam.setFolderProvider(folderProvider);
parameter = multipleColumnParam;
if (AnalysisLabelParameter.SEMANTIC_DISCOVERY_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[12].getHref();
} else if (AnalysisLabelParameter.BASIC_COLUMN_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[13].getHref();
} else if (AnalysisLabelParameter.NOMINAL_VALUES_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[14].getHref();
} else if (AnalysisLabelParameter.PATTERN_FREQUENCY_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[15].getHref();
} else if (AnalysisLabelParameter.DISCRETE_DATA_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[16].getHref();
} else if (AnalysisLabelParameter.SUMMARY_STATISTICS_ANALYSIS.equals(currentLiteral)) {
href = relatedTopics[17].getHref();
} else {
href = relatedTopics[13].getHref();
}
break;
case COLUMNS_COMPARISON:
AnalysisParameter anaParam = new AnalysisParameter();
anaParam.setFolderProvider(folderProvider);
parameter = anaParam;
href = relatedTopics[5].getHref();
break;
case CONNECTION:
switch(currentType) {
case CONNECTION:
default:
AnalysisFilterParameter connParam = new AnalysisFilterParameter();
connParam.setFolderProvider(folderProvider);
parameter = connParam;
href = relatedTopics[1].getHref();
parentType = currentType;
break;
case CATALOG:
PackagesAnalyisParameter catalogParam = new PackagesAnalyisParameter();
catalogParam.setFolderProvider(folderProvider);
parameter = catalogParam;
href = relatedTopics[2].getHref();
parentType = currentType;
break;
case SCHEMA:
PackagesAnalyisParameter schemaParam = new PackagesAnalyisParameter();
schemaParam.setFolderProvider(folderProvider);
parameter = schemaParam;
href = relatedTopics[3].getHref();
parentType = currentType;
break;
}
break;
case TABLE:
switch(currentType) {
case MATCH_ANALYSIS:
parameter = new AnalysisParameter();
parameter.setFolderProvider(folderProvider);
href = relatedTopics[8].getHref();
parentType = currentType;
break;
case COLUMN_SET:
AnalysisParameter corrParam = new AnalysisParameter();
corrParam.setFolderProvider(folderProvider);
parameter = corrParam;
href = relatedTopics[10].getHref();
parentType = currentType;
break;
case TABLE_FUNCTIONAL_DEPENDENCY:
FuncationDependencyParameter funcationDependency = new FuncationDependencyParameter();
funcationDependency.setFolderProvider(folderProvider);
parameter = funcationDependency;
href = relatedTopics[9].getHref();
parentType = currentType;
break;
default:
NamedColumnSetAnalysisParameter tableParam = new NamedColumnSetAnalysisParameter();
tableParam.setFolderProvider(folderProvider);
parameter = tableParam;
href = relatedTopics[7].getHref();
break;
}
break;
default:
parameter = new AnalysisParameter();
}
selectedWizard = WizardFactory.createAnalysisWizard(parentType, parameter);
setPageComplete(true);
}
// MOD by hcheng,0007483: Add help in analysis wizard
OpeningHelpWizardDialog dialog = (OpeningHelpWizardDialog) getWizard().getContainer();
dialog.setHref(href);
dialog.showHelp();
}
});
typeTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
AnalysisTypeNode node = (AnalysisTypeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
if (node.getParent() == null) {
typeTreeViewer.expandToLevel(node, 1);
} else {
advanceToNextPageOrFinish();
}
}
});
}
use of org.eclipse.help.IContext in project tdq-studio-se by Talend.
the class ImportPatternsAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
ImportPatternsWizard wizard = new ImportPatternsWizard(folder, type);
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[2].getHref();
WizardDialog dialog = new OpeningHelpWizardDialog(null, wizard, href);
wizard.setWindowTitle(getText());
if (WizardDialog.OK == dialog.open()) {
if (this.node != null) {
CorePlugin.getDefault().refreshDQView(this.node);
}
}
}
use of org.eclipse.help.IContext in project tdq-studio-se by Talend.
the class CreateUDIAction method run.
@Override
public void run() {
if (this.folder == null) {
this.folder = ResourceManager.getUDIFolder();
}
UDIndicatorParameter parameter = new UDIndicatorParameter();
FolderProvider folderProvider = new FolderProvider();
folderProvider.setFolderResource(folder);
parameter.setFolderProvider(folderProvider);
NewUDIndicatorWizard fileWizard = WizardFactory.createNewUDIWizard(parameter);
fileWizard.setWindowTitle(getText());
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getUDIndicatorHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[0].getHref();
WizardDialog dialog = new OpeningHelpWizardDialog(null, fileWizard, href);
if (WizardDialog.OK == dialog.open()) {
ProxyRepositoryManager.getInstance().save();
}
}
use of org.eclipse.help.IContext 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();
}
}
use of org.eclipse.help.IContext in project tdq-studio-se by Talend.
the class ExportPatternsAction method run.
@Override
public void run() {
Wizard wizard = isForExchange ? new ExportForExchangeWizard(folder.getFullPath().toString()) : new ExportPatternsWizard(node, isForExchange);
WizardDialog dialog = null;
// MOD hcheng 2009-07-07,for 8122.Add an help file in the "Export patterns for Talend exchange wizard".
if (isForExchange) {
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[3].getHref();
dialog = new OpeningHelpWizardDialog(null, wizard, href);
} else {
// MOD yyi 2009-08-20,for 8689.Add help in "export pattern" wizard.
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[4].getHref();
dialog = new OpeningHelpWizardDialog(null, wizard, href);
}
wizard.setWindowTitle(getText());
if (WizardDialog.OK == dialog.open()) {
try {
folder.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
log.error(e, e);
}
}
}
Aggregations