X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tmf%2Forg.eclipse.tracecompass.tmf.ui.swtbot.tests%2Fshared%2Forg%2Feclipse%2Ftracecompass%2Ftmf%2Fui%2Fswtbot%2Ftests%2Fshared%2FSWTBotUtils.java;fp=tmf%2Forg.eclipse.tracecompass.tmf.ui.swtbot.tests%2Fshared%2Forg%2Feclipse%2Ftracecompass%2Ftmf%2Fui%2Fswtbot%2Ftests%2Fshared%2FSWTBotUtils.java;h=3809a3f3ff279e9d995afc48a47600e06628dad2;hb=43439230e2184842a9d75552a2e944beb181c267;hp=dc2189419a885ef14ce8b340d1125caf97989ba2;hpb=101bcc6537f5cca823925bd159fa704892dced58;p=deliverable%2Ftracecompass.git diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java index dc2189419a..3809a3f3ff 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java @@ -31,6 +31,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jface.bindings.keys.IKeyLookup; import org.eclipse.jface.bindings.keys.KeyStroke; import org.eclipse.jface.bindings.keys.ParseException; @@ -80,6 +81,7 @@ import org.eclipse.tracecompass.tmf.ui.views.TracingPerspectiveFactory; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorReference; import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.WorkbenchException; @@ -761,12 +763,28 @@ public final class SWTBotUtils { * view id. */ public static void openView(final String id) { + openView(id, null); + } + + /** + * Open a view by id and secondary id + * + * @param id + * view id. + * @param secondaryId + * The secondary ID + */ + public static void openView(final String id, final @Nullable String secondaryId) { final PartInitException res[] = new PartInitException[1]; UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { try { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id); + if (secondaryId == null) { + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id); + } else { + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id, secondaryId, IWorkbenchPage.VIEW_ACTIVATE); + } } catch (PartInitException e) { res[0] = e; }