Search in sources :

Example 1 with MatchRuleMasterDetailsPage

use of org.talend.dataprofiler.core.ui.editor.matchrule.MatchRuleMasterDetailsPage 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)1 DefaultSaveAction (org.talend.dataprofiler.core.ui.action.actions.DefaultSaveAction)1 TdEditorToolBar (org.talend.dataprofiler.core.ui.editor.TdEditorToolBar)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