tmf/lttng: Update 2014 copyrights
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / handlers / ChangeChannelStateHandler.java
index 742220a658063003b4b7cce55d0a3cbe022cc8e8..2863449cb7e740b74a8056dabe15bf0537413dcd 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -41,7 +41,7 @@ import org.eclipse.ui.PlatformUI;
  *
  * @author Bernd Hufmann
  */
-abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
+public abstract class ChangeChannelStateHandler extends BaseControlViewHandler {
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -57,7 +57,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
     /**
      * @return the new state to set
      */
-    abstract protected TraceEnablement getNewState();
+    protected abstract TraceEnablement getNewState();
 
     // ------------------------------------------------------------------------
     // Operations
@@ -69,12 +69,8 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
      * @param monitor - a progress monitor
      * @throws ExecutionException If the command fails
      */
-    abstract protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
+    protected abstract void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
 
@@ -101,7 +97,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
 
                         if (kernelDomain != null) {
                             session = (TraceSessionComponent)kernelDomain.getParent();
-                            List<String> channelNames = new ArrayList<String>();
+                            List<String> channelNames = new ArrayList<>();
                             for (Iterator<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
                                 TraceChannelComponent channel = iterator.next();
@@ -124,7 +120,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
                                 session = (TraceSessionComponent)ustDomain.getParent();
                             }
 
-                            List<String> channelNames = new ArrayList<String>();
+                            List<String> channelNames = new ArrayList<>();
                             for (Iterator<TraceChannelComponent> iterator = ustChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
                                 TraceChannelComponent channel = iterator.next();
@@ -164,10 +160,6 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
         return null;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
-     */
     @Override
     public boolean isEnabled() {
 
@@ -179,8 +171,8 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
 
         TraceDomainComponent kernelDomain = null;
         TraceDomainComponent ustDomain = null;
-        List<TraceChannelComponent> kernelChannels = new ArrayList<TraceChannelComponent>();
-        List<TraceChannelComponent> ustChannels = new ArrayList<TraceChannelComponent>();
+        List<TraceChannelComponent> kernelChannels = new ArrayList<>();
+        List<TraceChannelComponent> ustChannels = new ArrayList<>();
 
         // Check if one or more session are selected
         ISelection selection = page.getSelection(ControlView.ID);
@@ -238,23 +230,23 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
     /**
      *  Class containing parameter for the command execution.
      */
-    static protected class Parameter {
+    protected static class Parameter {
         /**
          * Kernel domain component reference.
          */
-        final protected TraceDomainComponent fKernelDomain;
+        protected final TraceDomainComponent fKernelDomain;
         /**
          * UST domain component reference.
          */
-        final protected TraceDomainComponent fUstDomain;
+        protected final TraceDomainComponent fUstDomain;
         /**
          * The list of kernel channel components the command is to be executed on.
          */
-        final protected List<TraceChannelComponent> fKernelChannels;
+        protected final List<TraceChannelComponent> fKernelChannels;
         /**
          * The list of UST channel components the command is to be executed on.
          */
-        final protected List<TraceChannelComponent> fUstChannels;
+        protected final List<TraceChannelComponent> fUstChannels;
 
         /**
          * Constructor
@@ -266,9 +258,9 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
         public Parameter(TraceDomainComponent kernelDomain, TraceDomainComponent ustDomain, List<TraceChannelComponent> kernelChannels, List<TraceChannelComponent> ustChannels) {
             fKernelDomain = kernelDomain;
             fUstDomain = ustDomain;
-            fKernelChannels = new ArrayList<TraceChannelComponent>();
+            fKernelChannels = new ArrayList<>();
             fKernelChannels.addAll(kernelChannels);
-            fUstChannels = new ArrayList<TraceChannelComponent>();
+            fUstChannels = new ArrayList<>();
             fUstChannels.addAll(ustChannels);
         }
 
This page took 0.026711 seconds and 5 git commands to generate.