use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class CreateNewAnalysisAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
* org.eclipse.ui.cheatsheets.ICheatSheetManager)
*/
public void run(String[] params, ICheatSheetManager manager) {
// ADD xqliu TDQ-4285 2011-12-27
if (!CheatSheetActionHelper.canRun()) {
return;
}
// passed parameter.
if (params == null || params.length == 0) {
return;
}
Integer analysisCatigory = null;
if (NumberUtils.isNumber(params[0])) {
analysisCatigory = NumberUtils.toInt(params[0]);
}
AnalysisType analysisType = null;
Wizard wizard = null;
if (analysisCatigory != null) {
switch(analysisCatigory) {
case AnalysisType.BUSINESS_RULE_VALUE:
analysisType = AnalysisType.TABLE;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.TABLE_FUNCTIONAL_DEPENDENCY_VALUE:
analysisType = AnalysisType.TABLE_FUNCTIONAL_DEPENDENCY;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.COLUMN_SET_VALUE:
analysisType = AnalysisType.COLUMN_SET;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.MULTIPLE_COLUMN_VALUE:
analysisType = AnalysisType.MULTIPLE_COLUMN;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.CATALOG_VALUE:
analysisType = AnalysisType.CATALOG;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.SCHEMA_VALUE:
analysisType = AnalysisType.SCHEMA;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.COLUMNS_COMPARISON_VALUE:
analysisType = AnalysisType.COLUMNS_COMPARISON;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
case AnalysisType.COLUMN_CORRELATION_VALUE:
analysisType = AnalysisType.COLUMN_CORRELATION;
if (params[1] != null) {
if (NumberUtils.isNumber(params[1])) {
AnalysisLabelParameter parameter = new AnalysisLabelParameter();
parameter.setAnalysisTypeName(analysisType.getLiteral());
int correAnaType = NumberUtils.toInt(params[1]);
if (correAnaType == 0) {
parameter.setCategoryLabel(AnalysisLabelParameter.NUMBERIC_CORRELATION);
} else if (correAnaType == 1) {
parameter.setCategoryLabel(AnalysisLabelParameter.NOMINAL_CORRELATION);
} else {
parameter.setCategoryLabel(AnalysisLabelParameter.DATE_CORRELATION);
}
wizard = WizardFactory.createAnalysisWizard(analysisType, parameter);
}
}
break;
case AnalysisType.MATCH_ANALYSIS_VALUE:
analysisType = AnalysisType.MATCH_ANALYSIS;
wizard = WizardFactory.createAnalysisWizard(analysisType);
break;
default:
break;
}
}
if (analysisType == null || wizard == null) {
return;
}
wizard.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
if (WizardDialog.OK == dialog.open()) {
ProxyRepositoryManager.getInstance().save();
}
}
use of org.eclipse.jface.wizard.Wizard 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);
}
}
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class AbstractPredefinedAnalysisAction method getStandardAnalysisWizardDialog.
protected WizardDialog getStandardAnalysisWizardDialog(AnalysisType type, AnalysisParameter parameter) {
Wizard wizard = WizardFactory.createAnalysisWizard(type, parameter);
wizard.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
return dialog;
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class AnalyzeColumnAction method openStandardAnalysisDialog.
private int openStandardAnalysisDialog(AnalysisType type) {
// MOD klliu 2011-02-16 Modify this action for distincting CreateNewAnalysisAction feature 15387
IRepositoryNode firstElement = (RepositoryNode) this.selection.getFirstElement();
IRepositoryViewObject viewObject = firstElement.getObject();
Item item = viewObject.getProperty().getItem();
ConnectionItem connectionItem = (ConnectionItem) item;
Connection connection = connectionItem.getConnection();
IRepositoryNode repositoryNode = RepositoryNodeHelper.recursiveFind(connection);
AnalysisParameter parameter = new AnalysisParameter();
parameter.setConnectionRepNode(repositoryNode);
Wizard wizard = WizardFactory.createAnalysisWizard(type, parameter);
wizard.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.setPageSize(500, 340);
return dialog.open();
}
use of org.eclipse.jface.wizard.Wizard in project tdq-studio-se by Talend.
the class EditHDFSConnectionAction method run.
/*
* (non-Jsdoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
if (node != null) {
Wizard wizard = (Wizard) HadoopClusterUtils.getDefault().createHDFSWizard(PlatformUI.getWorkbench(), false, (RepositoryNode) node, null);
WizardDialog dialog = new WizardDialog(null, wizard);
if (Window.OK == dialog.open()) {
CorePlugin.getDefault().refreshDQView(node.getParent());
}
}
}
Aggregations