Search in sources :

Example 1 with MatchAnalysisDetailsPage

use of org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage in project tdq-studio-se by Talend.

the class MatchWizard method updateAnalysisBySelectedNode.

// when calling this method, the validation of the selection has been approved.the nodes will only contains one
// column set, or some columns from one same column set.
private void updateAnalysisBySelectedNode(AnalysisEditor editor) {
    MatchAnalysisDetailsPage masterPage = (MatchAnalysisDetailsPage) editor.getMasterPage();
    List<IRepositoryNode> nodes = selectionPage.nodes;
    if (nodes != null && nodes.size() > 0) {
        // if the first selected node is not column type(there should only one column set in the selected node then)
        if (!(nodes.get(0) instanceof ColumnRepNode)) {
            nodes = ((ColumnSetRepNode) nodes.get(0)).getAllColumns();
        }
        // update analyze data label by selected nodes names(don't cotain columnRepNode).
        if (nodes.size() > 0) {
            masterPage.updateAnalyzeDataLabel(nodes.get(0));
        }
        // give the selected columns to the master page
        masterPage.setSelectedNodes(nodes.toArray(new RepositoryNode[nodes.size()]));
        masterPage.doSave(new NullProgressMonitor());
        masterPage.updateAllColumnsToKeySection();
    }
}
Also used : ColumnRepNode(org.talend.dq.nodes.ColumnRepNode) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage)

Example 2 with MatchAnalysisDetailsPage

use of org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage in project tdq-studio-se by Talend.

the class MatchAnalysisAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    PackagesAnalyisParameter packaFilterParameter = new PackagesAnalyisParameter();
    if (needselection) {
        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);
        packaFilterParameter.setConnectionRepNode(repositoryNode);
    }
    if (openMatchAnalysisDialog(packaFilterParameter) == Window.OK) {
        AnalysisEditor editor = (AnalysisEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        if (editor != null) {
            MatchAnalysisDetailsPage page = (MatchAnalysisDetailsPage) editor.getMasterPage();
            IRepositoryNode[] columns = getColumns();
            if (this.needselection && columns.length > 0) {
                page.updateAnalyzeDataLabel(columns[0]);
                page.setSelectedNodes(columns);
            }
            page.doSave(null);
        }
    }
}
Also used : ConnectionItem(org.talend.core.model.properties.ConnectionItem) Item(org.talend.core.model.properties.Item) IRepositoryNode(org.talend.repository.model.IRepositoryNode) PackagesAnalyisParameter(org.talend.dq.analysis.parameters.PackagesAnalyisParameter) ConnectionItem(org.talend.core.model.properties.ConnectionItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Connection(org.talend.core.model.metadata.builder.connection.Connection) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) AnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage)

Example 3 with MatchAnalysisDetailsPage

use of org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage in project tdq-studio-se by Talend.

the class ExportMatchRuleAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
     * org.eclipse.ui.cheatsheets.ICheatSheetManager)
     */
public void run(String[] arg0, ICheatSheetManager arg1) {
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor instanceof MatchAnalysisEditor) {
        MatchAnalysisDetailsPage masterPage = (MatchAnalysisDetailsPage) ((MatchAnalysisEditor) editor).getMasterPage();
        RecordMatchingIndicator rmIndicator = MatchRuleAnlaysisUtils.getRecordMatchIndicatorFromAna(masterPage.getCurrentModelElement());
        this.matchRule = rmIndicator.getBuiltInMatchRuleDefinition();
        this.run();
    }
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage) MatchAnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)

Example 4 with MatchAnalysisDetailsPage

use of org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage in project tdq-studio-se by Talend.

the class CreateNewConnectionForMatchAnalysisAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
     * org.eclipse.ui.cheatsheets.ICheatSheetManager)
     */
public void run(String[] arg0, ICheatSheetManager arg1) {
    ConnectionWizard connectionWizard = new ConnectionWizard(PlatformUI.getWorkbench(), null);
    connectionWizard.setForcePreviousAndNextButtons(true);
    WizardDialog dialog = new WizardDialog(null, connectionWizard);
    dialog.setPageSize(500, 200);
    dialog.open();
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor instanceof MatchAnalysisEditor) {
        MatchAnalysisDetailsPage masterPage = (MatchAnalysisDetailsPage) ((MatchAnalysisEditor) editor).getMasterPage();
        if (masterPage.getAnalysisHandler() != null) {
            masterPage.openColumnsSelectionDialog(masterPage.getAnalysisHandler().getConnection());
        }
    }
}
Also used : ConnectionWizard(org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard) IEditorPart(org.eclipse.ui.IEditorPart) WizardDialog(org.eclipse.jface.wizard.WizardDialog) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage) MatchAnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)

Example 5 with MatchAnalysisDetailsPage

use of org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage in project tdq-studio-se by Talend.

the class SelectDataForMatchAnalysisAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[],
     * org.eclipse.ui.cheatsheets.ICheatSheetManager)
     */
public void run(String[] arg0, ICheatSheetManager arg1) {
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editor instanceof MatchAnalysisEditor) {
        MatchAnalysisDetailsPage masterPage = (MatchAnalysisDetailsPage) ((MatchAnalysisEditor) editor).getMasterPage();
        masterPage.openColumnsSelectionDialog(null);
    }
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) MatchAnalysisDetailsPage(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage) MatchAnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)

Aggregations

MatchAnalysisDetailsPage (org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisDetailsPage)5 IEditorPart (org.eclipse.ui.IEditorPart)3 MatchAnalysisEditor (org.talend.dataprofiler.core.ui.editor.analysis.MatchAnalysisEditor)3 IRepositoryNode (org.talend.repository.model.IRepositoryNode)2 RepositoryNode (org.talend.repository.model.RepositoryNode)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Connection (org.talend.core.model.metadata.builder.connection.Connection)1 ConnectionItem (org.talend.core.model.properties.ConnectionItem)1 Item (org.talend.core.model.properties.Item)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 AnalysisEditor (org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor)1 ConnectionWizard (org.talend.dataprofiler.core.ui.wizard.analysis.connection.ConnectionWizard)1 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)1 PackagesAnalyisParameter (org.talend.dq.analysis.parameters.PackagesAnalyisParameter)1 ColumnRepNode (org.talend.dq.nodes.ColumnRepNode)1