Bug 218655 - [api][breaking] Provide SystemType enablement info in non-UI
Summary: [api][breaking] Provide SystemType enablement info in non-UI
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 215820
  Show dependency tree
 
Reported: 2008-02-12 12:17 EST by Martin Oberhuber CLA
Modified: 2008-02-12 12:34 EST (History)
1 user (show)

See Also:
mober.at+eclipse: review? (dmcknigh)
mober.at+eclipse: review? (ddykstal.eclipse)


Attachments
Patch making the change (11.59 KB, patch)
2008-02-12 12:30 EST, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-02-12 12:17:54 EST
Currently, only RSESystemTypeAdapter#isEnabled() can be used to check whether a given system type is currently enabled.

The problem with this is, that it binds enablement info to plugins that live in the UI space only. I think that also plain non-UI plugins should be able to filter out system types which are statically configured but not currently enabled.

In order to support this, IRSESystemType#isEnabled() should be provided instead of RSESystemTypeAdapter#isEnabled(). This is also a prerequisite for moving the SystemRegistry implementation into non-UI as per bug 215820.

Note that extenders who provide their own implementations by subclassing AbstractRSESystemType may want to use this functionality to also change enablement based on available licensing and the like.
Comment 1 Martin Oberhuber CLA 2008-02-12 12:30:20 EST
Created attachment 89520 [details]
Patch making the change

Attached patch makes the requested change.

I think it is important that the notion of whether a system type is enabled or not is always consistent. There should not be a difference between "enabled for non-UI plugins" versus "enabled for UI visibility".

Therefore, this is a breaking API change: extenders which used to provide their own subclass of RSESystemType along with their own subclass of RSESystemTypeAdapter and their own isEnabled() method would return proper enablement only to UI plugins, but not to non-UI plugins querying the IRSESystemType directly.

Such clients need to move the code that they used to have in their RSESystemTypeAdapter subclass into their AbstractRSESystemType subclass instead. In order to force them make this change, 
   RSESystemTypeAdapter#isEnabled()
has been marked final in this patch, such that extenders who used to override the method are notified of the required change by means of a compiler error.
Comment 2 Martin Oberhuber CLA 2008-02-12 12:33:12 EST
Patch committed, please review:
[218655][api] Provide SystemType enablement info in non-UI
   IRSESystemType
   AbstractRSESystemType
   RSESystemTypeAdapter
   SystemPreferencesManager

Note that I can back out the change if requested.