use of org.talend.dataprofiler.core.ui.grid.IndicatorSelectDialog in project tdq-studio-se by Talend.
the class AnalysisColumnTreeViewer method openIndicatorSelectDialog.
/**
* Open the dialog for select indicator
*
* @param shell
* @return The array of ModelElementIndicator which selected by user if user click ok button. If cancel button be
* clicked then the size of return array will be zero. If have a Where Clause is error will return null
*/
public ModelElementIndicator[] openIndicatorSelectDialog(Shell shell) {
List<Object[]> previewData = masterPage.getSampleTable().getExistPreviewData();
final IndicatorSelectDialog dialog = new IndicatorSelectDialog(shell, DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.indicatorSelection"), masterPage.getCurrentModelElementIndicators(), // $NON-NLS-1$
previewData);
dialog.setLimitNumber(this.masterPage.getPreviewLimit());
dialog.create();
if (!DQPreferenceManager.isBlockWeb()) {
dialog.getShell().addShellListener(new ShellAdapter() {
@Override
public void shellActivated(ShellEvent e) {
dialog.getShell().setFocus();
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorSelectorHelpContextID());
PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
}
});
dialog.getShell().addHelpListener(new HelpListener() {
public void helpRequested(HelpEvent e) {
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getIndicatorSelectorHelpContextID());
PlatformUI.getWorkbench().getHelpSystem().displayHelp(context);
}
});
}
if (dialog.open() == Window.OK) {
isGridPreviewColumnMoved = dialog.isGridPreviewColumnMoved();
ModelElementIndicator[] result = dialog.getResult();
for (ModelElementIndicator modelElementIndicator : result) {
modelElementIndicator.storeTempIndicator();
}
return result;
} else {
ModelElementIndicator[] result = dialog.getResult();
for (ModelElementIndicator modelElementIndicator : result) {
modelElementIndicator.getTempIndicator().clear();
}
return null;
}
}
use of org.talend.dataprofiler.core.ui.grid.IndicatorSelectDialog in project tdq-studio-se by Talend.
the class SelectIndicatorsHandler method execute.
/*
* (non-Javadoc)
*
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell activeShell = HandlerUtil.getActiveShell(event);
if (null != activeShell) {
// MOD sizhaoliu TDQ-6075 Enable keyboard shortcut to select all the indicators
boolean select;
if (event.getCommand().getId().equals("org.talend.dataprofiler.core.selectAllIndicators")) {
// $NON-NLS-1$
select = true;
} else if (event.getCommand().getId().equals("org.talend.dataprofiler.core.deselectAllIndicators")) {
// $NON-NLS-1$
select = false;
} else {
return null;
}
Object dialog = activeShell.getData();
if (dialog instanceof IndicatorSelectDialog) {
((IndicatorSelectDialog) dialog).selectAllIndicators(select);
}
}
return null;
}
Aggregations