Search in sources :

Example 1 with DefaultSaveAction

use of org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction in project tdq-studio-se by Talend.

the class IndicatorEditor method addPages.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.CommonFormEditor#addPages()
     */
@Override
protected void addPages() {
    // TDQ-8453 according to the type to use IndicatorDefinition or UDI master page
    if (isSystemIndicator()) {
        // $NON-NLS-1$
        masterPage = new IndicatorDefinitionMaterPage(this, ID, "Indicator Definition");
    } else {
        // $NON-NLS-1$
        masterPage = new UDIMasterPage(this, ID, "User Define Indicator Definition");
    }
    try {
        addPage(masterPage);
        setPartName(masterPage.getIntactElemenetName());
    } catch (PartInitException e) {
        ExceptionHandler.process(e, Level.ERROR);
    }
    TdEditorToolBar toolbar = getToolBar();
    if (toolbar != null && masterPage != null) {
        saveAction = new DefaultSaveAction(this);
        toolbar.addActions(saveAction);
        setSaveActionButtonState(false);
    }
}
Also used : PartInitException(org.eclipse.ui.PartInitException) DefaultSaveAction(org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction) TdEditorToolBar(org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)

Example 2 with DefaultSaveAction

use of org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction in project tdq-studio-se by Talend.

the class PatternEditor method addPages.

@Override
protected void addPages() {
    // $NON-NLS-1$
    masterPage = new PatternMasterDetailsPage(this, ID, DefaultMessagesImpl.getString("PatternEditor.patternSettings"));
    // MOD qiongli 2011-3-21,bug 19472.set method 'setPartName(...)' behind method 'addPage(...)'
    try {
        addPage(masterPage);
        setPartName(masterPage.getIntactElemenetName());
    } catch (PartInitException e) {
        ExceptionHandler.process(e, Level.ERROR);
    }
    TdEditorToolBar toolbar = getToolBar();
    if (toolbar != null && masterPage != null) {
        saveAction = new DefaultSaveAction(this);
        toolbar.addActions(saveAction);
    }
}
Also used : PartInitException(org.eclipse.ui.PartInitException) DefaultSaveAction(org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction) TdEditorToolBar(org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)

Example 3 with DefaultSaveAction

use of org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction in project tdq-studio-se by Talend.

the class AnalysisEditor method addPages.

@Override
protected void addPages() {
    TdEditorToolBar toolbar = getToolBar();
    if (toolbar != null) {
        saveAction = new DefaultSaveAction(this);
        runAction = new RunAnalysisAction();
        toolbar.addActions(saveAction, runAction);
    }
    switch(analysisType) {
        case COLUMN_CORRELATION:
            masterPage = new CorrelationAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new CorrelationAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case MULTIPLE_COLUMN:
            masterPage = new ColumnAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new ColumnAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case CONNECTION:
            masterPage = new ConnectionAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new OverviewResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case CATALOG:
            masterPage = new CatalogAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new OverviewResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case SCHEMA:
            masterPage = new SchemaAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new OverviewResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case COLUMNS_COMPARISON:
            masterPage = new RedundancyAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new RedundancyAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case TABLE:
            masterPage = new BusinessRuleAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new BusinessRuleAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case TABLE_FUNCTIONAL_DEPENDENCY:
            masterPage = new FunctionalDependencyAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new FunctionalDependencyAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case COLUMN_SET:
            masterPage = new ColumnSetAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new ColumnSetAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        case // Added 20130724 TDQ-7504
        MATCH_ANALYSIS:
            masterPage = new MatchAnalysisDetailsPage(this, MASTER_PAGE, ANALYSIS_SETTINGS);
            resultPage = new MatchAnalysisResultPage(this, RESULT_PAGE, ANALYSIS_RESULTS);
            break;
        default:
    }
    try {
        if (masterPage != null) {
            addPage(masterPage);
            setPartName(masterPage.getIntactElemenetName());
            initContext();
            // Added 20130930 TDQ-8117, yyin
            // init the run analysis action, to give it the analysis item and listener
            this.runAction.setAnalysisItems(new TDQAnalysisItem[] { (TDQAnalysisItem) getMasterPage().getCurrentRepNode().getObject().getProperty().getItem() });
        }
        if (resultPage != null) {
            addPage(resultPage);
        }
    } catch (PartInitException e) {
        ExceptionHandler.process(e, Level.ERROR);
    }
    // Added 20130725 TDQ-7639 yyin : register the run analysis event, which need to refresh the pages
    registerUpdateExecutionEvent();
}
Also used : RunAnalysisAction(org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction) PartInitException(org.eclipse.ui.PartInitException) DefaultSaveAction(org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction) TdEditorToolBar(org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)

Example 4 with DefaultSaveAction

use of org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction in project tdq-studio-se by Talend.

the class DQRuleEditor method addPages.

@Override
protected void addPages() {
    ModelElement currentRuleModelElement = getCurrentModelElement();
    try {
        if (currentRuleModelElement != null) {
            if (currentRuleModelElement instanceof ParserRule) {
                parserPage = new ParserRuleMasterDetailsPage(this, ID, // $NON-NLS-1$
                DefaultMessagesImpl.getString("DQRuleEditor.parserRuleSettings"));
                addPage(parserPage);
                setPartName(parserPage.getIntactElemenetName());
            } else if (currentRuleModelElement instanceof MatchRuleDefinition) {
                matchPage = new MatchRuleMasterDetailsPage(this);
                addPage(matchPage);
                setPartName(matchPage.getIntactElemenetName());
                setTitleImage(ImageLib.getImage(ImageLib.MATCH_RULE_WHITE_ICON));
            } else {
                masterPage = new DQRuleMasterDetailsPage(this, ID, // $NON-NLS-1$
                DefaultMessagesImpl.getString("DQRuleEditor.dqRuleSettings"));
                addPage(masterPage);
                setPartName(masterPage.getIntactElemenetName());
            }
        }
    } catch (PartInitException e) {
        ExceptionHandler.process(e, Level.ERROR);
    }
    // ADD xqliu 2009-07-02 bug 7687
    TdEditorToolBar toolbar = getToolBar();
    // MOD msjian 2011-9-22 TDQ-3372: Add a "save" button in the parser rule editor
    if (toolbar != null && (masterPage != null || parserPage != null || matchPage != null)) {
        // TDQ-3372 ~
        saveAction = new DefaultSaveAction(this);
        saveAction.setEnabled(false);
        toolbar.addActions(saveAction);
    }
// ~
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ParserRule(org.talend.dataquality.rules.ParserRule) MatchRuleDefinition(org.talend.dataquality.rules.MatchRuleDefinition) PartInitException(org.eclipse.ui.PartInitException) MatchRuleMasterDetailsPage(org.talend.dataprofiler.core.ui.editor.matchrule.MatchRuleMasterDetailsPage) DefaultSaveAction(org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction) TdEditorToolBar(org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)

Aggregations

PartInitException (org.eclipse.ui.PartInitException)4 DefaultSaveAction (org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction)4 TdEditorToolBar (org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)4 RunAnalysisAction (org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction)1 MatchRuleMasterDetailsPage (org.talend.dataprofiler.core.ui.editor.matchrule.MatchRuleMasterDetailsPage)1 MatchRuleDefinition (org.talend.dataquality.rules.MatchRuleDefinition)1 ParserRule (org.talend.dataquality.rules.ParserRule)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1