lttng.control: Fix typo in the SnapshotHandler class
authorBruno Roy <bruno.roy@ericsson.com>
Mon, 11 Jul 2016 18:31:19 +0000 (14:31 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 13 Jul 2016 20:19:05 +0000 (16:19 -0400)
Rename the SnapshotHandler class to fix a typo (it was SnaphshotHandler
before).

Change-Id: Ife2cb875a53d13ec9d55482c7fefa34787c13afe
Signed-off-by: Bruno Roy <bruno.roy@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/77065
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.control.ui/plugin.xml
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java [deleted file]
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnapshotHandler.java [new file with mode: 0644]

index b87532c7fd94020e8939db548c27a379cd200d04..85e9e80744cfe0f0380800b65e2071d6efecf89d 100644 (file)
       </handler>
 
       <handler
-            class="org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers.SnaphshotHandler"
+            class="org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers.SnapshotHandler"
             commandId="org.eclipse.linuxtools.internal.lttng2.ui.commands.control.snapshot">
          <activeWhen>
             <with
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnaphshotHandler.java
deleted file mode 100644 (file)
index a233df4..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2013, 2015 Ericsson
- *
- * 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
- *
- * Contributors:
- *   Bernd Hufmann - Initial API and implementation
- **********************************************************************/
-package org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * <p>
- * Command handler implementation to record a snapshot.
- * </p>
- *
- * @author Bernd Hufmann
- */
-public class SnaphshotHandler extends BaseControlViewHandler {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The list of session components the command is to be executed on.
-     */
-    @NonNull protected List<TraceSessionComponent> fSessions = new ArrayList<>();
-
-    // ------------------------------------------------------------------------
-    // Operations
-    // ------------------------------------------------------------------------
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        fLock.lock();
-        try {
-            // Make a copy for thread safety
-            final List<TraceSessionComponent> sessions = new ArrayList<>();
-            sessions.addAll(fSessions);
-
-            Job job = new Job(Messages.TraceControl_RecordSnapshotJob) {
-                @Override
-                protected IStatus run(IProgressMonitor monitor) {
-                    MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
-                    for (Iterator<TraceSessionComponent> iterator = sessions.iterator(); iterator.hasNext();) {
-                        try {
-                            // record snapshot for all selected sessions sequentially
-                            TraceSessionComponent session = iterator.next();
-                            session.recordSnapshot(monitor);
-                            if (monitor.isCanceled()) {
-                                status.add(Status.CANCEL_STATUS);
-                                break;
-                            }
-                        } catch (ExecutionException e) {
-                            status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RecordSnapshotFailure, e));
-                        }
-                    }
-                    return status;
-                }
-            };
-            job.setUser(true);
-            job.schedule();
-        } finally {
-            fLock.unlock();
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isEnabled() {
-        // Get workbench page for the Control View
-        IWorkbenchPage page = getWorkbenchPage();
-        if (page == null) {
-            return false;
-        }
-
-        List<TraceSessionComponent> sessions = new ArrayList<>(0);
-
-        // Check if one session is selected
-        ISelection selection = page.getSelection(ControlView.ID);
-        if (selection instanceof StructuredSelection) {
-            StructuredSelection structered = ((StructuredSelection) selection);
-            for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
-                Object element = iterator.next();
-                if (element instanceof TraceSessionComponent) {
-                    // Add only if corresponding TraceSessionComponent is an active snapshot session and not destroyed
-                    TraceSessionComponent session = (TraceSessionComponent) element;
-                    if(session.isSnapshotSession() && !session.isDestroyed()) {
-                        sessions.add(session);
-                    }
-                }
-            }
-        }
-        boolean isEnabled = !sessions.isEmpty();
-        fLock.lock();
-        try {
-            fSessions.clear();
-            if (isEnabled) {
-                fSessions.addAll(sessions);
-            }
-        } finally {
-            fLock.unlock();
-        }
-        return isEnabled;
-    }
-}
\ No newline at end of file
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnapshotHandler.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/handlers/SnapshotHandler.java
new file mode 100644 (file)
index 0000000..a06d318
--- /dev/null
@@ -0,0 +1,128 @@
+/**********************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * 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
+ *
+ * Contributors:
+ *   Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.tracecompass.internal.lttng2.control.ui.views.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.ControlView;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * <p>
+ * Command handler implementation to record a snapshot.
+ * </p>
+ *
+ * @author Bernd Hufmann
+ */
+public class SnapshotHandler extends BaseControlViewHandler {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+    /**
+     * The list of session components the command is to be executed on.
+     */
+    @NonNull protected List<TraceSessionComponent> fSessions = new ArrayList<>();
+
+    // ------------------------------------------------------------------------
+    // Operations
+    // ------------------------------------------------------------------------
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        fLock.lock();
+        try {
+            // Make a copy for thread safety
+            final List<TraceSessionComponent> sessions = new ArrayList<>();
+            sessions.addAll(fSessions);
+
+            Job job = new Job(Messages.TraceControl_RecordSnapshotJob) {
+                @Override
+                protected IStatus run(IProgressMonitor monitor) {
+                    MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
+                    for (Iterator<TraceSessionComponent> iterator = sessions.iterator(); iterator.hasNext();) {
+                        try {
+                            // record snapshot for all selected sessions sequentially
+                            TraceSessionComponent session = iterator.next();
+                            session.recordSnapshot(monitor);
+                            if (monitor.isCanceled()) {
+                                status.add(Status.CANCEL_STATUS);
+                                break;
+                            }
+                        } catch (ExecutionException e) {
+                            status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_RecordSnapshotFailure, e));
+                        }
+                    }
+                    return status;
+                }
+            };
+            job.setUser(true);
+            job.schedule();
+        } finally {
+            fLock.unlock();
+        }
+        return null;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        // Get workbench page for the Control View
+        IWorkbenchPage page = getWorkbenchPage();
+        if (page == null) {
+            return false;
+        }
+
+        List<TraceSessionComponent> sessions = new ArrayList<>(0);
+
+        // Check if one session is selected
+        ISelection selection = page.getSelection(ControlView.ID);
+        if (selection instanceof StructuredSelection) {
+            StructuredSelection structered = ((StructuredSelection) selection);
+            for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
+                Object element = iterator.next();
+                if (element instanceof TraceSessionComponent) {
+                    // Add only if corresponding TraceSessionComponent is an active snapshot session and not destroyed
+                    TraceSessionComponent session = (TraceSessionComponent) element;
+                    if(session.isSnapshotSession() && !session.isDestroyed()) {
+                        sessions.add(session);
+                    }
+                }
+            }
+        }
+        boolean isEnabled = !sessions.isEmpty();
+        fLock.lock();
+        try {
+            fSessions.clear();
+            if (isEnabled) {
+                fSessions.addAll(sessions);
+            }
+        } finally {
+            fLock.unlock();
+        }
+        return isEnabled;
+    }
+}
\ No newline at end of file
This page took 0.055857 seconds and 5 git commands to generate.