use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class MatchAnalysisDetailsPage method createAnaDataLabelComposite.
/**
* create Analysis Data Label Composite.
*
* @param dataparent
*/
private void createAnaDataLabelComposite(Composite dataparent) {
Composite titleComposite = toolkit.createComposite(dataparent);
GridLayout layout = new GridLayout(2, Boolean.TRUE);
titleComposite.setLayout(layout);
analyzeDataLabel = new Label(titleComposite, SWT.NONE);
final int analysisColumnSize = analysisHandler.getAnalyzedColumns().size();
final RepositoryNode firstColumnNode = analysisColumnSize > 0 ? RepositoryNodeHelper.recursiveFind(analysisHandler.getAnalyzedColumns().get(0)) : null;
// register: refresh the dataprovider combobox when the name of the data provider is changed.
refreshDataProiverLabel = new EventReceiver() {
@Override
public boolean handle(Object data) {
if (firstColumnNode != null) {
updateAnalyzeDataLabel(firstColumnNode);
}
return true;
}
};
EventManager.getInstance().register(getCurrentModelElement(), EventEnum.DQ_MATCH_ANALYSIS_REFRESH_DATAPROVIDER_LABEL, refreshDataProiverLabel);
if (analysisColumnSize > 0 && firstColumnNode != null) {
updateAnalyzeDataLabel(firstColumnNode);
} else if (analysisColumnSize > 0 && firstColumnNode == null) {
// $NON-NLS-1$
analyzeDataLabel.setText(analyzeDataDefaultInfo + "The connection is not available now!");
} else {
analyzeDataLabel.setText(analyzeDataDefaultInfo);
}
// ADD msjian TDQ-8040 2013-11-8: Add a button "show in repository view"
ImageHyperlink showInDQViewLink = toolkit.createImageHyperlink(titleComposite, SWT.NONE);
// $NON-NLS-1$
showInDQViewLink.setToolTipText(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.showDQElement"));
showInDQViewLink.setImage(ImageLib.getImage(ImageLib.APPLICATION_HOME));
showInDQViewLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
List<IRepositoryNode> analysedElements = findAllSelectedRepositoryNode();
if (analysedElements != null && analysedElements.size() > 0) {
DQRespositoryView dqview = CorePlugin.getDefault().findAndOpenRepositoryView();
// if DqRepository view is not openning we will not do anything
if (dqview == null) {
return;
}
ModelElement column = RepositoryNodeHelper.getModelElementFromRepositoryNode(analysedElements.get(0));
ModelElement container = (ModelElement) (column.eContainer());
RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(container);
if (recursiveFind == null) {
recursiveFind = RepositoryNodeHelper.createRepositoryNode(container);
}
dqview.showSelectedElements(recursiveFind);
}
}
});
// TDQ-8040~
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class SelectedComparisonAction method run.
@Override
public void run() {
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
final IComparisonLevel creatComparisonLevel = ComparisonLevelFactory.creatComparisonLevel(selectedObj1, selectedObj2);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
creatComparisonLevel.popComparisonUI(new UiHandler());
} catch (ReloadCompareException e) {
log.error(e, e);
}
}
});
}
};
try {
ProgressUI.popProgressDialog(op);
if (selectedObj1 instanceof Connection && selectedObj2 instanceof Connection) {
DQRespositoryView repositoryView = CorePlugin.getDefault().getRepositoryView();
if (repositoryView != null) {
repositoryView.refresh();
}
}
} catch (InvocationTargetException e) {
// $NON-NLS-1$
MessageUI.openError(Messages.getString("PopComparisonUIAction.checkConnectionFailure", e.getCause().getMessage()));
log.error(e, e);
} catch (InterruptedException e) {
log.error(e, e);
}
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class AnalysisColumnCompareTreeViewer method showDetailView.
public void showDetailView(TableViewer tableView) {
TableItem[] selection = tableView.getTable().getSelection();
if (selection.length > 0) {
RespositoryDetailView detailView = CorePlugin.getDefault().getRespositoryDetailView();
if (detailView == null) {
return;
}
DQRespositoryView dqview = CorePlugin.getDefault().getRepositoryView();
detailView.selectionChanged(dqview, new StructuredSelection(selection[0].getData()));
}
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class AnalysisColumnNominalIntervalTreeViewer method createTreeMenu.
/**
* DOC xzhao Comment method "createTreeMenu".
*
* @param newTree
* @param containEdit
*/
private void createTreeMenu(final Tree newTree, boolean containEdit) {
Menu oldMenu = newTree.getMenu();
if (oldMenu != null && !oldMenu.isDisposed()) {
oldMenu.dispose();
}
menu = new Menu(newTree);
MenuItem deleteMenuItem = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
deleteMenuItem.setText(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.removeElement"));
deleteMenuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
deleteMenuItem.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse .swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
removeSelectedElements(newTree);
// MOD mzhao 2005-05-05 bug 6587.
// MOD mzhao 2009-06-8, bug 5887.
// updateBindConnection(masterPage, tree);
}
});
// ADD 2009-01-07 mzhao for feature:0005664
MenuItem showMenuItem = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
showMenuItem.setText(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.showDQElement"));
showMenuItem.setImage(ImageLib.getImage(ImageLib.EXPLORE_IMAGE));
showMenuItem.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse .swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
TreeItem[] selection = newTree.getSelection();
if (selection.length > 0) {
// if DqRepository view is not openning we will not do anything
DQRespositoryView dqview = CorePlugin.getDefault().findAndOpenRepositoryView();
if (dqview == null) {
return;
}
// TdColumn tdColumn = (TdColumn) selection[0].getData(COLUMN_INDICATOR_KEY);
dqview.showSelectedElements(selection[0].getData(COLUMN_INDICATOR_KEY));
}
}
});
if (containEdit) {
editPatternMenuItem = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
editPatternMenuItem.setText(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.editPattern"));
editPatternMenuItem.setImage(ImageLib.getImage(ImageLib.PATTERN_REG));
editPatternMenuItem.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org .eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
TreeItem[] selection = tree.getSelection();
if (selection.length > 0) {
TreeItem treeItem = selection[0];
IndicatorUnit indicatorUnit = (IndicatorUnit) treeItem.getData(INDICATOR_UNIT_KEY);
PatternMatchingIndicator indicator = (PatternMatchingIndicator) indicatorUnit.getIndicator();
Pattern pattern = indicator.getParameters().getDataValidDomain().getPatterns().get(0);
// MOD mzhao 2009-03-13 Feature 6066 Move all folders
// into one project.
IFile file = ResourceFileMap.findCorrespondingFile(pattern);
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
activePage.openEditor(new FileEditorInput(file), // $NON-NLS-1$
"org.talend.dataprofiler.core.ui.editor.pattern.PatternEditor");
} catch (PartInitException e1) {
log.error(e1, e1);
}
}
}
});
}
newTree.setMenu(menu);
}
use of org.talend.dataprofiler.core.ui.views.DQRespositoryView in project tdq-studio-se by Talend.
the class AnalysisColumnNominalIntervalTreeViewer method showDetailView.
private void showDetailView(Tree newTree) {
TreeItem[] selection = newTree.getSelection();
if (selection.length > 0) {
RespositoryDetailView detailView = CorePlugin.getDefault().getRespositoryDetailView();
if (detailView == null) {
return;
}
DQRespositoryView dqview = CorePlugin.getDefault().getRepositoryView();
detailView.selectionChanged(dqview, new StructuredSelection(selection[0].getData(COLUMN_INDICATOR_KEY)));
}
}
Aggregations