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 / EnableEventOnDomainHandler.java
index 17d03555212fc6064b39b8c13630554ace637f8f..bbb47f90b262ba85cc3f3a208f2a89438cef9cfd 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,20 +18,21 @@ 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.LogLevelType;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
+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.LogLevelType;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceLogLevel;
-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>EnableEventOnDomainHandler</u></b>
  * <p>
  * Command handler implementation to enable events for a known domain and default channel 'channel0'
  * (which will be created if doesn't exist).
  * </p>
+ *
+ * @author Bernd Hufmann
  */
 public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
 
@@ -116,10 +117,10 @@ public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
         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 TraceDomainComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceDomainComponent tmpDomain = (TraceDomainComponent) element; 
+                    TraceDomainComponent tmpDomain = (TraceDomainComponent) element;
                     session = tmpDomain.getSession();
                     if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
                         domain = tmpDomain;
@@ -127,7 +128,7 @@ public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (domain != null);
         fLock.lock();
         try {
This page took 0.024351 seconds and 5 git commands to generate.