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

Bug 365524

Summary: Remove palette dependencies from EditDomain
Product: [Tools] GEF Reporter: Bastian Roth <basti.roth>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Introduction of EditDomainWithPalette class none

Description Bastian Roth CLA 2011-12-04 10:23:42 EST
Build Identifier: 20110615-0604

Since I want to put some SWT controls on the palette, I cannot do this using the current palette implementation because it is based on GEF itself. As I can see, the only way to provide components like combo boxes, lists, text fields etc. on the palette is to re-implement them by extending Draw2D figures. But that is an laborious task and therefore I suggest to source out the concrete palette implementation from the EditDomain class.
My attached solution introduces a further EditDomain class called EditDomainWithPalette which then represents the base for the already existing DefaultEditDomain. For a successful outsourcing, the EditDomain class needs to become abstract because understandably the method loadDefaultTool() does not know how to determine the default tool. As from now, the concrete extensions of EditDomain shall ensure to implement this method (e.g. EditDomainWithPalette). Due to making EditDomain abstract, the class PaletteViewerProvider also needs to be adapted. In this class, every reference to EditDomain must be replaced with a reference to EditDomainWithPalette.
Of course with the proposed solution, the API of GEF 3.x breaks at some points. But I think that only few available projects are affected by this API evolution because every GEF project that I've seen so far is based on DefaultEditDomain, and not directly on EditDomain.

Reproducible: Always
Comment 1 Bastian Roth CLA 2011-12-04 10:30:12 EST
Created attachment 207884 [details]
Introduction of EditDomainWithPalette class
Comment 2 Alexander Nyßen CLA 2012-03-11 14:56:22 EDT
OK, as this includes API breaking changes, it is not applicable to GEF 3.8. However, I think this would be nice for GEF4, so changing title to indicate this is a GEF4 topic.