Bug 365524 - Remove palette dependencies from EditDomain
Summary: Remove palette dependencies from EditDomain
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-04 10:23 EST by Bastian Roth CLA
Modified: 2013-10-18 03:19 EDT (History)
1 user (show)

See Also:


Attachments
Introduction of EditDomainWithPalette class (17.24 KB, patch)
2011-12-04 10:30 EST, Bastian Roth CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.