Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 508736

Summary: Generate the org.eclipse.gef.dot.internal.DotAttributes class
Product: [Tools] GEF Reporter: Tamas Miklossy <miklossy>
Component: GEF DOTAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand, nyssen
Version: unspecified   
Target Milestone: 5.0.0 (Oxygen) M5   
Hardware: PC   
OS: All   
Whiteboard:

Description Tamas Miklossy CLA 2016-12-06 07:34:49 EST
The DotAttributes class should contain the definitions of all dot attributes, their getter/setter methods and the getter/setter methods for the corresponding Builder objects (Graph.Builder, Node.Builder, Edge.Builder).

To make such definitions easier to maintain and less error-prone, the DotAttributes class should be generated using Xtend technology.
Comment 1 Alexander Nyßen CLA 2016-12-24 05:31:25 EST
I refactored DotAttributes into an Xtend class that uses an @DotAttribute active annotation to generate the getters and setters. The active annotation is defined by a newly created org.eclipse.gef.dot.generator bundle (which is optionally required by org.eclipse.gef.dot, as its a compile time-dependency; the generated DotAttributes class does not provide the annotations). I further merged DotLanguageSupport into DotAttributes, so the API is now more concise (the duplicate code within the DotJavaValidator could be removed).

There is still room for improvement. Within DotAttributes, validation and parsing could be split apart, and it is dubious whether the setters should implicitly validate (we could leave that to the client). Further, DotAttributes should offer a generic parse and serialize method for all attributes. 

Last, further parts of DotAttributes could be generated by introducing an active annotation on the class level (so the validators, parsers, and serializers, as well as the validate, parse, and serialize methods could be generated from the annotated fields).
Comment 2 Matthias Wienand CLA 2018-06-11 05:01:42 EDT
Since generation of DotAttributes is in-place since Oxygen M5, I resolve this ticket as fixed and set the target milestone accordingly.