use of org.erlide.tracing.core.ui.dialogs.RunnableWithProgress in project erlide_eclipse by erlang.
the class TraceBrowserView method doSelection.
/**
* Action performed when user clicks on tree element.
*
* @param event
*/
private void doSelection(final SelectionChangedEvent event) {
final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
final ITreeNode treeNode = (ITreeNode) selection.getFirstElement();
if (treeNode != null) {
task = new RunnableWithProgress("Loading trace results...") {
@Override
public void doAction() {
TraceBackend.getInstance().setActiveResultSet((TracingResultsNode) treeNode);
final int limit = Activator.getDefault().getPreferenceStore().getInt(PreferenceNames.TRACES_LOAD_LIMIT);
TraceBackend.getInstance().loadDataFromFile(1, limit);
}
};
try {
final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
new ProgressMonitorDialog(shell).run(true, false, task);
doAfterLoadingFile();
} catch (final Exception e) {
ErlLogger.error(e);
} finally {
task = null;
}
}
}
Aggregations