use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiAnalysisFactoryException in project tracecompass by tracecompass.
the class AddAnalysisHandler method execute.
@Override
@Nullable
public Object execute(@Nullable ExecutionEvent event) throws ExecutionException {
final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final AddAnalysisDialog dialog = new AddAnalysisDialog(shell, Messages.AddAnalysisDialog_Title, NAME_INPUT_VALIDATOR, COMMAND_INPUT_VALIDATOR);
if (dialog.open() != Window.OK) {
// User clicked Cancel, cancel the add operation
return null;
}
Path configFilePath;
try {
configFilePath = LamiConfigUtils.createConfigFile(checkNotNull(dialog.getName().trim()), checkNotNull(dialog.getCommand().trim()));
} catch (IOException e) {
showErrorBox(shell, e);
return null;
}
try {
final LamiAnalysis analysis = LamiAnalysisFactoryFromConfigFile.buildFromConfigFile(configFilePath, true, trace -> true);
OnDemandAnalysisManager.getInstance().registerAnalysis(analysis);
} catch (LamiAnalysisFactoryException e) {
showErrorBox(shell, e);
return null;
}
final Object elem = HandlerUtils.getSelectedModelElement();
if (elem != null && elem instanceof TmfOnDemandAnalysesElement) {
final TmfOnDemandAnalysesElement analysesElem = (TmfOnDemandAnalysesElement) elem;
analysesElem.refresh();
}
return null;
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiAnalysisFactoryException in project tracecompass by tracecompass.
the class Activator method loadUserDefinedAnalyses.
private void loadUserDefinedAnalyses() {
final Path configDirPath = LamiConfigUtils.getConfigDirPath();
try {
final List<LamiAnalysis> analyses = LamiAnalysisFactoryFromConfigFile.buildFromConfigDir(configDirPath, true, trace -> true);
OnDemandAnalysisManager manager = OnDemandAnalysisManager.getInstance();
analyses.forEach(manager::registerAnalysis);
} catch (LamiAnalysisFactoryException e) {
// $NON-NLS-1$
logWarning("Cannot load user-defined external analyses", e);
}
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiAnalysisFactoryException in project tracecompass by tracecompass.
the class Activator method start.
// ------------------------------------------------------------------------
// Operators
// ------------------------------------------------------------------------
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
TmfEventMatching.registerMatchObject(new TcpEventMatching());
TmfEventMatching.registerMatchObject(new TcpLttngEventMatching());
try {
LttngAnalysesLoader.load();
} catch (LamiAnalysisFactoryException | IOException e) {
// Not the end of the world if the analyses are not available
// $NON-NLS-1$
logWarning("Cannot find LTTng analyses configuration files: " + e.getMessage());
}
}
Aggregations