Fix for bug 382684 (connection re-use)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / handlers / EnableChannelOnSessionHandler.java
index 8602661299a8bc7e80d1b00d676f6b225e510b29..b4d43ab0f18d18f84abf5dd3d6c83501c8e42c57 100644 (file)
@@ -1,12 +1,12 @@
 /**********************************************************************
  * Copyright (c) 2012 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: 
+ *
+ * Contributors:
  *   Bernd Hufmann - Initial API and implementation
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
@@ -18,19 +18,20 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceSessionState;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent;
 import org.eclipse.ui.IWorkbenchPage;
 
 /**
- * <b><u>EnableChannelOnSessionHandler</u></b>
  * <p>
- * Command handler implementation to enable a trace channel for unknown domain 
+ * Command handler implementation to enable a trace channel for unknown domain
  * (on session level).
  * </p>
+ *
+ * @author Bernd Hufmann
  */
 public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
 
@@ -45,7 +46,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
     public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
         param.getSession().enableChannels(channelNames, info, isKernel, monitor);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.BaseCreateChannelHandler#getDomain(org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.CommandParameter)
@@ -77,7 +78,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
         if (selection instanceof StructuredSelection) {
             StructuredSelection structered = ((StructuredSelection) selection);
             for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
-                Object element = (Object) iterator.next();
+                Object element = iterator.next();
                 if (element instanceof TraceSessionComponent) {
                     // Add only TraceSessionComponents that are inactive and not destroyed
                     TraceSessionComponent tmpSession = (TraceSessionComponent) element;
@@ -88,7 +89,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
             }
         }
         boolean isEnabled = session != null;
-        
+
         fLock.lock();
         try {
             fParam = null;
@@ -98,7 +99,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
This page took 0.024513 seconds and 5 git commands to generate.