Bug 150939 - [api] IPropertyType should have a "read-only" setting
Summary: [api] IPropertyType should have a "read-only" setting
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-07-18 08:50 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:17 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 Martin Oberhuber CLA 2006-07-18 08:50:22 EDT
It should be possible to define properties as "read-only" in order to avoid users from modifying them in the ServicesForm or ConnectorServicesForm.
Comment 1 David Dykstal CLA 2007-04-05 12:16:03 EDT
I believe we should have this be an attribute of IProperty and not IPropertyType. Comments?
Comment 2 Martin Oberhuber CLA 2007-04-05 12:22:30 EDT
To be honest, I think that both make sense somehow.

The original intent was for properties like an "Object Type" that can never be changed by a user, because an object is an object and cannot ever change its type. It's a read-only property that is shown for information only.

But then you are right, there are also properties that are theoretically editable (like the name of an object, for instance) but cannot be edited at a given time - either because they are locked, or a file system is read-only, or a dialog just does not support editing.

My feeling is that for the latter case, typically, it's an all-or-nothing issue: either all those properties which are editable in principle can also be edited (because the file system allows it etc) or none can be edited. 

Therefore I think that IProperty.setReadOnly() is of less value than IPropertyType.setReadOnly().
Comment 3 David Dykstal CLA 2007-04-05 12:49:13 EDT
Types have typically been immutable. This has the pragmatic side effect of allowing singleton instances to be shared. Having a settable read-only attribute would break this unless we introduce new singletons for the read-only types.
Comment 4 David Dykstal CLA 2007-04-05 12:51:15 EDT
Another thought - by "read-only" you don't want to disallow the setting of a property value in the IProperty protocol, you just want to have a means of disallowing editing in a dialog, correct?
Comment 5 David Dykstal CLA 2007-04-05 14:52:05 EDT
Added the read-only attribute to IProperty which is needed in any case. Please re-open if this is really desired for IPropertyType as well.
Comment 6 Martin Oberhuber CLA 2008-08-13 13:17:39 EDT
[target cleanup] 2.0 M6 was the original target milestone for this bug