• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is java.awt. event.ComponentAdapter an adapter?  RSS feed

Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

My book says that ComponentAdapter is associated with the Adapter pattern. The class name obviously implies it

The Javadocs says:

An abstract adapter class for receiving component events. The methods in this class are empty. This class exists as convenience for creating listener objects.
Extend this class to create a ComponentEvent listener and override the methods for the events of interest. (If you implement the ComponentListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)

It seems to me that this class uses the Template pattern and not the Adapter. After all ComponentAdapter doesn't seem to adapt anything; it allows us to override pre-defined methods.

Any thoughts?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!