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 32304 - it is not possible to make java resources hidden
Summary: it is not possible to make java resources hidden
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: API
Depends on:
Blocks: 31864
  Show dependency tree
 
Reported: 2003-03-25 15:06 UTC by Pavel Buzek
Modified: 2003-12-11 14:25 UTC (History)
0 users

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 Pavel Buzek 2003-03-25 15:06:43 UTC
I need a way to specify for a resource that it should be used but should not be shown in UI 
and the user should not be able to remove it. Maybe it's ok to show it in classpath customizers.

Hint: If ContentDescriptor.getVisualObject() returns null the resource should not be shown in 
UI.
Comment 1 Vitezslav Stejskal 2003-04-03 11:37:13 UTC
Pavle, shouldn't this be supported by JavaProject.createResource? I
saw you are the author of this API, why didn't you implemented your
own request in it? :-)

I guess you also need to be able to specify visibility declaratively
in project's nature, right?
Comment 2 Pavel Buzek 2003-04-04 08:22:23 UTC
To replay to your question: because JP.createResource() only delegates to FolderItem.createFolderLink(). 
What's behing that is a little cryptic to me ;-)

After all I think that this should be solved more generally, at the level of projects/ide module. 
Projects module already provides functionality to hide resources from UI and I think that having 2 ways 
to achive it would be wrong. Besides this I also think that this will be usefull for other modules then 
Java. Most importantly, even if the resource is marked as hidden by a module it would be good if the user 
still could make it visible if she wants to. I posted a similar request to projects-dev yesterday. If 
there are no objections reassign the issue to projects/ide and publish the attribute that it uses 
("isVisible"?) and you are done. The module would of course put the value of "isVisible" into shared 
settings. (I actually think that it makes no sense to have it private, but that's another issue).
Comment 3 Svata Dedic 2003-04-07 16:27:37 UTC
Vito, I suggest to make that an optional UI contract, available from 
PathResource.getOriginal()'s DataObject. UI visibility stuff does not 
really belong to data APIs, as createResource() is. 
 
[BTW PathResource ought to be a Lookup.Provider :-)] 
 
The other idea is to introduce an abstract concept of "system 
resources", with the UI to decide whether to hide or show such ones. 
In that case, it would be a parameter to createResource as well as a 
property of PathResource. 
 
 
Comment 4 Pavel Buzek 2003-04-10 15:14:18 UTC
What about adding this to the ProjectMemberVisualDescriptor? This is
not a data layer. It is generally available for any type of objects.

BTW, Svato: I removed the displayName parameter from createResource
because we would have to change this signature every time PMVD is
extended. It is better to do smtg like this:

PathResource res = jp.createResource ("x", fo);
ProjectMemberVisualDescriptor.create (ProjectMember.find
(res.getDefinition ().getPrimaryFile ())).setDisplayName ("XXX");
Comment 5 Dusan Balek 2003-05-16 12:45:35 UTC
isVisible() and setVisible(...) methods added to
ProjectMemberVisualDescriptor.
Comment 6 Pavel Buzek 2003-07-02 14:07:51 UTC
i've verified all these issues
Comment 7 Pavel Buzek 2003-07-02 14:18:52 UTC
closing all my verified issues