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 25. ResultView Revisited — Observing Changes

Our old ResultView will keep displaying red or green even if the underlying Java code changes. We would like the color to be accurate—red if a test fails, green if all tests succeed, and neutral if we don't know. In this chapter we revisit the ResultView to clear the red/green result indication as soon as a Java resource has changed and we no longer know whether the tests will succeed or not. This will allow us to illustrate how to listen to changes to Java elements.

In this chapter, we'll see how to

  • Listen to changes to Java elements

  • Process Java element deltas

Testing Color

Let's start with the corresponding test case. We add the following test to ViewColorTest:

Example . org.eclipse.contribution.junit.test/ViewColorTest ...

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