This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 20601

Summary: Easier way to provide attributes to PropertyEditor via PropertyPanel
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: ExplorerAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: blocker CC: mentlicher
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Suggested patch
A NPE I got.

Description Jaroslav Tulach 2002-02-15 15:43:56 UTC
Currently it is necessary when one wants to provide additional attributes to
ExPropertyEditor to either use Nodes or write beanInfo for own object. Because
this is a common task, this should be simplified as much as possible.

There is a constructor new DefaultPropertyModel (bean, propertyName) right now
that uses beaninfo to find the right PropertyDescriptor. The suggestion is to
add new constructor: new DefaultPropertyModel (bean, featureDescriptor) so one
could use:

PropertyDescriptor pd = new PropertyDescriptor ("myProperty", bean.getClass ());
pd.setPropertyEditorClass (PropertyEditorManager.findEditor (Object.class));
pb.setValue ("superClass", MyProperty.class);
model = new DefaultPropertyModel (bean, pd);
panel = new PropertyPanel (model);

Which is much simpler than writing own bean info.
Comment 1 Jaroslav Tulach 2002-02-20 07:02:43 UTC
Created attachment 4757 [details]
Suggested patch
Comment 2 Jaroslav Tulach 2002-02-20 16:40:19 UTC
Implemented in OpenIDE >= 2.4
Comment 3 Martin Entlicher 2002-02-20 16:49:10 UTC
I'm testing it just now and it seems to work nice :-)
Thanks.
Comment 4 Martin Entlicher 2002-02-20 17:54:45 UTC
Created attachment 4766 [details]
A NPE I got.
Comment 5 Martin Entlicher 2002-02-20 17:55:46 UTC
I got the attached exception. It seems to be related to the change
performed. Thus reopening..
Comment 6 Martin Entlicher 2002-02-20 18:19:45 UTC
Also the property editor sets the selected service immediately. On
cancel it sets it back to the original one, but I think, that this is
not necessary is it?
Comment 8 Quality Engineering 2008-12-23 14:34:08 UTC
This issue had *1 votes* before move to platform component