Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 27481 - [Navigator] Context menu should show icons
Summary: [Navigator] Context menu should show icons
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-02 06:10 EST by Sebastian Davids CLA
Modified: 2003-01-24 17:34 EST (History)
2 users (show)

See Also:


Attachments
showing the different changes (102.81 KB, image/jpeg)
2002-12-02 06:11 EST, Sebastian Davids CLA
no flags Details
fixes (14.46 KB, patch)
2002-12-02 06:35 EST, Sebastian Davids CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Davids CLA 2002-12-02 06:10:12 EST
The context menu of the navigator does not show the action's icons.
Comment 1 Sebastian Davids CLA 2002-12-02 06:11:04 EST
Created attachment 2603 [details]
showing the different changes
Comment 2 Sebastian Davids CLA 2002-12-02 06:35:26 EST
Created attachment 2604 [details]
fixes

Implementation notes:

ResourceNavigatorActionGroup
- pulled up getImageDescriptor() from MainActionGroup; changed visibility to
protected

MainActionGroup
- commented 3 lines because the neccessary images don't exist yet, s.b.

SortAndFilterActionGroup
RefactorActionGroup
GotoActionGroup
WorkspaceActionGroup
- needed access to getImageDescriptor()

PropertySheetPage
- the menu showed exactly the same 2 actions which are already on the action
bar as buttons -- the menu is therefore redundant; the bookmarks view doesn't
show a menu so the menu is not necessary for "consistency" either

Tasklist
- changed order of "Sort" and "Filter..." to be consistent w/ Navigator view.

Todo:

The following icons have to be created an the lines in
MainActionGroup#makeActions() have to be uncommented afterwards:

clcl16/collapseall.gif
clcl16/synced.gif
dlcl16/synced.gif
Comment 3 Nick Edgar CLA 2002-12-02 10:40:17 EST
Sebastian,

We intentionally do not show icons in context menus for several reasons:
1. when menu items also have check boxes or radio buttons, the menu ends up 
appearing too wide,
2. having too many icons is visually distracting,
3. we want to minimize the number of graphics resources allocated (and the time 
to load them)

While we appreciate your initiative in trying to fix PRs, it would be best to 
check with us first to ensure that your efforts mesh with the project goals.

Thanks,
Nick

Comment 4 Sebastian Davids CLA 2002-12-02 14:29:21 EST
Please do the following:

Import org.eclipse.ui.views (and its required plug-ins) into an empty workspace
and start this "minimal" Eclipse.

Create a project.
Create a bookmark.
Create a task.

Open Bookmarks, Tasks, Properties and Navigator view.

Right click on a task in the Tasks view ... observe: context menu shows the same
icons as the main menu/toolbar.

Right click on a bookmark in the Bookmarks view ... observe: context menu shows
the same icons as the main menu.

Click on the project; then right click on info/editable in the Properties view
... observe: context menu shows the same icon as the main menu.

Take a look at the Navigator context menu and observe under "New.." icons will
be shown for Project/Folder/File/Other...

The Navigator view is the _only_ view -- from the basic views -- _not_ showing
icons.

So from a "consistency" standpoint:

Either rework the context menus of Bookmarks/Tasks/Properties not to show the
icons or show the icons on the Navigator menu.

@@@@

On load times/memory footprint -- the Edit/Paste/Cut icons are so common (i.e.
will be on a lot of menus -- copy will be on almost every context menu) they
could be ISharedImages.

With Cut/Copy/Paste icons it should either be "show them everywhere" or "show
them nowhere" but not "show them in this menu but not in that menu".

@@@@

As it is right now, Eclipse's context menus are quite inconsitent -- some views
populate their actions w/ their respective icons (from main menu/toolbar), some
don't.

@@@@

Looking at http://www.eclipse.org/articles/Article-UI-Guidelines/Contents.html I
couldn't find a reference why not to show the icons.
Comment 5 Sebastian Davids CLA 2002-12-02 14:36:06 EST
The changes in PropertySheetPage and TaskList are not dependent on the "contex
menu" issue.
Comment 6 Knut Radloff CLA 2002-12-03 11:49:18 EST
I agree about the (in)consistency. Most context menus already have icons. 
The Navigator context menu already seems to have (some) empty space where the 
icons would go. 
Some JDT context menus have the same problem. The Outline View does not have 
any icons. The Java editor context menu has icons for some actions. It does not 
have icons for cut/copy/paste.
Comment 7 Sebastian Davids CLA 2002-12-03 12:00:17 EST
I would go ahead and add the icons to JDT too ...

But I wait for "go" :)

I think the descision on cut/copy/paste images as ISharedImages is the main
blocker on how to implement it.
Comment 8 Nick Edgar CLA 2002-12-03 13:35:59 EST
I've asked the usability folk for guidelines here.  In the meantime, we can fix 
the inconsistency.  Knut, could you please review Sebastian's changes.
We should also add more common icons to ISharedImages. 
See bug 26423 as well.
Comment 9 Nick Edgar CLA 2002-12-03 15:57:40 EST
Both members of the usability team feel that icons should be avoided on context 
menus because they add unneeded visual clutter, in addition to the other 
reasons above.

For now, we should fix the inconsistency by adding icons in the Navigator, but 
we should be sparing in how many icons we include.

The guidelines should be updated with this recommendation.  JFace needs to 
support this better, so that the same actions can be reused whether in a 
toolbar, pulldown menu, or context menu, even if they specify an image.

Comment 10 Nick Edgar CLA 2002-12-16 15:01:20 EST
Sorry, we were not able to look at your patch for M4, but will do so in M5.
Comment 11 Sebastian Davids CLA 2002-12-16 15:04:53 EST
No problem ;)
Comment 12 Knut Radloff CLA 2003-01-21 15:17:42 EST
Entered bug 29914 requesting new icons for collapse all/sync with editor.
Go Back/Forward/Up already have icons.
Go to resource does not use the icon, presumably because it only is in the pull 
down menu and not in a context menu or toolbar.
Comment 13 Knut Radloff CLA 2003-01-21 15:37:32 EST
Released all changes except for GotoActionGroup. Need to investigate why go to 
resource icon is not used.
Made some minor modifications to use all three kinds of icons 
(disabled,enabled,colored) if they are already available.
Comment 14 Nick Edgar CLA 2003-01-22 10:23:39 EST
Knut, in the Properties view, we can't remove the categories and filter 
actions from the view menu.  They need to be there for accessibility.
Comment 15 Sebastian Davids CLA 2003-01-22 11:06:35 EST
The bookmarks view should also have a view menu then.
Comment 16 Sebastian Davids CLA 2003-01-22 11:16:11 EST
Some thoughs:

Shouldn't every button on the action bar be on the view menu then?

If so, the "Add Task" and "Delete Task" from the Task view e.g. should be 
placed on the corresponding view menu also -- the key "Delete" maps to "Delete 
Task" but "Add Task"?

Isn't there a way to make the buttons "accessible" on the action bar?

If not the action bar's "function" would be reduced to "provide the commonly 
used functions of the view menu for quick access".
Comment 17 Sebastian Davids CLA 2003-01-22 11:39:03 EST
I found an answer to my first question in the UI guidelines:

"Any action which appears in the toolbar [of a view] must also appear in the 
menu" above 6.12.

@@

To be consistent the following views should be updated then:

"Add Task" & "Delete Task" should be placed on the view menu of the Task View

"Restore Default Value" -> Properties view menu

"Back", "Forward", "Up", "Sync w/ Editor", "Collapse All" -> Navigator View 
menu

"Delete" & "Go to" -> Bookmarks View  menu (doesn't even have a menu yet)

@@@@

Remains the question if we want to force creators of views to have a view menu 
even if they have only one action (or a very small number) for their view.

Properties View (3 buttons/2 menu items) <-> Bookmarks View (2 buttons/no menu 
items).

Under the guideline above both views would have to be adjusted.
Comment 18 Knut Radloff CLA 2003-01-22 12:43:30 EST
From looking at existing views I would have thought the guideline is that tool 
items that are neither on the view context menu nor the main menu bar need to 
be in the view menu.
Comment 19 Knut Radloff CLA 2003-01-22 12:45:13 EST
Nick, please see the previous couple of comments regarding view menus.
The guideline does not quite match reality and I wonder if it is still correct.
Comment 20 Nick Edgar CLA 2003-01-22 13:23:15 EST
Knut's assumption in comment #18 is correct.
The requirement for accessibility is only that an action on a toolbar also be 
accessible via -some- menu, not necessarily the view menu.
So if it's on the main menu, or the context menu that's fine.
The context menu should be used for items that apply to the selection or 
particular items in the view (i.e. new item).  The view menu should be used for 
settings that affect the presentation of items in the view, not the items 
themselves (sorting, filtering, etc.).

To address Sebastian's concerns:
"Add Task" & "Delete Task" should be placed on the view menu of the Task View
-> New Task and Delete are already on the context menu, so no change is needed.

"Restore Default Value" -> Properties view menu
-> on the context menu (it applies to the selection), so no change is needed

"Back", "Forward", "Up", "Sync w/ Editor", "Collapse All" -> Navigator View 
menu
-> all are in the Navigate menu except for "Collapse All"; collapsing all can 
be done reasonable quickly using the arrow keys (repeated left arrow collapses 
the current item)

"Delete" & "Go to" -> Bookmarks View  menu (doesn't even have a menu yet)
-> on the context menu

Properties View (3 buttons/2 menu items) <-> Bookmarks View (2 buttons/no menu 
items).
-> this is OK since the other items are on the context menu

Under the guideline above both views would have to be adjusted.
-> no adjustment is needed

Comment 21 Knut Radloff CLA 2003-01-22 16:07:30 EST
Backed out the change in the PropertySheetPage. Added icon for Go To Resource 
action.
So the recommendation for icons in context menus is to reduce them to a minimum 
but not necessarily avoid them altogether? 
I'd like to get the UI Guidelines article updated.
Comment 22 Knut Radloff CLA 2003-01-22 16:13:51 EST
Sent David and Greg a note to update the guidelines.
Comment 23 Sebastian Davids CLA 2003-01-23 00:07:29 EST
In the guideline's sentence both *the menu* are misleading if they do not
specifically refer to the view pulldown menu -- which is mentioned in the
sentences above and one sentence below the citation.

The guidelines for the view toolbar should be updated along the lines of Nick's
comment #20:

"Any action which appears in the toolbar must also appear in a menu--either the
context menu for selection based actions, the pulldown menu for presentation
actions, or the main menu for other actions--, but there is no need to duplicate
every action in the menus within the toolbar."

Filed bug 30039 to continue in a different thread because it would be a post 2.1
consideration and doesn't belong to "icons in context menus" :)
Comment 24 Nick Edgar CLA 2003-01-23 09:16:44 EST
Dave and Greg don't own the guidelines any more, we do.
Knut, please enter a separate PR against Platform UI with a [UI Guidelines] tag.
Comment 25 Knut Radloff CLA 2003-01-23 10:07:51 EST
Opened bug 30090 to get the guidelines doc fixed.
Comment 26 Sebastian Davids CLA 2003-01-23 14:31:36 EST
On the Navigator view:

"Filter..."

On the Task view:

"Filters..."
Comment 27 Knut Radloff CLA 2003-01-23 15:10:43 EST
In build 20030121 the Navigator menu uses "Filters..."
The Package Explorer does, too.

Also, it's best to open separate bugs for unrelated problems. The 
PropertySheetPage and TasksList patches ideally would have been in separate 
bugs as well since they don't address the "icons in context menus" problem.
I do appreciate your input!
Comment 28 Sebastian Davids CLA 2003-01-23 20:47:21 EST
looked at nightly build 200301230800:

Navigator: Filters
Tasks: Filter
Comment 29 Sebastian Davids CLA 2003-01-23 20:48:07 EST
had it the wrong way round the first time :(
Comment 30 Knut Radloff CLA 2003-01-24 14:18:17 EST
Entered bug 30200 for task view menu.
Comment 31 Sebastian Davids CLA 2003-01-24 17:34:36 EST
verified