lttng: Fix Javadoc and formatting in lttng2.ui
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 11 Jun 2012 19:52:20 +0000 (15:52 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 14 Jun 2012 19:59:49 +0000 (15:59 -0400)
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
80 files changed:
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/ActivatorTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/AllTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/AllTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/ListenerValidator.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/ModelImplTestSetup.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlComponentTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlKernelProviderTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlKernelSessionTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlPropertiesTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlTestFacility.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlTreeModelTest.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlUstProviderTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlUstSessionTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/AllTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/AddContextDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/CreateSessionDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableEventsDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/service/CommandShellFactory.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/service/TestRemoteSystemProxy.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/shells/LTTngToolsFileShell.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/shells/TestCommandShell.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/ControlView.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/AddContextDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableEventsDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableKernelEventComposite.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableUstEventsComposite.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IConfirmDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IImportDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportFileInfo.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/NewConnectionDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/AddContextOnChannelHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/AddContextOnDomainHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/AddContextOnEventHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/AssignEventHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseAddContextHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseControlViewHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableEventHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/CalibrateHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ChangeChannelStateHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ChangeEventStateHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ChangeSessionStateHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ChannelCommandParameter.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/CreateSessionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/DestroySessionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableChannelOnDomainHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableChannelOnSessionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableEventOnChannelHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableEventOnDomainHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableEventOnSessionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/ImportHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/RefreshHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/KernelProviderComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceChannelComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceControlComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceDomainComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceEventComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceProviderGroup.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceSessionComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceSessionGroup.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/property/BaseEventPropertySource.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/property/TraceEventPropertySource.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/property/TraceProbeEventPropertySource.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandResult.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/ICommandResult.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/ICommandShell.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/IRemoteSystemProxy.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/RemoteSystemProxy.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/ILttngControlService.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceFactory.java

index a28b7afbac34a319068cad11fc490b014e6d8b77..a43bcf679efa78df271c9c016e67bf5cf7874637 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * 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:
  *   Francois Chouinard - Initial API and implementation
  *******************************************************************************/
@@ -26,6 +26,7 @@ import org.junit.Test;
  * Test suite for the Activator class
  * <p>
  */
+@SuppressWarnings("javadoc")
 public class ActivatorTest extends TestCase {
 
     // ------------------------------------------------------------------------
index d5aad5b37d787be50aaf97014f149847355b04d6..e34a1be6051abd9fface2a95b311c745a1de6fab 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * 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:
  *   Francois Chouinard - Initial API and implementation
  *******************************************************************************/
@@ -19,6 +19,7 @@ import junit.framework.TestSuite;
  * <b><u>AllTests</u></b>
  * <p>
  */
+@SuppressWarnings("javadoc")
 public class AllTests {
 
     public static Test suite() {
index b40bafbb1e127aebf40c8f04d43f86ec0b89b35d..3d44b0d10c63bc298cc160a0d4a41961159d0b9f 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011 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
  *******************************************************************************/
@@ -14,10 +14,11 @@ package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+@SuppressWarnings("javadoc")
 public class AllTests {
 
     public static Test suite() {
-        
+
         TestSuite suite = new TestSuite(AllTests.class.getName());
         //$JUnit-BEGIN$
         suite.addTestSuite(TraceControlComponentTest.class);
index ff87552d6cb8497ac62be96dee1222450d9bc8e7..24065ab31da86a5773b0547f11c716ac9f969924 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.lttng2.ui.tests.control.model.component;
@@ -16,8 +16,8 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceContr
 
 /**
  * The class can be used to validate the listener interface.
- *
  */
+@SuppressWarnings("javadoc")
 public class ListenerValidator implements ITraceControlComponentChangedListener {
 
     // ------------------------------------------------------------------------
@@ -26,11 +26,11 @@ public class ListenerValidator implements ITraceControlComponentChangedListener
     private boolean fisAddedCalled = false;
     private boolean fisRemoveCalled = false;
     private boolean fisChangedCalled = false;
-    
+
     private ITraceControlComponent fParent = null;
     private ITraceControlComponent fChild = null;
     private ITraceControlComponent fChangedComponent = null;
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -49,11 +49,11 @@ public class ListenerValidator implements ITraceControlComponentChangedListener
     public ITraceControlComponent getSavedParent() {
         return fParent;
     }
-    
+
     public ITraceControlComponent getSavedChild() {
         return fChild;
     }
-    
+
     public ITraceControlComponent getSavedComponent() {
         return fChangedComponent;
     }
index 1fbd76ad6855c71e3fee2b2dab709e8f457b47b8..a3c23f9e93e9a534c15dd7af7512f69b1ea6f7ea 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * 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:
  *   Bernd Hufmann - Initial API and implementation
  *******************************************************************************/
@@ -15,14 +15,15 @@ import junit.extensions.TestSetup;
 import junit.framework.Test;
 
 /**
- *  Test setup class for one-time setUp() and tearDown() across test cases. 
+ *  Test setup class for one-time setUp() and tearDown() across test cases.
  */
+@SuppressWarnings("javadoc")
 public class ModelImplTestSetup extends TestSetup {
 
     public ModelImplTestSetup(Test test) {
         super(test);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see junit.extensions.TestSetup#setUp()
index 51b4ff8d0300db3475fe4702873da664d867972f..bf453acb14fa00bf421b81ab59f327f4847b5d3f 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.lttng2.ui.tests.control.model.component;
@@ -37,20 +37,20 @@ import org.junit.Before;
  * The class <code>TraceControlComponentTest</code> contains tests for the class <code>{@link TraceControlComponent}</code>.
  *
  */
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "javadoc"})
 public class TraceControlComponentTest extends TestCase {
-    
+
     // ------------------------------------------------------------------------
     // Test data
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlComponentTest.class));
@@ -83,13 +83,13 @@ public class TraceControlComponentTest extends TestCase {
     @After
     public void tearDown()  throws Exception {
     }
-    
+
     /**
      * Run the TraceControlComponent(String) constructor test.
      */
     public void testTraceControlComponent_1()
         throws Exception {
-        
+
         String name = "node";
 
         TraceControlComponent result = new TraceControlComponent(name);
@@ -135,7 +135,7 @@ public class TraceControlComponentTest extends TestCase {
         fixture.addChild(new TraceControlRoot());
         ITraceControlComponent component = new TraceControlRoot();
         fixture.addChild(component);
-        
+
         ITraceControlComponent child = fixture.getChild(TraceControlRoot.TRACE_CONTROL_ROOT_NAME);
         assertNotNull(child);
         assertEquals(TraceControlRoot.TRACE_CONTROL_ROOT_NAME, child.getName());
@@ -163,7 +163,7 @@ public class TraceControlComponentTest extends TestCase {
      * @throws Exception
      *
      */
-    
+
     public void testAddComponentListener_1()
         throws Exception {
         TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
@@ -175,7 +175,7 @@ public class TraceControlComponentTest extends TestCase {
         TraceControlRoot root = new TraceControlRoot();
         fixture.addChild(root);
         assertTrue(validator.isAddedCalled());
-        
+
         fixture.removeChild(root);
         assertTrue(validator.isRemovedCalled());
 
@@ -225,14 +225,14 @@ public class TraceControlComponentTest extends TestCase {
      * @throws Exception
      *
      */
-    
+
     public void testFireCompenentUpdated()
         throws Exception {
         ITraceControlComponent parent = new TraceControlRoot();
-        
+
         TraceControlComponent fixture = new TraceControlComponent("node", parent);
         fixture.setToolTip("");
-        
+
         ITraceControlComponent component = new TraceControlComponent("child");
         fixture.addChild(component);
 
@@ -243,9 +243,9 @@ public class TraceControlComponentTest extends TestCase {
         assertTrue(validator.isAddedCalled());
         assertEquals(parent.getName(), validator.getSavedParent().getName());
         assertEquals(component.getName(), validator.getSavedChild().getName());
-        
+
         validator.initialize();
-        
+
         fixture.fireComponentRemoved(parent, component);
         assertTrue(validator.isRemovedCalled());
         assertEquals(parent.getName(), validator.getSavedParent().getName());
@@ -263,7 +263,7 @@ public class TraceControlComponentTest extends TestCase {
      * @throws Exception
      *
      */
-    
+
     public void testGetAdapter()
         throws Exception {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
@@ -309,37 +309,37 @@ public class TraceControlComponentTest extends TestCase {
      */
     public void testGetAndSetControlService_1()
         throws Exception {
-        
+
         TraceControlComponent parent = new TraceControlComponent("parent") {
             ILttngControlService fService = null;
-            
+
             @Override
             public void setControlService(ILttngControlService service ) {
                 fService = service;
             }
-            
+
             @Override
             public ILttngControlService getControlService() {
                 return fService;
             }
         };
-        
+
         TraceControlComponent fixture = new TraceControlComponent("", parent);
         parent.addChild(fixture);
         fixture.setToolTip("");
         TraceControlComponent child = new TraceControlComponent("child", fixture);
         fixture.addChild(child);
-        
+
         ILttngControlService result = fixture.getControlService();
         assertEquals(null, result);
-        
+
         TestRemoteSystemProxy proxy = new TestRemoteSystemProxy();
         ILttngControlService service = new LTTngControlService(proxy.createCommandShell());
         fixture.setControlService(service);
         result = fixture.getControlService();
         assertNotNull(service);
         assertEquals(service, result);
-        
+
         result = fixture.getChildren()[0].getControlService();
         assertNotNull(service);
         assertEquals(service, result);
@@ -359,7 +359,7 @@ public class TraceControlComponentTest extends TestCase {
 
         Image result = fixture.getImage();
         assertEquals(null, result);
-        
+
         fixture.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
         assertNotNull(fixture.getImage());
     }
@@ -410,7 +410,7 @@ public class TraceControlComponentTest extends TestCase {
 
         fixture.addChild(new TraceControlRoot());
         fixture.addChild(new TraceControlComponent("child"));
-        
+
         fixture.removeAllChildren();
         assertFalse(fixture.hasChildren());
     }
@@ -426,7 +426,7 @@ public class TraceControlComponentTest extends TestCase {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
         fixture.setToolTip("");
         TraceControlComponent child = new TraceControlComponent("child", fixture);
-        
+
         fixture.addChild(child);
         fixture.removeChild(child);
         assertFalse(fixture.hasChildren());
@@ -438,7 +438,7 @@ public class TraceControlComponentTest extends TestCase {
      * @throws Exception
      *
      */
-    
+
     public void testRemoveChild_2()
         throws Exception {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
@@ -460,7 +460,7 @@ public class TraceControlComponentTest extends TestCase {
         throws Exception {
         TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
         fixture.setToolTip("");
-        
+
         ListenerValidator validator = new ListenerValidator();
         fixture.addComponentListener(validator);
 
@@ -470,7 +470,7 @@ public class TraceControlComponentTest extends TestCase {
         TraceControlRoot root = new TraceControlRoot();
         fixture.addChild(root);
         assertFalse(validator.isAddedCalled());
-        
+
         fixture.removeChild(root);
         assertFalse(validator.isRemovedCalled());
 
@@ -497,7 +497,7 @@ public class TraceControlComponentTest extends TestCase {
 
     /**
      * Run the void setChildren(List<ITraceControlComponent>)/ITraceControlComponent[] getChildren() method test.
-     * 
+     *
      *
      * @throws Exception
      *
@@ -511,7 +511,7 @@ public class TraceControlComponentTest extends TestCase {
         children.add(new TraceControlComponent("child2"));
 
         fixture.setChildren(children);
-        
+
         ITraceControlComponent[] result = fixture.getChildren();
         assertEquals(2, result.length);
         assertEquals("child1", result[0].getName());
@@ -567,30 +567,30 @@ public class TraceControlComponentTest extends TestCase {
      */
     public void testGetAndSetTargetNodeState_1()
         throws Exception {
-        
+
         TraceControlComponent parent = new TraceControlComponent("parent") {
             private TargetNodeState fState;
-            
+
             @Override
             public void setTargetNodeState(TargetNodeState state ) {
                 fState = state;
             }
-            
+
             @Override
             public TargetNodeState getTargetNodeState() {
                 return fState;
             }
         };
-        
+
         TraceControlComponent fixture = new TraceControlComponent("", parent);
         parent.addChild(fixture);
-        
+
         fixture.setToolTip("");
         TargetNodeState state = TargetNodeState.CONNECTED;
 
         fixture.setTargetNodeState(state);
         TargetNodeState result = fixture.getTargetNodeState();
-        
+
         assertNotNull(result);
         assertEquals(state, result);
         // Check also parent
@@ -605,7 +605,7 @@ public class TraceControlComponentTest extends TestCase {
         assertEquals("DISCONNECTED", result.name());
         assertEquals("DISCONNECTED", result.toString());
         assertEquals(0, result.ordinal());
-        
+
         state = TargetNodeState.CONNECTING;
 
         fixture.setTargetNodeState(state);
@@ -614,7 +614,7 @@ public class TraceControlComponentTest extends TestCase {
         assertEquals("CONNECTING", result.name());
         assertEquals("CONNECTING", result.toString());
         assertEquals(3, result.ordinal());
-        
+
         fixture.setTargetNodeState(TargetNodeState.DISCONNECTING);
         result = fixture.getTargetNodeState();
         assertNotNull(result);
@@ -629,9 +629,9 @@ public class TraceControlComponentTest extends TestCase {
      *
      * @throws Exception
      *
-     
+
      */
-    
+
     public void testGetSndSetToolTip()
         throws Exception {
         TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
index 373c74f337b2b0435b225b607c5b696b74d77248..278d1a2762dd76416dc076f48bdeb2064c3638b6 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.lttng2.ui.tests.control.model.component;
@@ -49,7 +49,7 @@ import org.osgi.framework.FrameworkUtil;
  * The class <code>TraceControlKernelProviderTests</code> contains UST provider handling
  * test cases.
  */
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "javadoc"})
 public class TraceControlKernelProviderTests extends TestCase {
 
     // ------------------------------------------------------------------------
@@ -63,15 +63,15 @@ public class TraceControlKernelProviderTests extends TestCase {
     // ------------------------------------------------------------------------
     private TraceControlTestFacility fFacility;
     private TestRemoteSystemProxy fProxy;
-    private String fTestFile; 
-    
+    private String fTestFile;
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlKernelProviderTests.class));
@@ -110,22 +110,22 @@ public class TraceControlKernelProviderTests extends TestCase {
     public void tearDown() throws Exception {
         fFacility.waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
      */
     public void testKernelProviderTree() throws Exception {
-        
-        
+
+
         fProxy.setTestFile(fTestFile);
         fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-        
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
         ISystemProfile profile =  registry.createSystemProfile("myProfile", true);
         IHost host = registry.createLocalHost(profile, "myProfile", "user");
-        
+
         TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy);
 
         root.addChild(node);
@@ -151,7 +151,7 @@ public class TraceControlKernelProviderTests extends TestCase {
         ITraceControlComponent[] providers = groups[0].getChildren();
         KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
 
-        // Get kernel provider events and select 2 events 
+        // Get kernel provider events and select 2 events
         ITraceControlComponent[] events = kernelProvider.getChildren();
         assertNotNull(events);
         assertEquals(3, events.length);
@@ -166,12 +166,12 @@ public class TraceControlKernelProviderTests extends TestCase {
 
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
         // ------------------------------------------------------------------------
         // Create session
         // ------------------------------------------------------------------------
         TraceSessionComponent session = fFacility.createSession(groups[1]);
-        
+
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
@@ -187,21 +187,21 @@ public class TraceControlKernelProviderTests extends TestCase {
         ITraceControlComponent[] components =  { baseEventInfo0, baseEventInfo1 };
 
         fFacility.executeCommand(components, "assign.event");
-        
+
         // Verify that kernel domain was created
         ITraceControlComponent[] domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(1, domains.length);
 
         assertEquals("Kernel", domains[0].getName());
-        
+
         // Verify that channel0 was created with default values
         ITraceControlComponent[] channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(1, channels.length);
 
         assertTrue(channels[0] instanceof TraceChannelComponent);
-        TraceChannelComponent channel = (TraceChannelComponent) channels[0]; 
+        TraceChannelComponent channel = (TraceChannelComponent) channels[0];
         assertEquals("channel0", channel.getName());
         assertEquals(4, channel.getNumberOfSubBuffers());
         assertEquals("splice()", channel.getOutputType());
@@ -231,30 +231,30 @@ public class TraceControlKernelProviderTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event1.getState());
 
         // ------------------------------------------------------------------------
-        // Disable event components 
+        // Disable event components
         // ------------------------------------------------------------------------
         ITraceControlComponent[] selection = { event, event1 };
         fFacility.executeCommand(selection, "disableEvent");
-        
+
         assertEquals(TraceEnablement.DISABLED, event.getState());
         assertEquals(TraceEnablement.DISABLED, event1.getState());
 
         // ------------------------------------------------------------------------
-        // Enable event component 
+        // Enable event component
         // ------------------------------------------------------------------------
         fFacility.executeCommand(event1, "enableEvent");
-        
+
         // Verify event state
         assertEquals(TraceEnablement.ENABLED, event1.getState());
-        
+
         // ------------------------------------------------------------------------
-        // Destroy session 
+        // Destroy session
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-        
+
         fFacility.destroySession(session);
-        
+
         // Verify that no more session components exist
         assertEquals(0, groups[1].getChildren().length);
 
@@ -263,7 +263,7 @@ public class TraceControlKernelProviderTests extends TestCase {
         //-------------------------------------------------------------------------
         fFacility.executeCommand(node, "disconnect");
         assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-        
+
         //-------------------------------------------------------------------------
         // Delete node
         //-------------------------------------------------------------------------
index b5364fbbe7176c84a21fcdad6b9f34ed76f9c981..6000c30fa4c30a6890de0ea1f72810e580d99727 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.lttng2.ui.tests.control.model.component;
@@ -55,9 +55,9 @@ import org.osgi.framework.FrameworkUtil;
  * handling test cases.
  */
 
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "javadoc"})
 public class TraceControlKernelSessionTests extends TestCase {
-    
+
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
@@ -69,15 +69,15 @@ public class TraceControlKernelSessionTests extends TestCase {
     // ------------------------------------------------------------------------
     private TraceControlTestFacility fFacility;
     private TestRemoteSystemProxy fProxy;
-    private String fTestFile; 
-    
+    private String fTestFile;
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlKernelSessionTests.class));
@@ -116,15 +116,15 @@ public class TraceControlKernelSessionTests extends TestCase {
     public void tearDown()  throws Exception {
         fFacility.waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
      */
     public void testTraceSessionTree() throws Exception {
-        
+
         fProxy.setTestFile(fTestFile);
         fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-        
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
@@ -155,15 +155,15 @@ public class TraceControlKernelSessionTests extends TestCase {
         TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
         TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
         TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-        
+
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
         // ------------------------------------------------------------------------
         // Create session
         // ------------------------------------------------------------------------
         TraceSessionComponent session = fFacility.createSession(groups[1]);
-        
+
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
@@ -172,7 +172,7 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Initialize scenario
         fProxy.setScenario(SCEN_SCENARIO3_TEST);
-        
+
         // ------------------------------------------------------------------------
         // Enable channel on session
         // ------------------------------------------------------------------------
@@ -181,21 +181,21 @@ public class TraceControlKernelSessionTests extends TestCase {
         TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
 
         fFacility.executeCommand(session, "enableChannelOnSession");
-        
+
         // Verify that Kernel domain was created
         ITraceControlComponent[] domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(1, domains.length);
 
         assertEquals("Kernel", domains[0].getName());
-        
+
         // Verify that channel was created with correct data
         ITraceControlComponent[] channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(1, channels.length);
 
         assertTrue(channels[0] instanceof TraceChannelComponent);
-        TraceChannelComponent channel = (TraceChannelComponent) channels[0]; 
+        TraceChannelComponent channel = (TraceChannelComponent) channels[0];
         assertEquals("mychannel", channel.getName());
         assertEquals(4, channel.getNumberOfSubBuffers());
         assertEquals("splice()", channel.getOutputType());
@@ -216,9 +216,9 @@ public class TraceControlKernelSessionTests extends TestCase {
         info.setSwitchTimer(100);
         info.setReadTimer(200);
         channelStub.setChannelInfo(info);
-        
+
         fFacility.executeCommand(domains[0], "enableChannelOnDomain");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -230,7 +230,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(2, channels.length);
 
         assertTrue(channels[1] instanceof TraceChannelComponent);
-        channel = (TraceChannelComponent) channels[1]; 
+        channel = (TraceChannelComponent) channels[1];
         assertEquals("mychannel2", channel.getName());
         assertEquals(2, channel.getNumberOfSubBuffers());
         assertEquals("splice()", channel.getOutputType());
@@ -248,9 +248,9 @@ public class TraceControlKernelSessionTests extends TestCase {
         eventsDialogStub.setNames(events);
         eventsDialogStub.setIsKernel(true);
         TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
-        
+
         // ------------------------------------------------------------------------
-        // disable channels 
+        // disable channels
         // ------------------------------------------------------------------------
         // Get Kernel domain component instance
         domains = session.getChildren();
@@ -263,12 +263,12 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(2, channels.length);
 
         fFacility.executeCommand(channels, "disableChannel");
-        
+
         assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[0]).getState());
         assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[1]).getState());
 
         // ------------------------------------------------------------------------
-        // enable channels 
+        // enable channels
         // ------------------------------------------------------------------------
         // Get Kernel domain component instance
         domains = session.getChildren();
@@ -279,14 +279,14 @@ public class TraceControlKernelSessionTests extends TestCase {
         channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(2, channels.length);
-        
+
         fFacility.executeCommand(channels, "enableChannel");
-        
+
         assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[0]).getState());
         assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[1]).getState());
 
         // ------------------------------------------------------------------------
-        // enable event (tracepoints) on session 
+        // enable event (tracepoints) on session
         // ------------------------------------------------------------------------
         fFacility.executeCommand(session, "enableEventOnSession");
 
@@ -301,13 +301,13 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(3, channels.length);
 
         assertTrue(channels[2] instanceof TraceChannelComponent);
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         assertEquals("channel0", channel.getName());
         // No need to check parameters of default channel because that has been done in other tests
 
         ITraceControlComponent[] channel0Events = channel.getChildren();
         assertEquals(2, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
         assertTrue(channel0Events[1] instanceof TraceEventComponent);
 
@@ -324,7 +324,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // enable event (tracepoints) on domain 
+        // enable event (tracepoints) on domain
         // ------------------------------------------------------------------------
         events.clear();
         events.add("sched_wakeup_new");
@@ -339,14 +339,14 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel = (TraceChannelComponent) channels[2];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(3, channel0Events.length);
-        
+
         assertTrue(channel0Events[2] instanceof TraceEventComponent);
 
         event = (TraceEventComponent) channel0Events[2];
@@ -356,14 +356,14 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // enable event (tracepoints) on channel 
+        // enable event (tracepoints) on channel
         // ------------------------------------------------------------------------
         events.clear();
         eventsDialogStub.setNames(events);
         eventsDialogStub.setIsAllTracePoints(true);
 
         fFacility.executeCommand(channels[1], "enableEventOnChannel");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -373,10 +373,10 @@ public class TraceControlKernelSessionTests extends TestCase {
         channels =  domains[0].getChildren();
         // No need to check parameters of default channel because that has been done in other tests
         channel = (TraceChannelComponent) channels[1];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(3, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
         assertTrue(channel0Events[1] instanceof TraceEventComponent);
         assertTrue(channel0Events[2] instanceof TraceEventComponent);
@@ -392,7 +392,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         event = (TraceEventComponent) channel0Events[2];
         assertEquals("sched_wakeup_new", event.getName());
         assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
@@ -400,15 +400,15 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // enable event (syscall) on channel 
+        // enable event (syscall) on channel
         // ------------------------------------------------------------------------
         events.clear();
-        eventsDialogStub.setIsTracePoints(false);        
+        eventsDialogStub.setIsTracePoints(false);
         eventsDialogStub.setIsAllTracePoints(false);
         eventsDialogStub.setIsSysCalls(true);
 
         fFacility.executeCommand(channels[0], "enableEventOnChannel");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -416,16 +416,16 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel = (TraceChannelComponent) channels[0];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(1, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("syscalls", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
@@ -433,7 +433,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // enable event (syscall) on domain 
+        // enable event (syscall) on domain
         // ------------------------------------------------------------------------
         fFacility.executeCommand(domains[0], "enableEventOnDomain");
 
@@ -444,16 +444,16 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel = (TraceChannelComponent) channels[2];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(4, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("syscalls", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
@@ -461,7 +461,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // enable event (syscall) on session 
+        // enable event (syscall) on session
         // ------------------------------------------------------------------------
         fFacility.executeCommand(session, "enableEventOnSession");
 
@@ -472,34 +472,34 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel = (TraceChannelComponent) channels[2];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(4, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("syscalls", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
         assertEquals(TraceEventType.SYSCALL, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
-        
+
         // ------------------------------------------------------------------------
-        // enable event (dynamic probe) on domain 
+        // enable event (dynamic probe) on domain
         // ------------------------------------------------------------------------
         events.clear();
         eventsDialogStub.setIsSysCalls(false);
         eventsDialogStub.setIsDynamicProbe(true);
         eventsDialogStub.setDynamicProbe("0xc0101280");
         eventsDialogStub.setProbeEventName("myevent1");
-        
+
         fFacility.executeCommand(domains[0], "enableEventOnDomain");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -507,14 +507,14 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(5, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-        
+
         TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[0];
         assertEquals("myevent1", probeEvent.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
@@ -525,14 +525,14 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertNull(probeEvent.getSymbol());
 
         // ------------------------------------------------------------------------
-        // enable event (dynamic probe) on channel 
+        // enable event (dynamic probe) on channel
         // ------------------------------------------------------------------------
         eventsDialogStub.setIsDynamicProbe(true);
         eventsDialogStub.setDynamicProbe("init_post");
         eventsDialogStub.setProbeEventName("myevent2");
 
         fFacility.executeCommand(channels[2], "enableEventOnChannel");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -540,14 +540,14 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(6, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-        
+
         probeEvent = (TraceProbeEventComponent) channel0Events[0];
         assertEquals("myevent2", probeEvent.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
@@ -558,14 +558,14 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals("init_post", probeEvent.getSymbol());
 
         // ------------------------------------------------------------------------
-        // enable event (dynamic probe) on session 
+        // enable event (dynamic probe) on session
         // ------------------------------------------------------------------------
         eventsDialogStub.setIsDynamicProbe(true);
         eventsDialogStub.setDynamicProbe("init_post:0x1000");
         eventsDialogStub.setProbeEventName("myevent3");
 
         fFacility.executeCommand(session, "enableEventOnSession");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -573,7 +573,7 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
@@ -589,7 +589,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals("0x1000", probeEvent.getOffset());
         assertNull(null, probeEvent.getAddress());
         assertEquals("init_post", probeEvent.getSymbol());
-        
+
         // ------------------------------------------------------------------------
         // enable event (dynamic function probe) on session
         // ------------------------------------------------------------------------
@@ -601,7 +601,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         eventsDialogStub.setFunctionProbe("create_dev");
 
         fFacility.executeCommand(session, "enableEventOnSession");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -609,7 +609,7 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
@@ -625,7 +625,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals("0x0", probeEvent.getOffset());
         assertNull(null, probeEvent.getAddress());
         assertEquals("create_dev", probeEvent.getSymbol());
-  
+
         // ------------------------------------------------------------------------
         // enable event (dynamic function probe) on domain
         // ------------------------------------------------------------------------
@@ -634,7 +634,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         eventsDialogStub.setFunctionProbe("create_dev:0x2000");
 
         fFacility.executeCommand(domains[0], "enableEventOnDomain");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -642,7 +642,7 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
@@ -667,7 +667,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         eventsDialogStub.setFunctionProbe("create_dev:0x2000");
 
         fFacility.executeCommand(channels[0], "enableEventOnChannel");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -675,7 +675,7 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
@@ -693,7 +693,7 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals("create_dev", probeEvent.getSymbol());
 
         // ------------------------------------------------------------------------
-        // Add Context on domain  
+        // Add Context on domain
         // ------------------------------------------------------------------------
         // Get Kernel domain component instance
         domains = session.getChildren();
@@ -707,13 +707,13 @@ public class TraceControlKernelSessionTests extends TestCase {
         contexts.add("perf:cache-misses");
         addContextStub.setContexts(contexts);
         TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
-        
+
         fFacility.executeCommand(domains[0], "addContextOnDomain");
         // Currently there is nothing to verify because the list commands don't show any context information
         // However, the execution of the command make sure that the correct service command line is build and executed.
 
         // ------------------------------------------------------------------------
-        // Add Context on channel  
+        // Add Context on channel
         // ------------------------------------------------------------------------
 
         // Get Kernel domain component instance
@@ -723,8 +723,8 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         //Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
-        
+        channel = (TraceChannelComponent) channels[0];
+
         try {
             // The setContext() verifies that the contexts set are part of the available contexts
             // The available contexts are set by the command handler addContextOnDomain above.
@@ -738,9 +738,9 @@ public class TraceControlKernelSessionTests extends TestCase {
         fFacility.executeCommand(channel, "addContextOnChannel");
         // Currently there is nothing to verify because the list commands don't show any context information
         // However, the execution of the command make sure that the correct service command line is build and executed.
-        
+
         // ------------------------------------------------------------------------
-        // Add Context on event  
+        // Add Context on event
         // ------------------------------------------------------------------------
         // Get Kernel domain component instance
         domains = session.getChildren();
@@ -749,30 +749,30 @@ public class TraceControlKernelSessionTests extends TestCase {
 
         //Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
-        
+        channel = (TraceChannelComponent) channels[2];
+
         channel0Events = channel.getChildren();
 
         event = (TraceEventComponent) channel0Events[6];
-        
+
         fFacility.executeCommand(event, "addContextOnEvent");
         // Currently there is nothing to verify because the list commands don't show any context information
-        // However, the execution of the command make sure that the correct service command line is build and executed.        
+        // However, the execution of the command make sure that the correct service command line is build and executed.
 
         // ------------------------------------------------------------------------
-        // Calibrate  
+        // Calibrate
         // ------------------------------------------------------------------------
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(1, domains.length);
-        
+
         fFacility.executeCommand(domains[0], "calibrate");
-        // There is nothing to verify here. 
+        // There is nothing to verify here.
         // However, the execution of the command make sure that the correct service command line is build and executed.
-        
+
         // ------------------------------------------------------------------------
-        // refresh 
+        // refresh
         // ------------------------------------------------------------------------
         fFacility.executeCommand(node, "refresh");
         groups = node.getChildren();
@@ -783,30 +783,30 @@ public class TraceControlKernelSessionTests extends TestCase {
         assertEquals(1, groups[1].getChildren()[0].getChildren().length); // domains
         assertEquals(3, groups[1].getChildren()[0].getChildren()[0].getChildren().length); // channels
         assertEquals(2, groups[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren().length); // events (of channel[0])
-        
+
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-        
+
         session = (TraceSessionComponent)groups[1].getChildren()[0];
 
         // ------------------------------------------------------------------------
-        // start session 
+        // start session
         // ------------------------------------------------------------------------
         fFacility.startSession(session);
         assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
-        
+
         // ------------------------------------------------------------------------
-        // stop session 
+        // stop session
         // ------------------------------------------------------------------------
         fFacility.stopSession(session);
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        
+
         // ------------------------------------------------------------------------
-        // Destroy session 
+        // Destroy session
         // ------------------------------------------------------------------------
 
         fFacility.destroySession(session);
-        
+
         // Verify that no more session components exist
         assertEquals(0, groups[1].getChildren().length);
 
@@ -815,13 +815,13 @@ public class TraceControlKernelSessionTests extends TestCase {
         //-------------------------------------------------------------------------
         fFacility.executeCommand(node, "disconnect");
         assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-       
+
         //-------------------------------------------------------------------------
         // Delete node
         //-------------------------------------------------------------------------
-         
+
         fFacility.executeCommand(node, "delete");
         assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
     }
-    
+
 }
\ No newline at end of file
index ff63ad9beebe97399feec0279822c3aa793e0fec..df0eda5e668686f480161f42d8a4444aed0eda44 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.lttng2.ui.tests.control.model.component;
@@ -70,18 +70,18 @@ public class TraceControlPropertiesTest extends TestCase {
     private static final String TEST_STREAM = "ListInfoTest.cfg";
     private static final String SCEN_LIST_INFO_TEST = "ListInfoTest";
 
-    
+
     // ------------------------------------------------------------------------
     // Test data
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlPropertiesTest.class));
@@ -115,19 +115,22 @@ public class TraceControlPropertiesTest extends TestCase {
     public void tearDown() throws Exception {
         TraceControlTestFacility.getInstance().waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
+     *
+     * @throws Exception
+     *             This will fail the test
      */
     public void testComponentProperties() throws Exception {
-        
+
         TestRemoteSystemProxy proxy = new TestRemoteSystemProxy();
 
         URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
         File testfile = new File(FileLocator.toFileURL(location).toURI());
         proxy.setTestFile(testfile.getAbsolutePath());
         proxy.setScenario(SCEN_LIST_INFO_TEST);
-            
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
@@ -161,11 +164,11 @@ public class TraceControlPropertiesTest extends TestCase {
 
         adapter = node.getAdapter(IChannelInfo.class);
         assertNull(adapter);
-        
+
         ITraceControlComponent[] groups = node.getChildren();
         assertNotNull(groups);
         assertEquals(2, groups.length);
-        
+
         ITraceControlComponent[] providers = groups[0].getChildren();
 
         assertNotNull(providers);
@@ -175,7 +178,7 @@ public class TraceControlPropertiesTest extends TestCase {
         // Verify Kernel Provider Properties (adapter)
         // ------------------------------------------------------------------------
         KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
-        
+
         adapter = kernelProvider.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof KernelProviderPropertySource);
@@ -189,7 +192,7 @@ public class TraceControlPropertiesTest extends TestCase {
         // Verify UST Provider Properties (adapter)
         // ------------------------------------------------------------------------
         UstProviderComponent ustProvider = (UstProviderComponent) providers[1];
-        
+
         adapter = ustProvider.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof UstProviderPropertySource);
@@ -209,7 +212,7 @@ public class TraceControlPropertiesTest extends TestCase {
 
         BaseEventComponent baseEventInfo = (BaseEventComponent) events[0];
         assertNotNull(baseEventInfo);
-        
+
         adapter = baseEventInfo.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof BaseEventPropertySource);
@@ -257,7 +260,7 @@ public class TraceControlPropertiesTest extends TestCase {
         assertNotNull(domainSource.getPropertyDescriptors());
 
         assertEquals("Kernel", domainSource.getPropertyValue(TraceDomainPropertySource.TRACE_DOMAIN_NAME_PROPERTY_ID));
-        
+
         ITraceControlComponent[] channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(2, channels.length);
@@ -267,7 +270,7 @@ public class TraceControlPropertiesTest extends TestCase {
         // ------------------------------------------------------------------------
         assertTrue(channels[0] instanceof TraceChannelComponent);
         TraceChannelComponent channel = (TraceChannelComponent) channels[0];
-        
+
         adapter = channel.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof TraceChannelPropertySource);
@@ -283,7 +286,7 @@ public class TraceControlPropertiesTest extends TestCase {
         assertEquals(String.valueOf(200), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_READ_TIMER_PROPERTY_ID));
         assertEquals(String.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID));
         assertEquals(String.valueOf(0), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID));
-        
+
         // ------------------------------------------------------------------------
         // Verify Event Properties (adapter)
         // ------------------------------------------------------------------------
@@ -291,28 +294,28 @@ public class TraceControlPropertiesTest extends TestCase {
         assertNotNull(channel0Events);
         assertEquals(5, channel0Events.length);
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         TraceEventComponent event = (TraceEventComponent) channel0Events[0];
-        
+
         adapter = event.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof TraceEventPropertySource);
 
         TraceEventPropertySource eventSource = (TraceEventPropertySource)adapter;
         assertNotNull(eventSource.getPropertyDescriptors());
-        
+
         assertEquals("block_rq_remap", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID));
         assertEquals(TraceLogLevel.TRACE_EMERG.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID));
         assertEquals(TraceEventType.TRACEPOINT.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID));
         assertEquals(TraceEnablement.ENABLED.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID));
-        
+
         // ------------------------------------------------------------------------
         // Verify Probe Event Properties (adapter)
         // ------------------------------------------------------------------------
         assertTrue(channel0Events[2] instanceof TraceProbeEventComponent);
-        
+
         TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2];
-        
+
         adapter = probeEvent.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof TraceProbeEventPropertySource);
@@ -320,16 +323,16 @@ public class TraceControlPropertiesTest extends TestCase {
         TraceProbeEventPropertySource probeEventSource = (TraceProbeEventPropertySource)adapter;
         assertNotNull(probeEventSource.getPropertyDescriptors());
         assertEquals(4, probeEventSource.getPropertyDescriptors().length);
-        
+
         assertEquals("myevent2", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID));
         assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID));
         assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID));
         assertEquals("0xc0101340", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID));
-        
+
         assertTrue(channel0Events[3] instanceof TraceProbeEventComponent);
-        
+
         probeEvent = (TraceProbeEventComponent) channel0Events[3];
-        
+
         adapter = probeEvent.getAdapter(IPropertySource.class);
         assertNotNull(adapter);
         assertTrue(adapter instanceof TraceProbeEventPropertySource);
@@ -337,13 +340,13 @@ public class TraceControlPropertiesTest extends TestCase {
         probeEventSource = (TraceProbeEventPropertySource)adapter;
         assertNotNull(probeEventSource.getPropertyDescriptors());
         assertEquals(5, probeEventSource.getPropertyDescriptors().length);
-        
+
         assertEquals("myevent0", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID));
         assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID));
         assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID));
         assertEquals("0x0", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID));
         assertEquals("init_post", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID));
-        
+
         //-------------------------------------------------------------------------
         // Delete node
         //-------------------------------------------------------------------------
index 436291ee955168406cca45bb41026085b41ea614..e03b8eea40d23cb8fae5dcfd9129a8c1a4ba7e9b 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011 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
  *******************************************************************************/
@@ -27,29 +27,30 @@ import org.eclipse.ui.handlers.IHandlerService;
 
 /**
  *  Singleton class to facilitate the test cases. Creates UML2SD view and loader objects as well as provides
- *  utility methods for interacting with the loader/view.  
+ *  utility methods for interacting with the loader/view.
  */
+@SuppressWarnings("javadoc")
 public class TraceControlTestFacility {
 
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    public final static int WAIT_FOR_JOBS_DELAY = 1000; 
+    public final static int WAIT_FOR_JOBS_DELAY = 1000;
     public final static int GUI_REFESH_DELAY = 500;
-           
+
     public final static String DIRECTORY = "testfiles"; //$NON-NLS-1$
     public final static String COMMAND_CATEGORY_PREFIX = "org.eclipse.linuxtools.internal.lttng2.ui.commands.control."; //$NON-NLS-1$
     public final static String SCEN_INIT_TEST = "Initialize"; //$NON-NLS-1$
     public final static String SCEN_SCENARIO_SESSION_HANDLING = "SessionHandling"; //$NON-NLS-1$
     public final static String SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH = "SessionHandlingWithPath"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     private static TraceControlTestFacility fInstance = null;
     private ControlView fControlView = null;
     private boolean fIsInitialized = false;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -70,28 +71,28 @@ public class TraceControlTestFacility {
      * Initial the test facility.
      */
     public void init() {
-        
+
         if (!fIsInitialized) {
 
             IViewPart view;
             try {
-                
+
                 view = PlatformUI.getWorkbench()
                         .getActiveWorkbenchWindow()
                         .getActivePage()
                         .findView("org.eclipse.ui.internal.introview"); //$NON-NLS-1$
-                
+
                 if (view != null) {
                     PlatformUI.getWorkbench()
                     .getActiveWorkbenchWindow()
-                    .getActivePage().hideView(view); 
+                    .getActivePage().hideView(view);
                 }
 
                 view = PlatformUI.getWorkbench()
                                  .getActiveWorkbenchWindow()
                                  .getActivePage()
-                                 .showView(ControlView.ID); 
-                
+                                 .showView(ControlView.ID);
+
             } catch (PartInitException e) {
                 throw new RuntimeException(e);
             }
@@ -103,7 +104,7 @@ public class TraceControlTestFacility {
         }
     }
 
-    
+
     /**
      * Disposes the facility (and GUI)
      */
@@ -168,7 +169,7 @@ public class TraceControlTestFacility {
         setSelection(component);
         executeCommand(commandId);
     }
-    
+
     /**
      * Executes an Eclipse command with command ID after selecting passed components
      * @param components - array of components to select in the tree
@@ -208,7 +209,7 @@ public class TraceControlTestFacility {
         waitForJobs();
     }
 
-    
+
     /**
      * Selects passed components
      * @param components - array of component to select in the tree
@@ -220,7 +221,7 @@ public class TraceControlTestFacility {
         // Selection is done in own job
         waitForJobs();
     }
-    
+
     /**
      * Creates session on passed session group.
      * @param group - session group
@@ -233,14 +234,14 @@ public class TraceControlTestFacility {
     @SuppressWarnings("nls")
     public TraceSessionComponent createSession(ITraceControlComponent group) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
         executeCommand(group, "createSession");
-        
+
         ITraceControlComponent[] sessions = group.getChildren();
         if ((sessions == null) || (sessions.length == 0)) {
             return null;
         }
         return (TraceSessionComponent)sessions[0];
     }
-    
+
     /**
      * Destroys a given session.
      * @param session - session to destroy
@@ -253,7 +254,7 @@ public class TraceControlTestFacility {
     public void destroySession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
         executeCommand(session, "destroySession");
     }
-    
+
     /**
      * Starts a given session
      * @param session - session to start
@@ -266,7 +267,7 @@ public class TraceControlTestFacility {
     public void startSession(TraceSessionComponent session) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
         executeCommand(session, "start");
     }
-    
+
     /**
      * Stops a given session
      * @param session - session to stop
index 4c23bb34ebf567bbba4b3ad33811b157c4cecc84..8a913d1615bb8300f448eed8f6e8d1051ea97418 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.lttng2.ui.tests.control.model.component;
@@ -54,7 +54,7 @@ import org.osgi.framework.FrameworkUtil;
  */
 @SuppressWarnings("nls")
 public class TraceControlTreeModelTest extends TestCase {
+
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
@@ -62,21 +62,21 @@ public class TraceControlTreeModelTest extends TestCase {
     private static final String TEST_STREAM = "ListInfoTest.cfg";
     private static final String SCEN_LIST_INFO_TEST = "ListInfoTest";
     private static final String TARGET_NODE_NAME = "myNode";
-    
+
     // ------------------------------------------------------------------------
     // Test data
     // ------------------------------------------------------------------------
-    
+
     private TestRemoteSystemProxy fProxy;
-    private String fTestFile; 
-    
+    private String fTestFile;
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlTreeModelTest.class));
@@ -114,16 +114,18 @@ public class TraceControlTreeModelTest extends TestCase {
     public void tearDown()  throws Exception {
         TraceControlTestFacility.getInstance().waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
+     *
+     * @throws Exception
+     *             This will fail the test
      */
-    public void testTraceControlComponents()
-        throws Exception {
-        
+    public void testTraceControlComponents() throws Exception {
+
         fProxy.setTestFile(fTestFile);
         fProxy.setScenario(SCEN_LIST_INFO_TEST);
-        
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
@@ -159,10 +161,10 @@ public class TraceControlTreeModelTest extends TestCase {
         ITraceControlComponent[] groups = node.getChildren();
         assertNotNull(groups);
         assertEquals(2, groups.length);
-        
+
         assertTrue(groups[0] instanceof TraceProviderGroup);
         assertTrue(groups[1] instanceof TraceSessionGroup);
-        
+
         assertEquals("Provider", groups[0].getName());
         assertEquals("Sessions", groups[1].getName());
 
@@ -233,7 +235,7 @@ public class TraceControlTreeModelTest extends TestCase {
         ustProvider = (UstProviderComponent) providers[2];
         assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=4852]", ustProvider.getName());
         assertEquals(4852, ustProvider.getPid());
-        
+
         // verify getters and setter
         verifyUstProviderGettersSetters(ustProvider);
 
@@ -254,10 +256,10 @@ public class TraceControlTreeModelTest extends TestCase {
         assertEquals("ust_tests_hello:tptest", baseEventInfo.getName());
         assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
-        
+
         // verify getters and setters
         verifyBaseEventGettersSetters(baseEventInfo);
-        
+
         // ------------------------------------------------------------------------
         // Verify TraceSessionGroup
         // ------------------------------------------------------------------------
@@ -280,11 +282,11 @@ public class TraceControlTreeModelTest extends TestCase {
 
         // Verify setters and setters
         verifySessionGetterSetters(session);
-        
+
         ITraceControlComponent[] domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(2, domains.length);
-        
+
         // ------------------------------------------------------------------------
         // Verify Kernel domain
         // ------------------------------------------------------------------------
@@ -295,12 +297,12 @@ public class TraceControlTreeModelTest extends TestCase {
 
         // Verify setters and setters
         verifyDomainGettersSetters((TraceDomainComponent) domains[0]);
-        
+
         // ------------------------------------------------------------------------
         // Verify Kernel's channel0
         // ------------------------------------------------------------------------
         assertTrue(channels[0] instanceof TraceChannelComponent);
-        TraceChannelComponent channel = (TraceChannelComponent) channels[0]; 
+        TraceChannelComponent channel = (TraceChannelComponent) channels[0];
         assertEquals("channel0", channel.getName());
         assertEquals(4, channel.getNumberOfSubBuffers());
         assertEquals("splice()", channel.getOutputType());
@@ -321,13 +323,13 @@ public class TraceControlTreeModelTest extends TestCase {
         assertTrue(channel0Events[2] instanceof TraceProbeEventComponent);
         assertTrue(channel0Events[3] instanceof TraceProbeEventComponent);
         assertTrue(channel0Events[4] instanceof TraceEventComponent);
-        
+
         TraceEventComponent event = (TraceEventComponent) channel0Events[0];
         assertEquals("block_rq_remap", event.getName());
         assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         event = (TraceEventComponent) channel0Events[1];
         assertEquals("block_bio_remap", event.getName());
         assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
@@ -354,18 +356,18 @@ public class TraceControlTreeModelTest extends TestCase {
         assertNull(probeEvent.getAddress());
         assertEquals("0x0", probeEvent.getOffset());
         assertEquals("init_post", probeEvent.getSymbol());
-        
+
         event = (TraceEventComponent) channel0Events[4];
         assertEquals("syscalls", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
         assertEquals(TraceEventType.SYSCALL, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         // ------------------------------------------------------------------------
         // Verify Kernel's channel1
         // ------------------------------------------------------------------------
         assertEquals("channel1", channels[1].getName());
-        channel = (TraceChannelComponent) channels[1]; 
+        channel = (TraceChannelComponent) channels[1];
         assertEquals(4, channel.getNumberOfSubBuffers());
         assertEquals("splice()", channel.getOutputType());
         assertEquals(true, channel.isOverwriteMode());
@@ -384,9 +386,9 @@ public class TraceControlTreeModelTest extends TestCase {
         // Verify domain UST global
         // ------------------------------------------------------------------------
         assertEquals("UST global", domains[1].getName());
-        
+
         ITraceControlComponent[] ustChannels = domains[1].getChildren();
-        
+
         for (int i = 0; i < ustChannels.length; i++) {
             assertTrue(ustChannels[i] instanceof TraceChannelComponent);
         }
@@ -394,7 +396,7 @@ public class TraceControlTreeModelTest extends TestCase {
         // ------------------------------------------------------------------------
         // Verify UST global's mychannel1
         // ------------------------------------------------------------------------
-        channel = (TraceChannelComponent) ustChannels[0]; 
+        channel = (TraceChannelComponent) ustChannels[0];
         assertEquals("mychannel1", channel.getName());
         assertEquals(8, channel.getNumberOfSubBuffers());
         assertEquals("mmap()", channel.getOutputType());
@@ -403,8 +405,8 @@ public class TraceControlTreeModelTest extends TestCase {
         assertEquals(TraceEnablement.DISABLED, channel.getState());
         assertEquals(8192, channel.getSubBufferSize());
         assertEquals(200, channel.getSwitchTimer());
-        
-        // verify getters and setters 
+
+        // verify getters and setters
         verifyChannelGettersSetters(channel);
 
         // ------------------------------------------------------------------------
@@ -431,31 +433,31 @@ public class TraceControlTreeModelTest extends TestCase {
         // ------------------------------------------------------------------------
         ustEvents = channel.getChildren();
         assertEquals(2, ustEvents.length);
-        
+
         event = (TraceEventComponent) ustEvents[0];
         assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
         assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
         assertEquals(TraceEnablement.DISABLED, event.getState());
-        
+
         event = (TraceEventComponent) ustEvents[1];
         assertEquals("*", ustEvents[1].getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         // verify getters and setters
         verifyEventGettersSetters(event);
-        
+
         // disconnect
         node.disconnect();
         assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
         assertNotNull(node.getImage());
         assertNotSame(connectedImage, node.getImage());
-        
+
         node.getParent().removeChild(node);
     }
-    
+
     private void verifySessionGetterSetters(TraceSessionComponent session) {
         // save original values
         String name = session.getName();
@@ -465,7 +467,7 @@ public class TraceControlTreeModelTest extends TestCase {
         // test cases
         session.setName("newName");
         assertEquals("newName", session.getName());
-        
+
         session.setSessionPath("/home/user/tmp");
         assertEquals("/home/user/tmp", session.getSessionPath());
 
@@ -473,7 +475,7 @@ public class TraceControlTreeModelTest extends TestCase {
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
         Image inactiveImage = session.getImage();
         assertNotNull(inactiveImage);
-        
+
         session.setSessionState("active");
         assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
 
@@ -489,13 +491,13 @@ public class TraceControlTreeModelTest extends TestCase {
         for (int i = 0; i < domains.length; i++) {
             assertEquals(domains[i].getName(), children[i].getName());
         }
-        
-        // restore original values      
+
+        // restore original values
         session.setName(name);
         session.setSessionPath(origPath);
         session.setSessionState(origState);
     }
-    
+
     private void verifyDomainGettersSetters(TraceDomainComponent domain) {
         // save original values
         boolean isKernel = domain.isKernel();
@@ -526,11 +528,11 @@ public class TraceControlTreeModelTest extends TestCase {
         String name =  event.getName();
         TraceLogLevel level = event.getLogLevel();
         TraceEventType type = event.getEventType();
-        
+
         // test cases
         event.setName("newName");
         assertEquals("newName", event.getName());
-        
+
         event.setLogLevel(TraceLogLevel.TRACE_INFO);
         assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel());
         event.setLogLevel("TRACE_ALERT");
@@ -540,24 +542,24 @@ public class TraceControlTreeModelTest extends TestCase {
         assertEquals(TraceEventType.UNKNOWN, event.getEventType());
         event.setEventType("tracepoint");
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
-        
+
         // restore original values
         event.setName(name);
         event.setLogLevel(level);
         event.setEventType(type);
     }
-    
+
     private void verifyEventGettersSetters(TraceEventComponent event) {
         // save original values
         String name =  event.getName();
         TraceLogLevel level = event.getLogLevel();
         TraceEventType type = event.getEventType();
         TraceEnablement state = event.getState();
-        
+
         // test cases
         event.setName("newName");
         assertEquals("newName", event.getName());
-        
+
         event.setLogLevel(TraceLogLevel.TRACE_INFO);
         assertEquals(TraceLogLevel.TRACE_INFO, event.getLogLevel());
         event.setLogLevel("TRACE_ALERT");
@@ -567,10 +569,10 @@ public class TraceControlTreeModelTest extends TestCase {
         assertEquals(TraceEventType.UNKNOWN, event.getEventType());
         event.setEventType("tracepoint");
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
-        
+
         event.setState("disabled");
         assertEquals(TraceEnablement.DISABLED, event.getState());
-        
+
         Image disabledImage = event.getImage();
         assertNotNull(disabledImage);
 
@@ -587,29 +589,29 @@ public class TraceControlTreeModelTest extends TestCase {
         event.setEventType(type);
         event.setState(state);
     }
-    
+
     private void verifyProbeEventGettersSetters(TraceProbeEventComponent event) {
         // save original values
         String address = event.getAddress();
         String offset = event.getOffset();
         String symbol = event.getSymbol();
-        
+
         // test cases
         event.setAddress("0xffff1234");
         assertEquals("0xffff1234", event.getAddress());
-        
+
         event.setOffset("0x1234");
         assertEquals("0x1234", event.getOffset());
-        
+
         event.setSymbol("init");
         assertEquals("init", event.getSymbol());
-        
+
         // restore original values
         event.setAddress(address);
         event.setOffset(offset);
         event.setSymbol(symbol);
     }
-    
+
     private void verifyChannelGettersSetters(TraceChannelComponent channel) {
         // save original values
         String name = channel.getName();
@@ -620,26 +622,26 @@ public class TraceControlTreeModelTest extends TestCase {
         TraceEnablement state =  channel.getState();
         long subBufferSize = channel.getSubBufferSize();
         long switchTimer = channel.getSwitchTimer();
-        
+
         // test cases
         channel.setName("newName");
         assertEquals("newName", channel.getName());
-        
+
         channel.setNumberOfSubBuffers(2);
         assertEquals(2, channel.getNumberOfSubBuffers());
-        
+
         channel.setOutputType("splice()");
         assertEquals("splice()", channel.getOutputType());
-        
+
         channel.setOverwriteMode(false);
         assertEquals(false, channel.isOverwriteMode());
-        
+
         channel.setReadTimer(250);
         assertEquals(250, channel.getReadTimer());
-        
+
         channel.setState("enabled");
         assertEquals(TraceEnablement.ENABLED, channel.getState());
-        
+
         Image enabledImage = channel.getImage();
         assertNotNull(enabledImage);
         channel.setState(TraceEnablement.DISABLED);
@@ -648,10 +650,10 @@ public class TraceControlTreeModelTest extends TestCase {
         Image disabledImage = channel.getImage();
         assertNotNull(disabledImage);
         assertNotSame(enabledImage, disabledImage);
-        
+
         channel.setSubBufferSize(1024);
         assertEquals(1024, channel.getSubBufferSize());
-        
+
         channel.setSwitchTimer(1000);
         assertEquals(1000, channel.getSwitchTimer());
 
@@ -665,19 +667,19 @@ public class TraceControlTreeModelTest extends TestCase {
         channel.setSubBufferSize(subBufferSize);
         channel.setSwitchTimer(switchTimer);
     }
-    
+
     private void verifyUstProviderGettersSetters(UstProviderComponent ustProvider) {
         // save original values
         String name = ustProvider.getName();
         int pid = ustProvider.getPid();
-        
+
         // test cases
         ustProvider.setName("newName");
         assertEquals("newName", ustProvider.getName());
 
         ustProvider.setPid(9876);
         assertEquals(9876, ustProvider.getPid());
-        
+
         // restore original values
         ustProvider.setName(name);
         ustProvider.setPid(pid);
index 7a29c63e14cf131ead673ac75046c2418c643a97..e519a57d3538e5e841261f26aeb6fceaee19dda9 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.lttng2.ui.tests.control.model.component;
@@ -65,15 +65,15 @@ public class TraceControlUstProviderTests extends TestCase {
     // ------------------------------------------------------------------------
     private TraceControlTestFacility fFacility;
     private TestRemoteSystemProxy fProxy;
-    private String fTestFile; 
-    
+    private String fTestFile;
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlUstProviderTests.class));
@@ -112,15 +112,18 @@ public class TraceControlUstProviderTests extends TestCase {
     public void tearDown() throws Exception {
         fFacility.waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
+     *
+     * @throws Exception
+     *             This will fail the test
      */
     public void testUstProviderTree() throws Exception {
-        
+
         fProxy.setTestFile(fTestFile);
         fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-        
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
@@ -129,9 +132,9 @@ public class TraceControlUstProviderTests extends TestCase {
 
         TargetNodeComponent node = new TargetNodeComponent("myNode", root, host, fProxy);
         root.addChild(node);
-        
+
         fFacility.waitForJobs();
-        
+
         fFacility.executeCommand(node, "connect");
 
         int i = 0;
@@ -139,7 +142,7 @@ public class TraceControlUstProviderTests extends TestCase {
             i++;
             fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
         }
-        
+
         // Verify that node is connected
         assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
 
@@ -152,7 +155,7 @@ public class TraceControlUstProviderTests extends TestCase {
         ITraceControlComponent[] providers = groups[0].getChildren();
         KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
 
-        // Get kernel provider events and select 2 events 
+        // Get kernel provider events and select 2 events
         ITraceControlComponent[] events = kernelProvider.getChildren();
         assertNotNull(events);
         assertEquals(3, events.length);
@@ -176,13 +179,13 @@ public class TraceControlUstProviderTests extends TestCase {
         TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
 
         TraceSessionComponent session = fFacility.createSession(groups[1]);
-        
+
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
         assertEquals("/home/user/temp", session.getSessionPath());
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        
+
         // ------------------------------------------------------------------------
         // Enable Channel on UST global domain
         // ------------------------------------------------------------------------
@@ -196,21 +199,21 @@ public class TraceControlUstProviderTests extends TestCase {
         TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelDialogStub);
 
         fFacility.executeCommand(session, "enableChannelOnSession");
-        
+
         // Verify that UST domain was created
         ITraceControlComponent[] domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(1, domains.length);
 
         assertEquals("UST global", domains[0].getName());
-        
+
         // Verify that channel was created with correct data
         ITraceControlComponent[]channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(1, channels.length);
 
         assertTrue(channels[0] instanceof TraceChannelComponent);
-        TraceChannelComponent channel = (TraceChannelComponent) channels[0]; 
+        TraceChannelComponent channel = (TraceChannelComponent) channels[0];
         assertEquals("mychannel", channel.getName());
         assertEquals(2, channel.getNumberOfSubBuffers());
         assertEquals("mmap()", channel.getOutputType());
@@ -239,7 +242,7 @@ public class TraceControlUstProviderTests extends TestCase {
         ITraceControlComponent[] ustSelection =  { baseEventInfo0, baseEventInfo1 };
 
         fFacility.executeCommand(ustSelection, "assign.event");
-        
+
         // verify that events were created under the channel
         // Note that domain and channel has to be re-read because the tree is re-created
 
@@ -264,29 +267,29 @@ public class TraceControlUstProviderTests extends TestCase {
         assertEquals(TraceEnablement.ENABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // Disable event components 
+        // Disable event components
         // ------------------------------------------------------------------------
         fFacility.executeCommand(event, "disableEvent");
-        
+
         assertEquals(TraceEnablement.DISABLED, event.getState());
 
         // ------------------------------------------------------------------------
-        // Enable event component 
+        // Enable event component
         // ------------------------------------------------------------------------
         fFacility.executeCommand(event, "enableEvent");
 
         // Verify event state
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         // ------------------------------------------------------------------------
-        // Destroy session 
+        // Destroy session
         // ------------------------------------------------------------------------
 
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
 
         fFacility.destroySession(session);
-        
+
         // Verify that no more session components exist
         assertEquals(0, groups[1].getChildren().length);
 
index 052ef2cb7a2fcd650099f59005105ebaff81f0b6..9856aa8ac0e6b6d5d1eb93b561bfe4e494424a86 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.lttng2.ui.tests.control.model.component;
@@ -67,15 +67,15 @@ public class TraceControlUstSessionTests extends TestCase {
     // ------------------------------------------------------------------------
     private TraceControlTestFacility fFacility;
     private TestRemoteSystemProxy fProxy;
-    private String fTestFile; 
-    
+    private String fTestFile;
+
     // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
 
     /**
      * Returns test setup used when executing test case stand-alone.
-     * @return Test setup class 
+     * @return Test setup class
      */
     public static Test suite() {
         return new ModelImplTestSetup(new TestSuite(TraceControlUstSessionTests.class));
@@ -114,15 +114,18 @@ public class TraceControlUstSessionTests extends TestCase {
     public void tearDown()  throws Exception {
         fFacility.waitForJobs();
     }
-    
+
     /**
      * Run the TraceControlComponent.
+     *
+     * @throws Exception
+     *             This will fail the test
      */
     public void testTraceSessionTree() throws Exception {
-        
+
         fProxy.setTestFile(fTestFile);
         fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-        
+
         ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();
 
         ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
@@ -153,12 +156,12 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
         // ------------------------------------------------------------------------
         // Create session
         // ------------------------------------------------------------------------
         TraceSessionComponent session = fFacility.createSession(groups[1]);
-        
+
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
@@ -167,7 +170,7 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Initialize scenario
         fProxy.setScenario(SCEN_SCENARIO4_TEST);
-        
+
         // ------------------------------------------------------------------------
         // Enable default channel on created session above
         // ------------------------------------------------------------------------
@@ -176,21 +179,21 @@ public class TraceControlUstSessionTests extends TestCase {
         TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
 
         fFacility.executeCommand(session, "enableChannelOnSession");
-        
+
         // Verify that Kernel domain was created
         ITraceControlComponent[] domains = session.getChildren();
         assertNotNull(domains);
         assertEquals(1, domains.length);
 
         assertEquals("UST global", domains[0].getName());
-        
+
         // Verify that channel was created with correct data
         ITraceControlComponent[] channels =  domains[0].getChildren();
         assertNotNull(channels);
         assertEquals(1, channels.length);
 
         assertTrue(channels[0] instanceof TraceChannelComponent);
-        TraceChannelComponent channel = (TraceChannelComponent) channels[0]; 
+        TraceChannelComponent channel = (TraceChannelComponent) channels[0];
         assertEquals("mychannel", channel.getName());
         assertEquals(4, channel.getNumberOfSubBuffers());
         assertEquals("mmap()", channel.getOutputType());
@@ -211,7 +214,7 @@ public class TraceControlUstSessionTests extends TestCase {
         info.setSwitchTimer(100);
         info.setReadTimer(200);
         channelStub.setChannelInfo(info);
-        
+
         fFacility.executeCommand(domains[0], "enableChannelOnDomain");
 
         // Get Kernel domain component instance
@@ -225,7 +228,7 @@ public class TraceControlUstSessionTests extends TestCase {
         assertEquals(2, channels.length);
 
         assertTrue(channels[1] instanceof TraceChannelComponent);
-        channel = (TraceChannelComponent) channels[1]; 
+        channel = (TraceChannelComponent) channels[1];
         assertEquals("mychannel2", channel.getName());
         assertEquals(2, channel.getNumberOfSubBuffers());
         assertEquals("mmap()", channel.getOutputType());
@@ -245,9 +248,9 @@ public class TraceControlUstSessionTests extends TestCase {
         eventsDialogStub.setNames(events);
         eventsDialogStub.setIsKernel(false);
         TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
-        
+
         fFacility.executeCommand(session, "enableEventOnSession");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -259,13 +262,13 @@ public class TraceControlUstSessionTests extends TestCase {
         assertEquals(3, channels.length);
 
         assertTrue(channels[2] instanceof TraceChannelComponent);
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         assertEquals("channel0", channel.getName());
         // No need to check parameters of default channel because that has been done in other tests
 
         ITraceControlComponent[] channel0Events = channel.getChildren();
         assertEquals(1, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
 
         TraceEventComponent event = (TraceEventComponent) channel0Events[0];
@@ -280,9 +283,9 @@ public class TraceControlUstSessionTests extends TestCase {
         events.clear();
         events.add("ust_tests_hello:tptest");
         eventsDialogStub.setNames(events);
-        
+
         fFacility.executeCommand(domains[0], "enableEventOnDomain");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -290,12 +293,12 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(2, channel0Events.length);
-        
+
         assertTrue(channel0Events[1] instanceof TraceEventComponent);
 
         event = (TraceEventComponent) channel0Events[1];
@@ -320,14 +323,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[1]; 
+        channel = (TraceChannelComponent) channels[1];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel = (TraceChannelComponent) channels[1];
-        
+
         channel0Events = channel.getChildren();
         assertEquals(1, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
 
         event = (TraceEventComponent) channel0Events[0];
@@ -340,7 +343,7 @@ public class TraceControlUstSessionTests extends TestCase {
         // Enable event (wildcard) on specific channel
         // ------------------------------------------------------------------------
         events.clear();
-        eventsDialogStub.setIsTracePoints(false);        
+        eventsDialogStub.setIsTracePoints(false);
         eventsDialogStub.setIsAllTracePoints(false);
         eventsDialogStub.setIsWildcard(true);
         eventsDialogStub.setWildcard("ust*");
@@ -354,14 +357,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(1, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("ust*", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
@@ -372,7 +375,7 @@ public class TraceControlUstSessionTests extends TestCase {
         // Enable event (wildcard) on domain
         // ------------------------------------------------------------------------
         events.clear();
-        eventsDialogStub.setIsTracePoints(false);        
+        eventsDialogStub.setIsTracePoints(false);
         eventsDialogStub.setIsAllTracePoints(false);
         eventsDialogStub.setIsWildcard(true);
         eventsDialogStub.setWildcard("ust*");
@@ -386,14 +389,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(1, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("ust*", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
@@ -404,7 +407,7 @@ public class TraceControlUstSessionTests extends TestCase {
         // Enable event (wildcard) on session
         // ------------------------------------------------------------------------
         events.clear();
-        eventsDialogStub.setIsTracePoints(false);        
+        eventsDialogStub.setIsTracePoints(false);
         eventsDialogStub.setIsAllTracePoints(false);
         eventsDialogStub.setIsWildcard(true);
         eventsDialogStub.setWildcard("ust*");
@@ -418,14 +421,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(4, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("u*", event.getName());
         assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
@@ -441,7 +444,7 @@ public class TraceControlUstSessionTests extends TestCase {
         eventsDialogStub.setLogLevelEventName("myevent1");
         eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL);
         eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_WARNING);
-        
+
         fFacility.executeCommand(domains[0], "enableEventOnDomain");
 
         // Get Kernel domain component instance
@@ -451,14 +454,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(5, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("myevent1", event.getName());
         assertEquals(TraceLogLevel.TRACE_WARNING, event.getLogLevel());
@@ -471,9 +474,9 @@ public class TraceControlUstSessionTests extends TestCase {
         eventsDialogStub.setLogLevelEventName("myevent2");
         eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
         eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
-        
+
         fFacility.executeCommand(session, "enableEventOnSession");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -481,14 +484,14 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[2]; 
+        channel = (TraceChannelComponent) channels[2];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(6, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("myevent2", event.getName());
         assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
@@ -501,9 +504,9 @@ public class TraceControlUstSessionTests extends TestCase {
         eventsDialogStub.setLogLevelEventName("myevent0");
         eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
         eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
-        
+
         fFacility.executeCommand(channels[0], "enableEventOnChannel");
-        
+
         // Get Kernel domain component instance
         domains = session.getChildren();
         assertNotNull(domains);
@@ -511,28 +514,28 @@ public class TraceControlUstSessionTests extends TestCase {
 
         // Verify that channel was created with correct data
         channels =  domains[0].getChildren();
-        channel = (TraceChannelComponent) channels[0]; 
+        channel = (TraceChannelComponent) channels[0];
         // No need to check parameters of default channel because that has been done in other tests
 
         channel0Events = channel.getChildren();
         assertEquals(2, channel0Events.length);
-        
+
         assertTrue(channel0Events[0] instanceof TraceEventComponent);
-        
+
         event = (TraceEventComponent) channel0Events[0];
         assertEquals("myevent0", event.getName());
         assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
         assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
         assertEquals(TraceEnablement.ENABLED, event.getState());
-        
+
         // ------------------------------------------------------------------------
-        // Destroy session 
+        // Destroy session
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
         fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
 
         fFacility.destroySession(session);
-        
+
         // Verify that no more session components exist
         assertEquals(0, groups[1].getChildren().length);
 
@@ -545,7 +548,7 @@ public class TraceControlUstSessionTests extends TestCase {
         //-------------------------------------------------------------------------
         // Delete node
         //-------------------------------------------------------------------------
-        
+
         fFacility.executeCommand(node, "delete");
 
         assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
index c259c15e0816e9d1a27c9fa30d01e3f6947c0a50..7ad5ed2c168ae1dd105442f6b7f774b69d1c7ead 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011 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
  *******************************************************************************/
@@ -14,6 +14,7 @@ package org.eclipse.linuxtools.lttng2.ui.tests.control.service;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+@SuppressWarnings("javadoc")
 public class AllTests {
 
     public static Test suite() {
index 6c4cb9819c2ae7bb7f67b09ab84c5bc1750c1cf7..2466fd143e9a6187c7630ffd14109f6252a21306 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.lttng2.ui.tests.control.service;
@@ -45,12 +45,12 @@ import org.osgi.framework.FrameworkUtil;
 /**
  * The class <code>LTTngControlServiceTest</code> contains test for the class <code>{@link  LTTngControlService}</code>.
  */
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "javadoc"})
 public class LTTngControlServiceTest extends TestCase {
 
     private static final String DIRECTORY   = "testfiles";
     private static final String TEST_STREAM = "LTTngServiceTest.cfg";
-    
+
     private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled";
     private static final String SCEN_LTTNG_VERSION = "LttngVersion";
     private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion";
@@ -80,7 +80,7 @@ public class LTTngControlServiceTest extends TestCase {
     private LTTngToolsFileShell fShell;
     private ILttngControlService fService;
 
-    
+
    // ------------------------------------------------------------------------
     // Static methods
     // ------------------------------------------------------------------------
@@ -102,7 +102,7 @@ public class LTTngControlServiceTest extends TestCase {
         URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
         File testfile = new File(FileLocator.toFileURL(location).toURI());
         fTestfile = testfile.getAbsolutePath();
-        
+
         fShell = fShellFactory.getFileShell();
         fShell.loadScenarioFile(fTestfile);
         fService = new LTTngControlService(fShell);
@@ -121,22 +121,22 @@ public class LTTngControlServiceTest extends TestCase {
     // ------------------------------------------------------------------------
     // Test Cases
     // ------------------------------------------------------------------------
-    
+
     public void testVersion() {
         try {
             fShell.setScenario(SCEN_LTTNG_VERSION);
-            ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); 
+            ILttngControlService service = LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
             assertNotNull(service);
             assertEquals("2.0.0", service.getVersion());
         } catch (ExecutionException e) {
             fail("Exeption thrown " + e);
         }
     }
-    
+
     public void testUnsupportedVersion() {
         try {
             fShell.setScenario(SCEN_LTTNG_UNSUPPORTED_VERSION);
-            LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); 
+            LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
             fail("No exeption thrown");
         } catch (ExecutionException e) {
             // success
@@ -146,7 +146,7 @@ public class LTTngControlServiceTest extends TestCase {
     public void testNoVersion() {
         try {
             fShell.setScenario(SCEN_LTTNG_NO_VERSION);
-            LTTngControlServiceFactory.getInstance().getLttngControlService(fShell); 
+            LTTngControlServiceFactory.getInstance().getLttngControlService(fShell);
             fail("No exeption thrown");
         } catch (ExecutionException e) {
             // success
@@ -162,7 +162,7 @@ public class LTTngControlServiceTest extends TestCase {
          // success
         }
     }
-    
+
     public void testGetSessionNames1() {
         try {
             fShell.setScenario(SCEN_NO_SESSION_AVAILABLE);
@@ -170,7 +170,7 @@ public class LTTngControlServiceTest extends TestCase {
 
             assertNotNull(result);
             assertEquals(0, result.length);
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
@@ -185,7 +185,7 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(2, result.length);
             assertEquals("mysession1", result[0]);
             assertEquals("mysession", result[1]);
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
@@ -196,12 +196,12 @@ public class LTTngControlServiceTest extends TestCase {
             fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST);
             fService.getSessionNames(new NullProgressMonitor());
             fail("No exeption thrown");
-            
+
         } catch (ExecutionException e) {
             // success
         }
     }
-    
+
     public void testGetSessionNameGarbage() {
         try {
             fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT);
@@ -209,12 +209,12 @@ public class LTTngControlServiceTest extends TestCase {
 
             assertNotNull(result);
             assertEquals(0, result.length);
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
     }
-    
+
     public void testGetSession1() {
         try {
             fShell.setScenario(SCEN_GET_SESSION1);
@@ -225,18 +225,18 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals("mysession", session.getName());
             assertEquals("/home/user/lttng-traces/mysession-20120129-084256", session.getSessionPath());
             assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
-            
+
             IDomainInfo[] domains = session.getDomains();
             assertNotNull(domains);
             assertEquals(2, domains.length);
-            
+
             // Verify Kernel domain
             assertEquals("Kernel", domains[0].getName());
             IChannelInfo[] channels =  domains[0].getChannels();
             assertNotNull(channels);
             assertEquals(2, channels.length);
 
-            // Verify Kernel's channel0 
+            // Verify Kernel's channel0
             assertEquals("channel0", channels[0].getName());
             assertEquals(4, channels[0].getNumberOfSubBuffers());
             assertEquals("splice()", channels[0].getOutputType());
@@ -245,7 +245,7 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(TraceEnablement.ENABLED, channels[0].getState());
             assertEquals(262144, channels[0].getSubBufferSize());
             assertEquals(0, channels[0].getSwitchTimer());
-            
+
             // Verify event info
             IEventInfo[] channel0Events = channels[0].getEvents();
             assertNotNull(channel0Events);
@@ -254,13 +254,13 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[0].getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, channel0Events[0].getEventType());
             assertEquals(TraceEnablement.ENABLED, channel0Events[0].getState());
-            
+
             assertEquals("block_bio_remap", channel0Events[1].getName());
             assertEquals(TraceLogLevel.TRACE_EMERG, channel0Events[1].getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, channel0Events[1].getEventType());
             assertEquals(TraceEnablement.DISABLED, channel0Events[1].getState());
-            
-            // Verify Kernel's channel1 
+
+            // Verify Kernel's channel1
             assertEquals("channel1", channels[1].getName());
             assertEquals(4, channels[1].getNumberOfSubBuffers());
             assertEquals("splice()", channels[1].getOutputType());
@@ -269,17 +269,17 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(TraceEnablement.DISABLED, channels[1].getState());
             assertEquals(524288, channels[1].getSubBufferSize());
             assertEquals(100, channels[1].getSwitchTimer());
-            
+
             // Verify event info
             IEventInfo[] channel1Events = channels[1].getEvents();
             assertEquals(0, channel1Events.length);
-            
+
             // Verify domain UST global
             assertEquals("UST global", domains[1].getName());
-            
+
             IChannelInfo[] ustChannels =  domains[1].getChannels();
-            
-            // Verify UST global's mychannel1 
+
+            // Verify UST global's mychannel1
             assertEquals("mychannel1", ustChannels[0].getName());
             assertEquals(8, ustChannels[0].getNumberOfSubBuffers());
             assertEquals("mmap()", ustChannels[0].getOutputType());
@@ -288,12 +288,12 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(TraceEnablement.DISABLED, ustChannels[0].getState());
             assertEquals(8192, ustChannels[0].getSubBufferSize());
             assertEquals(200, ustChannels[0].getSwitchTimer());
-            
+
             // Verify event info
             IEventInfo[] ustEvents = ustChannels[0].getEvents();
             assertEquals(0, ustEvents.length);
 
-            // Verify UST global's channel0 
+            // Verify UST global's channel0
             assertEquals("channel0", ustChannels[1].getName());
             assertEquals(4, ustChannels[1].getNumberOfSubBuffers());
             assertEquals("mmap()", ustChannels[1].getOutputType());
@@ -302,28 +302,28 @@ public class LTTngControlServiceTest extends TestCase {
             assertEquals(TraceEnablement.ENABLED, ustChannels[1].getState());
             assertEquals(4096, ustChannels[1].getSubBufferSize());
             assertEquals(0, ustChannels[1].getSwitchTimer());
-            
+
             // Verify event info
             ustEvents = ustChannels[1].getEvents();
             assertEquals(2, ustEvents.length);
-            
+
             assertEquals("ust_tests_hello:tptest_sighandler", ustEvents[0].getName());
             assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, ustEvents[0].getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, ustEvents[0].getEventType());
             assertEquals(TraceEnablement.DISABLED, ustEvents[0].getState());
-            
+
             assertEquals("*", ustEvents[1].getName());
             assertEquals(TraceLogLevel.LEVEL_UNKNOWN, ustEvents[1].getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, ustEvents[1].getEventType());
             assertEquals(TraceEnablement.ENABLED, ustEvents[1].getState());
-            
+
             // next session (no detailed information available)
             session = fService.getSession("mysession1", new NullProgressMonitor());
             assertNotNull(session);
             assertEquals("mysession1", session.getName());
             assertEquals("/home/user/lttng-traces/mysession1-20120203-133225", session.getSessionPath());
             assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-            
+
             domains = session.getDomains();
             assertNotNull(domains);
             assertEquals(0, domains.length);
@@ -340,19 +340,19 @@ public class LTTngControlServiceTest extends TestCase {
             // Verify event info
             assertNotNull(events);
             assertEquals(3, events.size());
-            
-            IBaseEventInfo baseEventInfo = (IBaseEventInfo) events.get(0);
+
+            IBaseEventInfo baseEventInfo = events.get(0);
             assertNotNull(baseEventInfo);
             assertEquals("sched_kthread_stop", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
-            
-            baseEventInfo = (IBaseEventInfo) events.get(1);
+
+            baseEventInfo = events.get(1);
             assertEquals("sched_kthread_stop_ret", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
-            
-            baseEventInfo = (IBaseEventInfo) events.get(2);
+
+            baseEventInfo = events.get(2);
             assertEquals("sched_wakeup_new", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_EMERG, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
@@ -370,23 +370,23 @@ public class LTTngControlServiceTest extends TestCase {
             // Check all providers
             assertNotNull(providers);
             assertEquals(2, providers.size());
-            
+
             //Verify first provider
             assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(0).getName());
             assertEquals(9379, providers.get(0).getPid());
-            
+
             // Verify event info
             IBaseEventInfo[] events = providers.get(0).getEvents();
             assertNotNull(events);
             assertEquals(2, events.length);
 
-            IBaseEventInfo baseEventInfo = (IBaseEventInfo) events[0];
+            IBaseEventInfo baseEventInfo = events[0];
             assertNotNull(baseEventInfo);
             assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
-            
-            baseEventInfo = (IBaseEventInfo) events[1];
+
+            baseEventInfo = events[1];
             assertEquals("ust_tests_hello:tptest", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_INFO, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
@@ -394,19 +394,19 @@ public class LTTngControlServiceTest extends TestCase {
             //Verify second provider
             assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello", providers.get(1).getName());
             assertEquals(4852, providers.get(1).getPid());
-            
+
             // Verify event info
             events = providers.get(1).getEvents();
             assertNotNull(events);
             assertEquals(2, events.length);
 
-            baseEventInfo = (IBaseEventInfo) events[0];
+            baseEventInfo = events[0];
             assertNotNull(baseEventInfo);
             assertEquals("ust_tests_hello:tptest_sighandler", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_WARNING, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
-            
-            baseEventInfo = (IBaseEventInfo) events[1];
+
+            baseEventInfo = events[1];
             assertEquals("ust_tests_hello:tptest", baseEventInfo.getName());
             assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, baseEventInfo.getLogLevel());
             assertEquals(TraceEventType.TRACEPOINT, baseEventInfo.getEventType());
@@ -423,7 +423,7 @@ public class LTTngControlServiceTest extends TestCase {
 
             assertNotNull(providers);
             assertEquals(0, providers.size());
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
@@ -454,20 +454,20 @@ public class LTTngControlServiceTest extends TestCase {
         } catch (ExecutionException e) {
             // success
         }
-        
+
         try {
             fService.createSession("wrongName", null, new NullProgressMonitor());
             fail("No exeption thrown");
         } catch (ExecutionException e) {
             // success
-        } 
+        }
 
         try {
             fService.createSession("withPath", "/home/user/hallo", new NullProgressMonitor());
             fail("No exeption thrown");
         } catch (ExecutionException e) {
             // success
-        } 
+        }
 
         try {
             ISessionInfo info = fService.createSession("session with spaces", null, new NullProgressMonitor());
@@ -476,10 +476,10 @@ public class LTTngControlServiceTest extends TestCase {
             assertNotNull(info.getSessionPath());
             assertTrue(info.getSessionPath().contains("session with spaces"));
             assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
-        } 
+        }
 
         try {
             ISessionInfo info = fService.createSession("pathWithSpaces", "/home/user/hallo user/here", new NullProgressMonitor());
@@ -488,10 +488,10 @@ public class LTTngControlServiceTest extends TestCase {
             assertNotNull(info.getSessionPath());
             assertTrue(info.getSessionPath().contains("/home/user/hallo user/here"));
             assertEquals(TraceSessionState.INACTIVE, info.getSessionState());
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
-        } 
+        }
     }
 
     public void testDestroySession() {
@@ -500,7 +500,7 @@ public class LTTngControlServiceTest extends TestCase {
             fService.destroySession("mysession2", new NullProgressMonitor());
         } catch (ExecutionException e) {
             fail(e.toString());
-        } 
+        }
     }
 
     public void testCreateChannel() {
@@ -512,9 +512,9 @@ public class LTTngControlServiceTest extends TestCase {
             String kernelChannel1 = "mychannel1";
             list.add(kernelChannel0);
             list.add(kernelChannel1);
-            
+
             fShell.setScenario(SCEN_CHANNEL_HANDLING);
-            
+
             // Create/enable/configure 2 kernel channels
             ChannelInfo chanInfo = new ChannelInfo("");
             chanInfo.setOverwriteMode(true);
@@ -523,11 +523,11 @@ public class LTTngControlServiceTest extends TestCase {
             chanInfo.setSwitchTimer(200);
             chanInfo.setNumberOfSubBuffers(2);
             fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor());
-            
+
             // Create/enable/configure 1 UST channel
             list.clear();
             list.add("ustChannel");
-            
+
             chanInfo = new ChannelInfo("");
             chanInfo.setOverwriteMode(true);
             chanInfo.setSubBufferSize(32768);
@@ -550,10 +550,10 @@ public class LTTngControlServiceTest extends TestCase {
             String kernelChannel1 = "mychannel1";
             list.add(kernelChannel0);
             list.add(kernelChannel1);
-            
+
             fShell.setScenario(SCEN_CHANNEL_HANDLING);
             fService.disableChannels(sessionName, list, true, new NullProgressMonitor());
-            
+
             list.clear();
             list.add("ustChannel");
             fService.disableChannels(sessionName, list, false, new NullProgressMonitor());
@@ -562,7 +562,7 @@ public class LTTngControlServiceTest extends TestCase {
             fail(e.toString());
         }
     }
-    
+
     public void testEnableChannel() {
         try {
 
@@ -572,32 +572,32 @@ public class LTTngControlServiceTest extends TestCase {
             String kernelChannel1 = "mychannel1";
             list.add(kernelChannel0);
             list.add(kernelChannel1);
-            
+
             fShell.setScenario(SCEN_CHANNEL_HANDLING);
             fService.enableChannels(sessionName, list, true, null, new NullProgressMonitor());
-            
+
             // Create/enable/configure 1 UST channel
             list.clear();
             list.add("ustChannel");
-            
+
             fService.enableChannels(sessionName, list, false, null, new NullProgressMonitor());
 
         } catch (ExecutionException e) {
             fail(e.toString());
         }
     }
-    
+
 //    public void tesEnableChannelNoTracer() {
 //        try {
 //            ILttngControlService service = new LTTngControlService(fShellFactory.getShellForChannelNoTracer());
 //            service.getSessionNames(new NullProgressMonitor());
 //            fail("No exeption thrown");
-//            
+//
 //        } catch (ExecutionException e) {
 //            // success
 //        }
-//    }    
-    
+//    }
+
     public void testEnableEvents() {
         try {
             // 1) session name, channel = null, 3 event names, kernel
@@ -611,7 +611,7 @@ public class LTTngControlServiceTest extends TestCase {
             list.add(eventName2);
             fShell.setScenario(SCEN_EVENT_HANDLING);
             fService.enableEvents(sessionName, null, list, true, new NullProgressMonitor());
-            
+
             // 2) session name, channel=mychannel, event name= null, kernel
             String channelName = "mychannel";
             fService.enableEvents(sessionName, channelName, null, true, new NullProgressMonitor());
@@ -621,30 +621,30 @@ public class LTTngControlServiceTest extends TestCase {
             list.clear();
             list.add(ustEventName);
             fService.enableEvents(sessionName, channelName, list, false, new NullProgressMonitor());
-            
+
             // 4) session name, channel = mychannel, no event name, ust
             list.clear();
             fService.enableEvents(sessionName, channelName, list, false, new NullProgressMonitor());
-            
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
     }
-    
+
     public void testEnableSyscalls() {
         try {
             // 1) session name, channel = null, 3 event names, kernel
             String sessionName = "mysession2";
             String channelName = "mychannel";
-            
+
             fShell.setScenario(SCEN_EVENT_HANDLING);
 
-            // 1) session name, channel = null 
+            // 1) session name, channel = null
             fService.enableSyscalls(sessionName, null, new NullProgressMonitor());
 
             // 2) session name, channel = mychannel
             fService.enableSyscalls(sessionName, channelName, new NullProgressMonitor());
-                        
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
@@ -659,15 +659,15 @@ public class LTTngControlServiceTest extends TestCase {
             String eventName1 = "myevent1";
             String functionProbe = "0xc0101340";
             String dynProbe = "init_post";
-            
+
             fShell.setScenario(SCEN_EVENT_HANDLING);
 
-            // 1) session name, channel = null, event name, function probe, probe 
+            // 1) session name, channel = null, event name, function probe, probe
             fService.enableProbe(sessionName, null, eventName0, true, functionProbe, new NullProgressMonitor());
 
             // 2) session name, channel = mychannel
             fService.enableProbe(sessionName, channelName, eventName1, false, dynProbe, new NullProgressMonitor());
-                        
+
         } catch (ExecutionException e) {
             fail(e.toString());
         }
@@ -680,9 +680,9 @@ public class LTTngControlServiceTest extends TestCase {
             String channelName = "mychannel";
             String eventName4 = "myevent4";
             String eventName5 = "myevent5";
-            
+
             fShell.setScenario(SCEN_EVENT_HANDLING);
-            
+
             // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
             fService.enableLogLevel(sessionName, null, eventName4, LogLevelType.LOGLEVEL_ONLY, TraceLogLevel.TRACE_DEBUG, new NullProgressMonitor());
 
@@ -693,7 +693,7 @@ public class LTTngControlServiceTest extends TestCase {
             fail(e.toString());
         }
     }
-    
+
     public void testAddContext() {
         try {
             // 1) session name, channel = null, 3 event names, kernel
@@ -710,7 +710,7 @@ public class LTTngControlServiceTest extends TestCase {
             assertNotNull(availContexts);
             assertEquals(12, availContexts.size());
 
-            // A very "hard-coded" way to verify but it works ...  
+            // A very "hard-coded" way to verify but it works ...
             Set<String> expectedContexts = new HashSet<String>();
             expectedContexts.add("pid");
             expectedContexts.add("procname");
@@ -724,9 +724,9 @@ public class LTTngControlServiceTest extends TestCase {
             expectedContexts.add("vppid");
             expectedContexts.add("perf:cpu-cycles");
             expectedContexts.add("perf:cycles");
-            
+
             assertTrue(expectedContexts.containsAll(availContexts));
-            
+
             // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
             fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
 
@@ -750,14 +750,14 @@ public class LTTngControlServiceTest extends TestCase {
             fail("No exeption generated");
         } catch (ExecutionException e) {
             // success
-        } 
+        }
         try {
             // 1) session name, channel = null, event name, loglevel-only, TRACE_DEBUG
             fService.addContexts(sessionName, channelName, eventName, false, contexts, new NullProgressMonitor());
             fail("No exeption generated");
         } catch (ExecutionException e) {
             // success
-        } 
+        }
     }
 
     public void testCalibrate() {
@@ -778,7 +778,7 @@ public class LTTngControlServiceTest extends TestCase {
             fail("No exeption generated");
         } catch (ExecutionException e) {
             // success
-        } 
+        }
     }
-    
+
 }
index 65bb0fa557e25ae03c8d76bd0e6897ac5b11fb3c..bc11566447c3ae96e28d633d33efa4cb45b54650 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.stubs.dialogs;
@@ -20,8 +20,9 @@ import java.util.Set;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IAddContextDialog;
 
 /**
- * Add Context dialog stub. 
+ * Add Context dialog stub.
  */
+@SuppressWarnings("javadoc")
 public class AddContextDialogStub implements IAddContextDialog {
 
     private Set<String> fAvailableContexts = null;
@@ -48,10 +49,10 @@ public class AddContextDialogStub implements IAddContextDialog {
     public void setContexts(List<String> contexts) throws IllegalArgumentException{
         fContexts = new ArrayList<String>();
         fContexts.addAll(contexts);
-        // If availableContexts are null we cannot verify 
+        // If availableContexts are null we cannot verify
         if (fAvailableContexts != null) {
             for (Iterator<String> iterator = fContexts.iterator(); iterator.hasNext();) {
-                String string = (String) iterator.next();
+                String string = iterator.next();
                 if (!fAvailableContexts.contains(string)) {
                     throw new IllegalArgumentException();
                 }
index 5a79cc5b812977168e456074e5385e0494a1e18b..88757c733b96365a49363b064cd51d462cb1cac8 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.stubs.dialogs;
@@ -15,14 +15,15 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.ICreateSe
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
 
 /**
- * Create session dialog stub implementation. 
+ * Create session dialog stub implementation.
  */
+@SuppressWarnings("javadoc")
 public class CreateSessionDialogStub implements ICreateSessionDialog {
-    
+
     public String fName = "mysession"; //$NON-NLS-1$
     public String fPath = null;
-    
-    
+
+
     @Override
     public String getSessionName() {
         return fName;
@@ -47,11 +48,11 @@ public class CreateSessionDialogStub implements ICreateSessionDialog {
     public int open() {
         return 0;
     }
-    
+
     public void setSessionPath(String path) {
         fPath = path;
     }
-    
+
     public void setSessionName(String name) {
         fName = name;
     }
index b0d2084ccadbcb29bf56cc914034d3499bfe9484..7092eac29402ea8d0916aaf30582042817d7e638 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.stubs.dialogs;
@@ -17,17 +17,18 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableCh
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
 
 /**
- * Create channel dialog stub implementation. 
+ * Create channel dialog stub implementation.
  */
+@SuppressWarnings("javadoc")
 public class EnableChannelDialogStub implements IEnableChannelDialog {
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     private TraceDomainComponent fDomain;
     private ChannelInfo fChannelInfo;
     private boolean fIsKernel;
-    
+
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
@@ -39,14 +40,14 @@ public class EnableChannelDialogStub implements IEnableChannelDialog {
         fChannelInfo.setSwitchTimer(100);
         fChannelInfo.setSubBufferSize(16384);
     }
-   
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
     public void setIsKernel(boolean isKernel) {
         fIsKernel = isKernel;
     }
-    
+
     @Override
     public IChannelInfo getChannelInfo() {
         return fChannelInfo;
@@ -69,7 +70,7 @@ public class EnableChannelDialogStub implements IEnableChannelDialog {
     public boolean isKernel() {
         return fIsKernel;
     }
-    
+
     public void setChannelInfo(ChannelInfo info) {
         fChannelInfo = info;
     }
index 6812451a9708d9a243fd5f6296e79e393ae28c1b..eadadfbc757d5911a0eb15fa7bbae70aefbe1b55 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.stubs.dialogs;
@@ -21,8 +21,9 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceD
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup;
 
 /**
- * Enable events dialog stub implementation. 
+ * Enable events dialog stub implementation.
  */
+@SuppressWarnings("javadoc")
 public class EnableEventsDialogStub implements IEnableEventsDialog {
 
     // ------------------------------------------------------------------------
@@ -112,7 +113,7 @@ public class EnableEventsDialogStub implements IEnableEventsDialog {
     public void setLogLevelType(LogLevelType logLevelType) {
         fLogLevelType = logLevelType;
     }
-    
+
     public void setNames(List<String> names) {
         fNames = names;
     }
index ec88c1168fe7ff58f1a07f491cf8a56ad55cd614..3fe895f7d58a035aae3c9bd4c751c1f3fdd6c9f1 100644 (file)
@@ -1,24 +1,25 @@
 /**********************************************************************
  * 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.stubs.service;
 
 import org.eclipse.linuxtools.internal.lttng2.stubs.shells.LTTngToolsFileShell;
 
+@SuppressWarnings("javadoc")
 public class CommandShellFactory {
 
     public static final int GET_SESSION_NAMES_COMMAND_SHELL = 0;
-    
+
     private static CommandShellFactory fInstance = null;
-    
+
     public static CommandShellFactory getInstance() {
         if (fInstance == null) {
             fInstance = new CommandShellFactory();
@@ -33,7 +34,7 @@ public class CommandShellFactory {
 //        ICommandShell shell = new LTTngToolsSimulatorShell(proxy);
 //        return shell;
 //    }
-    
+
     public LTTngToolsFileShell getFileShell() {
         return new LTTngToolsFileShell();
     }
index 691f68ba5bc9d17c22d0b6bb7c8b0f00c04456f7..381d1804ddca281c82035f8551d2aa9a7faf2c76 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.stubs.service;
@@ -23,9 +23,9 @@ import org.eclipse.rse.services.shells.IShellService;
 import org.eclipse.rse.services.terminals.ITerminalService;
 import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
 
-
+@SuppressWarnings("javadoc")
 public class TestRemoteSystemProxy implements IRemoteSystemProxy {
-    
+
     private LTTngToolsFileShell fShell = null;
     private String fTestFile = null;
     private String fScenario = null;
@@ -69,7 +69,7 @@ public class TestRemoteSystemProxy implements IRemoteSystemProxy {
 
     @Override
     public ICommandShell createCommandShell() throws ExecutionException {
-        if (fShell == null) { 
+        if (fShell == null) {
             fShell = CommandShellFactory.getInstance().getFileShell();
             if ((fTestFile != null) && (fScenario != null)) {
                 try {
@@ -90,11 +90,11 @@ public class TestRemoteSystemProxy implements IRemoteSystemProxy {
     @Override
     public void removeCommunicationListener(ICommunicationsListener listener) {
     }
-    
+
     public void setTestFile(String testFile) {
         fTestFile = testFile;
     }
-    
+
     public void setScenario(String scenario) {
         fScenario = scenario;
         if (fShell != null) {
index 06e9a4e30471b8e32aa93178e00f5f08d9545adb..c436905bc9b467888a0483d7071bb57fc3e81724 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.stubs.shells;
@@ -29,6 +29,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.CommandResult;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
 
+@SuppressWarnings("javadoc")
 public class LTTngToolsFileShell extends TestCommandShell {
 
     // ------------------------------------------------------------------------
@@ -44,7 +45,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
     private final static String OUTPUT_KEY = "<COMMAND_OUTPUT>"; //$NON-NLS-1$
     private final static String OUTPUT_END_KEY = "</COMMAND_OUTPUT>"; //$NON-NLS-1$
     private final static String COMMENT_KEY = "#.*"; //$NON-NLS-1$
-    
+
     private final static Pattern LTTNG_LIST_SESSION_PATTERN =  Pattern.compile("lttng\\s+list\\s+(.+)"); //$NON-NLS-1$
     private final static String LTTNG_LIST_PROVIDER_PATTERN = "lttng\\s+list\\s+(-u|-k)"; //$NON-NLS-1$
 
@@ -54,64 +55,64 @@ public class LTTngToolsFileShell extends TestCommandShell {
     private String fScenariofile;
     private String fScenario;
 
-    private Map<String, Map<String, ICommandResult>> fScenarioMap = new HashMap<String, Map<String, ICommandResult>>();
-    private Map<String, Integer> fSessionNameMap = new HashMap<String, Integer>();
+    private final Map<String, Map<String, ICommandResult>> fScenarioMap = new HashMap<String, Map<String, ICommandResult>>();
+    private final Map<String, Integer> fSessionNameMap = new HashMap<String, Integer>();
 
     /**
      * Parse a scenario file with the format:
      * <SCENARIO>
      * ScenarioName
-     * 
+     *
      * <COMMAND_INPUT>
      * Command
      * </COMAND_INPUT>
-     * 
+     *
      * <COMMAND_RESULT>
      * CommandResult
      * </COMMAND_RESULT>
-     * 
+     *
      * <COMMAND_OUTPUT>
      * CommandOutput
      * </COMMAND_OUTPUT>
-     * 
+     *
      * </SCENARIO>
-     * 
+     *
      * Where: ScenarioName - is the scenario name
      *        Command - the command line string
      *        CommandResult - the result integer of the command (0 for success, 1 for failure)
      *        ComandOutput - the command output string (multi-line possible)
-     *        
+     *
      * Note: 1) There can be many scenarios per file
      *       2) There can be many (Command-CommandResult-CommandOutput) triples per scenario
      *       3) Lines starting with # will be ignored (comments)
-     *                 
+     *
      * @param scenariofile - path to scenario file
      * @throws Exception
      */
     public synchronized void loadScenarioFile(String scenariofile) throws Exception {
         fScenariofile = scenariofile;
-        
+
         // clean up map
         Collection<Map<String, ICommandResult>> values = fScenarioMap.values();
         for (Iterator<Map<String, ICommandResult>> iterator = values.iterator(); iterator.hasNext();) {
-            Map<String, ICommandResult> map = (Map<String, ICommandResult>) iterator.next();
+            Map<String, ICommandResult> map = iterator.next();
             map.clear();
         }
         fScenarioMap.clear();
-        
+
         // load from file
-        
+
         // Open the file
         FileInputStream fstream = new FileInputStream(fScenariofile);
-        
+
         // Get the object of DataInputStream
         DataInputStream in = new DataInputStream(fstream);
         BufferedReader br = new BufferedReader(new InputStreamReader(in));
         String strLine;
-        
+
         // Read File Line by Line
-        
-        // Temporary map for generating instance numbers for lttng list <session> commands. 
+
+        // Temporary map for generating instance numbers for lttng list <session> commands.
         // The numbers are per scenario.
         Map<String, Integer> tmpSessionNameMap = new HashMap<String, Integer>();
         while ((strLine = br.readLine()) != null) {
@@ -139,7 +140,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
                 int result = 0;
                 tmpSessionNameMap.clear();
                 while ((strLine = br.readLine()) != null) {
-                    // Ignore comments 
+                    // Ignore comments
                     if(isComment(strLine)) {
                         continue;
                     }
@@ -147,7 +148,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
                     if (SCENARIO_END_KEY.equals(strLine)) {
                         // Scenario is finished
                         break;
-                    } 
+                    }
                     if (INPUT_KEY.equals(strLine)) {
                         strLine = br.readLine();
                         // Ignore comments
@@ -156,7 +157,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
                         }
                         // Read command
                         input = strLine;
-                        
+
                         // Handle instances of 'lttng list <session"-comamand
                         Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(strLine);
                         if (matcher.matches() && !input.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
@@ -198,8 +199,8 @@ public class LTTngToolsFileShell extends TestCommandShell {
                     } else if (inOutput) {
                         // subsequent lines of output
                         output.add(strLine);
-                    } 
-//                    else { 
+                    }
+//                    else {
 //                        if (RESULT_END_KEY.equals(strLine)) {
                         // nothing to do
 //                    }
@@ -243,7 +244,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
 
         if (commands.containsKey(command)) {
             return commands.get(command);
-        } 
+        }
 
         String[] output = new String[1];
         output[0] = String.valueOf("Command not found");
@@ -253,7 +254,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
         result.setResult(1);
         return result;
    }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
index 4f14a8a30ba7ed9d981f3999231cff83e97a4483..0aa5c1f6d4823c0c856459b5d1ddeec61584825f 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.stubs.shells;
@@ -17,15 +17,18 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.CommandRes
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
 
+/**
+ * Command shell stub
+ */
 public class TestCommandShell implements ICommandShell {
 
     protected boolean fIsConnected = false;
-    
+
     @Override
     public void connect() throws ExecutionException {
         fIsConnected = true;
     }
-    
+
     @Override
     public void disconnect() {
         fIsConnected = false;
@@ -39,7 +42,7 @@ public class TestCommandShell implements ICommandShell {
     @Override
     public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
         if (fIsConnected) {
-            
+
         }
         return new CommandResult(0, new String[0]);
     }
index 23883cb86ffc919ec4359f998bb80db3f389d568..972ce5a395643af5e4aed8605eb51e66fe3b0c86 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2009, 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:
  *   Francois Chouinard - Initial API and implementation
  *   Bernd Hufmann - Filled with content
@@ -35,9 +35,9 @@ import org.eclipse.ui.progress.UIJob;
 
 /**
  * <p>
- * View implementation for Trace Control. 
+ * View implementation for Trace Control.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ControlView extends ViewPart implements ITraceControlComponentChangedListener {
@@ -58,12 +58,12 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
      * The tree viewer.
      */
     private TreeViewer fTreeViewer = null;
-    
+
     /**
-     * The trace control root node. This provides access to the whole model. 
+     * The trace control root node. This provides access to the whole model.
      */
     private ITraceControlComponent fRoot = null;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -74,7 +74,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
 
     /**
      * Returns the trace control tree node (model)
-     * 
+     *
      * @return the trace control tree node (model).
      */
     public ITraceControlComponent getTraceControlRoot() {
@@ -87,7 +87,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
      */
     @Override
@@ -106,22 +106,22 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
 
         // Create context menu for the tree viewer
         createContextMenu();
-        
+
         getSite().setSelectionProvider(fTreeViewer);
-        
+
         RSECorePlugin.getTheSystemRegistry(); // to load RSE
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
      */
     @Override
     public void setFocus() {
         fTreeViewer.getControl().setFocus();
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponentChangedListener#componentAdded(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent, org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent)
@@ -159,7 +159,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
 
                 fTreeViewer.refresh(component);
 
-                // Change selection needed 
+                // Change selection needed
                 final ISelection sel = fTreeViewer.getSelection();
                 fTreeViewer.setSelection(null);
                 fTreeViewer.setSelection(sel);
@@ -173,7 +173,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
         myJob.setUser(false);
         myJob.schedule();
     }
-    
+
     /**
      * Sets the selected component in the tree
      * @param component - component to select
@@ -186,7 +186,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
 
     /**
      * Sets the selected components in the tree
-     * @param component - array of components to select
+     * @param components - array of components to select
      */
     public void setSelection(ITraceControlComponent[] components) {
         final StructuredSelection selection = new StructuredSelection(components);
@@ -200,7 +200,7 @@ public class ControlView extends ViewPart implements ITraceControlComponentChang
         myJob.setUser(false);
         myJob.schedule();
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
index a1503f83873962ca89532ff250ea768a55931a3d..fb5ddb204a509a55267e21bfac684de60944b17e 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.dialogs;
@@ -38,7 +38,7 @@ import org.eclipse.swt.widgets.Shell;
  * <p>
  * Dialog box for collecting information about contexts to be added to channels/events.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AddContextDialog extends Dialog implements IAddContextDialog  {
@@ -46,11 +46,11 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    
+
     /**
      * The icon file for this dialog box.
      */
-    public static final String ADD_CONTEXT_ICON_FILE = "icons/elcl16/add-context.gif"; //$NON-NLS-1$ 
+    public static final String ADD_CONTEXT_ICON_FILE = "icons/elcl16/add-context.gif"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -66,12 +66,12 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     /**
      * A Tree model for the checkbox tree viewer.
      */
-    private ContextModel fContextModel = new ContextModel();
+    private final ContextModel fContextModel = new ContextModel();
     /**
      * The contexts to add.
      */
-    private List<String> fSelectedContexts = new ArrayList<String>();
-    
+    private final List<String> fSelectedContexts = new ArrayList<String>();
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -83,11 +83,11 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
         super(shell);
         setShellStyle(SWT.RESIZE);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IAddContextDialog#setAvalibleContexts(java.util.List)
@@ -96,7 +96,7 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     public void setAvalibleContexts(List<String> contexts) {
         fContextModel.setAvalibleContexts(contexts);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IAddContextDialog#getContexts()
@@ -141,18 +141,18 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
         layout = new GridLayout(1, true);
         contextGroup.setLayout(layout);
         contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-        
+
         fContextsViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-        fContextsViewer.getTree().setToolTipText(Messages.TraceControl_AddContextAvailableContextsTooltip); 
+        fContextsViewer.getTree().setToolTipText(Messages.TraceControl_AddContextAvailableContextsTooltip);
 
         fContextsViewer.setContentProvider(new ContextsContentProvider());
         fContextsViewer.setLabelProvider(new ContextsLabelProvider());
         fContextsViewer.addCheckStateListener(new ContextCheckListener());
         fContextsViewer.setInput(fContextModel);
         fContextsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
-        
+
         getShell().setMinimumSize(new Point(500, 450));
-        
+
         return fDialogComposite;
     }
 
@@ -181,11 +181,11 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
                 fSelectedContexts.add(component.getName());
             }
         }
-        
+
         // validation successful -> call super.okPressed()
         super.okPressed();
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper classes and methods
     // ------------------------------------------------------------------------
@@ -238,7 +238,7 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     final public static class ContextsLabelProvider extends ColumnLabelProvider {
         @Override
         public String getText(Object element) {
-            
+
             if ((element != null) && (element instanceof IContextModelComponent)) {
                 return ((IContextModelComponent)element).getName();
             }
@@ -246,9 +246,9 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
             return "";//$NON-NLS-1$
         }
     }
-    
+
     /**
-     * Check state listener for the contexts tree. 
+     * Check state listener for the contexts tree.
      */
     final public class ContextCheckListener implements ICheckStateListener {
         @Override
@@ -256,8 +256,8 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
           if (event.getChecked()) {
               if (event.getElement() instanceof AllContexts) {
                   fContextsViewer.setSubtreeChecked(event.getElement(), true);
-              } 
-          } else { 
+              }
+          } else {
               if (event.getElement() instanceof AllContexts) {
                   fContextsViewer.setSubtreeChecked(event.getElement(), false);
               } else {
@@ -273,21 +273,30 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
      */
     public static class ContextModel implements IContextModelComponent {
 
-        private AllContexts fAllContexts;
-        
+        private final AllContexts fAllContexts;
+
+        /**
+         * Constructor
+         */
         public ContextModel() {
             fAllContexts = new AllContexts(this);
         }
 
+        /**
+         * Sets the available contexts
+         *
+         * @param contexts
+         *            The contexts to set
+         */
         public void setAvalibleContexts(List<String> contexts) {
             fAllContexts.setAvalibleContexts(contexts);
         }
-        
+
         @Override
         public String getName() {
             return "root"; //$NON-NLS-1$
         }
-        
+
         @Override
         public Object getParent() {
             return null;
@@ -307,25 +316,37 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     }
 
     /**
-     * Model element (to select/deselect) all contexts) for the context tree viewer 
+     * Model element (to select/deselect) all contexts) for the context tree viewer
      */
     public static class AllContexts implements IContextModelComponent {
         /**
          * The available list of contexts.
          */
         private List<Context> fAvailableContexts;
-        
-        private IContextModelComponent fParent;
 
+        private final IContextModelComponent fParent;
+
+        /**
+         * Constructor
+         *
+         * @param parent
+         *            The parent component
+         */
         public AllContexts(IContextModelComponent parent) {
             fParent = parent;
         }
-        
+
+        /**
+         * Sets the available contexts
+         *
+         * @param contexts
+         *            The contexts to set
+         */
         public void setAvalibleContexts(List<String> contexts) {
             fAvailableContexts = new ArrayList<Context>();
             if (contexts != null) {
                 for (Iterator<String> iterator = contexts.iterator(); iterator.hasNext();) {
-                    String name = (String) iterator.next();
+                    String name = iterator.next();
                     fAvailableContexts.add(new Context(this, name));
                 }
             }
@@ -335,17 +356,17 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
         public String getName() {
             return Messages.TraceControl_AddContextAllLabel;
         }
-        
+
         @Override
         public Object[] getChildren() {
             return fAvailableContexts.toArray();
         }
-        
+
         @Override
         public Object getParent() {
             return fParent;
         }
-        
+
         @Override
         public boolean hasChildren() {
             return true;
@@ -353,18 +374,26 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     }
 
     /**
-     * Model element (the context) for the context tree viewer 
+     * Model element (the context) for the context tree viewer
      */
     public static class Context implements IContextModelComponent {
 
-        private String fContextName;
-        private IContextModelComponent fParent; 
-        
+        private final String fContextName;
+        private final IContextModelComponent fParent;
+
+        /**
+         * Constructor
+         *
+         * @param parent
+         *            The parent component
+         * @param name
+         *            The name of this context
+         */
         public Context(IContextModelComponent parent, String name) {
             fParent = parent;
             fContextName = name;
         }
-        
+
         @Override
         public String getName() {
             return fContextName;
@@ -387,12 +416,28 @@ public class AddContextDialog extends Dialog implements IAddContextDialog  {
     }
 
     /**
-     * Interface for the tree model used for the context tree viewer. 
+     * Interface for the tree model used for the context tree viewer.
      */
     public interface IContextModelComponent {
+
+        /**
+         * @return The name of this component
+         */
         public String getName();
+
+        /**
+         * @return The parent component
+         */
         public Object getParent();
+
+        /**
+         * @return The array of children of this component
+         */
         public Object[] getChildren();
+
+        /**
+         * @return If this component has children or not
+         */
         public boolean hasChildren();
     }
 }
index cd48a2ff53638c4d215e9e98529b5f1dbcb0db68..fb44f5ee430c6f79e50481c02657b71edbb27358 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.dialogs;
@@ -37,7 +37,7 @@ import org.eclipse.swt.widgets.Shell;
  * <p>
  * Dialog box for collecting information events to be enabled.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
@@ -45,11 +45,11 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    
+
     /**
      * The icon file for this dialog box.
      */
-    public static final String ENABLE_EVENT_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$ 
+    public static final String ENABLE_EVENT_ICON_FILE = "icons/elcl16/enable_event.gif"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -63,7 +63,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
      */
     private EnableKernelEventComposite fKernelComposite;
     /**
-     * The composite with widgets for collecting information about UST events. 
+     * The composite with widgets for collecting information about UST events.
      */
     private EnableUstEventsComposite fUstComposite;
     /**
@@ -75,17 +75,17 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
      */
     private Button fUstButton;
     /**
-     * The referenced trace provider group containing the kernel provider and UST 
+     * The referenced trace provider group containing the kernel provider and UST
      * provider component which contains a list of available tracepoints.
      */
     private TraceProviderGroup fProviderGroup;
     /**
-     * The parent domain component where the channel node should be added. 
+     * The parent domain component where the channel node should be added.
      * Null in case the domain is not known (i.e. on session level).
      */
     private TraceDomainComponent fDomain;
     /**
-     * Output domain information. True in case of Kernel domain. False for UST.     
+     * Output domain information. True in case of Kernel domain. False for UST.
      */
     private boolean fIsKernel;
 
@@ -95,17 +95,16 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
     /**
      * Constructor
      * @param shell - a shell for the display of the dialog
-     * @param providerGroup - the trace provider group
      */
     public EnableEventsDialog(Shell shell) {
         super(shell);
         setShellStyle(SWT.RESIZE);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isTracpoints()
@@ -117,7 +116,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return fUstComposite.isTracepoints();
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isAllTracePoints()
      */
@@ -128,7 +127,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return fUstComposite.isAllTracePoints();
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isSysCalls()
@@ -140,7 +139,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isAllSysCalls()
      */
@@ -151,7 +150,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getEventNames()
      */
@@ -173,7 +172,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getProbeName()
      */
@@ -184,7 +183,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return null;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getProbeEventName()
      */
@@ -195,7 +194,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return null;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isDynamicFunctionProbe()
@@ -207,7 +206,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getFunctionEventName()
      */
@@ -218,7 +217,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return null;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getFunction()
@@ -230,7 +229,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return null;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableUstEvents#isWildcard()
@@ -253,7 +252,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
             return fUstComposite.getWildcard();
         }
         return null;
-        
+
     }
 
     /*
@@ -266,7 +265,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
             return fUstComposite.isLogLevel();
         }
         return false;
-        
+
     }
 
     /*
@@ -279,9 +278,9 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
             return fUstComposite.getLogLevelType();
         }
         return null;
-        
+
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableUstEvents#getLogLevel()
@@ -292,7 +291,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
             return fUstComposite.getLogLevel();
         }
         return null;
-        
+
     }
 
     /*
@@ -306,7 +305,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         }
         return null;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableEventsDialog#isKernel()
@@ -315,7 +314,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
     public boolean isKernel() {
         return fIsKernel;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableEventsDialog#setTraceProviderGroup(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProviderGroup)
@@ -359,7 +358,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
      */
     @Override
     protected Control createDialogArea(Composite parent) {
-        
+
         // Main dialog panel
         fDialogComposite = new Composite(parent, SWT.NONE);
         GridLayout layout = new GridLayout(1, true);
@@ -367,13 +366,13 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
 
         // ------------------------------------------------------------------------
-        // Domain Group 
+        // Domain Group
         // ------------------------------------------------------------------------
         Group domainGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
         domainGroup.setText(Messages.TraceControl_DomainDisplayName);
         layout = new GridLayout(2, true);
-        domainGroup.setLayout(layout); 
-        
+        domainGroup.setLayout(layout);
+
         fKernelButton = new Button(domainGroup, SWT.RADIO);
         fKernelButton.setText(Messages.TraceControl_KernelDomainDisplayName);
         fKernelButton.setSelection(fIsKernel);
@@ -396,7 +395,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         fUstButton.setLayoutData(data);
 
         // ------------------------------------------------------------------------
-        // Kernel or UST event data group 
+        // Kernel or UST event data group
         // ------------------------------------------------------------------------
         fUstComposite = null;
         fKernelComposite = null;
@@ -406,7 +405,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         } else {
             createUstComposite();
         }
-        
+
         fKernelButton.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
@@ -428,14 +427,14 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
                 }
             }
         });
-        
+
         fDialogComposite.layout();
-        
+
         getShell().setMinimumSize(new Point(500, 650));
-        
+
         return fDialogComposite;
     }
-    
+
 
     /*
      * (non-Javadoc)
@@ -459,16 +458,16 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
         if (fKernelComposite != null && !fKernelComposite.isValid()) {
             return;
         }
-        
+
      // Validate UST composite in case of UST domain
         if (fUstComposite != null && !fUstComposite.isValid()) {
             return;
         }
-        
+
         // validation successful -> call super.okPressed()
         super.okPressed();
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
@@ -500,7 +499,7 @@ public class EnableEventsDialog extends Dialog implements IEnableEventsDialog  {
      * Creates the UST composite (if not existing)
      */
     private void createUstComposite() {
-        if (fUstComposite == null) { 
+        if (fUstComposite == null) {
             fUstComposite = new EnableUstEventsComposite(fDialogComposite, SWT.NONE, fProviderGroup);
             GridLayout layout = new GridLayout(1, true);
             fUstComposite.setLayout(layout);
index ee808066264ffcbda7ae989cc000834fea62c8ec..8135db3f022749ad1a3acfd7e5f8da8a37ae84ee 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.dialogs;
@@ -41,7 +41,7 @@ import org.eclipse.swt.widgets.Text;
  * <p>
  * A composite for collecting information about kernel events to be enabled.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableKernelEventComposite extends Composite implements IEnableKernelEvents {
@@ -49,7 +49,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION };
+    private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION }
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -72,7 +72,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
      */
     private Button fProbeActivateButton;
     /**
-     * The text field for the event name for the dynamic probe. 
+     * The text field for the event name for the dynamic probe.
      */
     private Text fProbeEventNameText;
     /**
@@ -84,7 +84,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
      */
     private Button fFunctionActivateButton;
     /**
-     * The text field for the event name for the dynamic probe. 
+     * The text field for the event name for the dynamic probe.
      */
     private Text fFunctionEventNameText;
     /**
@@ -92,10 +92,10 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
      */
     private Text fFunctionText;
     /**
-     * The referenced trace provider group containing the kernel provider 
+     * The referenced trace provider group containing the kernel provider
      * component which contains a list of available tracepoints.
      */
-    private TraceProviderGroup fProviderGroup;
+    private final TraceProviderGroup fProviderGroup;
     /**
      * The flag indicating that tracepoints are selected.
      */
@@ -117,7 +117,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
      */
     private boolean fIsDynamicProbe;
     /**
-     *  The event name of the dynamic probe. 
+     *  The event name of the dynamic probe.
      */
     private String fProbeEventName;
     /**
@@ -141,6 +141,16 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     // Constructors
     // ------------------------------------------------------------------------
 
+    /**
+     * Constructor
+     *
+     * @param parent
+     *            The parent composite
+     * @param style
+     *            The index of the style for this event composite
+     * @param providerGroup
+     *            The trace provider group
+     */
     public EnableKernelEventComposite(Composite parent, int style, TraceProviderGroup providerGroup) {
         super(parent, style);
         fProviderGroup = providerGroup;
@@ -157,7 +167,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isTracepoints() {
         return fIsTracepoints;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isAllTracePoints()
      */
@@ -165,7 +175,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isAllTracePoints() {
         return fIsAllTracepoints;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isSysCalls()
@@ -174,7 +184,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isSysCalls() {
         return fIsSysCalls;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isAllSysCalls()
      */
@@ -182,7 +192,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isAllSysCalls() {
         return fIsSysCalls;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getEventNames()
      */
@@ -198,7 +208,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isDynamicProbe() {
         return fIsDynamicProbe;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getProbeName()
      */
@@ -206,7 +216,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public String getProbeName() {
         return fProbeString;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getProbeEventName()
      */
@@ -214,7 +224,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public String getProbeEventName() {
         return fProbeEventName;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#isDynamicFunctionProbe()
@@ -223,7 +233,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public boolean isDynamicFunctionProbe() {
         return fIsDynamicFunctionProbe;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getFunctionEventName()
      */
@@ -231,7 +241,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     public String getFunctionEventName() {
         return fFunctionEventName;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableKernelEvents#getFunction()
      */
@@ -247,23 +257,23 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
      * Creates the composite content
      */
     public void createContent() {
-        
-        // Tracepoints Group 
+
+        // Tracepoints Group
         createTracepointsGroup();
 
-        // Syscalls Group 
+        // Syscalls Group
         createSysCallsGroup();
-        
-        // Dynamic Probe Group 
+
+        // Dynamic Probe Group
         createDynamicProbeGroup();
 
-        // Dynamic Function Probe Group 
+        // Dynamic Function Probe Group
         createDynamicFunctionPropeGroup();
-        
+
         // Set default enablements
         setKernelEnablements(KernelGroupEnum.TRACEPOINTS);
     }
-    
+
     /**
      * Validates the kernel composite input data.
      * @return true if configured data is valid and can be retrieved.
@@ -305,7 +315,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
                 fProbeEventName = temp;
                 // fProbeString will be validated by lttng-tools
                 fProbeString = fProbeText.getText();
-            } 
+            }
         }
 
         // initialize function string
@@ -330,7 +340,7 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
 
         return true;
     }
-    
+
     /**
      * Creates tracepoints group.
      */
@@ -559,14 +569,14 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
     // Local classes
     // ------------------------------------------------------------------------
     /**
-     * Content provider for the tracepoints tree. 
+     * Content provider for the tracepoints tree.
      */
     final static public class KernelContentProvider extends TraceControlContentProvider {
         @Override
         public Object[] getChildren(Object parentElement) {
             if (parentElement instanceof TraceProviderGroup) {
                 List<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(KernelProviderComponent.class);
-                return (ITraceControlComponent[]) children.toArray(new ITraceControlComponent[children.size()]);
+                return children.toArray(new ITraceControlComponent[children.size()]);
             }
             if (parentElement instanceof ITraceControlComponent) {
                 return ((ITraceControlComponent)parentElement).getChildren();
@@ -574,9 +584,9 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
             return new Object[0];
         }
     }
-    
+
     /**
-     * Content label for the tracepoints tree. 
+     * Content label for the tracepoints tree.
      */
     final static public class KernelLabelProvider extends TraceControlLabelProvider {
         @Override
@@ -591,9 +601,9 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
             return super.getText(element);
         }
     }
-    
+
     /**
-     * Check state listener for the tracepoints tree. 
+     * Check state listener for the tracepoints tree.
      */
     final public class KernelCheckListener implements ICheckStateListener {
         @Override
@@ -601,8 +611,8 @@ public class EnableKernelEventComposite extends Composite implements IEnableKern
           if (event.getChecked()) {
               if (event.getElement() instanceof KernelProviderComponent) {
                   fTracepointsViewer.setSubtreeChecked(event.getElement(), true);
-              } 
-          } else { 
+              }
+          } else {
               if (event.getElement() instanceof KernelProviderComponent) {
                   fTracepointsViewer.setSubtreeChecked(event.getElement(), false);
               } else {
index c4cf581d9dc7a5d539a661dd4b01df2c1b96ed17..83347f1f6751ea97e9361dc470b2112da07a9b9e 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.dialogs;
@@ -47,7 +47,7 @@ import org.eclipse.swt.widgets.Text;
  * <p>
  * A composite for collecting information about UST events to be enabled.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableUstEventsComposite extends Composite implements IEnableUstEvents  {
@@ -55,13 +55,13 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    
-    private enum GroupEnum { TRACEPOINTS, WILDCARD, LOGLEVEL };
-    
+
+    private enum GroupEnum { TRACEPOINTS, WILDCARD, LOGLEVEL }
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     /**
      * A button to enable/disable the tracepoints group
      */
@@ -99,10 +99,10 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
      */
     private Button fLogLevelOnlyButton;
     /**
-     * The referenced trace provider group containing the UST providers 
+     * The referenced trace provider group containing the UST providers
      * component which contains a list of available tracepoints.
      */
-    private TraceProviderGroup fProviderGroup;
+    private final TraceProviderGroup fProviderGroup;
     /**
      * The flag indicating that tracepoints are selected.
      */
@@ -116,15 +116,15 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
      */
     private List<String> fSelectedEvents;
     /**
-     * The flag indicating that all wildcard are selected.. 
+     * The flag indicating that all wildcard are selected..
      */
     private boolean fIsWildcard;
     /**
-     * The wildcard if wildcard is selected. 
+     * The wildcard if wildcard is selected.
      */
     private String fWildcard;
     /**
-     *The flag indicating that all log level are selected. 
+     *The flag indicating that all log level are selected.
      */
     private boolean fIsLogLevel;
     /**
@@ -146,7 +146,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     /**
      * Constructor
      * @param parent - a parent composite
-     * @Param style - a compsite style
+     * @param style - a composite style
      * @param providerGroup - the trace provider group
      */
     public EnableUstEventsComposite(Composite parent, int style, TraceProviderGroup providerGroup) {
@@ -166,7 +166,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     public boolean isTracepoints() {
         return fIsTracepoints;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableUstEvents#isAllTracePoints()
@@ -175,7 +175,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     public boolean isAllTracePoints() {
         return fIsAllTracepoints;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableUstEvents#getEventNames()
@@ -238,22 +238,25 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     public String getLogLevelEventName() {
         return fLogLevelEventName;
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
 
+    /**
+     * Create the contents of this event composite
+     */
     public void createContent() {
-        
-        // Tracepoints Group 
+
+        // Tracepoints Group
         createTracepointsGroup();
 
-        // Wildcard Group 
+        // Wildcard Group
         createWildCardGroup();
 
-        // Log Level Group 
+        // Log Level Group
         createLogLevelGroup();
-        
+
         // Set default enablements
         setEnablements(GroupEnum.TRACEPOINTS);
     }
@@ -263,11 +266,11 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     * @return true if configured data is valid and can be retrieved.
     */
     public boolean isValid() {
-        
+
         fIsTracepoints = fTracepointsActivateButton.getSelection();
         fIsWildcard = fWildcardActivateButton.getSelection();
         fIsLogLevel = fLogLevelActivateButton.getSelection();
-        
+
         // initialize tracepoint fields
         fIsAllTracepoints = false;
         fSelectedEvents = new ArrayList<String>();
@@ -317,9 +320,8 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
                         Messages.TraceControl_InvalidLogLevel + " (" + temp + ") \n");  //$NON-NLS-1$ //$NON-NLS-2$
 
                 return false;
-            } else {
-                fLogLevel = levels[id];
             }
+            fLogLevel = levels[id];
         }
 
         // initialize wildcard with the event name string
@@ -342,11 +344,11 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         // validation successful -> call super.okPressed()
         return true;
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
-    
+
     /**
      * Creates tracepoints group.
      */
@@ -357,7 +359,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         tpMainGroup.setLayout(layout);
         GridData data = new GridData(GridData.FILL_BOTH);
         tpMainGroup.setLayoutData(data);
-        
+
         Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE);
         layout = new GridLayout(1, true);
         buttonComposite.setLayout(layout);
@@ -374,13 +376,13 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
                 setEnablements(GroupEnum.TRACEPOINTS);
             }
         });
-        
+
         Group tpGroup = new Group(tpMainGroup, SWT.SHADOW_NONE);
         layout = new GridLayout(1, true);
         tpGroup.setLayout(layout);
         data = new GridData(GridData.FILL_BOTH);
         tpGroup.setLayoutData(data);
-        
+
         fTracepointsViewer = new CheckboxTreeViewer(tpGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
         fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip);
         fTracepointsViewer.setContentProvider(new UstContentProvider());
@@ -391,7 +393,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         fTracepointsViewer.setInput(fProviderGroup.getParent());
         fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
     }
-    
+
     /**
      * Creates wildcard group.
      */
@@ -402,7 +404,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         wildcardMainGroup.setLayout(layout);
         GridData data = new GridData(GridData.FILL_HORIZONTAL);
         wildcardMainGroup.setLayoutData(data);
-        
+
         Composite buttonComposite = new Composite(wildcardMainGroup, SWT.NONE);
         layout = new GridLayout(1, false);
         buttonComposite.setLayout(layout);
@@ -420,26 +422,26 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
                 setEnablements(GroupEnum.WILDCARD);
             }
         });
-        
+
         Group wildcardGroup = new Group(wildcardMainGroup, SWT.SHADOW_NONE);
         layout = new GridLayout(3, true);
         wildcardGroup.setLayout(layout);
         data = new GridData(GridData.FILL_HORIZONTAL);
         wildcardGroup.setLayoutData(data);
-        
+
         Label wildcardLabel = new Label(wildcardGroup, SWT.LEFT);
         wildcardLabel.setText(Messages.TraceControl_EnableEventsWildcardLabel);
         data = new GridData(GridData.FILL_HORIZONTAL);
         data.horizontalSpan = 1;
         wildcardLabel.setLayoutData(data);
-        
+
         fWildcardText = new Text(wildcardGroup, SWT.LEFT);
         fWildcardText.setToolTipText(Messages.TraceControl_EnableEventsWildcardTooltip);
         data = new GridData(GridData.FILL_HORIZONTAL);
         data.horizontalSpan = 2;
         fWildcardText.setLayoutData(data);
     }
-    
+
     /**
      * Creates log level group.
      */
@@ -450,7 +452,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         logLevelMainGroup.setLayout(layout);
         GridData data = new GridData(GridData.FILL_HORIZONTAL);
         logLevelMainGroup.setLayoutData(data);
-        
+
         Composite buttonComposite = new Composite(logLevelMainGroup, SWT.NONE);
         layout = new GridLayout(1, false);
         buttonComposite.setLayout(layout);
@@ -488,7 +490,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         fLogLevelEventNameText.setLayoutData(data);
 
         TraceLogLevel[] levels = TraceLogLevel.values();
-        
+
         String[] levelNames = new String[levels.length - 1];
         int k = 0;
         for (int i = 0; i < levels.length; i++) {
@@ -516,17 +518,17 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
         data = new GridData(GridData.FILL_BOTH);
         fLogLevelButton.setLayoutData(data);
     }
-    
+
     /**
      * Enable/selects widgets depending on the group specified.
      * @param group - group to enable.
      */
     private void setEnablements(GroupEnum group) {
-        
+
         // Enable/disable trace point items
         fTracepointsActivateButton.setSelection(group == GroupEnum.TRACEPOINTS);
         fTracepointsViewer.getTree().setEnabled(group == GroupEnum.TRACEPOINTS);
-        
+
         // Enable/disable wildcard items
         fWildcardActivateButton.setSelection(group == GroupEnum.WILDCARD);
         fWildcardText.setEnabled(group == GroupEnum.WILDCARD);
@@ -543,18 +545,18 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     // Local classes
     // ------------------------------------------------------------------------
     /**
-     * Content provider for the tracepoints tree. 
+     * Content provider for the tracepoints tree.
      */
     final static public class UstContentProvider extends TraceControlContentProvider {
         @Override
         public Object[] getChildren(Object parentElement) {
             if (parentElement instanceof TargetNodeComponent) {
                 List<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(TraceProviderGroup.class);
-                return (ITraceControlComponent[]) children.toArray(new ITraceControlComponent[children.size()]);
+                return children.toArray(new ITraceControlComponent[children.size()]);
             }
             if (parentElement instanceof TraceProviderGroup) {
                 List<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(UstProviderComponent.class);
-                return (ITraceControlComponent[]) children.toArray(new ITraceControlComponent[children.size()]);
+                return children.toArray(new ITraceControlComponent[children.size()]);
             }
             if (parentElement instanceof ITraceControlComponent) {
                 return ((ITraceControlComponent)parentElement).getChildren();
@@ -562,9 +564,9 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
             return new Object[0];
         }
     }
-    
+
     /**
-     * Content label for the tracepoints tree. 
+     * Content label for the tracepoints tree.
      */
      final static public class UstLabelProvider extends TraceControlLabelProvider {
         @Override
@@ -585,7 +587,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
     }
 
     /**
-     * Check state listener for the tracepoints tree. 
+     * Check state listener for the tracepoints tree.
      */
     final public class UstCheckStateListener implements ICheckStateListener {
         @Override
@@ -596,7 +598,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
                 }
                 if (event.getElement() instanceof UstProviderComponent) {
                     fTracepointsViewer.setSubtreeChecked(event.getElement(), true);
-                } 
+                }
             } else {
                 if (event.getElement() instanceof TraceProviderGroup) {
                     fTracepointsViewer.setSubtreeChecked(event.getElement(), true);
index 3e448005649ea25dd5786e6973c76046453c4c74..c8e560e2f96d39593b5366b707c08f11cb0e6945 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.dialogs;
@@ -17,11 +17,22 @@ import org.eclipse.swt.widgets.Shell;
  * <p>
  * Interface for a confirmation dialog.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public interface IConfirmDialog {
-    
+
+    /**
+     * Open a confirmation dialog
+     *
+     * @param parent
+     *            The parent shell
+     * @param title
+     *            The title of the dialog window
+     * @param message
+     *            The message in the dialog window
+     * @return If the user clicked OK (true) or Cancel (false)
+     */
     public boolean openConfirm(Shell parent, String title, String message);
-    
+
 }
index 59c32aa08ebc1986a37ba7eca38a94072505dd0b..0a18907c3634308375c11b839e0ce64900b24223 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.dialogs;
@@ -20,11 +20,11 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceS
  * <p>
  * Interface for import traces dialog.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public interface IImportDialog {
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -37,13 +37,13 @@ public interface IImportDialog {
      * @return the project to import the traces to
      */
     public IProject getProject();
-    
+
     /**
      * Sets the session containing the traces to import
-     * @param session 
+     * @param session The trace session
      */
     public void setSession(TraceSessionComponent session);
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
index 476dfd25fab1952da1695e7899fb5e9946500424..fd9fac07bb2e09edc3ac9fcc9e7eb691a04a6914 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.dialogs;
@@ -54,7 +54,7 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
  * <p>
  * Dialog box for collecting trace import information.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ImportDialog extends Dialog implements IImportDialog {
@@ -62,11 +62,10 @@ public class ImportDialog extends Dialog implements IImportDialog {
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
-    /**
-     * The icon file for this dialog box.
-     */
+    /** The icon file for this dialog box. */
     public static final String IMPORT_ICON_FILE = "icons/elcl16/import_trace.gif"; //$NON-NLS-1$
-    
+
+    /** Parent directory for UST traces */
     public static final String UST_PARENT_DIRECTORY = "ust"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
@@ -85,7 +84,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
      */
     private CCombo fCombo;
     /**
-     * The overwrite button 
+     * The overwrite button
      */
     private Button fOverwriteButton;
     /**
@@ -97,18 +96,18 @@ public class ImportDialog extends Dialog implements IImportDialog {
      */
     private TraceSessionComponent fSession = null;
     /**
-     * List of traces to import  
+     * List of traces to import
      */
-    private List<ImportFileInfo> fTraces = new ArrayList<ImportFileInfo>();
+    private final List<ImportFileInfo> fTraces = new ArrayList<ImportFileInfo>();
     /**
-     * Selection index in project combo box. 
+     * Selection index in project combo box.
      */
     private int fProjectIndex;
     /**
      * Flag to indicate that something went wrong when creating the dialog box.
      */
     private boolean fIsError = false;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -143,7 +142,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
     public IProject getProject() {
         return fProjects.get(fProjectIndex);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IImportDialog#setSession(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionComponent)
@@ -173,7 +172,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
      */
     @Override
     protected Control createDialogArea(Composite parent) {
-        
+
         // Main dialog panel
         fDialogComposite = new Composite(parent, SWT.NONE);
         GridLayout layout = new GridLayout(1, true);
@@ -185,9 +184,9 @@ public class ImportDialog extends Dialog implements IImportDialog {
         layout = new GridLayout(1, true);
         contextGroup.setLayout(layout);
         contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-        
+
         IRemoteSystemProxy proxy = fSession.getTargetNode().getRemoteSystemProxy();
-        
+
         IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem();
 
         try {
@@ -199,10 +198,10 @@ public class ImportDialog extends Dialog implements IImportDialog {
             tree.setLayoutData(data);
             tree.setFont(parent.getFont());
             tree.setToolTipText(Messages.TraceControl_ImportDialogTracesTooltip);
-            
+
             fFolderViewer.setContentProvider(new FolderContentProvider());
             fFolderViewer.setLabelProvider(new WorkbenchLabelProvider());
-            
+
             fFolderViewer.addCheckStateListener(new ICheckStateListener() {
                 @Override
                 public void checkStateChanged(CheckStateChangedEvent event) {
@@ -216,7 +215,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
                             return;
                         }
                         fFolderViewer.setSubtreeChecked(event.getElement(), event.getChecked());
-                        if (!event.getChecked()) { 
+                        if (!event.getChecked()) {
                             fFolderViewer.setChecked(element.getParentRemoteFile(), false);
                         }
                     }
@@ -248,7 +247,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
             fCombo.setToolTipText(Messages.TraceControl_ImportDialogProjectsTooltip);
             fCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1));
             fCombo.setItems(projectNames.toArray(new String[projectNames.size()]));
-            
+
             Group overrideGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
             layout = new GridLayout(1, true);
             overrideGroup.setLayout(layout);
@@ -259,12 +258,12 @@ public class ImportDialog extends Dialog implements IImportDialog {
 
             getShell().setMinimumSize(new Point(500, 400));
 
-            
+
         } catch (SystemMessageException e) {
             createErrorComposite(parent, e.fillInStackTrace());
             return fDialogComposite;
         }
-        
+
         return fDialogComposite;
     }
 
@@ -313,15 +312,15 @@ public class ImportDialog extends Dialog implements IImportDialog {
             Object[] checked = fFolderViewer.getCheckedElements();
             for (int i = 0; i < checked.length; i++) {
                 IRemoteFile file = (IRemoteFile) checked[i];
-                
-                // Only add actual trace directories  
+
+                // Only add actual trace directories
                 if (file.isDirectory() && !UST_PARENT_DIRECTORY.equals(file.getName())) {
-                    
+
                     ImportFileInfo info = new ImportFileInfo(file, file.getName(), overwriteAll);
                     String traceName = info.getLocalTraceName();
                     IFolder folder = traceFolder.getFolder(traceName);
 
-                    // Verify if trace directory already exists (and not overwrite) 
+                    // Verify if trace directory already exists (and not overwrite)
                     if (folder.exists() && !overwriteAll) {
 
                         // Ask user for overwrite or new name
@@ -336,7 +335,7 @@ public class ImportDialog extends Dialog implements IImportDialog {
                             }
                             fTraces.add(info);
                         }
-                    } else { 
+                    } else {
                         fTraces.add(info);
                     }
                 }
@@ -357,6 +356,11 @@ public class ImportDialog extends Dialog implements IImportDialog {
     // ------------------------------------------------------------------------
     // Helper methods and classes
     // ------------------------------------------------------------------------
+    /**
+     * Helper class for the contents of a folder in a tracing project
+     *
+     * @author Bernd Hufmann
+     */
     public static class FolderContentProvider extends WorkbenchContentProvider {
         @Override
         public Object[] getChildren(Object o) {
@@ -370,22 +374,22 @@ public class ImportDialog extends Dialog implements IImportDialog {
             return super.getChildren(o);
         }
     }
-    
+
     /**
      * Creates a dialog composite with an error message which can be used
      * when an exception occurred during creation time of the dialog box.
      * @param parent - a parent composite
-     * @param e - a error causing exception 
+     * @param e - a error causing exception
      */
     private void createErrorComposite(Composite parent, Throwable e) {
         fIsError = true;
         fDialogComposite.dispose();
-        
+
         fDialogComposite = new Composite(parent, SWT.NONE);
         GridLayout layout = new GridLayout(1, true);
         fDialogComposite.setLayout(layout);
         fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        
+
         Text errorText = new Text(fDialogComposite, SWT.MULTI);
         StringBuffer error = new StringBuffer();
         error.append(Messages.TraceControl_ImportDialogCreationError);
@@ -396,5 +400,5 @@ public class ImportDialog extends Dialog implements IImportDialog {
         errorText.setLayoutData(new GridData(GridData.FILL_BOTH));
     }
 
-    
+
  }
index 40214ebf702a9fb22a410038e4b8a2fd8155140c..22140a9deb39ec7192e6844fac1785e9090486e9 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.dialogs;
@@ -17,7 +17,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
  * <p>
  * Helper class for storing information about a remote file to import.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ImportFileInfo {
@@ -77,7 +77,7 @@ public class ImportFileInfo {
     }
     /**
      * Sets the overwrite flag.
-     * @param isOverwrite
+     * @param isOverwrite If the Overwrite checkbox is checked or not
      */
     public void setOverwrite(boolean isOverwrite) {
         this.fIsOverwrite = isOverwrite;
@@ -90,7 +90,7 @@ public class ImportFileInfo {
     }
     /**
      * Sets the remote file implementation
-     * @param the remote file implementation.
+     * @param remoteFile The remote file implementation.
      */
     public void setRemoteFile(IRemoteFile remoteFile) {
         fRemoteFile = remoteFile;
index 7f149764ce0a0eee5f3b0fd330b5e119864c90ff..752c7a81dcef2b0fc330c05a8fc6c28bc6c34f57 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.dialogs;
@@ -39,7 +39,7 @@ import org.eclipse.swt.widgets.Text;
  * <p>
  * Dialog box for connection information.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class NewConnectionDialog extends Dialog implements INewConnectionDialog {
@@ -50,7 +50,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
     /**
      * The icon file for this dialog box.
      */
-    public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/target_add.gif"; //$NON-NLS-1$ 
+    public static final String TARGET_NEW_CONNECTION_ICON_FILE = "icons/elcl16/target_add.gif"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -95,7 +95,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
      * The node address (IP or DNS name) string.
      */
     private String fHostName = null;
-    
+
     /**
      * Input list of existing RSE hosts available for selection.
      */
@@ -104,6 +104,12 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+    /**
+     * Constructor
+     *
+     * @param shell
+     *            The shell
+     */
     public NewConnectionDialog(Shell shell) {
         super(shell);
         setShellStyle(SWT.RESIZE);
@@ -129,7 +135,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
     public String getHostName() {
         return fHostName;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.INewConnectionDialog#setTraceControlParent(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent)
@@ -138,7 +144,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
     public void setTraceControlParent(ITraceControlComponent parent) {
         fParent = parent;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.INewConnectionDialog#setHosts(org.eclipse.rse.core.model.IHost[])
@@ -170,7 +176,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
      */
     @Override
     protected Control createDialogArea(Composite parent) {
-        
+
         // Main dialog panel
         fDialogComposite = new Composite(parent, SWT.NONE);
         GridLayout layout = new GridLayout(1, true);
@@ -181,10 +187,10 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
         fComboGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
         fComboGroup.setText(Messages.TraceControl_NewNodeExistingConnectionGroupName);
         layout = new GridLayout(2, true);
-        fComboGroup.setLayout(layout); 
+        fComboGroup.setLayout(layout);
         GridData data = new GridData(GridData.FILL_HORIZONTAL);
         fComboGroup.setLayoutData(data);
-        
+
         fExistingHostsCombo = new CCombo(fComboGroup, SWT.READ_ONLY);
         fExistingHostsCombo.setToolTipText(Messages.TraceControl_NewNodeComboToolTip);
         fExistingHostsCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
@@ -203,18 +209,18 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
         fTextGroup.setLayout(layout);
         data = new GridData(GridData.FILL_HORIZONTAL);
         fTextGroup.setLayoutData(data);
-        
+
         fButton = new Button(fTextGroup, SWT.CHECK);
         fButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
         fButton.setText(Messages.TraceControl_NewNodeEditButtonName);
         fButton.setEnabled(fExistingHosts.length > 0);
-        
+
         Label connectionNameLabel = new Label(fTextGroup, SWT.RIGHT);
         connectionNameLabel.setText(Messages.TraceControl_NewNodeConnectionNameLabel);
         fConnectionNameText = new Text(fTextGroup, SWT.NONE);
         fConnectionNameText.setToolTipText(Messages.TraceControl_NewNodeConnectionNameTooltip);
         fConnectionNameText.setEnabled(fExistingHosts.length == 0);
-        
+
         Label hostNameLabel = new Label(fTextGroup, SWT.RIGHT);
         hostNameLabel.setText(Messages.TraceControl_NewNodeHostNameLabel);
         fHostNameText = new Text(fTextGroup, SWT.NONE);
@@ -233,7 +239,7 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
                     fExistingHostsCombo.setEnabled(true);
                     fConnectionNameText.setEnabled(false);
                     fHostNameText.setEnabled(false);
-                }             
+                }
             }
 
             @Override
@@ -253,19 +259,19 @@ public class NewConnectionDialog extends Dialog implements INewConnectionDialog
             public void widgetDefaultSelected(SelectionEvent e) {
             }
         });
-        
+
         // layout widgets
         data = new GridData(GridData.FILL_HORIZONTAL);
         fHostNameText.setText("666.666.666.666"); //$NON-NLS-1$
         Point minSize = fHostNameText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
         data.widthHint = minSize.x + 5;
         data.horizontalSpan = 2;
-        
+
         fConnectionNameText.setLayoutData(data);
         fHostNameText.setLayoutData(data);
-        
+
         fHostNameText.setText(""); //$NON-NLS-1$
-        
+
         return fDialogComposite;
     }
 
index a6f7a75542cb93c18f85d84b121490d6ad648ab0..9036b616a1024cb86b7ed67c15a4e3e349e3d1b1 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;
@@ -28,7 +28,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to add contexts to a given channel and all of its events.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AddContextOnChannelHandler extends BaseAddContextHandler {
@@ -36,7 +36,7 @@ public class AddContextOnChannelHandler extends BaseAddContextHandler {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -70,10 +70,10 @@ public class AddContextOnChannelHandler extends BaseAddContextHandler {
         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 TraceChannelComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceChannelComponent tmpChannel = (TraceChannelComponent) element; 
+                    TraceChannelComponent tmpChannel = (TraceChannelComponent) element;
                     session = tmpChannel.getSession();
                     if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
                         channel = tmpChannel;
@@ -81,7 +81,7 @@ public class AddContextOnChannelHandler extends BaseAddContextHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (channel != null);
         fLock.lock();
         try {
index 210f1f3127a4535e1d0098e6e1f7e103a1914c13..9badc1d50e389451f15b2f7a245540d789b6ae48 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;
@@ -28,7 +28,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to add contexts to all channels and all events.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AddContextOnDomainHandler extends BaseAddContextHandler {
@@ -36,7 +36,7 @@ public class AddContextOnDomainHandler extends BaseAddContextHandler {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -58,26 +58,26 @@ public class AddContextOnDomainHandler extends BaseAddContextHandler {
      */
     @Override
     public boolean isEnabled() {
-        
+
         // Get workbench page for the Control View
         IWorkbenchPage page = getWorkbenchPage();
         if (page == null) {
             return false;
         }
-        
+
         TraceDomainComponent domain = null;
         TraceSessionComponent session = null;
-        
+
         // Check if one domain 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 = (Object) iterator.next();
+                Object element = iterator.next();
                 if (element instanceof TraceDomainComponent) {
                     TraceDomainComponent tmpDomain = (TraceDomainComponent) element;
                     session = (TraceSessionComponent) tmpDomain.getParent();
-                    
+
                     // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed
                     if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) {
                         domain = tmpDomain;
@@ -85,9 +85,9 @@ public class AddContextOnDomainHandler extends BaseAddContextHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = domain != null;
-        
+
         fLock.lock();
         try {
             fParam = null;
index ffea402da93f347526384cbbbf444ecb63b858f6..63a38398f8705700a49e9d91278fd3737e75945a 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;
@@ -28,7 +28,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to add contexts to a given event.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AddContextOnEventHandler extends BaseAddContextHandler {
@@ -36,7 +36,7 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -70,10 +70,10 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
         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 TraceEventComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceEventComponent tmpEvent = (TraceEventComponent) element; 
+                    TraceEventComponent tmpEvent = (TraceEventComponent) element;
                     session = tmpEvent.getSession();
                     if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
                         event = tmpEvent;
@@ -81,7 +81,7 @@ public class AddContextOnEventHandler extends BaseAddContextHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (event != null);
         fLock.lock();
         try {
index dc61294c21b4914b3fdf715cacd7161c02e2a7a7..eea654058a6f2d97be250463bb8322d9cb0facae 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;
@@ -44,7 +44,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * Command handler implementation to assign events to a session and channel and enable/configure them.
  * This is done on the trace provider level.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class AssignEventHandler extends BaseControlViewHandler {
@@ -56,7 +56,7 @@ public class AssignEventHandler extends BaseControlViewHandler {
      * The command execution parameter.
      */
     private Parameter fParam;
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -93,7 +93,7 @@ public class AssignEventHandler extends BaseControlViewHandler {
                         List<BaseEventComponent> events = param.getEvents();
                         // Create list of event names
                         for (Iterator<BaseEventComponent> iterator = events.iterator(); iterator.hasNext();) {
-                            BaseEventComponent event = (BaseEventComponent) iterator.next();
+                            BaseEventComponent event = iterator.next();
                             eventNames.add(event.getName());
                         }
 
@@ -113,7 +113,7 @@ public class AssignEventHandler extends BaseControlViewHandler {
                     refresh(new CommandParameter(dialog.getSession()));
 
                     if (error != null) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_EnableEventsFailure, error);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_EnableEventsFailure, error);
                     }
                     return Status.OK_STATUS;
                 }
@@ -146,14 +146,14 @@ public class AssignEventHandler 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 BaseEventComponent) {
                     BaseEventComponent event = (BaseEventComponent) element;
                     ITraceControlComponent provider = event.getParent();
-                    
+
                     // check for kernel or UST provider
                     boolean temp = false;
                     if (provider instanceof KernelProviderComponent) {
@@ -174,7 +174,7 @@ public class AssignEventHandler extends BaseControlViewHandler {
 
                     // Add BaseEventComponents
                     events.add(event);
-                    
+
                     if (sessions == null) {
                         TargetNodeComponent  root = (TargetNodeComponent)event.getParent().getParent().getParent();
                         sessions = root.getSessions();
@@ -197,28 +197,28 @@ public class AssignEventHandler extends BaseControlViewHandler {
     }
 
     /**
-     *  Class containing parameter for the command execution. 
+     *  Class containing parameter for the command execution.
      */
     final static private class Parameter {
 
         /**
-         * The list of event components the command is to be executed on. 
+         * The list of event components the command is to be executed on.
          */
-        private List<BaseEventComponent> fEvents;
-        
+        private final List<BaseEventComponent> fEvents;
+
         /**
          * The list of available sessions.
          */
         final private TraceSessionComponent[] fSessions;
-        
+
         /**
          * Flag for indicating Kernel or UST.
          */
         final private boolean fIsKernel;
-        
+
         /**
          * Constructor
-         * 
+         *
          * @param sessions - a array of trace sessions
          * @param events - a lists of events to enable
          * @param isKernel - domain (true for kernel or UST)
@@ -229,7 +229,7 @@ public class AssignEventHandler extends BaseControlViewHandler {
             fEvents.addAll(events);
             fIsKernel = isKernel;
         }
-        
+
         /**
          * Copy constructor
          * @param other - a parameter to copy
@@ -237,15 +237,15 @@ public class AssignEventHandler extends BaseControlViewHandler {
         public Parameter(Parameter other) {
             this(other.fSessions, other.fEvents, other.fIsKernel);
         }
-        
+
         public TraceSessionComponent[] getSessions() {
             return fSessions;
         }
-        
+
         public List<BaseEventComponent> getEvents() {
             return fEvents;
         }
-        
+
         public boolean isKernel() {
             return fIsKernel;
         }
index 5b911e14b27175e61411e83931f97639e3772eb0..155aadb81bef1f470b440cce3e4b7c6ef064fe77 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;
@@ -32,7 +32,7 @@ import org.eclipse.ui.progress.UIJob;
  * <p>
  * Base command handler implementation to add contexts.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class BaseAddContextHandler extends BaseControlViewHandler {
@@ -48,16 +48,21 @@ abstract public class BaseAddContextHandler extends BaseControlViewHandler {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /**
-     * Adds contexts to channel(s) and/or event(s) 
-     * @param param - a parameter instance with data for the command execution
-     * @param contextNames - list contexts to add
-     * @param monitor - a progress monitor
+     * Adds contexts to channel(s) and/or event(s)
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param contextNames
+     *            - list contexts to add
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If something goes wrong
      */
     abstract public void addContexts(CommandParameter param, List<String> contextNames, IProgressMonitor monitor) throws ExecutionException;
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
@@ -82,7 +87,7 @@ abstract public class BaseAddContextHandler extends BaseControlViewHandler {
                     try {
                         final List<String> availableContexts = param.getSession().getContextList(monitor);
                         final IAddContextDialog dialog = TraceControlDialogFactory.getInstance().getAddContextDialog();
-                        dialog.setAvalibleContexts(availableContexts); 
+                        dialog.setAvalibleContexts(availableContexts);
 
                         if ((dialog.open() != Window.OK) || (dialog.getContexts().isEmpty())) {
                             return Status.OK_STATUS;
@@ -103,9 +108,9 @@ abstract public class BaseAddContextHandler extends BaseControlViewHandler {
 
                                 // get session configuration in all cases
                                 refresh(param);
-                                
+
                                 if (error != null) {
-                                    return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddContextFailure, error);
+                                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddContextFailure, error);
                                 }
                                 return Status.OK_STATUS;
                             }
@@ -113,7 +118,7 @@ abstract public class BaseAddContextHandler extends BaseControlViewHandler {
                         addJob.setUser(true);
                         addJob.schedule();
                     } catch (ExecutionException e) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_GetContextFailure, e);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_GetContextFailure, e);
                     }
 
                     return Status.OK_STATUS;
index 99ff75b15dbbfe1352e24d328515f47d7d40eca9..336e8e548f0edc74e83a0ace5f16743f63d7124a 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;
@@ -31,7 +31,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Abstract Command handler implementation for all control view handlers.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class BaseControlViewHandler extends AbstractHandler {
@@ -43,7 +43,7 @@ abstract public class BaseControlViewHandler extends AbstractHandler {
      * The synchronization lock.
      */
     final protected ReentrantLock fLock = new ReentrantLock();
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -76,14 +76,14 @@ abstract public class BaseControlViewHandler extends AbstractHandler {
      */
     protected void refresh(final CommandParameter param) {
         Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) {
-            
+
             @Override
             protected IStatus run(IProgressMonitor monitor) {
                 try {
                     param.getSession().getConfigurationFromNode(monitor);
                 } catch (ExecutionException e) {
-                    return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e);
-                } 
+                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e);
+                }
                 return Status.OK_STATUS;
             }
         };
index 7af1edea2b5870a1a360b9926ed78e0e98cad6d8..8d08305c1c4a3b67b47b556a13e2c0ad9e835ce1 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;
@@ -30,9 +30,9 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceD
 
 /**
  * <p>
- * Base implementation of a command handler to enable a trace channel.  
+ * Base implementation of a command handler to enable a trace channel.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract class BaseEnableChannelHandler extends BaseControlViewHandler {
@@ -45,21 +45,32 @@ abstract class BaseEnableChannelHandler extends BaseControlViewHandler {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+
     /**
-     * Enables channels with given names which are part of this domain. If a given channel 
-     * doesn't exists it creates a new channel with the given parameters (or default values 
-     * if given parameter is null). 
-     * @param - a parameter instance with data for the command execution
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param info - channel information to set for the channel (use null for default)
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     * Enables channels with given names which are part of this domain. If a
+     * given channel doesn't exists it creates a new channel with the given
+     * parameters (or default values if given parameter is null).
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param info
+     *            - channel information to set for the channel (use null for
+     *            default)
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If something goes wrong when enabling the channel
      */
-    abstract public void enableChannel(CommandParameter param, List<String> channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException; 
-    
+    abstract public void enableChannel(CommandParameter param,
+            List<String> channelNames, IChannelInfo info, boolean isKernel,
+            IProgressMonitor monitor) throws ExecutionException;
+
     /**
-     * @param - a parameter instance with data for the command execution
+     * @param param - a parameter instance with data for the command execution
      * @return returns the relevant domain (null if domain is not known)
      */
     abstract public TraceDomainComponent getDomain(CommandParameter param);
@@ -86,7 +97,7 @@ abstract class BaseEnableChannelHandler extends BaseControlViewHandler {
                 protected IStatus run(IProgressMonitor monitor) {
                     Exception error = null;
 
-                    List<String> channelNames = new ArrayList<String>();                    
+                    List<String> channelNames = new ArrayList<String>();
                     channelNames.add(dialog.getChannelInfo().getName());
 
                     try {
@@ -99,7 +110,7 @@ abstract class BaseEnableChannelHandler extends BaseControlViewHandler {
                     refresh(param);
 
                     if (error != null) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateChannelStateFailure, error);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateChannelStateFailure, error);
                     }
                     return Status.OK_STATUS;
                 }
index 4cf8ce4f1c37d66f71db62f7c3033390a2b0a25f..7b95a44306a722348cb4ac165fa62da87c8f6643 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;
@@ -37,7 +37,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Base command handler implementation to enable events.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class BaseEnableEventHandler extends BaseControlViewHandler {
@@ -53,48 +53,74 @@ abstract public class BaseEnableEventHandler extends BaseControlViewHandler {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+
     /**
      * Enables a list of events for given parameters.
-     * @param - a parameter instance with data for the command execution
-     * @param eventNames - list of event names
-     * @param isKernel - true if kernel domain else false
-     * @param monitor - a progress monitor
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param eventNames
+     *            - list of event names
+     * @param isKernel
+     *            - true if kernel domain else false
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails for some reason
      */
     abstract public void enableEvents(CommandParameter param, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Enables all syscall events.
-     * @param - a parameter instance with data for the command execution
-     * @param monitor - a progress monitor
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails for some reason
      */
     abstract public void enableSyscalls(CommandParameter param, IProgressMonitor monitor) throws ExecutionException;
-    
+
     /**
      * Enables a dynamic probe.
-     * @param - a parameter instance with data for the command execution
-     * @param eventName - a event name
-     * @param isFunction - true for dynamic function entry/return probe else false
-     * @param probe - a dynamic probe information
-     * @param monitor - a progress monitor
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param eventName
+     *            - a event name
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - a dynamic probe information
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails for some reason
      */
     abstract public void enableProbe(CommandParameter param, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException;
-    
+
     /**
      * Enables events using log level
-     * @param - a parameter instance with data for the command execution
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
-     * @param monitor - a progress monitor  
+     *
+     * @param param
+     *            - a parameter instance with data for the command execution
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
-     */    
+     *             If the command fails for some reason
+     */
     abstract public void enableLogLevel(CommandParameter param, String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException;
-    
+
     /**
-     * @param - a parameter instance with data for the command execution
+     * @param param
+     *            - a parameter instance with data for the command execution
      * @return returns the relevant domain (null if domain is not known)
      */
     abstract TraceDomainComponent getDomain(CommandParameter param);
@@ -183,7 +209,7 @@ abstract public class BaseEnableEventHandler extends BaseControlViewHandler {
                     refresh(param);
 
                     if (error != null) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error);
                     }
                     return Status.OK_STATUS;
                 }
index 48ed15fa99213e1e284c353d9e3c8a20abacd1c3..dd670631d575dab0dfe37695def8b1dac9b53dfa 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;
@@ -34,7 +34,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Command handler implementation to execute command calibrate to quantify LTTng overhead.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class CalibrateHandler extends BaseControlViewHandler {
@@ -50,7 +50,7 @@ public class CalibrateHandler extends BaseControlViewHandler {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
@@ -74,7 +74,7 @@ public class CalibrateHandler extends BaseControlViewHandler {
                     try {
                         param.getDomain().calibrate(monitor);
                     } catch (ExecutionException e) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddCalibrateFailure, e);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_AddCalibrateFailure, e);
                     }
 
                     return Status.OK_STATUS;
@@ -95,7 +95,7 @@ public class CalibrateHandler extends BaseControlViewHandler {
      */
     @Override
     public boolean isEnabled() {
-        
+
         // Get workbench page for the Control View
         IWorkbenchPage page = getWorkbenchPage();
         if (page == null) {
@@ -110,11 +110,11 @@ public class CalibrateHandler extends BaseControlViewHandler {
         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) {
                     TraceDomainComponent tmpDomain = (TraceDomainComponent) element;
                     session = (TraceSessionComponent) tmpDomain.getParent();
-                    
+
                     // Add only TraceDomainComponent whose TraceSessionComponent parent is not destroyed
                     if ((!session.isDestroyed())) {
                         domain = tmpDomain;
index 9ea06971e741ae958fd878e76cb1f93f6b383386..90dc7a3e0baab1f994e6095aa6e6c7305a1fda47 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;
@@ -38,7 +38,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Abstract command handler implementation to enable or disabling a trace channel.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
@@ -57,7 +57,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
     /**
      * @return the new state to set
      */
-    abstract protected TraceEnablement getNewState(); 
+    abstract protected TraceEnablement getNewState();
 
     // ------------------------------------------------------------------------
     // Operations
@@ -65,11 +65,11 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
     /**
      * Changes the state of the given channels.
      * @param domain - the domain of the channels.
-     * @param channelNames - a list of channel names 
+     * @param channelNames - a list of channel names
      * @param monitor - a progress monitor
      * @throws ExecutionException
      */
-    abstract protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException; 
+    abstract protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
 
     /*
      * (non-Javadoc)
@@ -104,7 +104,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
                             List<String> channelNames = new ArrayList<String>();
                             for (Iterator<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
-                                TraceChannelComponent channel = (TraceChannelComponent) iterator.next();
+                                TraceChannelComponent channel = iterator.next();
                                 channelNames.add(channel.getName());
                             }
 
@@ -112,7 +112,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
 
                             for (Iterator<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
-                                TraceChannelComponent channel = (TraceChannelComponent) iterator.next();
+                                TraceChannelComponent channel = iterator.next();
                                 channel.setState(getNewState());
                             }
                         }
@@ -127,7 +127,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
                             List<String> channelNames = new ArrayList<String>();
                             for (Iterator<TraceChannelComponent> iterator = ustChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
-                                TraceChannelComponent channel = (TraceChannelComponent) iterator.next();
+                                TraceChannelComponent channel = iterator.next();
                                 channelNames.add(channel.getName());
                             }
 
@@ -135,7 +135,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
 
                             for (Iterator<TraceChannelComponent> iterator = ustChannels.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
-                                TraceChannelComponent channel = (TraceChannelComponent) iterator.next();
+                                TraceChannelComponent channel = iterator.next();
                                 channel.setState(getNewState());
                             }
                         }
@@ -143,11 +143,11 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
                         error = e;
                     }
 
-                    // In all cases notify listeners  
+                    // In all cases notify listeners
                     session.fireComponentChanged(session);
 
                     if (error != null) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeChannelStateFailure, error);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeChannelStateFailure, error);
                     }
 
                     return Status.OK_STATUS;
@@ -179,17 +179,17 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
         TraceDomainComponent ustDomain = null;
         List<TraceChannelComponent> kernelChannels = new ArrayList<TraceChannelComponent>();
         List<TraceChannelComponent> ustChannels = new ArrayList<TraceChannelComponent>();
-        
+
         // Check if one or more session are selected
         ISelection selection = page.getSelection(ControlView.ID);
         if (selection instanceof StructuredSelection) {
             StructuredSelection structered = ((StructuredSelection) selection);
             String sessionName = null;
             for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
-                Object element = (Object) iterator.next();
-                 
+                Object element = iterator.next();
+
                 if (element instanceof TraceChannelComponent) {
-                    
+
                     // Add only TraceChannelComponents that are disabled
                     TraceChannelComponent channel = (TraceChannelComponent) element;
                     if (sessionName == null) {
@@ -219,7 +219,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (!kernelChannels.isEmpty() || !ustChannels.isEmpty());
         fLock.lock();
         try {
@@ -229,12 +229,12 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
-    
+
     /**
-     *  Class containing parameter for the command execution. 
+     *  Class containing parameter for the command execution.
      */
     static protected class Parameter {
         /**
@@ -246,14 +246,14 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
          */
         final protected TraceDomainComponent fUstDomain;
         /**
-         * The list of kernel channel components the command is to be executed on. 
+         * The list of kernel channel components the command is to be executed on.
          */
         final protected List<TraceChannelComponent> fKernelChannels;
         /**
-         * The list of UST channel components the command is to be executed on. 
+         * The list of UST channel components the command is to be executed on.
          */
         final protected List<TraceChannelComponent> fUstChannels;
-        
+
         /**
          * Constructor
          * @param kernelDomain - a kernel domain component
@@ -269,7 +269,7 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
             fUstChannels = new ArrayList<TraceChannelComponent>();
             fUstChannels.addAll(ustChannels);
         }
-        
+
         /**
          * Copy constructor
          * @param other a parameter to copy
@@ -277,28 +277,28 @@ abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
         public Parameter(Parameter other) {
             this(other.fKernelDomain, other.fUstDomain, other.fKernelChannels, other.fUstChannels);
         }
-        
+
         /**
          * @return the kernel domain component.
          */
         public TraceDomainComponent getKernelDomain() {
             return fKernelDomain;
         }
-        
+
         /**
          * @return the UST domain component.
          */
         public TraceDomainComponent getUstDomain() {
             return fUstDomain;
-        }   
-        
+        }
+
         /**
          * @return the list of kernel channel components.
          */
         public List<TraceChannelComponent> getKernelChannels() {
             return fKernelChannels;
         }
-        
+
         /**
          * @return the list of UST channel components.
          */
index a87375d548cbb92bcbaffbb76aacaa626256fca3..7ec0916be81fb4cb8ddf63d5f935042a7d1b2878 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;
@@ -38,7 +38,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Base Command handler implementation to enable or disabling a trace channel.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
@@ -50,14 +50,14 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
      * The command execution parameter.
      */
     protected Parameter fParam;
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
     /**
      * @return the new state to set
      */
-    abstract protected TraceEnablement getNewState(); 
+    abstract protected TraceEnablement getNewState();
 
     // ------------------------------------------------------------------------
     // Operations
@@ -65,11 +65,11 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
     /**
      * Change the state
      * @param channel - channel of events to be enabled
-     * @param eventNames - list event names  
+     * @param eventNames - list event names
      * @param monitor - a progress monitor
      * @throws ExecutionException
      */
-    abstract protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException; 
+    abstract protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException;
 
     /*
      * (non-Javadoc)
@@ -86,7 +86,7 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
 
         fLock.lock();
         try {
-            
+
             final Parameter param = new Parameter(fParam);
 
             Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) {
@@ -102,15 +102,15 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
                             session = param.getChannel().getSession();
                             List<String> eventNames = new ArrayList<String>();
                             List<TraceEventComponent> events = param.getEvents();
-                            
+
                             for (Iterator<TraceEventComponent> iterator = events.iterator(); iterator.hasNext();) {
                                 // Enable/disable all selected channels which are disabled
-                                TraceEventComponent event = (TraceEventComponent) iterator.next();
+                                TraceEventComponent event = iterator.next();
 
                                 // Workaround for wildcard handling in lttng-tools
                                 if ("*".equals(event.getName())) { //$NON-NLS-1$
                                     isAll = true;
-                                } else { 
+                                } else {
                                     eventNames.add(event.getName());
                                 }
                             }
@@ -124,7 +124,7 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
 
                             for (Iterator<TraceEventComponent> iterator = events.iterator(); iterator.hasNext();) {
                                 // Enable all selected channels which are disabled
-                                TraceEventComponent ev = (TraceEventComponent) iterator.next();
+                                TraceEventComponent ev = iterator.next();
                                 ev.setState(getNewState());
                             }
                         }
@@ -133,12 +133,12 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
                     }
 
                     if (session != null) {
-                        // In all cases notify listeners  
+                        // In all cases notify listeners
                         session.fireComponentChanged(session);
                     }
 
                     if (error != null) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error);
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeEventStateFailure, error);
                     }
 
                     return Status.OK_STATUS;
@@ -166,7 +166,7 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
 
         // Check if one or more session are selected
         ISelection selection = page.getSelection(ControlView.ID);
-        
+
         TraceChannelComponent channel = null;
         List<TraceEventComponent> events = new ArrayList<TraceEventComponent>();
 
@@ -174,17 +174,17 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
             StructuredSelection structered = ((StructuredSelection) selection);
             String sessionName = null;
             String channelName = null;
-            
+
             for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
-                Object element = (Object) iterator.next();
-                 
+                Object element = iterator.next();
+
                 if (element instanceof TraceEventComponent) {
-                    
+
                     TraceEventComponent event = (TraceEventComponent) element;
                     if (sessionName == null) {
                         sessionName = String.valueOf(event.getSessionName());
                     }
-                    
+
                     if (channel == null) {
                         channel = (TraceChannelComponent)event.getParent();
                     }
@@ -222,7 +222,7 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
     }
 
     /**
-     *  Class containing parameter for the command execution. 
+     *  Class containing parameter for the command execution.
      */
     static protected class Parameter {
         /**
@@ -230,10 +230,10 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
          */
         final private TraceChannelComponent fChannel;
         /**
-         * The list of kernel channel components the command is to be executed on. 
+         * The list of kernel channel components the command is to be executed on.
          */
         final private List<TraceEventComponent> fEvents = new ArrayList<TraceEventComponent>();
-        
+
         /**
          * Constructor
          * @param channel - a channel component
@@ -243,7 +243,7 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
             fChannel = channel;
             fEvents.addAll(events);
         }
-        
+
         /**
          * Copy constructor
          * @param other - a parameter to copy
@@ -251,14 +251,14 @@ abstract public class ChangeEventStateHandler extends BaseControlViewHandler {
         public Parameter(Parameter other) {
             this(other.fChannel, other.fEvents);
         }
-        
+
         /**
          * @return the trace channel component.
          */
         public TraceChannelComponent getChannel() {
             return fChannel;
         }
-        
+
         /**
          * @return a list of trace event components.
          */
index bc39897bdddbdfd99fe3211b87ef67114172ec34..bc7b3f6c9434e90edaaf8a3e0f96a995c3319719 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;
@@ -36,7 +36,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Abstract command handler implementation to start or stop one or more trace sessions.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
@@ -45,10 +45,10 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The list of session components the command is to be executed on. 
+     * The list of session components the command is to be executed on.
      */
     protected List<TraceSessionComponent> fSessions = new ArrayList<TraceSessionComponent>();
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -57,15 +57,20 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
      * @return new required state.
      */
     abstract TraceSessionState getNewState();
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /**
-     * Performs the state change on given session. 
-     * @param session - a session which state is to be changed
-     * @param monitor - a progress monitor
+     * Performs the state change on given session.
+     *
+     * @param session
+     *            - a session which state is to be changed
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
      */
     abstract public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException;
 
@@ -84,7 +89,7 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
 
         fLock.lock();
         try {
-            
+
             final List<TraceSessionComponent> sessions = new ArrayList<TraceSessionComponent>();
             sessions.addAll(fSessions);
 
@@ -95,7 +100,7 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
                         for (Iterator<TraceSessionComponent> iterator = sessions.iterator(); iterator.hasNext();) {
 
                             // Start all selected sessions
-                            TraceSessionComponent session = (TraceSessionComponent) iterator.next();
+                            TraceSessionComponent session = iterator.next();
                             changeState(session, monitor);
 
                             // Set Session state
@@ -103,8 +108,8 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
                             session.fireComponentChanged(session);
                         }
                     } catch (ExecutionException e) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeSessionStateFailure, e);
-                    }  
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeSessionStateFailure, e);
+                    }
                     return Status.OK_STATUS;
                 }
             };
@@ -135,7 +140,7 @@ abstract public class ChangeSessionStateHandler extends BaseControlViewHandler {
         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 session = (TraceSessionComponent) element;
index 8f40a70c17f16cec7a3d4af68824d5ef46d1b5c0..9d3faff9fd571543771a5dce6815b8a7bb45622e 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;
@@ -16,10 +16,10 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceS
 
 /**
  * Class containing parameter for the command execution.
- *  
+ *
  * @author Bernd Hufmann
  */
-public class ChannelCommandParameter extends CommandParameter implements Cloneable {
+public class ChannelCommandParameter extends CommandParameter {
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -52,7 +52,7 @@ public class ChannelCommandParameter extends CommandParameter implements Cloneab
     public TraceChannelComponent getChannel() {
         return fChannel;
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
index a18cd3f94ffcf7547d1bfa268c5952f4202515b0..9098c7bd86c86369198d474f68d97ed31ed158a0 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;
@@ -32,7 +32,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to create a trace session.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class CreateSessionHandler extends BaseControlViewHandler {
@@ -41,10 +41,10 @@ public class CreateSessionHandler extends BaseControlViewHandler {
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The trace session group the command is to be executed on. 
+     * The trace session group the command is to be executed on.
      */
     private TraceSessionGroup fSessionGroup = null;
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -57,8 +57,8 @@ public class CreateSessionHandler extends BaseControlViewHandler {
 
         fLock.lock();
         try {
-            final TraceSessionGroup sessionGroup = fSessionGroup; 
-                    
+            final TraceSessionGroup sessionGroup = fSessionGroup;
+
             // Open dialog box for the node name and address
             ICreateSessionDialog dialog = TraceControlDialogFactory.getInstance().getCreateSessionDialog();
             dialog.setTraceSessionGroup(sessionGroup);
@@ -76,8 +76,8 @@ public class CreateSessionHandler extends BaseControlViewHandler {
                     try {
                         sessionGroup.createSession(sessionName, sessionPath, monitor);
                     } catch (ExecutionException e) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e);
-                    } 
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e);
+                    }
                     return Status.OK_STATUS;
                 }
             };
@@ -95,7 +95,7 @@ public class CreateSessionHandler extends BaseControlViewHandler {
      */
     @Override
     public boolean isEnabled() {
-        
+
         // Get workbench page for the Control View
         IWorkbenchPage page = getWorkbenchPage();
         if (page == null) {
index 2f9c5c8aa0dfa8900cd15d25841a7f65f3abecef..24525042b96f254060991d271a68c263f155b0f8 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;
@@ -39,7 +39,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Command handler implementation to destroy one or more trace sessions.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class DestroySessionHandler extends BaseControlViewHandler {
@@ -48,10 +48,10 @@ public class DestroySessionHandler extends BaseControlViewHandler {
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The list of session components the command is to be executed on. 
+     * The list of session components the command is to be executed on.
      */
-    private List<TraceSessionComponent> fSessions = new ArrayList<TraceSessionComponent>();
-    
+    private final List<TraceSessionComponent> fSessions = new ArrayList<TraceSessionComponent>();
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -69,8 +69,8 @@ public class DestroySessionHandler extends BaseControlViewHandler {
         }
         // Get user confirmation
         IConfirmDialog dialog = TraceControlDialogFactory.getInstance().getConfirmDialog();
-        if (!dialog.openConfirm(window.getShell(), 
-                Messages.TraceControl_DestroyConfirmationTitle, 
+        if (!dialog.openConfirm(window.getShell(),
+                Messages.TraceControl_DestroyConfirmationTitle,
                 Messages.TraceControl_DestroyConfirmationMessage)) {
 
             return null;
@@ -80,10 +80,10 @@ public class DestroySessionHandler extends BaseControlViewHandler {
             @Override
             protected IStatus run(IProgressMonitor monitor) {
                 try {
-                    // Make a copy of the list of sessions to avoid ConcurrentModificationException when iterating 
-                    // over fSessions, since fSessions is modified in another thread triggered by the tree viewer refresh 
+                    // Make a copy of the list of sessions to avoid ConcurrentModificationException when iterating
+                    // over fSessions, since fSessions is modified in another thread triggered by the tree viewer refresh
                     // after removing a session.
-                    TraceSessionComponent[] sessions = (TraceSessionComponent[])fSessions.toArray(new TraceSessionComponent[fSessions.size()]);
+                    TraceSessionComponent[] sessions = fSessions.toArray(new TraceSessionComponent[fSessions.size()]);
 
                     for (int i = 0; i < sessions.length; i++) {
                         // Destroy all selected sessions
@@ -92,8 +92,8 @@ public class DestroySessionHandler extends BaseControlViewHandler {
                         sessionGroup.destroySession(session, monitor);
                     }
                 } catch (ExecutionException e) {
-                    return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_DestroySessionFailure, e);
-                }  
+                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_DestroySessionFailure, e);
+                }
                 return Status.OK_STATUS;
             }
         };
@@ -121,7 +121,7 @@ public class DestroySessionHandler extends BaseControlViewHandler {
         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 session = (TraceSessionComponent) element;
index 8533897ab2ecec0f1cceede89177c5ddea31fb06..7cb1f38cb760fa7981fbacc6a79c9e1bf07a9a71 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;
@@ -29,7 +29,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to enable a trace channel for known domain.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
@@ -51,7 +51,7 @@ public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
             ((DomainCommandParameter)param).getDomain().enableChannels(channelNames, info, 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)
@@ -70,26 +70,26 @@ public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
      */
     @Override
     public boolean isEnabled() {
-        
+
         // Get workbench page for the Control View
         IWorkbenchPage page = getWorkbenchPage();
         if (page == null) {
             return false;
         }
-        
+
         TraceDomainComponent domain = null;
         TraceSessionComponent session = null;
-        
+
         // Check if one domain 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 = (Object) iterator.next();
+                Object element = iterator.next();
                 if (element instanceof TraceDomainComponent) {
                     TraceDomainComponent tmpDomain = (TraceDomainComponent) element;
                     session = (TraceSessionComponent) tmpDomain.getParent();
-                    
+
                     // Add only TraceDomainComponent whose TraceSessionComponent parent is inactive and not destroyed
                     if ((session.getSessionState() == TraceSessionState.INACTIVE) && (!session.isDestroyed())) {
                         domain = tmpDomain;
@@ -97,9 +97,9 @@ public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = domain != null;
-        
+
         fLock.lock();
         try {
             fParam = null;
@@ -109,8 +109,8 @@ public class EnableChannelOnDomainHandler extends BaseEnableChannelHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
-    
+
 }
index 89a4dedfdd64cb80ae9371d2e47e9d694cee1c15..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;
@@ -27,10 +27,10 @@ import org.eclipse.ui.IWorkbenchPage;
 
 /**
  * <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 {
@@ -46,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)
@@ -78,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;
@@ -89,7 +89,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
             }
         }
         boolean isEnabled = session != null;
-        
+
         fLock.lock();
         try {
             fParam = null;
@@ -99,7 +99,7 @@ public class EnableChannelOnSessionHandler extends BaseEnableChannelHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
index 4761f9bdea9e5ea5e24f2f6e3f58a5e0f87f6625..2997f76569fa0f0330a6d39c70f27754aa794a94 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;
@@ -30,7 +30,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to enable events for a known channel.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableEventOnChannelHandler extends BaseEnableEventHandler {
@@ -94,7 +94,7 @@ public class EnableEventOnChannelHandler extends BaseEnableEventHandler {
     public TraceDomainComponent getDomain(CommandParameter param) {
         if (param instanceof ChannelCommandParameter) {
             return (TraceDomainComponent) ((ChannelCommandParameter)param).getChannel().getParent();
-        } 
+        }
         return null;
     }
 
@@ -116,10 +116,10 @@ public class EnableEventOnChannelHandler 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 TraceChannelComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceChannelComponent tmpChannel = (TraceChannelComponent) element; 
+                    TraceChannelComponent tmpChannel = (TraceChannelComponent) element;
                     session = tmpChannel.getSession();
                     if(!session.isDestroyed()) {
                         channel = tmpChannel;
@@ -127,7 +127,7 @@ public class EnableEventOnChannelHandler extends BaseEnableEventHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (channel != null);
         fLock.lock();
         try {
index 8c071a456e3dc523a286740599c99fc119fef88a..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;
@@ -31,7 +31,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * 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 {
@@ -117,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;
@@ -128,7 +128,7 @@ public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = (domain != null);
         fLock.lock();
         try {
index b892e060d068a02b93385f36e5d60e1cf7b62617..2c827142c0590c7beccf5318c3f663d56434364f 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;
@@ -31,7 +31,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * Command handler implementation to enable events for a known session and default channel 'channel0'
  * (which will be created if doesn't exist).
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class EnableEventOnSessionHandler extends BaseEnableEventHandler {
@@ -39,7 +39,7 @@ public class EnableEventOnSessionHandler extends BaseEnableEventHandler {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     //-------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -79,7 +79,7 @@ public class EnableEventOnSessionHandler extends BaseEnableEventHandler {
         param.getSession().enableLogLevel(eventName, logLevelType, level, monitor);
     }
 
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.BaseEnableEventHandler#getDomain(org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.CommandParameter)
@@ -107,10 +107,10 @@ public class EnableEventOnSessionHandler 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 TraceSessionComponent) {
                     // Add only if corresponding TraceSessionComponents is inactive and not destroyed
-                    TraceSessionComponent tmpSession = (TraceSessionComponent) element; 
+                    TraceSessionComponent tmpSession = (TraceSessionComponent) element;
                     if(tmpSession.getSessionState() == TraceSessionState.INACTIVE && !tmpSession.isDestroyed()) {
                         session = tmpSession;
                     }
index 1b4b9671c8ee0c04a73b9593089642541b632143..eb0ce70898e6f0f06eb7888c04b8b842caf783ee 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;
@@ -48,7 +48,7 @@ import org.eclipse.ui.PlatformUI;
  * <p>
  * Command handler implementation to import traces from a (remote) session to a tracing project.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ImportHandler extends BaseControlViewHandler {
@@ -57,7 +57,7 @@ public class ImportHandler extends BaseControlViewHandler {
     // Attributes
     // ------------------------------------------------------------------------
     protected CommandParameter fParam;
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -65,7 +65,7 @@ public class ImportHandler extends BaseControlViewHandler {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
@@ -82,7 +82,7 @@ public class ImportHandler extends BaseControlViewHandler {
         fLock.lock();
         try {
             final CommandParameter param = fParam.clone();
-            
+
             final IImportDialog dialog = TraceControlDialogFactory.getInstance().getImportDialog();
             dialog.setSession(param.getSession());
 
@@ -96,15 +96,15 @@ public class ImportHandler extends BaseControlViewHandler {
                     try {
                         List<ImportFileInfo> traces = dialog.getTracePathes();
                         IProject project = dialog.getProject();
-                        
+
                         for (Iterator<ImportFileInfo> iterator = traces.iterator(); iterator.hasNext();) {
-                            ImportFileInfo remoteFile = (ImportFileInfo) iterator.next();
+                            ImportFileInfo remoteFile = iterator.next();
                             downloadTrace(remoteFile, project);
                         }
 
                     } catch (ExecutionException e) {
-                        return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e);
-                    }  
+                        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ImportFailure, e);
+                    }
                     return Status.OK_STATUS;
                 }
             };
@@ -134,7 +134,7 @@ public class ImportHandler extends BaseControlViewHandler {
         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;
@@ -157,20 +157,23 @@ public class ImportHandler extends BaseControlViewHandler {
         }
         return isEnabled;
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
     /**
      * Downloads a trace from the remote host to the given project.
-     * @param trace - trace information of trace to import
-     * @param project - project to import to
+     *
+     * @param trace
+     *            - trace information of trace to import
+     * @param project
+     *            - project to import to
      * @throws ExecutionException
      */
     private void downloadTrace(ImportFileInfo trace, IProject project) throws ExecutionException {
         try {
             IRemoteFileSubSystem fsss = trace.getImportFile().getParentRemoteFileSubSystem();
-            
+
             IFolder traceFolder = project.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME);
             if (!traceFolder.exists()) {
                 throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTraceFolder.TRACE_FOLDER_NAME + ")");  //$NON-NLS-1$//$NON-NLS-2$
@@ -194,9 +197,9 @@ public class ImportHandler extends BaseControlViewHandler {
                 destinations[i] = folder.getLocation().addTrailingSeparator().append(sources[i].getName()).toString();
                 encodings[i] = null;
             }
-            
+
             fsss.downloadMultiple(sources, destinations, encodings, new NullProgressMonitor());
-            
+
         } catch (SystemMessageException e) {
             throw new ExecutionException(e.toString(), e);
         } catch (CoreException e) {
index 9e45d960c87d211c6988203a0db6e0dc39ea01a6..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;
@@ -27,7 +27,7 @@ import org.eclipse.ui.IWorkbenchPage;
  * <p>
  * Command handler implementation to refresh node configuration.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class RefreshHandler extends BaseControlViewHandler {
@@ -39,7 +39,7 @@ public class RefreshHandler extends BaseControlViewHandler {
      * The node component reference.
      */
     private TargetNodeComponent fNode;
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -76,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;
@@ -94,9 +94,9 @@ public class RefreshHandler extends BaseControlViewHandler {
                 }
             }
         }
-        
+
         boolean isEnabled = node != null;
-        
+
         fLock.lock();
         try {
             fNode = null;
@@ -106,7 +106,7 @@ public class RefreshHandler extends BaseControlViewHandler {
         } finally {
             fLock.unlock();
         }
-        
+
         return isEnabled;
     }
 }
index e9ecdf0944537019b00a0ed16a377264da5f4c0a..32629d50d64752186d2411cdfcbf460029fb379f 100644 (file)
@@ -1,14 +1,14 @@
 /*******************************************************************************
  * 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:
  *   Bernd Hufmann - Initial API and implementation
- *   
+ *
  *******************************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages;
 
@@ -16,14 +16,15 @@ import org.eclipse.osgi.util.NLS;
 
 /**
  * <p>
- * Messages file for the trace control package. 
+ * Messages file for the trace control package.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
+@SuppressWarnings("javadoc")
 final public class Messages extends NLS {
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.messages"; //$NON-NLS-1$
-    
+
     // Failures
     public static String TraceControl_ConnectionFailure;
     public static String TraceControl_DisconnectionFailure;
@@ -37,10 +38,10 @@ final public class Messages extends NLS {
     public static String TraceControl_UnexpectedCommandOutputFormat;
     public static String TraceControl_UnexpectedNameError;
     public static String TraceControl_UnexpectedPathError;
-    
+
     public static String TraceControl_UnsupportedVersionError;
     public static String TraceControl_GettingVersionError;
-    
+
     // Commands
     public static String TraceControl_RetrieveNodeConfigurationJob;
     public static String TraceControl_ListSessionFailure;
@@ -48,12 +49,12 @@ final public class Messages extends NLS {
     public static String TraceControl_NewNodeCreationFailure;
     public static String TraceControl_CreateSessionJob;
     public static String TraceControl_CreateSessionFailure;
-    
+
     public static String TraceControl_DestroySessionJob;
     public static String TraceControl_DestroySessionFailure;
     public static String TraceControl_DestroyConfirmationTitle;
     public static String TraceControl_DestroyConfirmationMessage;
-    
+
     public static String TraceControl_ImportJob;
     public static String TraceControl_ImportFailure;
 
@@ -62,25 +63,25 @@ final public class Messages extends NLS {
 
     public static String TraceControl_CreateChannelStateJob;
     public static String TraceControl_CreateChannelStateFailure;
-    
+
     public static String TraceControl_ChangeChannelStateJob;
     public static String TraceControl_ChangeChannelStateFailure;
     public static String TraceControl_ChangeEventStateJob;
     public static String TraceControl_ChangeEventStateFailure;
-    
+
     public static String TraceControl_EnableEventsJob;
     public static String TraceControl_EnableEventsFailure;
     public static String TraceControl_DisableEventsJob;
-    
+
     public static String TraceControl_GetContextJob;
     public static String TraceControl_GetContextFailure;
-    
+
     public static String TraceControl_AddContextJob;
     public static String TraceControl_AddContextFailure;
-    
+
     public static String TraceControl_AddCalibrateJob;
     public static String TraceControl_AddCalibrateFailure;
-    
+
     // Dialogs
     public static String TraceControl_NewDialogTitle;
     public static String TraceControl_NewNodeExistingConnectionGroupName;
@@ -91,7 +92,7 @@ final public class Messages extends NLS {
     public static String TraceControl_NewNodeHostNameLabel;
     public static String TraceControl_NewNodeHostNameTooltip;
     public static String TraceControl_AlreadyExistsError;
-    
+
     public static String TraceControl_CreateSessionDialogTitle;
     public static String TraceControl_CreateSessionNameLabel;
     public static String TraceControl_CreateSessionNameTooltip;
@@ -102,7 +103,7 @@ final public class Messages extends NLS {
     public static String TraceControl_SessionPathAlreadyExistsError;
     public static String TraceControl_InvalidSessionPathError;
     public static String TraceControl_FileSubSystemError;
-    
+
     public static String TraceControl_EnableChannelDialogTitle;
     public static String TraceControl_EnableChannelNameLabel;
     public static String TraceControl_EnableChannelNameTooltip;
@@ -116,10 +117,10 @@ final public class Messages extends NLS {
     public static String TraceControl_EnableChannelDiscardModeTooltip;
     public static String TraceControl_EnableChannelOverwriteModeLabel;
     public static String TraceControl_EnableChannelOverwriteModeTooltip;
-    
+
     public static String TraceControl_InvalidChannelNameError;
     public static String TraceControl_ChannelAlreadyExistsError;
-    
+
     public static String TraceControl_EnableEventsDialogTitle;
     public static String TraceControl_EnableEventsSessionGroupName;
     public static String TraceControl_EnableEventsChannelGroupName;
@@ -142,7 +143,7 @@ final public class Messages extends NLS {
     public static String TraceControl_EnableEventsFucntionGroupName;
     public static String TraceControl_EnableEventsFunctionEventNameTooltip;
     public static String TraceControl_EnableEventsFunctionNameLabel;
-    
+
     public static String TraceControl_EnableEventsWildcardGroupName;
     public static String TraceControl_EnableEventsWildcardLabel;
     public static String TraceControl_EnableEventsWildcardTooltip;
@@ -158,12 +159,12 @@ final public class Messages extends NLS {
     public static String TraceControl_InvalidWildcardError;
     public static String TraceControl_InvalidLogLevelEventNameError;
     public static String TraceControl_InvalidLogLevel;
-    
+
     public static String TraceControl_AddContextDialogTitle;
     public static String TraceControl_AddContextAvailableContextsLabel;
     public static String TraceControl_AddContextAvailableContextsTooltip;
     public static String TraceControl_AddContextAllLabel;
-    
+
     public static String TraceControl_ImportDialogTitle;
     public static String TraceControl_ImportDialogTracesGroupName;
     public static String TraceControl_ImportDialogTracesTooltip;
@@ -181,7 +182,7 @@ final public class Messages extends NLS {
     public static String TraceControl_ImportDialogConfirmationNewNameLabel;
     public static String TraceControl_InvalidTraceNameError;
     public static String TraceControl_ImportDialogTraceAlreadyExistError;
-    
+
     // Tree structure strings
     public static String TraceControl_KernelDomainDisplayName;
     public static String TraceControl_UstDisplayName;
@@ -193,7 +194,7 @@ final public class Messages extends NLS {
     public static String TraceControl_EventDisplayName;
     public static String TraceControl_ProviderDisplayName;
     public static String TraceControl_KernelProviderDisplayName;
-    
+
     // Property names
     public static String TraceControl_SessionNamePropertyName;
     public static String TraceControl_EventNamePropertyName;
@@ -216,19 +217,19 @@ final public class Messages extends NLS {
     public static String TraceControl_ProbeAddressPropertyName;
     public static String TraceControl_ProbeOffsetPropertyName;
     public static String TraceControl_ProbeSymbolPropertyName;
-    
+
     // Preferences
     public static String TraceControl_TracingGroupPreference;
     public static String TraceControl_LoggingPreference;
     public static String TraceControl_LogfilePath;
     public static String TraceControl_AppendLogfilePreference;
-     
+
     public static String TraceControl_VerboseLevelsPreference;
     public static String TraceControl_VerboseLevelNonePreference;
     public static String TraceControl_VerboseLevelVerbosePreference;
     public static String TraceControl_VerboseLevelVeryVerbosePreference;
     public static String TraceControl_VerboseLevelVeryVeryVerbosePreference;
-    
+
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
index 1ce4d6816f97023ea104121c17da3a403babfd1a..284552862030541b502e67117924188c5bf20c5e 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
  **********************************************************************/
 
@@ -25,11 +25,11 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the Kernel provider component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class KernelProviderComponent extends TraceControlComponent {
-    
+
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
@@ -41,12 +41,12 @@ public class KernelProviderComponent extends TraceControlComponent {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
      */
@@ -55,17 +55,17 @@ public class KernelProviderComponent extends TraceControlComponent {
         setToolTip(Messages.TraceControl_ProviderDisplayName);
         setImage(KERNEL_PROVIDER_ICON_FILE);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
     /**
-     * Sets the events information for this component. 
-     * @param eventInfos - events information to set. 
+     * Sets the events information for this component.
+     * @param eventInfos - events information to set.
      */
     public void setEventInfo(List<IBaseEventInfo> eventInfos) {
         for (Iterator<IBaseEventInfo> iterator = eventInfos.iterator(); iterator.hasNext();) {
-            IBaseEventInfo baseEventInfo = (IBaseEventInfo) iterator.next();
+            IBaseEventInfo baseEventInfo = iterator.next();
             BaseEventComponent component = new BaseEventComponent(baseEventInfo.getName(), this);
             component.setEventInfo(baseEventInfo);
             addChild(component);
@@ -83,10 +83,10 @@ public class KernelProviderComponent extends TraceControlComponent {
             return new KernelProviderPropertySource(this);
         }
         return null;
-    } 
+    }
 
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
 }
index 1a48147f74b5678c8e809f1ec88a65414d9e5307..a5d1a0018f8e4d9904a2dd0caab34c311982220b 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.model.impl;
@@ -41,7 +41,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace node component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TargetNodeComponent extends TraceControlComponent implements ICommunicationsListener {
@@ -90,7 +90,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component
      * @param parent - the parent of the component
      * @param host - the host connection implementation
@@ -106,7 +106,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     }
 
     /**
-     * Constructor (using default proxy) 
+     * Constructor (using default proxy)
      * @param name - the name of the component
      * @param parent - the parent of the component
      * @param host - the host connection implementation
@@ -129,7 +129,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
         }
         return fDisconnectedImage;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getTargetNodeState()
@@ -138,7 +138,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     public TargetNodeState getTargetNodeState() {
         return fState;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#setTargetNodeState(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent.TargetNodeState)
@@ -148,7 +148,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
         fState = state;
         fireComponentChanged(TargetNodeComponent.this);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getControlService()
@@ -164,7 +164,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
      */
     @Override
     public void setControlService(ILttngControlService service) {
-        fService = (ILttngControlService)service;
+        fService = service;
     }
 
     /*
@@ -178,8 +178,8 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
             return new TargetNodePropertySource(this);
         }
         return null;
-    } 
-    
+    }
+
     /**
      * @return remote host name
      */
@@ -200,17 +200,17 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     public TraceSessionComponent[] getSessions() {
         List<ITraceControlComponent> compenents = getChildren(TraceSessionGroup.class);
         if (compenents.size() > 0) {
-            TraceSessionGroup group = (TraceSessionGroup)compenents.get(0); 
+            TraceSessionGroup group = (TraceSessionGroup)compenents.get(0);
             List<ITraceControlComponent> sessions = group.getChildren(TraceSessionComponent.class);
-            return (TraceSessionComponent[])sessions.toArray(new TraceSessionComponent[sessions.size()]);
+            return sessions.toArray(new TraceSessionComponent[sessions.size()]);
         }
         return new TraceSessionComponent[0];
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
    /*
     * @see org.eclipse.rse.core.subsystems.ICommunicationsListener#communicationsStateChange(org.eclipse.rse.core.subsystems.CommunicationsEvent)
     */
@@ -277,16 +277,14 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
             } catch (Exception e) {
                 Activator.getDefault().logError(Messages.TraceControl_DisconnectionFailure + " (" + getName() + "). \n", e); //$NON-NLS-1$ //$NON-NLS-2$
             } finally {
-                handleDisconnected();                    
+                handleDisconnected();
             }
         }
     }
 
     /**
-     * Retrieves the trace configuration from the target node and populates the information
-     * in the tree model. The execution is done in a own job.
-     * 
-     * @throws ExecutionException
+     * Retrieves the trace configuration from the target node and populates the
+     * information in the tree model. The execution is done in a own job.
      */
     public void getConfigurationFromNode() {
         Job job = new Job(Messages.TraceControl_RetrieveNodeConfigurationJob) {
@@ -298,15 +296,15 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
                     TraceProviderGroup providerGroup = new TraceProviderGroup(Messages.TraceControl_ProviderDisplayName, TargetNodeComponent.this);
                     addChild(providerGroup);
                     providerGroup.getProviderFromNode(monitor);
-                    
+
                     // Get session information from node
                     TraceSessionGroup sessionGroup = new TraceSessionGroup(Messages.TraceControl_AllSessionsDisplayName, TargetNodeComponent.this);
                     addChild(sessionGroup);
                     sessionGroup.getSessionsFromNode(monitor);
                 } catch (ExecutionException e) {
                     removeAllChildren();
-                    return new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e);
-                } 
+                    return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ListSessionFailure, e);
+                }
 
                 return Status.OK_STATUS;
             }
@@ -322,7 +320,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
         removeAllChildren();
         getConfigurationFromNode();
     }
-    
+
     /**
      * Deregisters host from registry.
      */
@@ -348,7 +346,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     }
 
     /**
-     * Handles the connected event. 
+     * Handles the connected event.
      */
     private void handleConnected() {
         setTargetNodeState(TargetNodeState.CONNECTED);
@@ -361,7 +359,7 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
     }
 
     /**
-     * Handles the disconnected event. 
+     * Handles the disconnected event.
      */
     private void handleDisconnected() {
         removeAllChildren();
index c82f08afcd67af2a54fcea5b06ea643817345bff..57ad4c3315d45b7f3786354bcca5305b2d8bd4aa 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.model.impl;
@@ -36,7 +36,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace channel component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceChannelComponent extends TraceControlComponent {
@@ -51,7 +51,7 @@ public class TraceChannelComponent extends TraceControlComponent {
      * Path to icon file for this component (state disabled).
      */
     public static final String TRACE_CHANNEL_ICON_FILE_DISABLED = "icons/obj16/channel_disabled.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -63,12 +63,12 @@ public class TraceChannelComponent extends TraceControlComponent {
      * The image to be displayed in disabled state.
      */
     private Image fDisabledImage = null;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
      */
@@ -79,7 +79,7 @@ public class TraceChannelComponent extends TraceControlComponent {
         fChannelInfo = new ChannelInfo(name);
         fDisabledImage = Activator.getDefault().loadIcon(TRACE_CHANNEL_ICON_FILE_DISABLED);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -97,7 +97,9 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Sets the channel information.
+     *
      * @param channelInfo
+     *            The channel info to assign to this component
      */
     public void setChannelInfo(IChannelInfo channelInfo) {
         fChannelInfo = channelInfo;
@@ -176,7 +178,7 @@ public class TraceChannelComponent extends TraceControlComponent {
      * @return the read timer interval.
      */
     public long getReadTimer() {
-        return fChannelInfo.getReadTimer(); 
+        return fChannelInfo.getReadTimer();
     }
     /**
      * Sets the read timer interval to the given value.
@@ -229,20 +231,20 @@ public class TraceChannelComponent extends TraceControlComponent {
             return new TraceChannelPropertySource(this);
         }
         return null;
-    } 
+    }
 
     /**
      * @return session name from parent
      */
     public String getSessionName() {
-       return ((TraceDomainComponent)getParent()).getSessionName(); 
+       return ((TraceDomainComponent)getParent()).getSessionName();
     }
 
     /**
      * @return session from parent
      */
     public TraceSessionComponent getSession() {
-       return ((TraceDomainComponent)getParent()).getSession(); 
+       return ((TraceDomainComponent)getParent()).getSession();
     }
 
     /**
@@ -251,21 +253,24 @@ public class TraceChannelComponent extends TraceControlComponent {
     public boolean isKernel() {
         return ((TraceDomainComponent)getParent()).isKernel();
     }
-    
+
     /**
      * @return the parent target node
      */
     public TargetNodeComponent getTargetNode() {
         return ((TraceDomainComponent)getParent()).getTargetNode();
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableEvents(List<String> eventNames) throws ExecutionException {
         enableEvents(eventNames, new NullProgressMonitor());
@@ -273,17 +278,23 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
-     * @param monitor - a progress monitor
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableEvents(List<String> eventNames, IProgressMonitor monitor) throws ExecutionException {
         getControlService().enableEvents(getSessionName(), getName(), eventNames, isKernel(), monitor);
     }
-    
+
     /**
      * Enables all syscalls (for kernel domain)
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableSyscalls() throws ExecutionException {
         enableSyscalls(new NullProgressMonitor());
@@ -291,8 +302,11 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Enables all syscalls (for kernel domain)
-     * @param monitor - a progress monitor
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException {
         getControlService().enableSyscalls(getSessionName(), getName(), monitor);
@@ -300,54 +314,84 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false
-     * @param probe - the actual probe
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String eventName, boolean isFunction, String probe) throws ExecutionException {
+    public void enableProbe(String eventName, boolean isFunction, String probe)
+            throws ExecutionException {
         enableProbe(eventName, isFunction, probe, new NullProgressMonitor());
     }
 
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false 
-     * @param probe - the actual probe
-     * @param monitor - a progress monitor
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
+    public void enableProbe(String eventName, boolean isFunction, String probe,
+            IProgressMonitor monitor) throws ExecutionException {
         getControlService().enableProbe(getSessionName(), getName(), eventName, isFunction, probe, monitor);
     }
 
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level) throws ExecutionException {
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level) throws ExecutionException {
         enableLogLevel(eventName, logLevelType, level, new NullProgressMonitor());
     }
 
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
-     * @param monitor - a progress monitor  
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException {
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level, IProgressMonitor monitor)
+            throws ExecutionException {
         getControlService().enableLogLevel(getSessionName(), getName(), eventName, logLevelType, level, monitor);
     }
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
      * @throws ExecutionException
+     *             If the command fails
      */
     public void disableEvent(List<String> eventNames) throws ExecutionException {
         disableEvent(eventNames, new NullProgressMonitor());
@@ -355,18 +399,27 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
-     * @param monitor - a progress monitor
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void disableEvent(List<String> eventNames, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().disableEvent(getParent().getParent().getName(), getName(), eventNames, isKernel(), monitor);
+    public void disableEvent(List<String> eventNames, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().disableEvent(getParent().getParent().getName(),
+                getName(), eventNames, isKernel(), monitor);
     }
-    
+
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
+     *
+     * @param contexts
+     *            - a list of contexts to add
      * @throws ExecutionException
+     *             If the command fails
      */
     public void addContexts(List<String> contexts) throws ExecutionException {
         addContexts(contexts, new NullProgressMonitor());
@@ -374,11 +427,17 @@ public class TraceChannelComponent extends TraceControlComponent {
 
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
-     * @param monitor - a progress monitor
+     *
+     * @param contexts
+     *            - a list of contexts to add
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void addContexts(List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().addContexts(getSessionName(), getName(), null, isKernel(), contexts, monitor);
+    public void addContexts(List<String> contexts, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().addContexts(getSessionName(), getName(), null,
+                isKernel(), contexts, monitor);
     }
 }
index 2852dd9158d77096072eb8d3f2b9ad3734338c3b..efbd56e4401fe2c71948fce9456f5e581f3d53ff 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.model.impl;
@@ -27,7 +27,7 @@ import org.eclipse.swt.graphics.Image;
  * <p>
  * Base implementation for trace control component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceControlComponent implements ITraceControlComponent {
@@ -58,16 +58,16 @@ public class TraceControlComponent implements ITraceControlComponent {
     /**
      * The list if children components.
      */
-    private List<ITraceControlComponent> fChildren = new ArrayList<ITraceControlComponent>();
+    private final List<ITraceControlComponent> fChildren = new ArrayList<ITraceControlComponent>();
     /**
      * The list of listeners to be notified about changes.
      */
-    private ListenerList fListeners = new ListenerList();
+    private final ListenerList fListeners = new ListenerList();
 
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
-    
+
     /**
      * Constructor
      * @param name - the name of the component.
@@ -75,7 +75,7 @@ public class TraceControlComponent implements ITraceControlComponent {
     public TraceControlComponent(String name) {
         this(name, null);
     }
-    
+
     /**
      * Constructor
      * @param name - the name of the component.
@@ -85,7 +85,7 @@ public class TraceControlComponent implements ITraceControlComponent {
         fName = name;
         fParent = parent;
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -113,7 +113,7 @@ public class TraceControlComponent implements ITraceControlComponent {
      */
     @Override
     public Image getImage() {
-        return fImage; 
+        return fImage;
     }
 
     /*
@@ -133,7 +133,7 @@ public class TraceControlComponent implements ITraceControlComponent {
     public void setImage(Image image) {
         fImage = image;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent#getToolTip()
@@ -151,19 +151,19 @@ public class TraceControlComponent implements ITraceControlComponent {
     public void setToolTip(String toolTip) {
         fToolTip = toolTip;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent#getTargetNodeState()
      */
-    @Override    
+    @Override
     public TargetNodeState getTargetNodeState() {
         if (getParent() != null) {
             return getParent().getTargetNodeState();
         }
         return TargetNodeState.DISCONNECTED;
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent#setTargetNodeState(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent.TargetNodeState)
@@ -199,7 +199,7 @@ public class TraceControlComponent implements ITraceControlComponent {
      */
     @Override
     public ITraceControlComponent[] getChildren() {
-        return (ITraceControlComponent [])fChildren.toArray(new ITraceControlComponent[fChildren.size()]);
+        return fChildren.toArray(new ITraceControlComponent[fChildren.size()]);
     }
 
     /*
@@ -208,7 +208,7 @@ public class TraceControlComponent implements ITraceControlComponent {
     @Override
     public void setChildren(List<ITraceControlComponent> children) {
         for (Iterator<ITraceControlComponent> iterator = children.iterator(); iterator.hasNext();) {
-            ITraceControlComponent traceControlComponent = (ITraceControlComponent) iterator.next();
+            ITraceControlComponent traceControlComponent = iterator.next();
             fChildren.add(traceControlComponent);
             fireComponentChanged(this);
         }
@@ -238,7 +238,7 @@ public class TraceControlComponent implements ITraceControlComponent {
        List<ITraceControlComponent> list = new ArrayList<ITraceControlComponent>();
 
        for (Iterator<ITraceControlComponent> iterator = fChildren.iterator(); iterator.hasNext();) {
-           ITraceControlComponent child = (ITraceControlComponent) iterator.next();
+           ITraceControlComponent child = iterator.next();
            if (child.getClass() == clazz) {
                list.add(child);
            }
@@ -313,7 +313,7 @@ public class TraceControlComponent implements ITraceControlComponent {
     @Override
     public void removeAllChildren() {
         for (Iterator<ITraceControlComponent> iterator = fChildren.iterator(); iterator.hasNext();) {
-            ITraceControlComponent child = (ITraceControlComponent) iterator.next();
+            ITraceControlComponent child = iterator.next();
             child.removeAllChildren();
         }
         fChildren.clear();
@@ -351,9 +351,9 @@ public class TraceControlComponent implements ITraceControlComponent {
      */
     @Override
     public void addComponentListener(ITraceControlComponentChangedListener listener) {
-        if (fParent != null)
+        if (fParent != null) {
             fParent.addComponentListener(listener);
-        else {
+        else {
             fListeners.add(listener);
         }
     }
@@ -364,9 +364,9 @@ public class TraceControlComponent implements ITraceControlComponent {
      */
     @Override
     public void removeComponentListener(ITraceControlComponentChangedListener listener) {
-        if (fParent != null)
+        if (fParent != null) {
             fParent.removeComponentListener(listener);
-        else {
+        else {
             fListeners.remove(listener);
         }
     }
@@ -412,7 +412,7 @@ public class TraceControlComponent implements ITraceControlComponent {
             }
         }
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent#fireCompenentChanged(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent)
index bed409ec7cf4ee96d36e7af2d1ac8e1a559fda07..fbb9231bb1050e5272af10402ff9ece3b85931ae 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.model.impl;
@@ -30,7 +30,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace domain component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceDomainComponent extends TraceControlComponent {
@@ -54,7 +54,7 @@ public class TraceDomainComponent extends TraceControlComponent {
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
      */
@@ -94,19 +94,19 @@ public class TraceDomainComponent extends TraceControlComponent {
         }
         return null;
     }
-    
+
     /**
      * @return session name from parent
      */
     public String getSessionName() {
         return ((TraceSessionComponent)getParent()).getName();
     }
-    
+
     /**
      * @return session from parent
      */
     public TraceSessionComponent getSession() {
-       return (TraceSessionComponent)getParent(); 
+       return (TraceSessionComponent)getParent();
     }
 
     /**
@@ -115,23 +115,23 @@ public class TraceDomainComponent extends TraceControlComponent {
     public boolean isKernel() {
         return fDomainInfo.isKernel();
     }
-    
+
     /**
-     * Sets whether domain is  Kernel domain or UST 
+     * Sets whether domain is  Kernel domain or UST
      * @param isKernel true for kernel, false for UST
      */
     public void setIsKernel(boolean isKernel) {
         fDomainInfo.setIsKernel(isKernel);
     }
-    
+
     /**
      * @return returns all available channels for this domain.
      */
     public TraceChannelComponent[] getChannels() {
         List<ITraceControlComponent> channels = getChildren(TraceChannelComponent.class);
-        return (TraceChannelComponent[])channels.toArray(new TraceChannelComponent[channels.size()]);
+        return channels.toArray(new TraceChannelComponent[channels.size()]);
     }
-    
+
     /**
      * @return the parent target node
      */
@@ -142,141 +142,220 @@ public class TraceDomainComponent extends TraceControlComponent {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+
     /**
-     * Retrieves the session configuration from the node. 
+     * Retrieves the session configuration from the node.
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void getConfigurationFromNode() throws ExecutionException {
         getConfigurationFromNode(new NullProgressMonitor());
     }
+
     /**
-     * Retrieves the session configuration from the node. 
-     * @param monitor - a progress monitor
+     * Retrieves the session configuration from the node.
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
     public void getConfigurationFromNode(IProgressMonitor monitor) throws ExecutionException {
         TraceSessionComponent session = (TraceSessionComponent) getParent();
         session.getConfigurationFromNode(monitor);
     }
+
     /**
-     * Enables channels with given names which are part of this domain. If a given channel 
-     * doesn't exists it creates a new channel with the given parameters (or default values 
-     * if given parameter is null). 
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param info - channel information to set for the channel (use null for default)
+     * Enables channels with given names which are part of this domain. If a
+     * given channel doesn't exists it creates a new channel with the given
+     * parameters (or default values if given parameter is null).
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param info
+     *            - channel information to set for the channel (use null for
+     *            default)
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableChannels(List<String> channelNames, IChannelInfo info) throws ExecutionException {
         enableChannels(channelNames, info, new NullProgressMonitor());
     }
+
     /**
-     * Enables channels with given names which are part of this domain. If a given channel 
-     * doesn't exists it creates a new channel with the given parameters (or default values 
-     * if given parameter is null). 
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param info - channel information to set for the channel (use null for default)
-     * @param monitor - a progress monitor
+     * Enables channels with given names which are part of this domain. If a
+     * given channel doesn't exists it creates a new channel with the given
+     * parameters (or default values if given parameter is null).
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param info
+     *            - channel information to set for the channel (use null for
+     *            default)
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableChannels(List<String> channelNames, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableChannels(getParent().getName(), channelNames, isKernel(), info, monitor);
+    public void enableChannels(List<String> channelNames, IChannelInfo info,
+            IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableChannels(getParent().getName(), channelNames,
+                isKernel(), info, monitor);
     }
+
     /**
-     * Disables channels with given names which are part of this domain. 
-     * @param channelNames - a list of channel names to enable on this domain
+     * Disables channels with given names which are part of this domain.
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void disableChannels(List<String> channelNames) throws ExecutionException {
+    public void disableChannels(List<String> channelNames)
+            throws ExecutionException {
         disableChannels(channelNames, new NullProgressMonitor());
     }
+
     /**
-     * Disables channels with given names which are part of this domain. 
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param monitor - a progress monitor
+     * Disables channels with given names which are part of this domain.
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void disableChannels(List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().disableChannels(getParent().getName(), channelNames, isKernel(), monitor);
+    public void disableChannels(List<String> channelNames,
+            IProgressMonitor monitor) throws ExecutionException {
+        getControlService().disableChannels(getParent().getName(),
+                channelNames, isKernel(), monitor);
     }
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
-     * @param monitor - a progress monitor
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableEvents(List<String> eventNames, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableEvents(getSessionName(), null, eventNames, isKernel(), monitor);
+    public void enableEvents(List<String> eventNames, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().enableEvents(getSessionName(), null, eventNames,
+                isKernel(), monitor);
     }
 
     /**
      * Enables all syscalls (for kernel domain)
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
-   public void enableSyscalls() throws ExecutionException {
+    public void enableSyscalls() throws ExecutionException {
         enableSyscalls(new NullProgressMonitor());
     }
 
-   /**
-    * Enables all syscalls (for kernel domain)
-    * @param monitor - a progress monitor
-    * @throws ExecutionException
-    */
+    /**
+     * Enables all syscalls (for kernel domain)
+     *
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
 
-    public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException {
+    public void enableSyscalls(IProgressMonitor monitor)
+            throws ExecutionException {
         getControlService().enableSyscalls(getSessionName(), null, monitor);
     }
 
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false
-      * @param probe - the actual probe
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String eventName, boolean isFunction, String probe) throws ExecutionException {
+    public void enableProbe(String eventName, boolean isFunction, String probe)
+            throws ExecutionException {
         enableProbe(eventName, isFunction, probe, new NullProgressMonitor());
     }
-    
+
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false
-     * @param probe - the actual probe
-     * @param monitor - a progress monitor
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableProbe(getSessionName(), null, eventName, isFunction, probe, monitor);
+    public void enableProbe(String eventName, boolean isFunction, String probe,
+            IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableProbe(getSessionName(), null, eventName,
+                isFunction, probe, monitor);
     }
 
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level) throws ExecutionException {
-        enableLogLevel(eventName, logLevelType, level, new NullProgressMonitor());
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level) throws ExecutionException {
+        enableLogLevel(eventName, logLevelType, level,
+                new NullProgressMonitor());
     }
 
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
-     * @param monitor - a progress monitor  
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableLogLevel(getSessionName(), null, eventName, logLevelType, level, monitor);
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().enableLogLevel(getSessionName(), null, eventName,
+                logLevelType, level, monitor);
     }
 
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
+     *
+     * @param contexts
+     *            - a list of contexts to add
      * @throws ExecutionException
+     *             If the command fails
      */
     public void addContexts(List<String> contexts) throws ExecutionException {
         addContexts(contexts, new NullProgressMonitor());
@@ -284,17 +363,25 @@ public class TraceDomainComponent extends TraceControlComponent {
 
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
-     * @param monitor - a progress monitor
+     *
+     * @param contexts
+     *            - a list of contexts to add
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void addContexts(List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().addContexts(getSessionName(), null, null, isKernel(), contexts, monitor);
+    public void addContexts(List<String> contexts, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().addContexts(getSessionName(), null, null,
+                isKernel(), contexts, monitor);
     }
 
     /**
      * Executes calibrate command to quantify LTTng overhead.
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void calibrate() throws ExecutionException {
         calibrate(new NullProgressMonitor());
@@ -302,8 +389,11 @@ public class TraceDomainComponent extends TraceControlComponent {
 
     /**
      * Executes calibrate command to quantify LTTng overhead.
-     * @param monitor - a progress monitor
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
     public void calibrate(IProgressMonitor monitor) throws ExecutionException {
         getControlService().calibrate(isKernel(), monitor);
index 3a066b0229d1960e27fcc168117301c9f0995a53..ffea65de4924ebbd19841eaa642c2a3880a6db70 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.model.impl;
@@ -33,7 +33,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace channel component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceEventComponent extends TraceControlComponent {
@@ -48,7 +48,7 @@ public class TraceEventComponent extends TraceControlComponent {
      * Path to icon file for this component (disabled state).
      */
     public static final String TRACE_EVENT_ICON_FILE_DISABLED = "icons/obj16/event_disabled.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -60,15 +60,15 @@ public class TraceEventComponent extends TraceControlComponent {
      * The image to be displayed when in disabled state.
      */
     private Image fDisabledImage = null;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public TraceEventComponent(String name, ITraceControlComponent parent) {
         super(name, parent);
         setImage(TRACE_EVENT_ICON_FILE_ENABLED);
@@ -76,7 +76,7 @@ public class TraceEventComponent extends TraceControlComponent {
         fEventInfo = new EventInfo(name);
         fDisabledImage = Activator.getDefault().loadIcon(TRACE_EVENT_ICON_FILE_DISABLED);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -91,7 +91,7 @@ public class TraceEventComponent extends TraceControlComponent {
         }
         return super.getImage();
     }
-    
+
     /**
      * Sets the event information.
      * @param eventInfo - the event information to set.
@@ -99,25 +99,25 @@ public class TraceEventComponent extends TraceControlComponent {
     public void setEventInfo(IEventInfo eventInfo) {
         fEventInfo = eventInfo;
     }
-    
+
     /**
      * @return the trace event type
      */
     public TraceEventType getEventType() {
         return fEventInfo.getEventType();
     }
-    
+
     /**
-     * Sets the trace event type to the given type 
+     * Sets the trace event type to the given type
      * @param type - type to set
      */
     public void setEventType(TraceEventType type) {
         fEventInfo.setEventType(type);
     }
-    
+
     /**
      * Sets the trace event type to the type specified by the given name.
-     * @param type - event type name
+     * @param typeName - event type name
      */
     public void setEventType(String typeName) {
         fEventInfo.setEventType(typeName);
@@ -129,7 +129,7 @@ public class TraceEventComponent extends TraceControlComponent {
     public TraceEnablement getState() {
         return fEventInfo.getState();
     }
-    
+
     /**
      * Sets the event state (enablement) to the given value.
      * @param state - state to set.
@@ -137,7 +137,7 @@ public class TraceEventComponent extends TraceControlComponent {
     public void setState(TraceEnablement state) {
         fEventInfo.setState(state);
     }
-    
+
     /**
      * Sets the event state (enablement) to the value specified by the given name.
      * @param stateName - state to set.
@@ -152,15 +152,15 @@ public class TraceEventComponent extends TraceControlComponent {
     public TraceLogLevel getLogLevel() {
         return fEventInfo.getLogLevel();
     }
-    
+
     /**
-     * Sets the trace event log level to the given level 
+     * Sets the trace event log level to the given level
      * @param level - event log level to set
      */
     public void setLogLevel(TraceLogLevel level) {
         fEventInfo.setLogLevel(level);
     }
-    
+
     /**
      * Sets the trace event log level to the level specified by the given name.
      * @param levelName - event log level name
@@ -168,7 +168,7 @@ public class TraceEventComponent extends TraceControlComponent {
     public void setLogLevel(String levelName) {
         fEventInfo.setLogLevel(levelName);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
@@ -180,27 +180,27 @@ public class TraceEventComponent extends TraceControlComponent {
             return new TraceEventPropertySource(this);
         }
         return null;
-    } 
-    
+    }
+
     /**
      * @return session name from parent
      */
     public String getSessionName() {
-       return ((TraceChannelComponent)getParent()).getSessionName(); 
+       return ((TraceChannelComponent)getParent()).getSessionName();
     }
 
     /**
      * @return session from parent
      */
     public TraceSessionComponent getSession() {
-       return ((TraceChannelComponent)getParent()).getSession(); 
+       return ((TraceChannelComponent)getParent()).getSession();
     }
 
     /**
      * @return channel name from parent
      */
     public String getChannelName() {
-        return getParent().getName(); 
+        return getParent().getName();
     }
 
     /**
@@ -213,11 +213,14 @@ public class TraceEventComponent extends TraceControlComponent {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
+     *
+     * @param contexts
+     *            - a list of contexts to add
      * @throws ExecutionException
+     *             If the command fails
      */
     public void addContexts(List<String> contexts) throws ExecutionException {
         addContexts(contexts, new NullProgressMonitor());
@@ -225,11 +228,17 @@ public class TraceEventComponent extends TraceControlComponent {
 
     /**
      * Add contexts to given channels and or events
-     * @param contexts - a list of contexts to add
-     * @param monitor - a progress monitor
+     *
+     * @param contexts
+     *            - a list of contexts to add
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void addContexts(List<String> contexts, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().addContexts(getSessionName(),getChannelName(), getName(), isKernel(), contexts, monitor);
+    public void addContexts(List<String> contexts, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().addContexts(getSessionName(), getChannelName(),
+                getName(), isKernel(), contexts, monitor);
     }
 }
index 37c8a6d070bb84c2857f37433d1f47331b15480f..f4ee55feb8661029b2572555f6290183c8c437b7 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.model.impl;
@@ -26,7 +26,7 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceContr
  * <p>
  * Implementation of the trace provider group.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceProviderGroup extends TraceControlComponent {
@@ -37,24 +37,24 @@ public class TraceProviderGroup extends TraceControlComponent {
      * Path to icon file for this component.
      */
     public static final String TRACE_PROVIDERS_ICON_FILE = "icons/obj16/providers.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public TraceProviderGroup(String name, ITraceControlComponent parent) {
         super(name, parent);
         setImage(TRACE_PROVIDERS_ICON_FILE);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -62,10 +62,10 @@ public class TraceProviderGroup extends TraceControlComponent {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /**
      * Gets the provider information from the target node.
-     * @throws ExecutionException
+     * @throws ExecutionException If the command fails
      */
     public void getProviderFromNode() throws ExecutionException {
         getProviderFromNode(new NullProgressMonitor());
@@ -74,19 +74,19 @@ public class TraceProviderGroup extends TraceControlComponent {
     /**
      * Gets the provider information from the target node.
      * @param monitor - a progress monitor
-     * @throws ExecutionException
+     * @throws ExecutionException If the command fails
      */
     public void getProviderFromNode(IProgressMonitor monitor) throws ExecutionException {
-        
+
         List<IBaseEventInfo> eventInfos = getControlService().getKernelProvider(monitor);
         KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this);
         addChild(component);
         component.setEventInfo(eventInfos);
-        
+
         List<IUstProviderInfo> allProviders = getControlService().getUstProvider(monitor);
-        
+
         for (Iterator<IUstProviderInfo> iterator = allProviders.iterator(); iterator.hasNext();) {
-            IUstProviderInfo ustProviderInfo = (IUstProviderInfo) iterator.next();
+            IUstProviderInfo ustProviderInfo = iterator.next();
             UstProviderComponent ustComponent = new UstProviderComponent(ustProviderInfo.getName(), this);
             addChild(ustComponent);
             ustComponent.setUstProvider(ustProviderInfo);
index b641127dc0a592e3f4f711c37b510d1cb857c78d..753faac1db76055845eae97e352a0093c860ee37 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.model.impl;
@@ -34,7 +34,7 @@ import org.eclipse.ui.views.properties.IPropertySource;
  * <p>
  * Implementation of the trace session component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceSessionComponent extends TraceControlComponent {
@@ -79,10 +79,10 @@ public class TraceSessionComponent extends TraceControlComponent {
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public TraceSessionComponent(String name, ITraceControlComponent parent) {
         super(name, parent);
         setImage(TRACE_SESSION_ICON_FILE_INACTIVE);
@@ -108,7 +108,7 @@ public class TraceSessionComponent extends TraceControlComponent {
         if (fSessionInfo.getSessionState() == TraceSessionState.INACTIVE) {
             return super.getImage();
         }
-        
+
         return fActiveImage;
     }
 
@@ -159,7 +159,7 @@ public class TraceSessionComponent extends TraceControlComponent {
 
     /**
      * Sets the path string (where session is located) to the given value.
-     * @param path - session path to set.
+     * @param sessionPath - session path to set.
      */
     public void setSessionPath(String sessionPath) {
         fSessionInfo.setSessionPath(sessionPath);
@@ -176,135 +176,185 @@ public class TraceSessionComponent extends TraceControlComponent {
             return new TraceSessionPropertySource(this);
         }
         return null;
-    } 
+    }
 
     /**
      * @return all available domains of this session.
      */
     public TraceDomainComponent[] getDomains() {
         List<ITraceControlComponent> sessions = getChildren(TraceDomainComponent.class);
-        return (TraceDomainComponent[])sessions.toArray(new TraceDomainComponent[sessions.size()]);
+        return sessions.toArray(new TraceDomainComponent[sessions.size()]);
     }
-    
+
     /**
      * @return the parent target node
      */
     public TargetNodeComponent getTargetNode() {
         return ((TraceSessionGroup)getParent()).getTargetNode();
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+
     /**
-     * Retrieves the session configuration from the node. 
+     * Retrieves the session configuration from the node.
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void getConfigurationFromNode() throws ExecutionException {
         getConfigurationFromNode(new NullProgressMonitor());
     }
 
     /**
-     * Retrieves the session configuration from the node. 
-     * @param monitor - a progress monitor
+     * Retrieves the session configuration from the node.
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void getConfigurationFromNode(IProgressMonitor monitor) throws ExecutionException {
+    public void getConfigurationFromNode(IProgressMonitor monitor)
+            throws ExecutionException {
         removeAllChildren();
         fSessionInfo = getControlService().getSession(getName(), monitor);
         IDomainInfo[] domains = fSessionInfo.getDomains();
         for (int i = 0; i < domains.length; i++) {
-            TraceDomainComponent domainComponent = new TraceDomainComponent(domains[i].getName(), this);
+            TraceDomainComponent domainComponent = new TraceDomainComponent(
+                    domains[i].getName(), this);
             addChild(domainComponent);
             domainComponent.setDomainInfo(domains[i]);
         }
     }
-    
+
     /**
-     * Starts the session. 
-     * throws ExecutionExecption
+     * Starts the session.
+     *
+     * @throws ExecutionException
+     *             If the command fails
      */
     public void startSession() throws ExecutionException {
         startSession(new NullProgressMonitor());
     }
-    
+
     /**
      * Starts the session.
-     * @param monitor - a progress monitor
-     * throws ExecutionExecption
+     *
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public void startSession(IProgressMonitor monitor) throws ExecutionException {
+    public void startSession(IProgressMonitor monitor)
+            throws ExecutionException {
         getControlService().startSession(getName(), monitor);
     }
-    
+
     /**
-     * Starts the session. 
-     * throws ExecutionExecption
+     * Starts the session.
+     *
+     * @throws ExecutionException
+     *             If the command fails
      */
     public void stopSession() throws ExecutionException {
         startSession(new NullProgressMonitor());
     }
-    
+
     /**
      * Starts the session.
-     * @param monitor - a progress monitor
-     * throws ExecutionExecption
+     *
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
      */
     public void stopSession(IProgressMonitor monitor) throws ExecutionException {
         getControlService().stopSession(getName(), monitor);
     }
 
     /**
-     * Enables channels with given names which are part of this domain. If a given channel 
-     * doesn't exists it creates a new channel with the given parameters (or default values 
-     * if given parameter is null). 
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param info - channel information to set for the channel (use null for default)
-     * @param isKernel -  a flag for indicating kernel or UST.
+     * Enables channels with given names which are part of this domain. If a
+     * given channel doesn't exists it creates a new channel with the given
+     * parameters (or default values if given parameter is null).
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param info
+     *            - channel information to set for the channel (use null for
+     *            default)
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableChannels(List<String> channelNames, IChannelInfo info, boolean isKernel) throws ExecutionException {
+    public void enableChannels(List<String> channelNames, IChannelInfo info,
+            boolean isKernel) throws ExecutionException {
         enableChannels(channelNames, info, isKernel, new NullProgressMonitor());
     }
 
     /**
-     * Enables channels with given names which are part of this domain. If a given channel 
-     * doesn't exists it creates a new channel with the given parameters (or default values 
-     * if given parameter is null). 
-     * @param channelNames - a list of channel names to enable on this domain
-     * @param info - channel information to set for the channel (use null for default)
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     * Enables channels with given names which are part of this domain. If a
+     * given channel doesn't exists it creates a new channel with the given
+     * parameters (or default values if given parameter is null).
+     *
+     * @param channelNames
+     *            - a list of channel names to enable on this domain
+     * @param info
+     *            - channel information to set for the channel (use null for
+     *            default)
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableChannels(List<String> channelNames, IChannelInfo info, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableChannels(getName(), channelNames, isKernel, info, monitor);
+    public void enableChannels(List<String> channelNames, IChannelInfo info,
+            boolean isKernel, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().enableChannels(getName(), channelNames, isKernel,
+                info, monitor);
     }
-    
+
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
-     * @param isKernel -  a flag for indicating kernel or UST.
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableEvent(List<String> eventNames, boolean isKernel) throws ExecutionException {
+    public void enableEvent(List<String> eventNames, boolean isKernel)
+            throws ExecutionException {
         enableEvents(eventNames, isKernel, new NullProgressMonitor());
     }
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param eventNames - a list of event names to enabled.
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     *
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableEvents(List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableEvents(getName(), null, eventNames, isKernel, monitor);
+    public void enableEvents(List<String> eventNames, boolean isKernel,
+            IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableEvents(getName(), null, eventNames, isKernel,
+                monitor);
     }
 
     /**
      * Enables all syscalls (for kernel domain)
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void enableSyscalls() throws ExecutionException {
         enableSyscalls(new NullProgressMonitor());
@@ -312,62 +362,99 @@ public class TraceSessionComponent extends TraceControlComponent {
 
     /**
      * Enables all syscalls (for kernel domain)
-     * @param monitor - a progress monitor
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException {
+    public void enableSyscalls(IProgressMonitor monitor)
+            throws ExecutionException {
         getControlService().enableSyscalls(getName(), null, monitor);
     }
 
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false
-     * @param probe - the actual probe
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String eventName, boolean isFunction, String probe) throws ExecutionException {
+    public void enableProbe(String eventName, boolean isFunction, String probe)
+            throws ExecutionException {
         enableProbe(eventName, isFunction, probe, new NullProgressMonitor());
     }
-    
+
     /**
      * Enables a dynamic probe (for kernel domain)
-     * @param eventName - event name for probe
-     * @param isFunction - true for dynamic function entry/return probe else false
-     * @param probe - the actual probe
-     * @param monitor - a progress monitor
+     *
+     * @param eventName
+     *            - event name for probe
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - the actual probe
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-   public void enableProbe(String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableProbe(getName(), null, eventName, isFunction, probe, monitor);
+    public void enableProbe(String eventName, boolean isFunction, String probe,
+            IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableProbe(getName(), null, eventName, isFunction,
+                probe, monitor);
     }
-    
+
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level) throws ExecutionException {
-        enableLogLevel(eventName, logLevelType, level, new NullProgressMonitor());
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level) throws ExecutionException {
+        enableLogLevel(eventName, logLevelType, level,
+                new NullProgressMonitor());
     }
 
     /**
      * Enables events using log level.
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
-     * @param monitor - a progress monitor  
+     *
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableLogLevel(getName(), null, eventName, logLevelType, level, monitor);
+    public void enableLogLevel(String eventName, LogLevelType logLevelType,
+            TraceLogLevel level, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().enableLogLevel(getName(), null, eventName,
+                logLevelType, level, monitor);
     }
-    
+
     /**
      * Gets all available contexts to be added to channels/events.
+     *
      * @return the list of available contexts
+     * @throws ExecutionException
+     *             If the command fails
      */
     public List<String> getContextList() throws ExecutionException {
         return getContextList(new NullProgressMonitor());
@@ -375,10 +462,15 @@ public class TraceSessionComponent extends TraceControlComponent {
 
     /**
      * Gets all available contexts to be added to channels/events.
+     *
      * @param monitor
+     *            The monitor that will indicate the progress
      * @return the list of available contexts
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public List<String> getContextList(IProgressMonitor monitor) throws ExecutionException {
+    public List<String> getContextList(IProgressMonitor monitor)
+            throws ExecutionException {
         return getControlService().getContextList(monitor);
     }
 }
index 7f959bb6fd48f77c320a4073bdf3c6bb136628f4..87177ef3d589dbad535825ea2918a81ac5aab015 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.model.impl;
@@ -21,7 +21,7 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceContr
  * <p>
  * Implementation of the trace session group.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceSessionGroup extends TraceControlComponent {
@@ -30,21 +30,21 @@ public class TraceSessionGroup extends TraceControlComponent {
     // ------------------------------------------------------------------------
     /**
      * Path to icon file for this component.
-     */    
+     */
     public static final String TRACE_SESSIONS_ICON_FILE = "icons/obj16/sessions.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
-     */    
+     */
     public TraceSessionGroup(String name, ITraceControlComponent parent) {
         super(name, parent);
         setImage(TRACE_SESSIONS_ICON_FILE);
@@ -66,7 +66,9 @@ public class TraceSessionGroup extends TraceControlComponent {
     // ------------------------------------------------------------------------
     /**
      * Retrieves the sessions information from the node.
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void getSessionsFromNode() throws ExecutionException {
         getSessionsFromNode(new NullProgressMonitor());
@@ -74,62 +76,87 @@ public class TraceSessionGroup extends TraceControlComponent {
 
     /**
      * Retrieves the sessions information from the node.
-     * @param monitor - a progress monitor
+     *
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void getSessionsFromNode(IProgressMonitor monitor) throws ExecutionException {
+    public void getSessionsFromNode(IProgressMonitor monitor)
+            throws ExecutionException {
         String[] sessionNames = getControlService().getSessionNames(monitor);
         for (int i = 0; i < sessionNames.length; i++) {
-            TraceSessionComponent session = new TraceSessionComponent(sessionNames[i], this);
+            TraceSessionComponent session = new TraceSessionComponent(
+                    sessionNames[i], this);
             addChild(session);
             session.getConfigurationFromNode(monitor);
         }
     }
 
     /**
-     * Creates a session with given session name and location. 
-     * @param sessionName - a session name to create
-     * @param sessionPath - a path for storing the traces (use null for default)
-     * @return the session information
-     * throws ExecutionExecption
+     * Creates a session with given session name and location.
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param sessionPath
+     *            - a path for storing the traces (use null for default)
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath) throws ExecutionException {
+    public void createSession(String sessionName, String sessionPath)
+            throws ExecutionException {
         createSession(sessionName, sessionPath, new NullProgressMonitor());
     }
-    
+
     /**
-     * Creates a session with given session name and location. 
-     * @param sessionName - a session name to create
-     * @param sessionPath - a path for storing the traces (use null for default)
-     * @Param monitor - a progress monitor 
-     * @return the session information
-     * throws ExecutionExecption
+     * Creates a session with given session name and location.
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param sessionPath
+     *            - a path for storing the traces (use null for default)
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException {
-        ISessionInfo sessionInfo = getControlService().createSession(sessionName, sessionPath, monitor);
+    public void createSession(String sessionName, String sessionPath,
+            IProgressMonitor monitor) throws ExecutionException {
+        ISessionInfo sessionInfo = getControlService().createSession(
+                sessionName, sessionPath, monitor);
         if (sessionInfo != null) {
-            TraceSessionComponent session = new TraceSessionComponent(sessionInfo.getName(), TraceSessionGroup.this);
+            TraceSessionComponent session = new TraceSessionComponent(
+                    sessionInfo.getName(), TraceSessionGroup.this);
             addChild(session);
             session.getConfigurationFromNode(monitor);
         }
     }
 
     /**
-     * Destroys a session with given session name. 
-     * @param session - a session component to destroy
-     * throws ExecutionExecption
+     * Destroys a session with given session name.
+     *
+     * @param session
+     *            - a session component to destroy
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public void destroySession(TraceSessionComponent session) throws ExecutionException {
+    public void destroySession(TraceSessionComponent session)
+            throws ExecutionException {
         destroySession(session, new NullProgressMonitor());
     }
-    
+
     /**
-     * Destroys a session with given session name. 
-     * @param session - a session component to destroy
-     * @param monitor - a progress monitor
-     * throws ExecutionExecption
+     * Destroys a session with given session name.
+     *
+     * @param session
+     *            - a session component to destroy
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public void destroySession(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException {
+    public void destroySession(TraceSessionComponent session,
+            IProgressMonitor monitor) throws ExecutionException {
         getControlService().destroySession(session.getName(), monitor);
         session.removeAllChildren();
         removeChild(session);
index 3b90b16870d242919cfd09d7e5fca81bf594f6ba..130e690f12d4d50bf29617f0a77558d8da1113d4 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.preferences;
@@ -27,7 +27,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
  * <p>
  * Preference page implementation for configuring LTTng tracer control preferences.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ControlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
@@ -37,10 +37,14 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
     // ------------------------------------------------------------------------
     RadioGroupFieldEditor fVerboseLevel;
     BooleanFieldEditor  fIsAppend;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     */
     public ControlPreferencePage() {
         super(FieldEditorPreferencePage.GRID);
 
@@ -48,7 +52,7 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
         IPreferenceStore store = ControlPreferences.getInstance().getPreferenceStore();
         setPreferenceStore(store);
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -75,7 +79,7 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
 
         StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent());
         addField(logfile);
-        
+
         fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent());
         addField(fIsAppend);
 
@@ -89,15 +93,15 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
                         ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE,
                     },
                     {
-                        Messages.TraceControl_VerboseLevelVerbosePreference, 
+                        Messages.TraceControl_VerboseLevelVerbosePreference,
                         ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE
                     },
                     {
-                        Messages.TraceControl_VerboseLevelVeryVerbosePreference, 
+                        Messages.TraceControl_VerboseLevelVeryVerbosePreference,
                         ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE
                     },
                     {
-                        Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference, 
+                        Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference,
                         ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE
                     }
                 },
@@ -118,7 +122,7 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
      */
     @Override
     public void propertyChange(PropertyChangeEvent event) {
-        
+
         if (event.getProperty().equals(FieldEditor.VALUE)) {
             if (event.getSource() instanceof FieldEditor) {
                 FieldEditor editor = (FieldEditor) event.getSource();
@@ -131,7 +135,7 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
         }
         super.propertyChange(event);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performDefaults()
index 18f1dcb3d0401a8b0940fb1e8660082ea7c96e0e..05df09ed5e82083a876151c52315a9fdf118bc08 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.preferences;
@@ -20,7 +20,7 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.logging.ControlCo
  * <p>
  * Singleton class to access LTTng tracer control preferences.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class ControlPreferences {
@@ -105,7 +105,7 @@ public class ControlPreferences {
     // ------------------------------------------------------------------------
     /**
      * Returns the trace control preferences singleton instance
-     * 
+     *
      * @return the trace control preferences singleton instance
      */
     public synchronized static ControlPreferences getInstance() {
@@ -130,21 +130,21 @@ public class ControlPreferences {
     }
 
     /**
-     * @return value of tracing group preference 
+     * @return value of tracing group preference
      */
     public String getTracingGroup() {
         return fPreferenceStore.getString(TRACE_CONTROL_TRACING_GROUP_PREF);
     }
 
     /**
-     * @return whether is logging is enabled 
+     * @return whether is logging is enabled
      */
     public boolean isLoggingEnabled() {
         return fPreferenceStore.getBoolean(TRACE_CONTROL_LOG_COMMANDS_PREF);
     }
 
     /**
-     * @return whether an existing log file will appended or not  
+     * @return whether an existing log file will appended or not
      */
     public boolean isAppend() {
         return fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF);
@@ -156,30 +156,34 @@ public class ControlPreferences {
     public String getVerboseLevel() {
         return fPreferenceStore.getString(TRACE_CONTROL_VERBOSE_LEVEL_PREF);
     }
-    
+
     /**
      * @return absolute log file path
      */
     public String getLogfilePath() {
         return fPreferenceStore.getString(TRACE_CONTROL_LOG_FILE_PATH_PREF);
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
+
     /**
      * Initializes the control preferences (e.g. enable open log file)
+     *
+     * @param preferenceStore
+     *            The preference store to assign
      */
     public void init(IPreferenceStore preferenceStore) {
         fPreferenceStore = preferenceStore;
 
         if (fPreferenceStore.getBoolean(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF)) {
             ControlCommandLogger.init(getLogfilePath(), isAppend());
-        } 
+        }
     }
 
     /**
-     * Disposes any resource (e.g. close log file). 
+     * Disposes any resource (e.g. close log file).
      */
     public void dispose() {
         ControlCommandLogger.close();
index 2b3a9ab7bcea28e56a1f25631d76b679d284b752..77b8123124160822c9ed67f564709e6f93f458d9 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.property;
@@ -24,7 +24,7 @@ import org.eclipse.ui.views.properties.TextPropertyDescriptor;
  * <p>
  * Property source implementation for the base event component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class BaseEventPropertySource extends BasePropertySource {
@@ -46,7 +46,7 @@ public class BaseEventPropertySource extends BasePropertySource {
      */
     public static final String BASE_EVENT_LOGLEVEL_PROPERTY_ID = "base.event.loglevel"; //$NON-NLS-1$
     /**
-     *  The base event 'name' property name. 
+     *  The base event 'name' property name.
      */
     public static final String BASE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName;
     /**
@@ -57,15 +57,15 @@ public class BaseEventPropertySource extends BasePropertySource {
      * The base event 'log level' property name.
      */
     public static final String BASE_EVENT_LOGLEVEL_PROPERTY_NAME = Messages.TraceControl_LogLevelPropertyName;
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The base event component which this property source is for. 
+     * The base event component which this property source is for.
      */
     private final BaseEventComponent fBaseEvent;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -76,7 +76,7 @@ public class BaseEventPropertySource extends BasePropertySource {
     public BaseEventPropertySource(BaseEventComponent component) {
         fBaseEvent = component;
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -92,7 +92,7 @@ public class BaseEventPropertySource extends BasePropertySource {
         if (fBaseEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) {
             list.add(new TextPropertyDescriptor(BASE_EVENT_LOGLEVEL_PROPERTY_ID, BASE_EVENT_LOGLEVEL_PROPERTY_NAME));
         }
-        return (IPropertyDescriptor [])list.toArray(new IPropertyDescriptor[list.size()]);        
+        return list.toArray(new IPropertyDescriptor[list.size()]);
     }
 
     /*
index 19dd6dcabff2b11bd96cebdb86a23b6a194b4729..124890e38626e1b9d22c2bf853e8e66af6b14e64 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.property;
@@ -24,7 +24,7 @@ import org.eclipse.ui.views.properties.TextPropertyDescriptor;
  * <p>
  * Property source implementation for the trace event component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceEventPropertySource extends BasePropertySource {
@@ -49,7 +49,7 @@ public class TraceEventPropertySource extends BasePropertySource {
      */
     public static final String TRACE_EVENT_STATE_PROPERTY_ID = "trace.event.state"; //$NON-NLS-1$
     /**
-     *  The trace event 'name' property name. 
+     *  The trace event 'name' property name.
      */
     public static final String TRACE_EVENT_NAME_PROPERTY_NAME = Messages.TraceControl_EventNamePropertyName;
     /**
@@ -69,10 +69,10 @@ public class TraceEventPropertySource extends BasePropertySource {
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The event component which this property source is for. 
+     * The event component which this property source is for.
      */
     protected final TraceEventComponent fEvent;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -83,7 +83,7 @@ public class TraceEventPropertySource extends BasePropertySource {
     public TraceEventPropertySource(TraceEventComponent component) {
         fEvent = component;
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -100,7 +100,7 @@ public class TraceEventPropertySource extends BasePropertySource {
         if (fEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) {
             list.add(new TextPropertyDescriptor(TRACE_EVENT_LOGLEVEL_PROPERTY_ID, TRACE_EVENT_LOGLEVEL_PROPERTY_NAME));
         }
-        return (IPropertyDescriptor [])list.toArray(new IPropertyDescriptor[list.size()]);        
+        return list.toArray(new IPropertyDescriptor[list.size()]);
     }
 
     /*
index e843224377cee485f5ad0bbdaab833eed2ed89da..239d7132a9678dbf5a9a362353cdb8e0220666a6 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.property;
@@ -25,7 +25,7 @@ import org.eclipse.ui.views.properties.TextPropertyDescriptor;
  * <p>
  * Property source implementation for the trace probe event component.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class TraceProbeEventPropertySource extends TraceEventPropertySource {
@@ -61,17 +61,24 @@ public class TraceProbeEventPropertySource extends TraceEventPropertySource {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     *
+     * @param component
+     *            A trace event component
+     */
     public TraceProbeEventPropertySource(TraceEventComponent component) {
         super(component);
         if (component.getClass() != TraceProbeEventComponent.class) {
             throw new IllegalArgumentException("Invalid type passed. Only class of type TraceProbeEventComponent allowed:\n" + component.getClass()); //$NON-NLS-1$
         }
     }
-    
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -90,7 +97,7 @@ public class TraceProbeEventPropertySource extends TraceEventPropertySource {
         if (fEvent instanceof TraceProbeEventComponent) {
             TraceProbeEventComponent event = (TraceProbeEventComponent) fEvent;
             if (event.getAddress() != null) {
-                list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME));                
+                list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME));
             }
 
             if (event.getOffset() != null) {
@@ -101,7 +108,7 @@ public class TraceProbeEventPropertySource extends TraceEventPropertySource {
                 list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME));
             }
         }
-        return (IPropertyDescriptor [])list.toArray(new IPropertyDescriptor[list.size()]);
+        return list.toArray(new IPropertyDescriptor[list.size()]);
     }
 
     /*
index c90236b5ed0f93d7997942a077c9ee94e19b96a2..6a5beb309857a88c7800ce0db841e70131a1011d 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.remote;
@@ -17,11 +17,11 @@ import java.util.Arrays;
  * <p>
  * Class containing command result of remote command execution.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class CommandResult implements ICommandResult {
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -38,6 +38,15 @@ public class CommandResult implements ICommandResult {
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     *
+     * @param result
+     *            The result of the command
+     * @param output
+     *            The output, as an array of strings
+     */
     public CommandResult(int result, String[] output) {
         fResult = result;
         if (output != null) {
@@ -46,7 +55,7 @@ public class CommandResult implements ICommandResult {
     }
 
     // ------------------------------------------------------------------------
-    // Accessor
+    // Accessors
     // ------------------------------------------------------------------------
     /*
      * (non-Javadoc)
index 79b73813d23ca5986dade8ee2e7c231d59e7ab88..baf9e976671244bd57c7a97dac63ad5ffbde6b12 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:
  *   Patrick Tasse - Initial API and implementation
  *   Bernd Hufmann - Updated using Executor Framework
  **********************************************************************/
@@ -34,9 +34,9 @@ import org.eclipse.rse.services.shells.IShellService;
 
 /**
  * <p>
- * Implementation of remote command execution using RSE's shell service. 
+ * Implementation of remote command execution using RSE's shell service.
  * </p>
- * 
+ *
  * @author Patrick Tasse
  * @author Bernd Hufmann
  */
@@ -46,15 +46,17 @@ public class CommandShell implements ICommandShell {
     // Constants
     // ------------------------------------------------------------------------
 
-    // string to be echo'ed when running command in shell, used to indicate that the command has finished running
+    /** String to be echo'ed when running command in shell, used to indicate that the command has finished running */
     public final static String DONE_MARKUP_STRING = "--RSE:donedonedone:--"; //$NON-NLS-1$
-    
-    //command delimiter for shell
+
+    /** Command delimiter for shell */
     public final static String CMD_DELIMITER = "\n"; //$NON-NLS-1$
 
+    /** Shell "echo" command */
     public final static String SHELL_ECHO_CMD = " echo "; //$NON-NLS-1$
 
-    private final static int DEFAULT_TIMEOUT_VALUE = 15000; // in milliseconds
+    /** Default timeout, in milliseconds */
+    private final static int DEFAULT_TIMEOUT_VALUE = 15000;
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -62,12 +64,19 @@ public class CommandShell implements ICommandShell {
     private IRemoteSystemProxy fProxy = null;
     private IHostShell fHostShell = null;
     private BufferedReader fBufferReader = null;
-    private ExecutorService fExecutor = Executors.newFixedThreadPool(1);
+    private final ExecutorService fExecutor = Executors.newFixedThreadPool(1);
     private boolean fIsConnected = false;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     *
+     * @param proxy
+     *            The Remote System proxy
+     */
     public CommandShell(IRemoteSystemProxy proxy) {
         fProxy = proxy;
     }
@@ -139,7 +148,7 @@ public class CommandShell implements ICommandShell {
 
                             if (monitor.isCanceled()) {
                                 flushInput();
-                                throw new CancellationException(); 
+                                throw new CancellationException();
                             }
 
                             if (nextLine.contains(DONE_MARKUP_STRING) && nextLine.contains(SHELL_ECHO_CMD)) {
@@ -151,7 +160,7 @@ public class CommandShell implements ICommandShell {
                             // check if job was cancelled
                             if (monitor.isCanceled()) {
                                 flushInput();
-                                throw new CancellationException(); 
+                                throw new CancellationException();
                             }
 
                             if (!nextLine.contains(DONE_MARKUP_STRING)) {
@@ -184,12 +193,12 @@ public class CommandShell implements ICommandShell {
         }
         throw new ExecutionException(Messages.TraceControl_ShellNotConnected, null);
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
     /**
-     * Flushes the buffer reader 
+     * Flushes the buffer reader
      * @throws IOException
      */
     private void flushInput() throws IOException {
@@ -200,22 +209,25 @@ public class CommandShell implements ICommandShell {
             }
         }
     }
-    
+
     /**
-     * format the command to be sent into the shell command with the done markup string.
-     * The done markup string is needed so we can tell that end of output has been reached.
-     * 
+     * Format the command to be sent into the shell command with the done markup
+     * string. The done markup string is needed so we can tell that end of
+     * output has been reached.
+     *
      * @param cmd
+     *            The original command
      * @return formatted command string
      */
     private String formatShellCommand(String cmd) {
-        if (cmd == null || cmd.equals("")) //$NON-NLS-1$
+        if (cmd == null || cmd.equals("")) //$NON-NLS-1$
             return cmd;
+        }
         StringBuffer formattedCommand = new StringBuffer();
         // Make a multi line command by using \ and \r. This is needed for matching
-        // the DONE_MARKUP_STRING in echoed command when having a long command 
+        // the DONE_MARKUP_STRING in echoed command when having a long command
         // (bigger than max SSH line)
-        formattedCommand.append(cmd).append("\\\r;"); //$NON-NLS-1$ 
+        formattedCommand.append(cmd).append("\\\r;"); //$NON-NLS-1$
         formattedCommand.append(SHELL_ECHO_CMD).append(DONE_MARKUP_STRING);
         formattedCommand.append(" $?"); //$NON-NLS-1$
         formattedCommand.append(CMD_DELIMITER);
index b8c9bd4c451b7e963d5e38409107e93317965729..393d543cb418fe469105da9e71e6da8c7e3188ff 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.remote;
@@ -15,19 +15,22 @@ package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;
  * <p>
  * Interface for providing command execution result.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public interface ICommandResult {
     /**
-     * The result of the command. 
-     * @return 0 if successful else >0 
+     * The result of the command.
+     *
+     * @return 0 if successful else >0
      */
-    public int getResult() ;
+    public int getResult();
 
     /**
      * Sets the command result value.
+     *
      * @param result
+     *            The integer result to set
      */
     public void setResult(int result);
 
@@ -38,7 +41,9 @@ public interface ICommandResult {
 
     /**
      * Sets the command output.
+     *
      * @param output
+     *            The output (as an array of Strings) to assign
      */
     public void setOutput(String[] output);
 }
\ No newline at end of file
index 60d6e5cab1b11526c7050ceff3ad2476f6062808..da89d3280b098845944e123b523c67d2f6f3889f 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.remote;
@@ -18,41 +18,54 @@ import org.eclipse.core.runtime.IProgressMonitor;
  * <p>
  * Interface for a command shell implementation
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public interface ICommandShell {
-    
+
     /**
      * Method to connect the command shell.
+     *
      * @throws ExecutionException
+     *             If the command fails
      */
     public void connect() throws ExecutionException;
-    
+
     /**
      * Method to disconnect the command shell.
      */
     public void disconnect();
-    
+
     /**
      * Method to execute a command on the command shell.
-     * 
-     * @param command - the command to executed
-     * @param monitor - a progress monitor
+     *
+     * @param command
+     *            - the command to executed
+     * @param monitor
+     *            - a progress monitor
      * @return the command result
      * @throws ExecutionException
+     *             If the command fails
      */
-    public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException;
+    public ICommandResult executeCommand(String command,
+            IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Method to execute a command on the command shell.
-     * 
-     * @param command - the command to executed
-     * @param monitor - a progress monitor
-     * @param checkReturnValue - flag to indicate that the command result should be checked. If false the command result will be always 0.
+     *
+     * @param command
+     *            - the command to executed
+     * @param monitor
+     *            - a progress monitor
+     * @param checkReturnValue
+     *            - flag to indicate that the command result should be checked.
+     *            If false the command result will be always 0.
      * @return the command result
      * @throws ExecutionException
+     *             If the command fails
      */
-    public ICommandResult executeCommand(final String command, final IProgressMonitor monitor, final boolean checkReturnValue) throws ExecutionException;
+    public ICommandResult executeCommand(final String command,
+            final IProgressMonitor monitor, final boolean checkReturnValue)
+            throws ExecutionException;
 
 }
index 52158156e3bbdfc754bfdfd5110e2bbd45ef6d40..7ffc7aea25b0b4f5b588ec98efb0fd610d334ce8 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.remote;
@@ -23,7 +23,7 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSys
  * <p>
  * Remote System Proxy interface.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public interface IRemoteSystemProxy {
@@ -33,77 +33,81 @@ public interface IRemoteSystemProxy {
     // ------------------------------------------------------------------------
     /**
      * Find the first shell service.
-     * 
+     *
      * @return shell service object, or <code>null</code> if not found.
      */
     public IShellService getShellService();
 
     /**
      * Find the first terminal service.
-     * 
+     *
      * @return shell service object, or <code>null</code> if not found.
      */
     public ITerminalService getTerminalService();
 
     /**
      * Find the first IShellServiceSubSystem service.
-     * 
+     *
      * @return shell service subsystem, or <code>null</code> if not found.
      */
     public ISubSystem getShellServiceSubSystem();
 
     /**
      * Find the first ITerminalServiceSubSystem service.
-     * 
-     * @param host the connection 
+     *
      * @return shell service subsystem, or <code>null</code> if not found.
      */
     public ISubSystem getTerminalServiceSubSystem();
-    
+
     /**
      * Finds the File Service Subsystem.
-     * @return file service subsystem, or <code>null</code> if not found. 
+     *
+     * @return file service subsystem, or <code>null</code> if not found.
      */
     public IFileServiceSubSystem getFileServiceSubSystem();
-    
+
     /**
-     * Connects the shell service sub system. 
-     * 
-     * @param callback - call-back method being called when connection was finished
-     * @throws Exception
+     * Connects the shell service sub system.
+     *
+     * @param callback
+     *            - call-back method being called when connection was finished
+     * @throws ExecutionException
+     *             If the connection fails
      */
     public void connect(IRSECallback callback) throws ExecutionException;
 
     /**
-     * Disconnects from the shell service sub system. 
-     * 
-     * @throws Exception
+     * Disconnects from the shell service sub system.
+     *
+     * @throws ExecutionException
+     *             If the disconnect command fails
      */
     public void disconnect() throws ExecutionException;
 
     /**
-     * Creates a command shell. 
-     * 
+     * Creates a command shell.
+     *
      * @return the command shell implementation
-     * @throws Exception
+     * @throws ExecutionException
+     *             If the command fails
      */
     public ICommandShell createCommandShell() throws ExecutionException;
 
     /**
-     * Method to add a communication listener to the connector service defined for 
-     * the given connection. 
-     * 
-     * @param listener - listener to add
-     * @throws Exception
+     * Method to add a communication listener to the connector service defined
+     * for the given connection.
+     *
+     * @param listener
+     *            - listener to add
      */
     public void addCommunicationListener(ICommunicationsListener listener);
 
     /**
-     * Method to remove a communication listener from the connector service defined for 
-     * the given connection. 
-     * 
-     * @param listener - listener to remove
-     * @throws Exception
+     * Method to remove a communication listener from the connector service
+     * defined for the given connection.
+     *
+     * @param listener
+     *            - listener to remove
      */
     public void removeCommunicationListener(ICommunicationsListener listener);
 
index 4e9f6c02127098f60481d5831b2d8fbc6b0a00ac..fa2a964da05d9c21c6382d2b7dcd16f1937fc400 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.remote;
@@ -27,19 +27,26 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSys
  * <p>
  * RemoteSystemProxy implementation.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class RemoteSystemProxy implements IRemoteSystemProxy {
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    private IHost fHost;
+    private final IHost fHost;
 
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     *
+     * @param host
+     *            The host of this proxy
+     */
     public RemoteSystemProxy(IHost host) {
         fHost = host;
     }
@@ -86,8 +93,8 @@ public class RemoteSystemProxy implements IRemoteSystemProxy {
             if (svc!=null) {
                 ssvc = (IShellService)svc.getAdapter(IShellService.class);
                 if (ssvc != null) {
-                    return subSystems[i];   
-                }   
+                    return subSystems[i];
+                }
             }
         }
         return null;
@@ -108,8 +115,8 @@ public class RemoteSystemProxy implements IRemoteSystemProxy {
             if (svc!=null) {
                 ssvc = (ITerminalService)svc.getAdapter(ITerminalService.class);
                 if (ssvc != null) {
-                    return subSystems[i];   
-                }   
+                    return subSystems[i];
+                }
             }
         }
         return null;
@@ -132,7 +139,7 @@ public class RemoteSystemProxy implements IRemoteSystemProxy {
         }
         return null;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.util.IRemoteSystemProxy#connect(org.eclipse.rse.core.model.IRSECallback)
      */
@@ -176,7 +183,7 @@ public class RemoteSystemProxy implements IRemoteSystemProxy {
         shell.connect();
         return shell;
     }
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.util.IRemoteSystemProxy#addCommunicationListener(org.eclipse.rse.core.subsystems.ICommunicationsListener)
      */
index 8d65032c7dc1a6dce54217e65bbc7fb03cd57bfa..753150de0a041e4e8334e26d8b844b70557f1945 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.service;
@@ -25,9 +25,9 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
 
 /**
 * <p>
-* Interface for LTTng trace control command service. 
+* Interface for LTTng trace control command service.
 * </p>
-* 
+*
 * @author Bernd Hufmann
 */
 public interface ILttngControlService {
@@ -39,178 +39,305 @@ public interface ILttngControlService {
 
     /**
      * Retrieves the existing sessions names from the node.
-     * @param monitor - a progress monitor
+     *
+     * @param monitor
+     *            - a progress monitor
      * @return an array with session names.
      * @throws ExecutionException
+     *             If the command fails
      */
-    public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException;
-    
+    public String[] getSessionNames(IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Retrieves the session information with the given name the node.
-     * @param sessionName - the session name
-     * @param monitor - a progress monitor 
+     *
+     * @param sessionName
+     *            - the session name
+     * @param monitor
+     *            - a progress monitor
      * @return session information
      * @throws ExecutionException
-     */    
-    public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException;
-    
+     *             If the command fails
+     */
+    public ISessionInfo getSession(String sessionName, IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Retrieves the kernel provider information (i.e. the kernel events)
-     * @param monitor - a progress monitor 
+     *
+     * @param monitor
+     *            - a progress monitor
      * @return the list of existing kernel events.
      * @throws ExecutionException
+     *             If the command fails
      */
-    public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException;
-    
+    public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Retrieves the UST provider information from the node.
+     *
      * @return - the UST provider information.
      * @throws ExecutionException
+     *             If the command fails
      */
     public List<IUstProviderInfo> getUstProvider() throws ExecutionException;
+
     /**
      * Retrieves the UST provider information from the node.
-     * @param monitor - a progress monitor 
+     *
+     * @param monitor
+     *            - a progress monitor
      * @return the UST provider information.
      * @throws ExecutionException
+     *             If the command fails
      */
-    public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException;
-    
+    public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Creates a session with given session name and location.
-     * @param sessionName - a session name to create
-     * @param sessionPath - a path for storing the traces (use null for default)
-     * @param monitor - a progress monitor 
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param sessionPath
+     *            - a path for storing the traces (use null for default)
+     * @param monitor
+     *            - a progress monitor
      * @return the session information
      * @throws ExecutionException
+     *             If the command fails
      */
-    public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException;
-    
+    public ISessionInfo createSession(String sessionName, String sessionPath,
+            IProgressMonitor monitor) throws ExecutionException;
+
     /**
-     * Destroys a session with given session name. 
-     * @param sessionName - a session name to destroy
-     * @param monitor - a progress monitor 
+     * Destroys a session with given session name.
+     *
+     * @param sessionName
+     *            - a session name to destroy
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException;
+    public void destroySession(String sessionName, IProgressMonitor monitor)
+            throws ExecutionException;
 
     /**
-     * Starts a session with given session name. 
-     * @param sessionName - a session name to start
-     * @param monitor - a progress monitor 
+     * Starts a session with given session name.
+     *
+     * @param sessionName
+     *            - a session name to start
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
-     */    
-    public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException;
+     *             If the command fails
+     */
+    public void startSession(String sessionName, IProgressMonitor monitor)
+            throws ExecutionException;
 
-     /**
-      * Stops a session with given session name. 
-      * @param sessionName - a session name to stop
-      * @param monitor - a progress monitor 
-      * @throws ExecutionException
-      */
-     public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException;
+    /**
+     * Stops a session with given session name.
+     *
+     * @param sessionName
+     *            - a session name to stop
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void stopSession(String sessionName, IProgressMonitor monitor)
+            throws ExecutionException;
 
-    
-     /**
-      * Enables a list of channels for given session and given channel information (configuration). 
-      * @param sessionName - a session name to create
-      * @param channelNames - a list of channel names to be enabled
-      * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) 
-      * @param info - channel information used for creation of a channel (or null for default)
-      * @param monitor - a progress monitor 
-      * @throws ExecutionException
-      */
-    public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException;
+    /**
+     * Enables a list of channels for given session and given channel
+     * information (configuration).
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param channelNames
+     *            - a list of channel names to be enabled
+     * @param isKernel
+     *            - a flag to indicate Kernel or UST (true for Kernel, false for
+     *            UST)
+     * @param info
+     *            - channel information used for creation of a channel (or null
+     *            for default)
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void enableChannels(String sessionName, List<String> channelNames,
+            boolean isKernel, IChannelInfo info, IProgressMonitor monitor)
+            throws ExecutionException;
 
-     /**
-      * Disables a list of channels for given session and given channel information (configuration). 
-      * @param sessionName - a session name to create
-      * @param channelNames - a list of channel names to be enabled
-      * @param isKernel - a flag to indicate Kernel or UST (true for Kernel, false for UST) 
-      * @param monitor - a progress monitor 
-      * @throws ExecutionException
-      */
-    public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException;
+    /**
+     * Disables a list of channels for given session and given channel
+     * information (configuration).
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param channelNames
+     *            - a list of channel names to be enabled
+     * @param isKernel
+     *            - a flag to indicate Kernel or UST (true for Kernel, false for
+     *            UST)
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void disableChannels(String sessionName, List<String> channelNames,
+            boolean isKernel, IProgressMonitor monitor)
+            throws ExecutionException;
 
     /**
      * Enables a list of events with no additional parameters.
-     * @param sessionName - a session name
-     * @param channelName - a channel name or null for default channel
-     * @param eventNames - a list of event names to be enabled, or null (list of size = 0)for all events .
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name or null for default channel
+     * @param eventNames
+     *            - a list of event names to be enabled, or null (list of size =
+     *            0)for all events .
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException;
+    public void enableEvents(String sessionName, String channelName,
+            List<String> eventNames, boolean isKernel, IProgressMonitor monitor)
+            throws ExecutionException;
 
     /**
      * Enables all syscall events.
-     * @param sessionName - a session name
-     * @param channelName - a channel name or null for default channel
-     * @param monitor - a progress monitor
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name or null for default channel
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException;
+    public void enableSyscalls(String sessionName, String channelName,
+            IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Enables a dynamic probe or dynamic function entry/return probe.
-     * @param sessionName - a session name
-     * @param channelName - a channel name or null for default channel
-     * @param eventName - a event name
-     * @param isFunction - true for dynamic function entry/return probe else false 
-     * @param probe - a dynamic probe information
-     * @param monitor - a progress monitor
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name or null for default channel
+     * @param eventName
+     *            - a event name
+     * @param isFunction
+     *            - true for dynamic function entry/return probe else false
+     * @param probe
+     *            - a dynamic probe information
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException;
+    public void enableProbe(String sessionName, String channelName,
+            String eventName, boolean isFunction, String probe,
+            IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Enables events using log level
-     * @param sessionName - a session name
-     * @param channelName - a channel name (null for default channel)
-     * @param eventName - a event name
-     * @param logLevelType - a log level type 
-     * @param level - a log level 
-     * @param monitor - a progress monitor  
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name (null for default channel)
+     * @param eventName
+     *            - a event name
+     * @param logLevelType
+     *            - a log level type
+     * @param level
+     *            - a log level
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException;    
-    
+    public void enableLogLevel(String sessionName, String channelName,
+            String eventName, LogLevelType logLevelType, TraceLogLevel level,
+            IProgressMonitor monitor) throws ExecutionException;
+
     /**
      * Disables a list of events with no additional parameters.
-     * @param sessionName - a session name
-     * @param channelName - a channel name (null for default channel)
-     * @param eventNames - a list of event names to enabled.
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name (null for default channel)
+     * @param eventNames
+     *            - a list of event names to enabled.
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException;
-    
+    public void disableEvent(String sessionName, String channelName,
+            List<String> eventNames, boolean isKernel, IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Gets all available context names to be added to channels/events.
+     *
      * @param monitor
+     *            The progress monitor
      * @return the list of available contexts
+     * @throws ExecutionException
+     *             If the command fails
      */
-    public List<String> getContextList(IProgressMonitor monitor) throws ExecutionException;
-    
+    public List<String> getContextList(IProgressMonitor monitor)
+            throws ExecutionException;
+
     /**
      * Add contexts to given channels and or events
-     * @param sessionName - a session name
-     * @param channelName - a channel name (null for all channels)
-     * @param eventName - a event name (null for all events)
-     * @param isKernel -  a flag for indicating kernel or UST.
-     * @param contexts - a list of name of contexts to add
-     * @param monitor - a progress monitor
+     *
+     * @param sessionName
+     *            - a session name
+     * @param channelName
+     *            - a channel name (null for all channels)
+     * @param eventName
+     *            - a event name (null for all events)
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param contexts
+     *            - a list of name of contexts to add
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contexts, IProgressMonitor monitor) throws ExecutionException;
-    
+    public void addContexts(String sessionName, String channelName,
+            String eventName, boolean isKernel, List<String> contexts,
+            IProgressMonitor monitor) throws ExecutionException;
+
     /**
      * Executes calibrate command to quantify LTTng overhead.
-     * @param isKernel - a flag for indicating kernel or UST.
-     * @param monitor - a progress monitor
+     *
+     * @param isKernel
+     *            - a flag for indicating kernel or UST.
+     * @param monitor
+     *            - a progress monitor
      * @throws ExecutionException
+     *             If the command fails
      */
-    public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException;
+    public void calibrate(boolean isKernel, IProgressMonitor monitor)
+            throws ExecutionException;
 }
index 5aa83f165a6c92690808c79f7c63808fd679895c..d5e3b03b634bf97f30a474c0452c95f9ef3181b6 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.service;
@@ -46,12 +46,12 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandSh
  * <p>
  * Service for sending LTTng trace control commands to remote host.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class LTTngControlService implements ILttngControlService {
-    
+
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -59,7 +59,7 @@ public class LTTngControlService implements ILttngControlService {
      * The command shell implementation
      */
     protected ICommandShell fCommandShell = null;
-    
+
     /**
      * The version string.
      */
@@ -71,7 +71,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Constructor
-     * 
+     *
      * @param shell
      *            - the command shell implementation to use
      */
@@ -90,9 +90,9 @@ public class LTTngControlService implements ILttngControlService {
     public String getVersion() {
         return fVersion;
     }
-    
+
     /**
-     * Sets the version of the LTTng 2.0 control service. 
+     * Sets the version of the LTTng 2.0 control service.
      * @param version - a version to set
      */
     public void setVersion(String version) {
@@ -101,10 +101,10 @@ public class LTTngControlService implements ILttngControlService {
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
-    
+
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
      * #getSessionNames(org.eclipse.core.runtime.IProgressMonitor)
@@ -139,7 +139,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
      * #getSession(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
@@ -189,7 +189,7 @@ public class LTTngControlService implements ILttngControlService {
 
                 // set channels
                 domainInfo.setChannels(channels);
-                
+
                 // set kernel flag
                 domainInfo.setIsKernel(true);
                 continue;
@@ -206,7 +206,7 @@ public class LTTngControlService implements ILttngControlService {
 
                 // set channels
                 domainInfo.setChannels(channels);
-                
+
                 // set kernel flag
                 domainInfo.setIsKernel(false);
                 continue;
@@ -218,7 +218,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
      * #getKernelProvider(org.eclipse.core.runtime.IProgressMonitor)
@@ -238,7 +238,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
      * #getUstProvider()
@@ -250,7 +250,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
      * #getUstProvider(org.eclipse.core.runtime.IProgressMonitor)
@@ -322,7 +322,7 @@ public class LTTngControlService implements ILttngControlService {
         //Session myssession2 created.
         //Traces will be written in /home/user/lttng-traces/myssession2-20120209-095418
         String[] output = result.getOutput();
-        
+
         // Get and verify session name
         Matcher matcher = LTTngControlServiceConstants.CREATE_SESSION_NAME_PATTERN.matcher(output[0]);
         String name = null;
@@ -331,42 +331,42 @@ public class LTTngControlService implements ILttngControlService {
             name = String.valueOf(matcher.group(1).trim());
         } else {
             // Output format not expected
-            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ 
-                    Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$ 
-                    formatOutput(result)); 
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+                    Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$
+                    formatOutput(result));
         }
 
         if ((name == null) || (!name.equals(sessionName))) {
             // Unexpected name returned
-            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ 
-                    Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$ 
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+                    Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$
         }
-        
+
         // Get and verify session path
         matcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(output[1]);
         String path = null;
-        
+
         if (matcher.matches()) {
             path = String.valueOf(matcher.group(1).trim());
         } else {
             // Output format not expected
-            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ 
-                    Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$ 
-                    formatOutput(result)); 
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+                    Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$
+                    formatOutput(result));
         }
 
         if ((path == null) || ((sessionPath != null) && (!path.contains(sessionPath)))) {
             // Unexpected path
-            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ 
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
                     Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$
         }
-        
+
         SessionInfo sessionInfo = new SessionInfo(name);
         sessionInfo.setSessionPath(path);
 
         return sessionInfo;
     }
-    
+
     @Override
     public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
         String newName = formatParameter(sessionName);
@@ -375,13 +375,13 @@ public class LTTngControlService implements ILttngControlService {
 
         ICommandResult result = executeCommand(command.toString(), monitor, false);
         String[] output = result.getOutput();
-        
+
         if (isError(result) && ((output == null) || (!LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN.matcher(output[0]).matches()))) {
                 throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
        }
         //Session <sessionName> destroyed
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#startSession(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
@@ -410,9 +410,9 @@ public class LTTngControlService implements ILttngControlService {
         executeCommand(command.toString(), monitor);
 
         //Session <sessionName> stopped
-        
+
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableChannel(java.lang.String, java.util.List, boolean, org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo, org.eclipse.core.runtime.IProgressMonitor)
@@ -428,7 +428,7 @@ public class LTTngControlService implements ILttngControlService {
         StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_CHANNEL);
 
         for (Iterator<String> iterator = channelNames.iterator(); iterator.hasNext();) {
-            String channel = (String) iterator.next();
+            String channel = iterator.next();
             command.append(channel);
             if (iterator.hasNext()) {
                 command.append(',');
@@ -461,7 +461,7 @@ public class LTTngControlService implements ILttngControlService {
 //                                     (default: 8, kernel default: 4)
             command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS);
             command.append(String.valueOf(info.getNumberOfSubBuffers()));
-            
+
 //            --switch-timer USEC  Switch timer interval in usec (default: 0)
             command.append(LTTngControlServiceConstants.OPTION_SWITCH_TIMER);
             command.append(String.valueOf(info.getSwitchTimer()));
@@ -469,10 +469,10 @@ public class LTTngControlService implements ILttngControlService {
 //            --read-timer USEC    Read timer interval in usec (default: 200)
             command.append(LTTngControlServiceConstants.OPTION_READ_TIMER);
             command.append(String.valueOf(info.getReadTimer()));
-        } 
+        }
 
         executeCommand(command.toString(), monitor);
-        
+
     }
 
     /*
@@ -481,7 +481,7 @@ public class LTTngControlService implements ILttngControlService {
      */
     @Override
     public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
-        
+
         // no channels to enable
         if (channelNames.isEmpty()) {
             return;
@@ -490,7 +490,7 @@ public class LTTngControlService implements ILttngControlService {
         StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL);
 
         for (Iterator<String> iterator = channelNames.iterator(); iterator.hasNext();) {
-            String channel = (String) iterator.next();
+            String channel = iterator.next();
             command.append(channel);
             if (iterator.hasNext()) {
                 command.append(',');
@@ -509,7 +509,7 @@ public class LTTngControlService implements ILttngControlService {
 
         executeCommand(command.toString(), monitor);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableEvent(java.lang.String, java.lang.String, java.util.List, boolean, org.eclipse.core.runtime.IProgressMonitor)
@@ -524,7 +524,7 @@ public class LTTngControlService implements ILttngControlService {
         } else {
 
             for (Iterator<String> iterator = eventNames.iterator(); iterator.hasNext();) {
-                String event = (String) iterator.next();
+                String event = iterator.next();
                 command.append(event);
                 if (iterator.hasNext()) {
                     command.append(',');
@@ -547,11 +547,11 @@ public class LTTngControlService implements ILttngControlService {
             command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
             command.append(channelName);
         }
-        
+
         command.append(LTTngControlServiceConstants.OPTION_TRACEPOINT);
-        
+
         executeCommand(command.toString(), monitor);
-        
+
     }
 
     /*
@@ -575,12 +575,12 @@ public class LTTngControlService implements ILttngControlService {
             command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
             command.append(channelName);
         }
-        
+
         command.append(LTTngControlServiceConstants.OPTION_SYSCALL);
-        
+
         executeCommand(command.toString(), monitor);
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableProbe(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
@@ -605,9 +605,9 @@ public class LTTngControlService implements ILttngControlService {
         } else {
             command.append(LTTngControlServiceConstants.OPTION_PROBE);
         }
-        
+
         command.append(probe);
-        
+
         executeCommand(command.toString(), monitor);
     }
 
@@ -630,19 +630,19 @@ public class LTTngControlService implements ILttngControlService {
             command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
             command.append(channelName);
         }
-        
+
         if (logLevelType == LogLevelType.LOGLEVEL) {
             command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL);
         } else if (logLevelType == LogLevelType.LOGLEVEL_ONLY) {
             command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL_ONLY);
-            
+
         } else {
             return;
         }
         command.append(level.getInName());
-        
+
         executeCommand(command.toString(), monitor);
-        
+
     }
 
     /*
@@ -662,7 +662,7 @@ public class LTTngControlService implements ILttngControlService {
             }
 
             for (Iterator<String> iterator = eventNames.iterator(); iterator.hasNext();) {
-                String event = (String) iterator.next();
+                String event = iterator.next();
                 command.append(event);
                 if (iterator.hasNext()) {
                     command.append(',');
@@ -699,15 +699,15 @@ public class LTTngControlService implements ILttngControlService {
 
         ICommandResult result = executeCommand(command.toString(), monitor);
 
-        String[] output = result.getOutput(); 
-        
+        String[] output = result.getOutput();
+
         List<String> contexts = new ArrayList<String>(0);
-        
+
         int index = 0;
         boolean inList = false;
         while (index < output.length) {
             String line = result.getOutput()[index];
-            
+
             Matcher startMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_INTRO.matcher(line);
             Matcher endMatcher = LTTngControlServiceConstants.ADD_CONTEXT_HELP_CONTEXTS_END_LINE.matcher(line);
 
@@ -737,7 +737,7 @@ public class LTTngControlService implements ILttngControlService {
         String newSessionName = formatParameter(sessionName);
         command.append(LTTngControlServiceConstants.OPTION_SESSION);
         command.append(newSessionName);
-        
+
         if (channelName != null) {
             command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
             command.append(channelName);
@@ -753,15 +753,15 @@ public class LTTngControlService implements ILttngControlService {
         } else {
             command.append(LTTngControlServiceConstants.OPTION_UST);
         }
-        
+
         for (Iterator<String> iterator = contextNames.iterator(); iterator.hasNext();) {
-            String context = (String) iterator.next();
+            String context = iterator.next();
             command.append(LTTngControlServiceConstants.OPTION_CONTEXT_TYPE);
             command.append(context);
         }
 
         executeCommand(command.toString(), monitor);
-        
+
     }
 
     /*
@@ -786,13 +786,13 @@ public class LTTngControlService implements ILttngControlService {
 
         executeCommand(command.toString(), monitor);
     }
-    
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
     /**
      * Checks if command result is an error result.
-     * 
+     *
      * @param result
      *            - the command result to check
      * @return true if error else false
@@ -806,7 +806,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Formats the output string as single string.
-     * 
+     *
      * @param output
      *            - output array
      * @return - the formatted output
@@ -828,7 +828,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Parses the domain information.
-     * 
+     *
      * @param output
      *            - a command output array
      * @param currentIndex
@@ -914,7 +914,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Parses the event information within a domain.
-     * 
+     *
      * @param output
      *            - a command output array
      * @param currentIndex
@@ -937,7 +937,7 @@ public class LTTngControlService implements ILttngControlService {
             } else if (LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line).matches()) {
                 // end of domain
                 return index;
-            } 
+            }
 
             Matcher matcher = LTTngControlServiceConstants.EVENT_PATTERN.matcher(line);
             Matcher matcher2 = LTTngControlServiceConstants.WILDCARD_EVENT_PATTERN.matcher(line);
@@ -954,7 +954,7 @@ public class LTTngControlService implements ILttngControlService {
                 eventInfo.setLogLevel(TraceLogLevel.LEVEL_UNKNOWN);
                 eventInfo.setEventType(matcher2.group(2).trim());
                 eventInfo.setState(matcher2.group(3));
-                
+
                 if (eventInfo.getEventType() == TraceEventType.PROBE) {
                     IProbeEventInfo probeEvent = new ProbeEventInfo(eventInfo.getName());
                     probeEvent.setLogLevel(eventInfo.getLogLevel());
@@ -1009,7 +1009,7 @@ public class LTTngControlService implements ILttngControlService {
             }
 //            else if (line.matches(EVENT_NONE_PATTERN)) {
                 // do nothing
-//            } else 
+//            } else
 
         }
 
@@ -1018,7 +1018,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Parses a line with attributes: <attribute Name>: <attribute value>
-     * 
+     *
      * @param line
      *            - attribute line to parse
      * @return the attribute value as string
@@ -1030,7 +1030,7 @@ public class LTTngControlService implements ILttngControlService {
 
     /**
      * Parses the event information within a provider.
-     * 
+     *
      * @param output
      *            - a command output array
      * @param currentIndex
@@ -1060,7 +1060,7 @@ public class LTTngControlService implements ILttngControlService {
     }
 
     /**
-     * Formats a command parameter for the command execution i.e. adds quotes 
+     * Formats a command parameter for the command execution i.e. adds quotes
      * at the beginning and end if necessary.
      * @param parameter - parameter to format
      * @return formated parameter
@@ -1115,7 +1115,7 @@ public class LTTngControlService implements ILttngControlService {
             }
             if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE.equals(level)) {
                 return LTTngControlServiceConstants.OPTION_VERY_VERBOSE;
-            } 
+            }
             if (ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE.equals(level)) {
                 return LTTngControlServiceConstants.OPTION_VERY_VERY_VERBOSE;
             }
@@ -1124,41 +1124,54 @@ public class LTTngControlService implements ILttngControlService {
     }
 
     /**
-     * Method that logs the command and command result if logging is enabled as well as forwards
-     * the command execution to the shell.
-     * @param command - the command to execute
-     * @param monitor - a progress monitor
+     * Method that logs the command and command result if logging is enabled as
+     * well as forwards the command execution to the shell.
+     *
+     * @param command
+     *            - the command to execute
+     * @param monitor
+     *            - a progress monitor
      * @return the command result
      * @throws ExecutionException
      */
-    protected ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
+    protected ICommandResult executeCommand(String command,
+            IProgressMonitor monitor) throws ExecutionException {
         return executeCommand(command, monitor, true);
     }
-    
+
     /**
-     * Method that logs the command and command result if logging is enabled as well as forwards
-     * the command execution to the shell.
-     * @param command - the command to execute
-     * @param monitor - a progress monitor
-     * @param - checkForError - true to verify command result, else false
+     * Method that logs the command and command result if logging is enabled as
+     * well as forwards the command execution to the shell.
+     *
+     * @param command
+     *            - the command to execute
+     * @param monitor
+     *            - a progress monitor
+     * @param checkForError
+     *            - true to verify command result, else false
      * @return the command result
-     * @throws ExecutionException in case of error result
+     * @throws ExecutionException
+     *             in case of error result
      */
-    protected ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkForError) throws ExecutionException {
+    protected ICommandResult executeCommand(String command,
+            IProgressMonitor monitor, boolean checkForError)
+            throws ExecutionException {
         if (ControlPreferences.getInstance().isLoggingEnabled()) {
             ControlCommandLogger.log(command);
         }
 
-        ICommandResult result = fCommandShell.executeCommand(command.toString(), monitor);
-        
+        ICommandResult result = fCommandShell.executeCommand(
+                command.toString(), monitor);
+
         if (ControlPreferences.getInstance().isLoggingEnabled()) {
             ControlCommandLogger.log(formatOutput(result));
         }
 
         if (isError(result)) {
-            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+            throw new ExecutionException(Messages.TraceControl_CommandError
+                    + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
         }
-        
+
         return result;
     }
 }
index f09b0a0429dc8b36b7f7b657efaaa3dcca23b074..cffd2ecfc3050c02113141278e62ccf50eacfb0d 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.service;
@@ -17,7 +17,7 @@ import java.util.regex.Pattern;
  * <p>
  * Constants for LTTng Control Service.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class LTTngControlServiceConstants {
@@ -25,6 +25,9 @@ public class LTTngControlServiceConstants {
     // ------------------------------------------------------------------------
     // Version constants
     // ------------------------------------------------------------------------
+    /**
+     * Constant for the LTTng toolchain version
+     */
     public final static String LTTNG_MAJOR_VERSION_2_0 = "2.0"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
@@ -51,35 +54,35 @@ public class LTTngControlServiceConstants {
      */
     public final static String COMMAND_LIST_UST = COMMAND_LIST + "-u";  //$NON-NLS-1$
     /**
-     * Command to create a session. 
+     * Command to create a session.
      */
     public final static String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$
     /**
-     * Command to destroy a session. 
+     * Command to destroy a session.
      */
     public final static String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$
     /**
-     * Command to destroy a session. 
+     * Command to destroy a session.
      */
     public final static String COMMAND_START_SESSION = " start "; //$NON-NLS-1$
     /**
-     * Command to destroy a session. 
+     * Command to destroy a session.
      */
     public final static String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$
     /**
-     * Command to enable a channel. 
+     * Command to enable a channel.
      */
     public final static String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$
     /**
-     * Command to disable a channel. 
+     * Command to disable a channel.
      */
     public final static String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$
     /**
-     * Command to enable a event. 
+     * Command to enable a event.
      */
     public final static String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$
     /**
-     * Command to disable a event. 
+     * Command to disable a event.
      */
     public final static String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$
     /**
@@ -169,7 +172,7 @@ public class LTTngControlServiceConstants {
     /**
      * Optional command line option for configuring a channel's overwrite mode.
      */
-    public final static String OPTION_OVERWRITE = " --overwrite ";  //$NON-NLS-1$ 
+    public final static String OPTION_OVERWRITE = " --overwrite ";  //$NON-NLS-1$
     /**
      * Optional command line option for configuring a channel's number of sub buffers.
      */
@@ -187,7 +190,7 @@ public class LTTngControlServiceConstants {
      */
     public final static String OPTION_READ_TIMER = " --read-timer ";  //$NON-NLS-1$
     /**
-     * Command line option for printing the help of a specif command 
+     * Command line option for printing the help of a specif command
      */
     public final static String OPTION_HELP = " -h ";  //$NON-NLS-1$
 
index 8c18577f00531be179e172fb7528084a36999db1..b9def2b191d2e5bc46ab967cf5ef3f70a84da231 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.service;
@@ -24,7 +24,7 @@ import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandSh
  * Factory to create LTTngControlService instances depending on the version of the LTTng Trace Control
  * installed on the remote host.
  * </p>
- * 
+ *
  * @author Bernd Hufmann
  */
 public class LTTngControlServiceFactory {
@@ -36,7 +36,7 @@ public class LTTngControlServiceFactory {
      * The singleton instance.
      */
     private static LTTngControlServiceFactory fInstance = null;
-    
+
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
@@ -63,17 +63,17 @@ public class LTTngControlServiceFactory {
     // Factory method
     // ------------------------------------------------------------------------
     /**
-     * Gets the LTTng Control Service implementation based on the version of the 
+     * Gets the LTTng Control Service implementation based on the version of the
      * remote LTTng Tools.
-     * 
+     *
      * @param shell - the shell implementation to pass to the service
      * @return - LTTng Control Service implementation
-     * @throws ExecutionException
+     * @throws ExecutionException If the command fails
      */
     public ILttngControlService getLttngControlService(ICommandShell shell) throws ExecutionException {
         // get the version
         ICommandResult result = shell.executeCommand(LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION, new NullProgressMonitor());
-        
+
         if ((result != null) && (result.getResult() == 0) && (result.getOutput().length >= 1) && (!LTTngControlServiceConstants.ERROR_PATTERN.matcher(result.getOutput()[0]).matches())) {
             int index = 0;
             while (index < result.getOutput().length) {
This page took 0.200649 seconds and 5 git commands to generate.