Search in sources :

Example 26 with Wizard

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();
    }
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) CreateNewAnalysisWizard(org.talend.dataprofiler.core.ui.wizard.analysis.CreateNewAnalysisWizard) Wizard(org.eclipse.jface.wizard.Wizard) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) AnalysisLabelParameter(org.talend.dq.analysis.parameters.AnalysisLabelParameter)

Example 27 with Wizard

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);
        }
    }
}
Also used : ExportPatternsWizard(org.talend.dataprofiler.core.pattern.ExportPatternsWizard) IContext(org.eclipse.help.IContext) CoreException(org.eclipse.core.runtime.CoreException) ExportForExchangeWizard(org.talend.dataprofiler.core.ui.imex.ExportForExchangeWizard) IHelpResource(org.eclipse.help.IHelpResource) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) Wizard(org.eclipse.jface.wizard.Wizard) ExportPatternsWizard(org.talend.dataprofiler.core.pattern.ExportPatternsWizard) ExportForExchangeWizard(org.talend.dataprofiler.core.ui.imex.ExportForExchangeWizard) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 28 with Wizard

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;
}
Also used : Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 29 with Wizard

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();
}
Also used : Item(org.talend.core.model.properties.Item) ConnectionItem(org.talend.core.model.properties.ConnectionItem) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ConnectionItem(org.talend.core.model.properties.ConnectionItem) AnalysisParameter(org.talend.dq.analysis.parameters.AnalysisParameter) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Connection(org.talend.core.model.metadata.builder.connection.Connection) IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 30 with Wizard

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());
        }
    }
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

Wizard (org.eclipse.jface.wizard.Wizard)40 WizardDialog (org.eclipse.jface.wizard.WizardDialog)34 InvocationTargetException (java.lang.reflect.InvocationTargetException)9 CoreException (org.eclipse.core.runtime.CoreException)7 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)7 IOException (java.io.IOException)6 IFile (org.eclipse.core.resources.IFile)6 Path (org.eclipse.core.runtime.Path)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)5 Shell (org.eclipse.swt.widgets.Shell)5 InvalidAlgorithmParameterException (de.flexiprovider.api.exceptions.InvalidAlgorithmParameterException)4 NoSuchAlgorithmException (de.flexiprovider.api.exceptions.NoSuchAlgorithmException)4 AlgorithmParameterSpec (de.flexiprovider.api.parameters.AlgorithmParameterSpec)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 IContainer (org.eclipse.core.resources.IContainer)4 IResource (org.eclipse.core.resources.IResource)4 ResourcesPlugin (org.eclipse.core.resources.ResourcesPlugin)4 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)4 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)4 INewWizard (org.eclipse.ui.INewWizard)4