Summary: | Enhance exception message for AbstractBehavior#getFeedbackPartFactory(IViewer viewer) | ||
---|---|---|---|
Product: | [Tools] GEF | Reporter: | Markus Muehlbrandt <markus.muehlbrandt> |
Component: | GEF MVC | Assignee: | gef-inbox <gef-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | matthias.wienand |
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: | low-hanging fruit |
Description
Markus Muehlbrandt
2017-07-03 03:29:56 EDT
In addition to getFeedbackPartFactory(IViewer), AbstractBehavior also defines getHandlePartFactory(IViewer). Both methods throw an UnsupportedOperationException in their default implementation, so that they only need to be implemented if the individual behavior needs to access a feedback or handle part factory. Behaviors can apply any logic in response to changes. Some behaviors might need to generate feedback, others might need to generate handles, others might need to generate both or none. Therefore, I think it is wrong to force an implementation for these methods, however, I am open for a discussion. There is no doubt that the exception message can be enhanced, though. It should probably give more information about the error, along the lines: "The default mechanism for generation of feedback depends on a feedback part factory that needs to be made accessible by implementing the getFeedbackPartFactory(IViewer) method of the respective behavior. In order to query the factory from the viewer using a dedicated rule, an implementation can delegate to getFeedbackPartFactory(IViewer, String)." What do you think? |