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 151057 - Hide Obsolete Property Editor APIs
Summary: Hide Obsolete Property Editor APIs
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: tomwheeler
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2008-10-22 18:44 UTC by tomwheeler
Modified: 2014-11-05 09:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomwheeler 2008-10-22 18:44:45 UTC
In accordance with this thread from nbdev:

   http://www.netbeans.org/servlets/ReadMsg?list=nbdev&msgNo=42825

I propose that the deprecated APIs relating to property support and editing be hidden somehow, in accordance to the new
compatibility policy:

   http://wiki.netbeans.org/CompatibilityPolicy

These older APIs have newer counterparts, mostly using PropertySupport, PropertyEnv and standard classes from the
java.beans package.  The mere existence of these older APIs is confusing for platform developers who are trying to
figure out the correct to create and use custom property editors.  I offer the following threads from the dev@openide
list to support this claim:

   http://openide.netbeans.org/servlets/ReadMsg?list=dev&msgNo=21170

   http://openide.netbeans.org/servlets/ReadMsg?listName=dev&msgNo=23282

The documentation related to this change should also state what the preferred approach for using the classes that
replace these.
Comment 1 Jaroslav Tulach 2010-06-18 07:32:33 UTC
We can try this for post 6.9 version, but I need help with rewriting existing usages of deprecated APIs. Are you volunteering, Tom?

Btw. the mail archive links are broken. I expect you are talking about deprecating and hiding:

http://bits.netbeans.org/6.9/javadoc/org-openide-explorer/org/openide/explorer/propertysheet/editors/EnhancedPropertyEditor.html
http://bits.netbeans.org/6.9/javadoc/org-openide-explorer/org/openide/explorer/propertysheet/editors/EnhancedCustomPropertyEditor.html
http://bits.netbeans.org/6.9/javadoc/org-openide-explorer/org/openide/explorer/propertysheet/editors/NodePropertyEditor.html

Right? Here is a grep of an nbms-and-javadoc job build output yielding 27 lines:

~$ grep Enhanced.*PropertyEditor out.txt  | cut -f 1 -d ":" | grep java$ | cut -c 50- | sort -u
beans/src/org/netbeans/modules/beans/beaninfo/CustomCodeEditor.java
beans/src/org/netbeans/modules/beans/IdxPropertyTypeEditor.java
beans/src/org/netbeans/modules/beans/PropertyTypeEditor.java
contrib/remotefs/src/org/netbeans/modules/remotefs/ftpfs/PasswordEditor.java
contrib/tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/TaskTagsPanel.java
contrib/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/DateSelectionPanel.java
jellytools.platform/src/org/netbeans/jellytools/properties/Property.java
j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/ChoiceEditor.java
j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/Int0Editor.java
j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/LogLevelEditor.java
j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/ui/DDTablePanel.java
j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/ValidationMethodEditor.java
o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java
openide.explorer/src/org/openide/explorer/propertysheet/ComboInplaceEditor.java
openide.explorer/src/org/openide/explorer/propertysheet/CustomEditorAction.java
openide.explorer/src/org/openide/explorer/propertysheet/CustomEditorDisplayer.java
openide.explorer/src/org/openide/explorer/propertysheet/InplaceEditorFactory.java
openide.explorer/src/org/openide/explorer/propertysheet/PropertyDialogManager.java
openide.explorer/src/org/openide/explorer/propertysheet/WrapperInplaceEditor.java
uml.propertysupport/src/org/netbeans/modules/uml/propertysupport/customizers/DocumentationCustomizer.java
uml.propertysupport/src/org/netbeans/modules/uml/propertysupport/customizers/ParameterCustomizer.java
uml.propertysupport/src/org/netbeans/modules/uml/propertysupport/customizers/PropertyElementCustomizer.java
uml.propertysupport/src/org/netbeans/modules/uml/propertysupport/customizers/ReturnTypeCustomizer.java
visualweb.jsfsupport.designtime/src/org/netbeans/modules/visualweb/faces/dt/std/ValueBindingPanel.java
xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/NullChoicePropertyEditor.java
xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/NullStringCustomEditor.java
xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/TreeNodeFilterCustomEditor.java

It should not be that hard to eliminate these usages and then use @PatchBytecode annotation to hide the interfaces from the API.
Comment 2 Jesse Glick 2010-06-18 15:28:16 UTC
(In reply to comment #1)
> http://bits.netbeans.org/6.9/javadoc/org-openide-explorer/org/openide/explorer/propertysheet/editors/EnhancedCustomPropertyEditor.html

Fixed links in core-main #4db7cceca65d

And what about NodeCustomizer?

> ~$ grep Enhanced.*PropertyEditor out.txt  | cut -f 1 -d ":" | grep java$ | cut
> -c 50- | sort -u

Better to search directly in sources:

hg locate -r . -0 \*\*.java | xargs -0 grep -lZ -- org\\.openide\\.explorer\\.propertysheet\\.editors\\.\[EN\] | xargs -0 ls -l

producing 31 hits in main (excepting openide.explorer and openide.nodes), and 17 in contrib.

> use @PatchBytecode annotation to hide the interfaces from the API

I guess you mean @PatchedPublic, which would need to be extended to types as well as methods. Not so easy - Enhanced*Editor are used from the org.openide.explorer.propertysheet package. (NodeCustomizer is used from org.openide.nodes.TMUtil and RADComponentNode in form; not sure who uses NodePropertyEditor.) So we can either leave them @Deprecated but supported as currently, or really delete them and all support for them. Note that

http://wiki.netbeans.org/CompatibilityPolicy#Technical_procedure_for_making_an_incompatible_phased_change

allows the latter option but only in a release after all known usages have been removed and the deletion has been preannounced; it would also mean a change to org.openide.explorer/1.
Comment 3 tomwheeler 2010-06-21 16:03:45 UTC
The relevant part from the inaccessible e-mail thread was the list of classes:

Here are the ones you noted:

 - EnhancedPropertyEditor
 - EnhancedCustomPropertyEditor 

and here are the ones I mentioned but you did not:

 - ExPropertyModel
 - DefaultPropertyModel
 - NodeCustomizer

You also mentioned NodePropertyEditor but I did not reference that in my original e-mail.  It is deprecated and of no use for new code, so I think it should be on the list as well.

Yes, I will volunteer to update current uses of these classes in the NetBeans codebase.
Comment 4 Jaroslav Tulach 2010-06-22 09:12:23 UTC
Re. "Yes, I will volunteer to update current uses of these classes" - OK, let's start with that. The less usages is there, the better. Then it will be easier to deprecate all/some of the classes.

Tom, unless you want to integrate yourself, create a patch, attach it to a bug, make the bug block this one. I'll try to help with convincing module owners that the fix is needed.
Comment 5 Jaroslav Tulach 2010-07-16 12:52:40 UTC
Assigning to Tom to provide some of the cleanup patches first.
Comment 6 tomwheeler 2010-07-16 15:15:42 UTC
Accepted -- I expect to be able to work on this in about two weeks.
Comment 7 tomwheeler 2010-08-01 22:22:38 UTC
I've started working on this today.  The following lists the classes I want to hide, the usages I found in the Hg main sources and what the Javadoc suggests to replace them with.

## org.openide.explorer.propertysheet.editors.EnhancedCustomPropertyEditor
## Use PropertyEnv instead.
-------------------------------------------------------------------------------------------------
  beans/src/org/netbeans/modules/beans/beaninfo/CustomCodeEditor.java
  compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/properties/extension/SimpleTabularDataCustomEditor.java
  compapp.configextension/src/org/netbeans/modules/compapp/configextension/handlers/properties/HandlerChainCustomEditor.java
  compapp.configextension/src/org/netbeans/modules/compapp/configextension/redelivery/properties/RedirectTargetCustomEditor.java
  compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/editors/PasswordCustomEditor.java
  compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/editors/SimpleTabularDataCustomEditor.java
  edm.editor/src/org/netbeans/modules/edm/editor/ui/view/conditionbuilder/ConditionBuilderView.java
  etl.editor/src/org/netbeans/modules/sql/framework/ui/view/conditionbuilder/ConditionBuilderView.java
  etl.editor/src/org/netbeans/modules/sql/framework/ui/view/GroupByView.java
  openide.explorer/src/org/openide/explorer/propertysheet/CustomEditorAction.java
  openide.explorer/src/org/openide/explorer/propertysheet/CustomEditorDisplayer.java
  openide.explorer/src/org/openide/explorer/propertysheet/PropertyDialogManager.java
  openide.explorer/src/org/openide/explorer/propertysheet/PropertyPanel.java
  visualweb.jsfsupport.designtime/src/org/netbeans/modules/visualweb/faces/dt/std/ValueBindingPanel.java
  visualweb.propertyeditors/src/com/sun/jsfcl/std/RaveStringCustomEditor.java
  visualweb.propertyeditors/src/com/sun/jsfcl/std/URLPanel.java
  visualweb.propertyeditors/src/org/netbeans/modules/visualweb/propertyeditors/binding/ValueBindingPropertyEditor.java
  visualweb.propertyeditors/src/org/netbeans/modules/visualweb/propertyeditors/StandardUrlPanel.java
  xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/NullStringCustomEditor.java
  xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/TreeNodeFilterCustomEditor.java


## org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor
## Update to use ExPropertyEditor and InplaceEditor.Factory, and also 
## create an implementation of InplaceEditor for the custom inline editor. 
-------------------------------------------------------------------------------------------------
  beans/src/org/netbeans/modules/beans/IdxPropertyTypeEditor.java
  beans/src/org/netbeans/modules/beans/PropertyTypeEditor.java
  compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/editors/JBILogLevelEditor.java
  j2ee.sun.appsrv81/appsrvbridge/src/org/netbeans/modules/j2ee/sun/util/EnhancedPropertyEditorFactory.java
  j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/ChoiceEditor.java
  j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/LogLevelEditor.java
  j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/editors/ValidationMethodEditor.java
  jellytools.platform/src/org/netbeans/jellytools/properties/Property.java
  o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java
  openide.explorer/src/org/openide/explorer/propertysheet/ComboInplaceEditor.java
  openide.explorer/src/org/openide/explorer/propertysheet/InplaceEditorFactory.java
  openide.explorer/src/org/openide/explorer/propertysheet/WrapperInplaceEditor.java
  xml.tax/src/org/netbeans/modules/xml/tax/beans/editor/NullChoicePropertyEditor.java


## org.openide.explorer.propertysheet.EnhancedCustomPropertyEditor
## Use PropertyEnv instead. See RectangleCustomEditor for details.
-------------------------------------------------------------------------------------------------
  dlight.visualizers/src/org/netbeans/modules/dlight/visualizers/FunctionsListSheetCell.java
  editor.deprecated.pre61settings/src/org/netbeans/modules/editor/options/ColoringEditorPanel.java

## org.openide.explorer.propertysheet.DefaultPropertyModel
## Use org.openide.nodes.PropertySupport.Reflection instead
-------------------------------------------------------------------------------------------------
  diff/src/org/netbeans/modules/diff/builtin/DiffPresenter.java

## org.openide.explorer.propertysheet.DefaultPropertyModel
## Use PropertySupport.Reflection or BeanNode if you need to expose bean properties
-------------------------------------------------------------------------------------------------
  form/src/org/netbeans/modules/form/RADComponentNode.java  
  openide.nodes/src/org/openide/nodes/TMUtil.java
Comment 8 Jaroslav Tulach 2010-08-10 12:40:38 UTC
I see the eliminatation of DefaultPropertyModel less important than the previously listed cases. But I am eagerly looking forward to see a patch.
Comment 9 tomwheeler 2010-10-07 15:11:37 UTC
I did start work on this, but it turned out to be a much bigger project than I originally expected and I haven't had as much time to work on it as I'd hoped.  Obviously, I missed the date for inclusion in 6.10, but I still do hope to complete it as time allows.
Comment 10 Jaroslav Tulach 2014-11-05 09:29:19 UTC
Dormant.