use of org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage in project tdq-studio-se by Talend.
the class RunAnalysisAction 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 mzhao 2009-02-03 If there is no active editor opened, run
// analysis action from cheat sheets will do nothing.
IEditorPart activateEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (activateEditor == null || !(activateEditor instanceof AnalysisEditor)) {
return;
}
// MOD TDQ-8117 20131008 yyin: find the analysis item from the editor
IEditorInput editorInput = activateEditor.getEditorInput();
if (editorInput instanceof AnalysisItemEditorInput) {
setAnalysisItems(new TDQAnalysisItem[] { ((TDQAnalysisItem) ((AnalysisItemEditorInput) editorInput).getItem()) });
}
AbstractAnalysisMetadataPage masterPage = ((AnalysisEditor) activateEditor).getMasterPage();
listener = masterPage;
// ~
run();
}
use of org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage in project tdq-studio-se by Talend.
the class IndicatorThresholdsForm method isContainRowCountIndicator.
private boolean isContainRowCountIndicator() {
IEditorPart editor = CorePlugin.getDefault().getCurrentActiveEditor();
if (editor == null) {
return false;
}
AbstractAnalysisMetadataPage masterPage = ((AnalysisEditor) editor).getMasterPage();
if (masterPage == null) {
return false;
}
// if the analysis type is TABLE Analysis, just return true
if (AnalysisType.TABLE.equals(masterPage.getAnalysisHandler().getAnalysis().getParameters().getAnalysisType())) {
return true;
}
ModelElementIndicator[] currentModelElementIndicators = masterPage.getCurrentModelElementIndicators();
if (currentModelElementIndicators == null) {
return false;
}
for (ModelElementIndicator meIndicator : currentModelElementIndicators) {
if (meIndicator != null && meIndicator.getIndicators() != null) {
for (Indicator indicator : meIndicator.getIndicators()) {
if (IndicatorsPackage.eINSTANCE.getRowCountIndicator().equals(indicator.eClass())) {
return true;
}
if (IndicatorsPackage.eINSTANCE.getCountsIndicator().equals(indicator.eClass())) {
CountsIndicator cInd = (CountsIndicator) indicator;
if (cInd.getRowCountIndicator() != null) {
return true;
}
}
if (ColumnsetPackage.eINSTANCE.getSimpleStatIndicator().equals(indicator.eClass())) {
return true;
}
}
}
}
return false;
}
use of org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage in project tdq-studio-se by Talend.
the class ColumnWizard method openEditor.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataprofiler.core.ui.wizard.analysis.AbstractAnalysisWizard#openEditor(org.talend.repository.model.IRepositoryNode
* )
*/
@Override
public void openEditor(IRepositoryNode repNode) {
super.openEditor(repNode);
if (this.selectionPage != null) {
AnalysisEditor editor = (AnalysisEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor != null) {
AbstractAnalysisMetadataPage masterPage = editor.getMasterPage();
List<IRepositoryNode> nodes = this.selectionPage.nodes;
if (nodes != null && nodes.size() > 0) {
// MOD msjian TDQ-6665 2013-1-7: after the wizard, make the editor is saved status
if (masterPage instanceof ColumnAnalysisDetailsPage) {
((ColumnAnalysisDetailsPage) masterPage).setTreeViewInput(nodes.toArray(new RepositoryNode[nodes.size()]));
ModelElementIndicator[] predefinedColumnIndicator = this.getPredefinedColumnIndicator();
if (predefinedColumnIndicator != null) {
((ColumnAnalysisDetailsPage) masterPage).refreshPreviewTable(predefinedColumnIndicator, false);
((ColumnAnalysisDetailsPage) masterPage).refreshTheTree(predefinedColumnIndicator);
}
// TDQ-12349: when the database can not support PatternFrequency, set to java engine automatically
if (this instanceof PatternFrequencyWizard && !RepNodeUtils.isSupportPatternFrequency(nodes)) {
masterPage.changeExecuteLanguageToJava(true);
}
// TDQ-12349~
} else if (masterPage instanceof ColumnSetAnalysisDetailsPage) {
((ColumnSetAnalysisDetailsPage) masterPage).setTreeViewInput(nodes.toArray(new RepositoryNode[nodes.size()]));
} else {
masterPage.getTreeViewer().setInput(nodes.toArray(new RepositoryNode[nodes.size()]));
}
masterPage.doSave(new NullProgressMonitor());
// TDQ-6665~
}
}
}
}
Aggregations