X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.lttng.ui.tests%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Flttng%2Fui%2Ftests%2Fcontrol%2Fmodel%2Fcomponent%2FTraceControlTestFacility.java;h=45331790bf5696da72ee7c0bf8559003d33024c0;hb=d132bcc71fa0ff07cf2a3f0b6258f38abb546fb7;hp=9dc19ae41e3e3f74448274844d00a100bddb049c;hpb=f1e23c542e9b00f6dab15b7aa2960315a22d9bc4;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.lttng.ui.tests/src/org/eclipse/linuxtools/lttng/ui/tests/control/model/component/TraceControlTestFacility.java b/org.eclipse.linuxtools.lttng.ui.tests/src/org/eclipse/linuxtools/lttng/ui/tests/control/model/component/TraceControlTestFacility.java index 9dc19ae41e..45331790bf 100644 --- a/org.eclipse.linuxtools.lttng.ui.tests/src/org/eclipse/linuxtools/lttng/ui/tests/control/model/component/TraceControlTestFacility.java +++ b/org.eclipse.linuxtools.lttng.ui.tests/src/org/eclipse/linuxtools/lttng/ui/tests/control/model/component/TraceControlTestFacility.java @@ -11,12 +11,19 @@ *******************************************************************************/ package org.eclipse.linuxtools.lttng.ui.tests.control.model.component; +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.NotEnabledException; +import org.eclipse.core.commands.NotHandledException; +import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.linuxtools.lttng.ui.views.control.ControlView; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IViewPart; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.handlers.IHandlerService; /** * Singleton class to facilitate the test cases. Creates UML2SD view and loader objects as well as provides @@ -31,6 +38,8 @@ public class TraceControlTestFacility { final static public int WAIT_FOR_JOBS_DELAY = 1000; final static public int GUI_REFESH_DELAY = 500; + final static public String COMMAND_CATEGORY_PREFIX = "org.eclipse.linuxtools.lttng.ui.commands.control."; //$NON-NLS-1$ + // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ @@ -124,4 +133,11 @@ public class TraceControlTestFacility { public ControlView getControlView() { return fControlView; } + + public void executeCommand(String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { +// ICommandService commandService = (ICommandService) fControlView.getSite().getService(ICommandService.class); + IHandlerService handlerService = (IHandlerService) fControlView.getSite().getService(IHandlerService.class); + handlerService.executeCommand(COMMAND_CATEGORY_PREFIX + commandId, null); + } + }