O'Reilly logo

Contributing to Eclipse: Principles, Patterns, and Plug-Ins by Kent Beck, Erich Gamma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Contributing a Menu Item to Run Tests

What we'll see in this chapter:

  • Contributing an action that shows up in the context menu of a selected object

  • Implementing the contribution by looking at an example

We'd like to get the minimal user interface possible for our example, just to have something complete running. Here is where we will start:

  1. Choose a test case class in the Package Explorer.

  2. Pop-up a context menu.

  3. Select Run Test.

  4. Run the tests.

  5. Pop up a dialog with the results of running all the tests in the type.

Create a new plug-in project named org.eclipse.contribution.junit. Use the default plug-in structure, but uncheck the Generate code for the class button on the final page. You will have to delete the line class="org.eclipse.contribution.junit.JUnitPlugin" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required