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 / RefreshHandler.java
index ab6eae01d3f84746a7f74b9ef8f272836b64662b..43eb113170927f7127cc8a3990074ee46d45432a 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;
@@ -17,17 +17,18 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.ControlView;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TargetNodeState;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent;
 import org.eclipse.ui.IWorkbenchPage;
 
 /**
- * <b><u>RefreshHandler</u></b>
  * <p>
  * Command handler implementation to refresh node configuration.
  * </p>
+ *
+ * @author Bernd Hufmann
  */
 public class RefreshHandler extends BaseControlViewHandler {
 
@@ -38,7 +39,7 @@ public class RefreshHandler extends BaseControlViewHandler {
      * The node component reference.
      */
     private TargetNodeComponent fNode;
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -75,10 +76,10 @@ public class RefreshHandler extends BaseControlViewHandler {
         // Check if one or more session are selected
         ISelection selection = page.getSelection(ControlView.ID);
         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 TraceControlComponent) {
                     TraceControlComponent component = (TraceControlComponent) element;
                     boolean isConnected = component.getTargetNodeState() == TargetNodeState.CONNECTED;
@@ -93,9 +94,9 @@ public class RefreshHandler extends BaseControlViewHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = node != null;
-        
+
         fLock.lock();
         try {
             fNode = null;
@@ -105,7 +106,7 @@ public class RefreshHandler extends BaseControlViewHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
This page took 0.024878 seconds and 5 git commands to generate.