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 107239 - Profile Project in context menu is different than UI spec.
Summary: Profile Project in context menu is different than UI spec.
Status: VERIFIED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Sedlacek
URL:
Keywords:
: 98516 104365 107798 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-19 15:26 UTC by Jaroslav Pospisil
Modified: 2007-09-19 18:49 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suggested patch (14.94 KB, patch)
2007-06-28 09:31 UTC, Milos Kleint
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Pospisil 2007-06-19 15:26:29 UTC
"Profile Project" item in Web Project context menu don't correspond with UI specification.
See http://wiki.netbeans.org/wiki/view/ProjectContextualMenus .
Comment 1 Jaroslav Pospisil 2007-06-19 15:42:12 UTC
This is the same also for EAR.
Comment 2 Jaroslav Pospisil 2007-06-20 08:45:42 UTC
It seems that Profile item doesn't correspond with UI specification for all Web and J2EE projects (web,web
freeform,ejb,ear...).
Comment 3 Jiri Sedlacek 2007-06-21 13:59:07 UTC
Profile Project is placed incorrectly in project popup menu for each project type. I'm not aware of any API which would 
make it possible to follow the UI spec and place Profile Project right below Test.

Reassigning to projects for evaluation what can be done.
Comment 4 Milos Kleint 2007-06-21 15:17:16 UTC
I assume you currently register your action under Projects/Actions in layers, right?


I basically see 2 solutions, however both require changes done in all the project type code (thus each project type
maintainer will have to fix it on his own)

1. Create a different placeholder in layers (Projects/Profiler-Actions) and put the loading of the folder in the right
place.
2. Have the profile action added to CommonActions class and allow the profiler guys to plug into that somehow.
the project type code would that have to add something like:
actions.add(CommonProjectActions.profileProjectAction());

Any of the solutions preferred? 
1. probably easier to code but means more copy&paste code in each project type codebase.
Comment 5 Jesse Glick 2007-06-21 18:32:38 UTC
Really we ought to have something like editor/mimelookup/api for merging generic and specific action lists to form
project context menus. I have never been happy with the Projects/Actions folder because it does not include the actions
that the project itself provides.

This issue requires API changes. I recommend it be waived for 6.0 and we can fix it properly in the next release.
Comment 6 Milos Kleint 2007-06-21 20:24:53 UTC
I'm not sure it's acceptable to waive, especially given that a temporary solution is reasonably simple. 

I agree that a long term solution is something along the lines of mime lookup (or is it looks? ;)
However can mime lookup also mask/remove generic action from a specific project type? 
For example the maven projects don't have "Profile"-ing implemented, so it doesn't really make sense to show that in
popup. (that's a bug, but I'm sure there's also some non-bug usecases.) 

So what about a "Projects/Profiler_actions_temporary" layer location with "Profile" action there. for 6.0.
Comment 7 Jesse Glick 2007-06-21 21:13:27 UTC
The MIME Lookup API does indeed support hiding files from base folders. In this case I don't think it would be needed
anyway, since the Profile Project action (or whatever) should simply disable (and hide) itself when included in the
context menu of projects to which it cannot be applied.

A temporary friend API for 6.0 such as you suggest might be OK, so long as there is a P2 DEFECT filed for post-6.0 to
remove or replace it. Should go to apireviews.
Comment 8 Jesse Glick 2007-06-21 21:14:56 UTC
BTW an alternate hack for 6.0, with lower risk of producing compatibility problems, would be for project types to just
look for actions in Projects/Actions/ with 'profiler' somehow in their name (details TBD) and move them up.
Comment 9 pzajac 2007-06-22 12:03:39 UTC
*** Issue 107798 has been marked as a duplicate of this issue. ***
Comment 10 Jiri Sedlacek 2007-06-26 11:27:47 UTC
*** Issue 98516 has been marked as a duplicate of this issue. ***
Comment 11 Jiri Sedlacek 2007-06-26 11:27:59 UTC
*** Issue 104365 has been marked as a duplicate of this issue. ***
Comment 12 Milos Kleint 2007-06-28 09:31:18 UTC
Created attachment 44503 [details]
suggested patch
Comment 13 Milos Kleint 2007-06-28 09:52:32 UTC
please review this change. While it's not intended to be an official contract, it probably deserves a review.

We need to move the "Profile" action to a different location. 
The current api for profiler and other modules to put items into the project's popup menu is to register your action in
layers under "Projects/Actions". 

In order to place the profile action elsewhere (according to spec) I introduced another location in the layers which is
intended for the profiler to use only.

Comment 14 Milos Kleint 2007-07-02 09:06:12 UTC
thanks for the review
Comment 15 Milos Kleint 2007-07-02 09:31:47 UTC
done. profiler guys, please move your profiler action to Projects/Profiler_Actions_temporary folder in layers.


Checking in web/project/src/org/netbeans/modules/web/project/ui/WebLogicalViewProvider.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/WebLogicalViewProvider.java,v  <--  WebLogicalViewProvider.java
new revision: 1.13; previous revision: 1.12
done
Checking in java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SELogicalViewProvider.java;
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SELogicalViewProvider.java,v  <-- 
J2SELogicalViewProvider.java
new revision: 1.28; previous revision: 1.27
done
Checking in j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/EjbJarLogicalViewProvider.java;
/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/EjbJarLogicalViewProvider.java,v  <-- 
EjbJarLogicalViewProvider.java
new revision: 1.28; previous revision: 1.27
done
Checking in j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/ui/J2eeArchiveLogicalViewProvider.java;
/cvs/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/ui/J2eeArchiveLogicalViewProvider.java,v  <-- 
J2eeArchiveLogicalViewProvider.java
new revision: 1.23; previous revision: 1.22
done
Comment 16 Jiri Sedlacek 2007-07-02 09:39:43 UTC
Thanks for fixing at projects side, reopening (original issue not yet fixed) and assigning back to profiler.
Comment 17 Jiri Sedlacek 2007-07-09 13:56:06 UTC
Could you please update also popup menus of other project types according to the spec? I cannot commit the profiler-
side fix, it would cause a regression for these project types:

 Freeform Java Project
 Web Freeform Project
 Plugin Modules
  - Module
  - Module Suite
  - Library Wrapper Module
Comment 18 Jiri Sedlacek 2007-07-09 14:11:04 UTC
OK, will try to fix myself...
Comment 19 Tomas Hurka 2007-07-10 13:35:41 UTC
Fixed for Freeform project and Plugin Modules

Checking in ant/freeform/src/org/netbeans/modules/ant/freeform/Actions.java;
/cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/Actions.java,v  <--  Actions.java
new revision: 1.25; previous revision: 1.24
done
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java;
/cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java,v  <--  ModuleActions.java
new revision: 1.31; previous revision: 1.30
done
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java;
/cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java,v  <--  SuiteActions.java
new revision: 1.26; previous revision: 1.25
done
Comment 20 Jiri Sedlacek 2007-07-10 14:52:20 UTC
Profile Project action moved to Projects/Profiler_Actions_temporary folder in profiler trunk. Fixed for Beta1.
Comment 21 Jaroslav Pospisil 2007-07-23 15:19:58 UTC
VERIFIED
Comment 22 Tim Lebedkov 2007-09-19 18:49:41 UTC
ok