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 57352 - Versioning menu elements are active for web projects, but not for java projects.
Summary: Versioning menu elements are active for web projects, but not for java projects.
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-01 18:01 UTC by Srividhya Narayanan
Modified: 2006-03-24 13:11 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The textual diff (9.09 KB, patch)
2005-04-04 18:20 UTC, Martin Entlicher
Details | Diff
Oops, vi has wrapped it, here is a corrected version. (9.01 KB, patch)
2005-04-04 18:24 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srividhya Narayanan 2005-04-01 18:01:28 UTC
In the versioning manager, I have added few projects of type web, ejb and java.
When I go to web and ejb type projects the versioning menu shows up for me to do
cvs operations at the project level. The same options dont show up for the plain
java projects.
Comment 1 Martin Entlicher 2005-04-02 18:42:31 UTC
True. This was not implemented for Java projects, because there can be external
source roots and there would have to be some projects - VCS integration to get
the list of files to act on.

Web projects can also have several various source roots, therefore the VCS
actions will likely not work correctly there.

So it needs to be discussed with web team whether the VCS actions should be
removed from the project node.

Moving to web to sort that out.
Comment 2 Pavel Buzek 2005-04-03 00:54:04 UTC
I created a Java project, a Web project and an EJB project under a cvs-ed
folder. I see CVS action on all project roots in Files explorer tab and on none
of them in Projects tab. 
I guess I am missing your point.
Can you clarify what menu exactly you are talking about?
Thanks.
Comment 3 Martin Entlicher 2005-04-04 16:40:26 UTC
Aha, I've identified the problem.
This is about Versioning menu, not the contextual menu. The contextual menu *is*
consistent, but the Versioning menu is not.

The problem is caused by the fact that Java project node does not have a
corresponding FileObject in the lookup. But Web project node does. The action in
Versioning menu takes the files to act on from FileObjects it finds in the
lookup of the selected nodes. So this is causing the difference.

I guess this was made for some reason and it's silly to request to remove the
FileObject from lookup of Web project node.

Thus I'm moving this back to VCS, I have to assure that the Versioning menu (the
contextual part) will be only on nodes that have FileSystemAction. This will
assure the consistency.
Comment 4 Martin Entlicher 2005-04-04 17:22:29 UTC
Uff, now I see that it's not so easy. When I add a check for FileSystemAction,
it removes the menu from Editor, which is not good!
The fix will likely be a pure hack - check for FileSystemAction only in case of
folders...

The same problem concerns VCS toolbar.
Comment 5 Martin Entlicher 2005-04-04 18:19:11 UTC
Fixed in trunk:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFSCommandsAction.java,v  <-- 
VcsFSCommandsAction.java
new revision: 1.20; previous revision: 1.19

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java,v
 <--  GeneralCommandAction.java
new revision: 1.26; previous revision: 1.25

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/VcsAllCommandsAction.java,v
 <--  VcsAllCommandsAction.java
new revision: 1.16; previous revision: 1.15
Comment 6 Martin Entlicher 2005-04-04 18:20:15 UTC
Created attachment 21361 [details]
The textual diff
Comment 7 Martin Entlicher 2005-04-04 18:24:06 UTC
Created attachment 21362 [details]
Oops, vi has wrapped it, here is a corrected version.
Comment 8 Jesse Glick 2005-04-04 20:41:42 UTC
I don't like this hack much, it does not address the real problem. Perhaps the
proper solution is that POJO projects *should* have the project directory in
their lookup if they do not have any external source roots. Or, a project with
external source roots should have multiple instances of FileObject in its
lookup, corresponding to Sources.GENERIC roots, and vcscore should know enough
to check for >1 FO in lookup. Or, the FO should be *removed* from the lookup of
every project node and vcscore should look for a Sources object and check
GENERIC source groups.
Comment 9 _ pkuzel 2005-04-05 09:24:12 UTC
Reviewed. We are late in release cycle justifing the hacky solution. 
Comment 10 Martin Entlicher 2005-04-05 13:46:46 UTC
I like the Jesse's idea, however, I do not think we can force other modules to
have FileObjects in their lookup iff they want to have VCS actions associated.
Ideally, that could be solved by some cookie, but that will definitely take some
time to implement. As we need some quick and robust solution, IMHO taking the
presence of FileSystemAction as a "cookie" works fine for this purpose.
Comment 11 Jesse Glick 2005-04-05 23:15:42 UTC
It's good enough for 4.1 I think.
Comment 12 Martin Entlicher 2005-04-06 13:31:24 UTC
O.K. Thanks. Fixed in release41 branch:

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java,v
 <--  GeneralCommandAction.java
new revision: 1.25.32.1; previous revision: 1.25

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/VcsAllCommandsAction.java,v
 <--  VcsAllCommandsAction.java
new revision: 1.15.6.1; previous revision: 1.15

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFSCommandsAction.java,v  <-- 
VcsFSCommandsAction.java
new revision: 1.19.6.1; previous revision: 1.19
Comment 13 Peter Pis 2005-04-08 09:00:05 UTC
Can you verify this issue, please?
Comment 14 Peter Pis 2005-06-20 14:55:04 UTC
Verified.