use of org.talend.dataprofiler.core.ui.editor.analysis.FunctionalDependencyAnalysisDetailsPage in project tdq-studio-se by Talend.
the class AnalysisColumnCompareTreeViewer method createAnalyzedColumnSetsSection.
private void createAnalyzedColumnSetsSection(String mainTitle, String description) {
columnsComparisonSection = masterPage.createSection(form, parentComp, mainTitle, description);
Composite sectionClient = toolkit.createComposite(columnsComparisonSection);
sectionClient.setLayout(new GridLayout());
if (showCheckButton) {
checkComputeButton = new Button(sectionClient, SWT.CHECK);
GridData layoutData = new GridData(GridData.FILL_BOTH);
layoutData.horizontalAlignment = SWT.CENTER;
checkComputeButton.setLayoutData(layoutData);
// $NON-NLS-1$
checkComputeButton.setText(DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.Compute"));
// $NON-NLS-1$
checkComputeButton.setToolTipText(DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.WhenUnchecked"));
checkComputeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
masterPage.setDirty(true);
}
});
checkComputeButton.setSelection(checkComputButton);
}
Composite columnComp = toolkit.createComposite(sectionClient);
columnComp.setLayoutData(new GridData(GridData.FILL_BOTH));
columnComp.setLayout(new GridLayout());
Composite compareToplevelComp = toolkit.createComposite(columnComp);
GridLayout compareToplevelLayout = new GridLayout();
compareToplevelLayout.numColumns = 2;
compareToplevelComp.setLayout(compareToplevelLayout);
// ColumnSet comparison analysis.s
if (masterPage instanceof FunctionalDependencyAnalysisDetailsPage) {
// $NON-NLS-1$
columnReverseButtion = toolkit.createButton(compareToplevelComp, "Reverse columns", SWT.NONE);
columnReverseButtion.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
handleColumnReverseAction();
}
});
columnReverseButtion.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == 13) {
handleColumnReverseAction();
}
}
});
masterPage.createRunButton(compareToplevelComp);
} else {
masterPage.createConnBindWidget(compareToplevelComp);
}
// ~
SashForm sashForm = new SashForm(sectionClient, SWT.NULL);
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
// $NON-NLS-1$
String leftSelectButtonText = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.selectColumnsForASet");
// $NON-NLS-1$
String rightSelectButtonText = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.selectColumnsForBSet");
String leftSelectButtonTooltip;
String rightSelectButtonTooltip;
if (masterPage instanceof FunctionalDependencyAnalysisDetailsPage) {
// $NON-NLS-1$
leftSelectButtonTooltip = DefaultMessagesImpl.getString("AnalysisColumnCompareTreeViewer.DeterminantCol");
// $NON-NLS-1$
rightSelectButtonTooltip = DefaultMessagesImpl.getString("AnalysisColumnCompareTreeViewer.DependentCol");
} else {
leftSelectButtonTooltip = DefaultMessagesImpl.getString(// $NON-NLS-1$
"AnalysisColumnCompareTreeViewer.selectColumnsForASetTooltip");
rightSelectButtonTooltip = DefaultMessagesImpl.getString(// $NON-NLS-1$
"AnalysisColumnCompareTreeViewer.selectColumnsForBSetTooltip");
}
Composite leftComp = toolkit.createComposite(sashForm);
leftComp.setLayoutData(new GridData(GridData.FILL_BOTH));
leftComp.setLayout(new GridLayout());
// $NON-NLS-1$
String leftSectionTitle = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.leftColumns");
leftTableViewer = this.createSectionPart(leftComp, columnListA, leftSectionTitle, leftSelectButtonText, leftSelectButtonTooltip, true);
Composite rightComp = toolkit.createComposite(sashForm);
rightComp.setLayoutData(new GridData(GridData.FILL_BOTH));
rightComp.setLayout(new GridLayout());
// $NON-NLS-1$
String rightSectionTitle = DefaultMessagesImpl.getString("ColumnsComparisonMasterDetailsPage.rightColumns");
rightTableViewer = this.createSectionPart(rightComp, columnListB, rightSectionTitle, rightSelectButtonText, rightSelectButtonTooltip, false);
// MOD mzhao 2009-05-05 bug:6587.
updateBindConnection(masterPage, tableViewerPosStack);
columnsComparisonSection.setClient(sectionClient);
}
use of org.talend.dataprofiler.core.ui.editor.analysis.FunctionalDependencyAnalysisDetailsPage in project tdq-studio-se by Talend.
the class OpenColumnSelectorAction 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 xqliu TDQ-4285 2011-12-27
if (!CheatSheetActionHelper.canRun()) {
return;
}
if (params == null || params.length == 0) {
return;
}
Integer analysisCatigory = null;
if (NumberUtils.isNumber(params[0])) {
analysisCatigory = NumberUtils.toInt(params[0]);
}
if (analysisCatigory != null) {
AnalysisEditor editor = (AnalysisEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor == null) {
return;
}
switch(analysisCatigory) {
case AnalysisType.BUSINESS_RULE_VALUE:
BusinessRuleAnalysisDetailsPage page4 = (BusinessRuleAnalysisDetailsPage) editor.getMasterPage();
page4.openTableSelectionDialog();
page4.doSave(null);
break;
case AnalysisType.TABLE_FUNCTIONAL_DEPENDENCY_VALUE:
FunctionalDependencyAnalysisDetailsPage page3 = (FunctionalDependencyAnalysisDetailsPage) editor.getMasterPage();
if (params[1] != null) {
if ("A".equalsIgnoreCase(params[1])) {
// $NON-NLS-1$
page3.openColumnsSetASelectionDialog();
} else {
page3.openColumnsSetBSelectionDialog();
}
}
// page3.doSave(null);
break;
case AnalysisType.COLUMN_SET_VALUE:
ColumnSetAnalysisDetailsPage page0 = (ColumnSetAnalysisDetailsPage) editor.getMasterPage();
page0.openColumnsSelectionDialog();
page0.doSave(null);
break;
case AnalysisType.MULTIPLE_COLUMN_VALUE:
ColumnAnalysisDetailsPage page = (ColumnAnalysisDetailsPage) editor.getMasterPage();
page.openColumnsSelectionDialog();
page.doSave(null);
break;
case AnalysisType.COLUMNS_COMPARISON_VALUE:
RedundancyAnalysisDetailsPage page1 = (RedundancyAnalysisDetailsPage) editor.getMasterPage();
if (params[1] != null) {
if (NumberUtils.isNumber(params[1])) {
int pos = NumberUtils.toInt(params[1]);
if (pos == 0) {
page1.openColumnsSetASelectionDialog();
} else {
page1.openColumnsSetBSelectionDialog();
}
}
}
// page1.doSave(null);
break;
case AnalysisType.COLUMN_CORRELATION_VALUE:
CorrelationAnalysisDetailsPage page2 = (CorrelationAnalysisDetailsPage) editor.getMasterPage();
page2.openColumnsSelectionDialog();
page2.doSave(null);
break;
default:
break;
}
}
}
Aggregations