use of org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction in project tdq-studio-se by Talend.
the class CorrelationAnalysisDetailsPage method createPreviewSection.
void createPreviewSection(final ScrolledForm form, Composite parent) {
previewSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(previewSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
Button chartButton = new Button(sectionClient, SWT.NONE);
// $NON-NLS-1$
chartButton.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.refreshGraphics"));
final Label message = toolkit.createLabel(sectionClient, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.spaceWhite"));
message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
message.setVisible(false);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
final Analysis analysis = correlationAnalysisHandler.getAnalysis();
chartButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Control control : chartComposite.getChildren()) {
control.dispose();
}
boolean analysisStatue = analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
if (!analysisStatue) {
boolean returnCode = MessageDialog.openConfirm(null, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.ViewResult"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.RunOrSeeSampleData"));
if (returnCode) {
new RunAnalysisAction().run();
message.setVisible(false);
} else {
createPreviewCharts(form, chartComposite, false);
// $NON-NLS-1$
message.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.warning"));
message.setVisible(true);
}
} else {
createPreviewCharts(form, chartComposite, true);
}
chartComposite.layout();
form.reflow(true);
}
});
previewSection.setClient(sectionClient);
}
use of org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction in project tdq-studio-se by Talend.
the class DynamicAnalysisMasterPage method createPreviewSection.
void createPreviewSection(final ScrolledForm form1, Composite parent) {
previewSection = createSection(form1, parent, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(previewSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite actionBarComp = toolkit.createComposite(sectionClient);
GridLayout gdLayout = new GridLayout();
gdLayout.numColumns = 3;
actionBarComp.setLayout(gdLayout);
createCollapseAllLink(actionBarComp);
createExpandAllLink(actionBarComp);
Button chartButton = new Button(actionBarComp, SWT.NONE);
// $NON-NLS-1$
chartButton.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.refreshGraphics"));
final Label message = toolkit.createLabel(sectionClient, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.spaceWhite"));
message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
message.setVisible(false);
chartButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
disposeChartComposite();
Analysis analysis = getAnalysisHandler().getAnalysis();
boolean analysisStatue = analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
if (!analysisStatue) {
boolean returnCode = MessageDialog.openConfirm(null, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.ViewResult"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.RunOrSeeSampleData"));
if (returnCode) {
new RunAnalysisAction().run();
message.setVisible(false);
} else {
createPreviewCharts(form1, chartComposite);
// $NON-NLS-1$
message.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.warning"));
message.setVisible(true);
}
} else {
createPreviewCharts(form1, chartComposite);
}
reLayoutChartComposite();
}
});
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
previewSection.setClient(sectionClient);
}
use of org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction in project tdq-studio-se by Talend.
the class RunAnalysisActionProvider method fillContextMenu.
/**
* Adds a submenu to the given menu with the name "New Component".
*/
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
Object[] array = ((TreeSelection) this.getContext().getSelection()).toArray();
ArrayList<TDQAnalysisItem> selectedItemsList = new ArrayList<TDQAnalysisItem>();
for (Object obj : array) {
RepositoryNode node = (RepositoryNode) obj;
RepositoryNode parent = node.getParent();
if (!(parent instanceof ReportSubFolderRepNode)) {
// IPath append = WorkbenchUtils.getFilePath(node);
Item item = node.getObject().getProperty().getItem();
if (item instanceof TDQAnalysisItem) {
selectedItemsList.add((TDQAnalysisItem) item);
}
}
}
if (!selectedItemsList.isEmpty()) {
// IFile file = ResourceManager.getRootProject().getFile(append);
RunAnalysisAction runAnalysisAction = new RunAnalysisAction();
// runAnalysisAction.setSelectionFile(file);
runAnalysisAction.setAnalysisItems(selectedItemsList.toArray(new TDQAnalysisItem[selectedItemsList.size()]));
menu.add(runAnalysisAction);
}
}
use of org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction in project tdq-studio-se by Talend.
the class ColumnSetAnalysisDetailsPage method createPreviewSection.
void createPreviewSection(final ScrolledForm form, Composite parent) {
previewSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(previewSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
Button chartButton = new Button(sectionClient, SWT.NONE);
// $NON-NLS-1$
chartButton.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.refreshGraphics"));
final Label message = toolkit.createLabel(sectionClient, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.spaceWhite"));
message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
message.setVisible(false);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
final Analysis analysis = columnSetAnalysisHandler.getAnalysis();
chartButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
disposeChartComposite();
boolean analysisStatue = analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
if (!analysisStatue) {
boolean returnCode = MessageDialog.openConfirm(null, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.ViewResult"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.RunOrSeeSampleData"));
if (returnCode) {
new RunAnalysisAction().run();
message.setVisible(false);
} else {
createPreviewCharts(form, chartComposite, false);
// $NON-NLS-1$
message.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.warning"));
message.setVisible(true);
}
} else {
createPreviewCharts(form, chartComposite, true);
}
chartComposite.layout();
form.reflow(true);
}
});
previewSection.setClient(sectionClient);
}
use of org.talend.dataprofiler.core.ui.action.actions.RunAnalysisAction 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();
}
Aggregations