keySet
()Ljava/util/Set<TK;>;
()L1java/util/Set<TK;>;
+put
+ (TK;TV;)TV;
+ (TK;TV;)T0V;
remove
(Ljava/lang/Object;)TV;
(Ljava/lang/Object;)T0V;
--- /dev/null
+class javafx/collections/SetChangeListener$Change
+getElementAdded
+ ()TE;
+ ()T0E;
+getElementRemoved
+ ()TE;
+ ()T0E;
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
- <attribute name="annotationpath" value="/org.lttng.scope.common.core/annotations"/>
+ <attribute name="annotationpath" value="/org.eclipse.tracecompass.common.core/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<attributes>
- <attribute name="annotationpath" value="/org.lttng.scope.common.core/annotations"/>
+ <attribute name="annotationpath" value="/org.eclipse.tracecompass.common.core/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
Eclipse-ExtensibleAPI: true
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
- org.lttng.scope.common.core,
- ca.polymtl.dorsal.libdelorean,
- org.eclipse.tracecompass.tmf.core
+ org.eclipse.tracecompass.tmf.core,
+ org.eclipse.tracecompass.statesystem.core,
+ org.eclipse.tracecompass.common.core
Export-Package: org.lttng.scope.tmf2.views.core,
org.lttng.scope.tmf2.views.core.activator.internal;x-internal:=true,
org.lttng.scope.tmf2.views.core.config,
--- /dev/null
+/*
+ * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.lttng.scope.tmf2.views.core;
+
+import static java.util.Objects.requireNonNull;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.Nullable;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author Alexandre Montplaisir
+ */
+public abstract class ScopeCoreActivator extends Plugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /** Map of all the registered activators, indexed by activator classes */
+ private static final Map<Class<? extends ScopeCoreActivator>, ScopeCoreActivator> CORE_ACTIVATORS =
+ Collections.synchronizedMap(new HashMap<Class<? extends ScopeCoreActivator>, ScopeCoreActivator>());
+
+ /** This instance's plug-in ID */
+ private final String fPluginId;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public ScopeCoreActivator() {
+ fPluginId = requireNonNull(getBundle().getSymbolicName());
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Return this plug-in's ID.
+ *
+ * @return The plug-in ID
+ */
+ public String getPluginId() {
+ return fPluginId;
+ }
+
+ /**
+ * Get a registered activator. Subclasses should implement their own public
+ * getInstance() method, which returns the result of this.
+ *
+ * @param activatorClass
+ * The activator's runtime class
+ * @return The corresponding activator
+ */
+ protected static <T extends ScopeCoreActivator> T getInstance(Class<T> activatorClass) {
+ ScopeCoreActivator activator = CORE_ACTIVATORS.get(activatorClass);
+ if (activator == null) {
+ /* The activator should be registered at this point! */
+ throw new IllegalStateException();
+ }
+ /*
+ * We inserted the corresponding class into the map ourselves, cast
+ * should always be safe.
+ */
+ @SuppressWarnings("unchecked")
+ T ret = (T) activator;
+ return ret;
+ }
+
+ // ------------------------------------------------------------------------
+ // Abstract methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Additional actions to run at the plug-in startup
+ */
+ protected abstract void startActions();
+
+ /**
+ * Additional actions to run at the plug-in shtudown
+ */
+ protected abstract void stopActions();
+
+ // ------------------------------------------------------------------------
+ // ore.eclipse.core.runtime.Plugin
+ // ------------------------------------------------------------------------
+
+ @Override
+ public final void start(@Nullable BundleContext context) throws Exception {
+ super.start(context);
+ Class<? extends ScopeCoreActivator> activatorClass = this.getClass();
+ synchronized (CORE_ACTIVATORS) {
+ if (CORE_ACTIVATORS.containsKey(activatorClass)) {
+ logError("Duplicate Activator : " + activatorClass.getCanonicalName()); //$NON-NLS-1$
+ }
+ CORE_ACTIVATORS.put(activatorClass, this);
+ }
+ startActions();
+ }
+
+ @Override
+ public final void stop(@Nullable BundleContext context) throws Exception {
+ stopActions();
+ CORE_ACTIVATORS.remove(this.getClass());
+ super.stop(context);
+ }
+
+ // ------------------------------------------------------------------------
+ // Logging helpers
+ // ------------------------------------------------------------------------
+
+ /**
+ * Log a message with severity INFO.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logInfo(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.INFO, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.INFO, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+
+ /**
+ * Log a message with severity WARNING.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logWarning(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.WARNING, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.WARNING, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+ /**
+ * Log a message with severity ERROR.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logError(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.ERROR, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.ERROR, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+}
package org.lttng.scope.tmf2.views.core.activator.internal;
-import org.lttng.scope.common.core.ScopeCoreActivator;
+import org.lttng.scope.tmf2.views.core.ScopeCoreActivator;
import org.lttng.scope.tmf2.views.core.context.ViewGroupContext;
/**
package org.lttng.scope.tmf2.views.core.timegraph.model.provider;
-import static org.lttng.scope.common.core.NonNullUtils.nullToEmptyString;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.FutureTask;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.lttng.scope.tmf2.views.core.TimeRange;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.arrows.TimeGraphArrowSeries;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeRender;
-import ca.polymtl.dorsal.libdelorean.ITmfStateSystem;
-
/**
* Basic implementation of a {@link TimeGraphModelArrowProvider} backed by a
* state system.
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.lttng.scope.tmf2.views.core.timegraph.model.provider.TimeGraphModelProvider;
import org.lttng.scope.tmf2.views.core.timegraph.model.provider.states.ITimeGraphModelStateProvider;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeRender;
-import ca.polymtl.dorsal.libdelorean.ITmfStateSystem;
-import ca.polymtl.dorsal.libdelorean.exceptions.StateSystemDisposedException;
-import ca.polymtl.dorsal.libdelorean.interval.ITmfStateInterval;
-
/**
* Basic implementation of a {@link TimeGraphModelProvider} backed by a state
* system.
import java.util.function.Function;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.lttng.scope.tmf2.views.core.MathUtils;
import com.google.common.collect.Iterables;
-import ca.polymtl.dorsal.libdelorean.ITmfStateSystem;
-import ca.polymtl.dorsal.libdelorean.exceptions.AttributeNotFoundException;
-import ca.polymtl.dorsal.libdelorean.exceptions.StateSystemDisposedException;
-import ca.polymtl.dorsal.libdelorean.interval.ITmfStateInterval;
-
/**
* Basic implementation of a {@link TimeGraphModelStateProvider} backed by a state
* system.
import java.util.stream.Collectors;
import org.eclipse.jdt.annotation.Nullable;
-import org.lttng.scope.common.core.StreamUtils.StreamFlattener;
+import org.eclipse.tracecompass.common.core.StreamUtils.StreamFlattener;
/**
* Render of a tree of the timegraph. Contains the tree elements that compose
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
- <attribute name="annotationpath" value="/org.lttng.scope.common.core/annotations"/>
+ <attribute name="annotationpath" value="/org.eclipse.tracecompass.common.core/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<attributes>
- <attribute name="annotationpath" value="/org.lttng.scope.common.core/annotations"/>
+ <attribute name="annotationpath" value="/org.eclipse.tracecompass.common.core/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
- org.lttng.scope.common.core,
- org.lttng.scope.common.ui,
org.lttng.scope.tmf2.views.core,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.tmf.ui,
- org.eclipse.core.resources
+ org.eclipse.core.resources,
+ org.eclipse.tracecompass.common.core
Export-Package: org.lttng.scope.tmf2.views.ui.activator.internal;x-internal:=true,
org.lttng.scope.tmf2.views.ui.jfx,
org.lttng.scope.tmf2.views.ui.jfx.examples,
--- /dev/null
+/*
+ * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.lttng.scope.tmf2.views.ui;
+
+import static java.util.Objects.requireNonNull;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author Alexandre Montplaisir
+ */
+public abstract class ScopeUIActivator extends AbstractUIPlugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /** Map of all the registered activators, indexed by activator classes */
+ private static final Map<Class<? extends ScopeUIActivator>, ScopeUIActivator> UI_ACTIVATORS =
+ Collections.synchronizedMap(new HashMap<Class<? extends ScopeUIActivator>, ScopeUIActivator>());
+
+ /** This instance's plug-in ID */
+ private final String fPluginId;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public ScopeUIActivator() {
+ fPluginId = requireNonNull(getBundle().getSymbolicName());
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Return this plug-in's ID.
+ *
+ * @return The plug-in ID
+ */
+ public String getPluginId() {
+ return fPluginId;
+ }
+
+ /**
+ * Get a registered activator. Subclasses should implement their own public
+ * getInstance() method, which returns the result of this.
+ *
+ * @param activatorClass
+ * The activator's runtime class
+ * @return The corresponding activator
+ */
+ protected static <T extends ScopeUIActivator> T getInstance(Class<T> activatorClass) {
+ ScopeUIActivator activator = UI_ACTIVATORS.get(activatorClass);
+ if (activator == null) {
+ /* The activator should be registered at this point! */
+ throw new IllegalStateException();
+ }
+ /*
+ * We inserted the corresponding class into the map ourselves, cast
+ * should always be safe.
+ */
+ @SuppressWarnings("unchecked")
+ T ret = (T) activator;
+ return ret;
+ }
+
+ /**
+ * Get an {@link Image} from a path within the plugin.
+ *
+ * @param path
+ * The path to the image
+ * @return The image object, or null if it could not be found
+ */
+ public @Nullable Image getImageFromPath(String path) {
+ ImageDescriptor id = getImageDescripterFromPath(path);
+ if (id == null) {
+ return null;
+ }
+ return id.createImage();
+ }
+
+ /**
+ * Get the image descriptor from a path within the plugin.
+ *
+ * @param path
+ * The path to the image
+ *
+ * @return The corresponding image descriptor, or null if the image is not
+ * found
+ */
+ public @Nullable ImageDescriptor getImageDescripterFromPath(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(fPluginId, path);
+ }
+
+ // ------------------------------------------------------------------------
+ // Abstract methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Additional actions to run at the plug-in startup
+ */
+ protected abstract void startActions();
+
+ /**
+ * Additional actions to run at the plug-in shtudown
+ */
+ protected abstract void stopActions();
+
+ // ------------------------------------------------------------------------
+ // ore.eclipse.core.runtime.Plugin
+ // ------------------------------------------------------------------------
+
+ @Override
+ public final void start(@Nullable BundleContext context) throws Exception {
+ super.start(context);
+ Class<? extends ScopeUIActivator> activatorClass = this.getClass();
+ synchronized (UI_ACTIVATORS) {
+ if (UI_ACTIVATORS.containsKey(activatorClass)) {
+ logError("Duplicate Activator : " + activatorClass.getCanonicalName()); //$NON-NLS-1$
+ }
+ UI_ACTIVATORS.put(activatorClass, this);
+ }
+ startActions();
+ }
+
+ @Override
+ public final void stop(@Nullable BundleContext context) throws Exception {
+ stopActions();
+ UI_ACTIVATORS.remove(this.getClass());
+ super.stop(context);
+ }
+
+ // ------------------------------------------------------------------------
+ // Logging helpers
+ // ------------------------------------------------------------------------
+
+ /**
+ * Log a message with severity INFO.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logInfo(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.INFO, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.INFO, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+
+ /**
+ * Log a message with severity WARNING.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logWarning(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.WARNING, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.WARNING, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+ /**
+ * Log a message with severity ERROR.
+ *
+ * @param message
+ * The message to log
+ * @param exception
+ * Optional exception to attach to the message
+ */
+ public void logError(@Nullable String message, Throwable... exception) {
+ if (exception.length < 1) {
+ getLog().log(new Status(IStatus.ERROR, fPluginId, nullToEmptyString(message)));
+ } else {
+ getLog().log(new Status(IStatus.ERROR, fPluginId, nullToEmptyString(message), exception[0]));
+ }
+ }
+
+}
package org.lttng.scope.tmf2.views.ui.activator.internal;
-import org.lttng.scope.common.ui.ScopeUIActivator;
+import org.lttng.scope.tmf2.views.ui.ScopeUIActivator;
import javafx.application.Platform;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.common.core.StreamUtils;
import org.eclipse.tracecompass.tmf.ui.views.TmfView;
import org.lttng.scope.tmf2.views.core.context.ViewGroupContext;
import org.lttng.scope.tmf2.views.ui.jfx.JfxUtils;
import org.lttng.scope.tmf2.views.ui.timeline.widgets.timegraph.TimeGraphWidget;
import org.lttng.scope.tmf2.views.ui.timeline.widgets.timegraph.VerticalPosition;
-import com.google.common.collect.ImmutableMap;
-
import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.paint.Paint;
widget.getControl().getModelRenderProvider().getArrowProviders();
fArrowProvidersConfig = arrowProviders.stream()
- .collect(ImmutableMap.toImmutableMap(
+ .collect(Collectors.toMap(
Function.identity(),
ap -> {
Group group = new Group();
import java.util.Optional;
import java.util.concurrent.FutureTask;
import java.util.function.Predicate;
+import java.util.stream.Collectors;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeElement;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeRender;
-import com.google.common.collect.ImmutableList;
-
class PredicateDrawnEventProvider extends TimeGraphDrawnEventProvider {
/** Maximum number of matching events */
.filter(Objects::nonNull)
/* TimeGraphEvent -> TimeGraphDrawnEvent */
.map(tgEvent -> new TimeGraphDrawnEvent(tgEvent, getEventSeries(), null))
- .collect(ImmutableList.toImmutableList());
+ .collect(Collectors.toList());
return new TimeGraphDrawnEventRender(timeRange, drawnEvents);
}