From: Alexandre Montplaisir Date: Mon, 5 Jun 2017 18:53:23 +0000 (-0400) Subject: Adapt views plugins to TMF X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=4290d35808ef723be708b12aeda887a972c77c58 Adapt views plugins to TMF Change-Id: I43ad92abcc9526fa58b9f802691d58899cdcfc97 Signed-off-by: Alexandre Montplaisir --- diff --git a/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea b/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea index 1075c454d1..5c0d1a408b 100644 --- a/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea +++ b/common/org.eclipse.tracecompass.common.core/annotations/java/util/Map.eea @@ -8,6 +8,9 @@ get keySet ()Ljava/util/Set; ()L1java/util/Set; +put + (TK;TV;)TV; + (TK;TV;)T0V; remove (Ljava/lang/Object;)TV; (Ljava/lang/Object;)T0V; diff --git a/common/org.eclipse.tracecompass.common.core/annotations/javafx/collections/SetChangeListener$Change.eea b/common/org.eclipse.tracecompass.common.core/annotations/javafx/collections/SetChangeListener$Change.eea new file mode 100644 index 0000000000..0ae8c4bb3d --- /dev/null +++ b/common/org.eclipse.tracecompass.common.core/annotations/javafx/collections/SetChangeListener$Change.eea @@ -0,0 +1,7 @@ +class javafx/collections/SetChangeListener$Change +getElementAdded + ()TE; + ()T0E; +getElementRemoved + ()TE; + ()T0E; diff --git a/tmf/org.lttng.scope.tmf2.views.core/.classpath b/tmf/org.lttng.scope.tmf2.views.core/.classpath index 0be7b35db4..5480bc8015 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/.classpath +++ b/tmf/org.lttng.scope.tmf2.views.core/.classpath @@ -2,12 +2,12 @@ - + - + diff --git a/tmf/org.lttng.scope.tmf2.views.core/META-INF/MANIFEST.MF b/tmf/org.lttng.scope.tmf2.views.core/META-INF/MANIFEST.MF index ae32157d62..3f46dbe325 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/META-INF/MANIFEST.MF +++ b/tmf/org.lttng.scope.tmf2.views.core/META-INF/MANIFEST.MF @@ -11,9 +11,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 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, diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/ScopeCoreActivator.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/ScopeCoreActivator.java new file mode 100644 index 0000000000..7f4b2546f3 --- /dev/null +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/ScopeCoreActivator.java @@ -0,0 +1,181 @@ +/* + * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir + * + * 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, ScopeCoreActivator> CORE_ACTIVATORS = + Collections.synchronizedMap(new HashMap, 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 getInstance(Class 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 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])); + } + } + +} diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/activator/internal/Activator.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/activator/internal/Activator.java index c65947995f..0393979df3 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/activator/internal/Activator.java +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/activator/internal/Activator.java @@ -9,7 +9,7 @@ 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; /** diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/TimeGraphModelProvider.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/TimeGraphModelProvider.java index ca794e60a7..0ffd061829 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/TimeGraphModelProvider.java +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/TimeGraphModelProvider.java @@ -9,7 +9,7 @@ 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; diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelArrowProvider.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelArrowProvider.java index 3e79da82bd..882b950775 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelArrowProvider.java +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelArrowProvider.java @@ -12,6 +12,7 @@ package org.lttng.scope.tmf2.views.core.timegraph.model.provider.statesystem; 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; @@ -20,8 +21,6 @@ import org.lttng.scope.tmf2.views.core.timegraph.model.render.arrows.TimeGraphAr 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. diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelProvider.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelProvider.java index a74f2774a7..8bf3948213 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelProvider.java +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelProvider.java @@ -17,6 +17,9 @@ import java.util.function.Function; 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; @@ -24,10 +27,6 @@ import org.lttng.scope.tmf2.views.core.timegraph.model.provider.arrows.ITimeGrap 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. diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelStateProvider.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelStateProvider.java index f737efe6f8..6b12c62c0c 100644 --- a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelStateProvider.java +++ b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/provider/statesystem/StateSystemModelStateProvider.java @@ -17,6 +17,10 @@ import java.util.concurrent.FutureTask; 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; @@ -34,11 +38,6 @@ import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTree 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. diff --git a/tmf/org.lttng.scope.tmf2.views.ui/.classpath b/tmf/org.lttng.scope.tmf2.views.ui/.classpath index 0be7b35db4..5480bc8015 100644 --- a/tmf/org.lttng.scope.tmf2.views.ui/.classpath +++ b/tmf/org.lttng.scope.tmf2.views.ui/.classpath @@ -2,12 +2,12 @@ - + - + diff --git a/tmf/org.lttng.scope.tmf2.views.ui/META-INF/MANIFEST.MF b/tmf/org.lttng.scope.tmf2.views.ui/META-INF/MANIFEST.MF index 4503ded772..950203b8b6 100644 --- a/tmf/org.lttng.scope.tmf2.views.ui/META-INF/MANIFEST.MF +++ b/tmf/org.lttng.scope.tmf2.views.ui/META-INF/MANIFEST.MF @@ -10,12 +10,11 @@ Bundle-ActivationPolicy: lazy 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, diff --git a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/ScopeUIActivator.java b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/ScopeUIActivator.java new file mode 100644 index 0000000000..ac21668a97 --- /dev/null +++ b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/ScopeUIActivator.java @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir + * + * 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, ScopeUIActivator> UI_ACTIVATORS = + Collections.synchronizedMap(new HashMap, 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 getInstance(Class 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 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])); + } + } + +} diff --git a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/activator/internal/Activator.java b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/activator/internal/Activator.java index ec33727fa7..c418eac227 100644 --- a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/activator/internal/Activator.java +++ b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/activator/internal/Activator.java @@ -9,7 +9,7 @@ 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; diff --git a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineManager.java b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineManager.java index 31b66d1aec..92f7d5464f 100644 --- a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineManager.java +++ b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineManager.java @@ -13,6 +13,7 @@ import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; import org.lttng.scope.tmf2.views.core.NestingBoolean; import org.lttng.scope.tmf2.views.core.context.ViewGroupContext; import org.lttng.scope.tmf2.views.core.timegraph.control.TimeGraphModelControl; @@ -29,6 +30,9 @@ import javafx.beans.property.BooleanProperty; import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleDoubleProperty; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.SplitPane; +import javafx.scene.shape.Rectangle; public class TimelineManager { @@ -69,25 +73,25 @@ public class TimelineManager { /* Bind divider positions, where applicable */ fWidgets.stream() .map(w -> w.getSplitPane()) - .filter(Objects::nonNull).map(p -> Objects.requireNonNull(p)) + .filter(Objects::nonNull).<@NonNull SplitPane> map(p -> Objects.requireNonNull(p)) .forEach(splitPane -> splitPane.getDividers().get(0).positionProperty().bindBidirectional(fDividerPosition)); /* Bind h-scrollbar positions */ fWidgets.stream() .map(w -> w.getTimeBasedScrollPane()) - .filter(Objects::nonNull).map(p -> Objects.requireNonNull(p)) + .filter(Objects::nonNull).<@NonNull ScrollPane> map(p -> Objects.requireNonNull(p)) .forEach(scrollPane -> scrollPane.hvalueProperty().bindBidirectional(fHScrollValue)); /* Bind the selection rectangles together */ fWidgets.stream() .map(w -> w.getSelectionRectangle()) - .filter(Objects::nonNull).map(r -> Objects.requireNonNull(r)) + .filter(Objects::nonNull).<@NonNull Rectangle> map(r -> Objects.requireNonNull(r)) .forEach(rect -> { rect.visibleProperty().bindBidirectional(fSelectionVisible); }); fWidgets.stream() .map(w -> w.getOngoingSelectionRectangle()) - .filter(Objects::nonNull).map(r -> Objects.requireNonNull(r)) + .filter(Objects::nonNull).<@NonNull Rectangle> map(r -> Objects.requireNonNull(r)) .forEach(rect -> { rect.layoutXProperty().bindBidirectional(fOngoingSelectionX); rect.widthProperty().bindBidirectional(fOngoingSelectionWidth); diff --git a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineView.java b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineView.java index 0a018608a7..e416644c75 100644 --- a/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineView.java +++ b/tmf/org.lttng.scope.tmf2.views.ui/src/org/lttng/scope/tmf2/views/ui/timeline/TimelineView.java @@ -17,8 +17,8 @@ import java.util.stream.Collectors; 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.common.core.StreamUtils; import org.lttng.scope.tmf2.views.core.context.ViewGroupContext; import javafx.embed.swt.FXCanvas;