简体   繁体   中英

How to programmatically control/get JUnit view while devloping Eclipse plug-in?

I want to have control over the JUnit view programmatically in order to add custom options over each test case method by right clicking .

As now when I right click on a particular test case method, I get options like "Go to File, Run, Debug" etc. I want to add my own option there and handle it programmatically. I have not found any posts regarding this and need help.

I am afraid, the context menu(s) of the JUnit view are not extensible.

In order to show or hide the JUnit view itself, you can use findView() , showView() , and hideView() declared in IWorkbenchPage . To get the active workbench page, use PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .

The view id of the JUnit view is org.eclipse.jdt.junit.ResultView

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM