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.
It is often an issue to find out the "username" of a DataObject. (menu, issue 18829, actions API, etc.). Because such name is constructed in DataNode it is always necessary to ask the DataObject for node delegate and thus create unnecessary objects. It might be wise to add public static String DataNode.findAnnotatedName (DataObject obj); public static Image DataNode.findAnnotatedIcon (DataObject obj); which would do the same logic as in getDisplayName and getIcon of DataNode, just allow others to use this without constructing the node. Problem1: DataObject with different node (not data node) could have different name. Answer1: I am not sure whether this is a real problem. Would work for most cases, I guess. Problem2: No place to attache PROP_DISPLAY_NAME listener - usually attached to Node. Answer2: One can listen on DataObject.PROP_NAME and rescan the name appropriatelly.
I'm not sure I see the point of such a method. Basically it would just get the set of files, and process them with the FileSystem.Status. You could do that yourself without such a method, right? So it would be only a convenience. The problems listed I see no good solution for. Consider e.g. AntProjectNode, the node delegate for an AntProjectDataObject. Its display name is not predictable from the data object without actually constructing the node, and changes in its display name are not predictable without constructing the node either. IMHO rather than creating a new API which we know in advance will be wrong in a number of cases and duplicates an existing API which is known to be right, we should concentrate on optimizing the node construction and ensuring that the node object does not consume a significant amount of memory.
So close as wontfix and copy the implementation of those static methods? I guess it is fine, except if somebody changes the default impl in future. But I close it.
It's true the default impl could change. However the nondefault impl for certain objects already is different. So any solution which doesn't actually ask the DataNode will be wrong sometimes anyway.
Ok. Silly idea.
Resolved for 3.4.x or earlier, no new info since then -> closing.