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 18551 - Property editor for array of DataObjects should be created
Summary: Property editor for array of DataObjects should be created
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Property Editors (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks: 19851
  Show dependency tree
 
Reported: 2001-12-12 01:40 UTC by Rochelle Raccah
Modified: 2008-12-22 09:49 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2001-12-12 01:40:30 UTC
The data object property editor should accept only single selection by default. 
If desired, multiple selection support can be added with another property
environment hint.
Comment 1 Rochelle Raccah 2001-12-12 01:43:54 UTC
Until issue 11928 is fixed, this is not available to set on the
BeanTreeView, but a workaround is possible:

BeanTreeView tree = new SingleSelectionBeanTreeView();

static class SingleSelectionBeanTreeView extends BeanTreeView
{
	SingleSelectionBeanTreeView ()
	{
		super();
		tree.getSelectionModel().setSelectionMode(
                            TreeSelectionModel.SINGLE_TREE_SELECTION);
	}
}
Comment 2 David Strupl 2002-01-07 14:18:52 UTC
I apologize but I am marking this as worksforme. According to cvs this
has always (at least since May 2001) been the case in the DataObject
editor's tree.
Do you request the possibility to select more nodes? Or?

This is currect code in the property editor:

        expPanel.getExplorerManager().addVetoableChangeListener(
        new VetoableChangeListener() {
            public void vetoableChange(PropertyChangeEvent evt) throws
PropertyVetoException {
                if (evt.getPropertyName().equals
                (ExplorerManager.PROP_SELECTED_NODES)) {
                    Node [] nodes = (Node []) evt.getNewValue();
                    if ((nodes != null) && (nodes.length > 1)) {
                        throw new PropertyVetoException("Only one node
can be selected here", evt); // NOI18N
                    }
                }
            }
        });
Seems to work for me. Could you please be more specific as to what
does not work? If there is something please reopen this issue.
Thanks.
Comment 3 Rochelle Raccah 2002-01-07 17:58:35 UTC
A cleaner solution would be to fix issue 11928 and use that instead of 
the vetoable listener.  That would also enable adding a hint for this 
property editor to allow for multiple selection (which might be useful 
as long as it's not the default) and a clean implementation of that.
Comment 4 David Strupl 2002-01-08 08:32:14 UTC
Sorry, but I have to insist that what is there works fine.

If you want a possibility to select more DataObjects at once we have
to create a new property editor for array of data objects - there is
no way how could the existing editor return the selection array. The
editor cannot be enhanced to handle arrays - there has to be a new one
(they can share code of course but the PropertyEditor class has to be
created). If this is what you want please comment on this a request
for enhancement - if you think it should be there give it a high
priority and vote for the issue. Meanwhile I am changing the issue
type to enhancement since I don't see any defect here. And also I am
changing the description to match the requirement.

As for 11928 - I don't think that the API change is necessary. The
listener solution works (not very nice but works fine). The opinions
on this can differ - you can bring the issue to openide-dev, vote,
argument etc. Please add comments directly to the #11928.
Comment 5 David Strupl 2002-01-08 08:32:56 UTC
Ooops. I forgot to clear the dependency - these are separate issues IMHO.
Comment 6 Rochelle Raccah 2002-01-08 19:47:40 UTC
As you can see in my update to issue 11928 - the user experience is
different based on whether the treeview enforces single selection by a
vetoable listener or directly setting on the tree.  The user
experience should be consistent with other single selection trees. 
I'll file a separate cleanup issue for this (for the data object
editor).  Right now I have no need for an array of data object
property editor, so for me, this enhancement is low priority.
Comment 7 David Strupl 2002-01-09 14:59:55 UTC
Low priority --> P4.
Comment 8 Marek Grummich 2002-07-22 08:43:53 UTC
Target milestone was changed from '3.4' to TBD.
Comment 9 Marek Grummich 2002-07-22 09:14:46 UTC
Target milestone was changed from '3.4' to TBD.
Comment 10 Marian Mirilovic 2002-12-06 17:09:40 UTC
reassigne to Tim, new owner of property editors.
Comment 11 _ tboudreau 2003-04-04 10:11:38 UTC
Since it appears that DataObjects will go away with the DataSystems
redesign, marking as wontfix.
Comment 12 Rochelle Raccah 2003-04-04 22:55:37 UTC
Will there be a property editor for nodes/file objects/whatever the
replacement is?  If so, please consider also providing an editor for
an array of those objects.
Comment 13 Quality Engineering 2003-07-01 15:47:03 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified

Comment 14 Quality Engineering 2003-07-01 16:17:46 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.
Comment 15 Rochelle Raccah 2003-07-01 23:27:31 UTC
Reopening as an enhancement for after datasystems redesign.
Comment 16 _ tboudreau 2003-07-18 19:18:25 UTC
One thing I don't understand:  How is this request for 
enhancement not satisfied by 
org.netbeans.beaninfo.editors.DataObjectArrayEditor?  It
sure looks like there's a property editor for this already.

Please close if so.
Comment 17 Rochelle Raccah 2003-07-19 01:09:00 UTC
It looks like that should do the trick, but I have never used it.  Is
there an example or test case?  I looked at the code a bit and it
calls setMultiSelection(true) on the panel, but I can't see where that
is used to do anything to the tree view.
Comment 18 _ tboudreau 2003-07-19 03:02:11 UTC
I haven't the foggiest.  Adding David to cc in case he can
shed some light.
Comment 19 David Strupl 2003-07-19 13:52:05 UTC
1. DataObjects are being replaced by something else. So this whole
issue is IMHO Wontfix.
2. The problem with DataObjectArrayEditor is IMHO that you cannot
reference the class from a module that does not depend on core. And if
it is not picked up automatically (if you specify in BeanInfo of your
class that the property uses java.beans.IndexedPropertyDescriptor) you
are out of luck unless you are able to refer to the editor by
specifying class name as a string. If I remember corretly this class
is used from core so the core classes can access its class.
I am not sure - the last thing I would try before giving up would be
to  try to use setPropertyEditorClass() in Node.Property(Support) (or
wherever this method is) with parameter being a class obtained using
the classloader obtained as Lookup.getDefault().lookup(ClassLoader.class).
Comment 20 _ tboudreau 2004-04-19 14:53:17 UTC
Passing property editor issues to new owner, Jirka
Comment 21 Jiri Rechtacek 2008-10-16 16:10:50 UTC
Obsolete I think. Closed as WONTFIX