Bug 440145 - Generalize IAdaptable so that adapters can be registered under the same class key, but with different roles
Summary: Generalize IAdaptable so that adapters can be registered under the same class...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF Common (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 439854
  Show dependency tree
 
Reported: 2014-07-22 12:38 EDT by Alexander Nyßen CLA
Modified: 2015-05-12 03:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2014-07-22 12:38:36 EDT
We should change the registration of adapters within IAdaptable from using a simple class key to an explicit AdapterKey, which consists of a Class key and an (optional) String or Object qualifier. As soon as more than one adapter is bound to a class key, the qualifier should be mandatory, while it should still be possible to bind a single adapter without the need to provide a qualifier (a default qualifier could be used in this case).

This way, adapter instances could be bound to the same class key but in different roles. This could e.g. be used to bind viewers as adapters to the domain (qualifying one as the "main" viewer and another one as the "palette" viewer, etc.) or registering selection feedback and selection handle geometry providers as adapter on visual parts or related behaviors.
Comment 1 Alexander Nyßen CLA 2014-07-23 02:35:10 EDT
Just an addition: This would also enable us to register different policies under the same class key but with different roles (e.g. different drag policies). The tools could decide whether they want to access all policies registered under a respective class key or just a specific one.
Comment 2 Alexander Nyßen CLA 2014-07-23 10:24:22 EDT
Revised IAdaptable and related AdapterMap bindings to use AdaperKeys rather than class keys for registering and retrieving adapters. Pushed all changes to origin/master. Resolving as fixed.