Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332760 - [e4] Task List toolbar icons disappear when Focus button is pressed
Summary: [e4] Task List toolbar icons disappear when Focus button is pressed
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.7   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 321278 371807
  Show dependency tree
 
Reported: 2010-12-16 11:28 EST by Steffen Pingel CLA
Modified: 2012-02-16 14:37 EST (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (3.05 KB, application/octet-stream)
2011-10-19 14:56 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2010-12-16 11:28:56 EST
Steps:
1. Press Focus button in Task List

On Gtk only the New Task and Presentation button remain whereas on 3.x the Focus and Refresh button also remain in the toolbar.

This is the code that gets executed in TaskListView.setFocusedMode():

		IToolBarManager manager = getViewSite().getActionBars().getToolBarManager();
		ToolBarManager toolBarManager = getToolBarManager(manager);
		try {
			if (toolBarManager != null) {
				toolBarManager.getControl().setRedraw(false);
			}
			if (focusedMode && isAutoExpandMode()) {
				manager.remove(FilterCompletedTasksAction.ID);
				manager.remove(CollapseAllAction.ID);
			} else if (manager.find(CollapseAllAction.ID) == null) {
				manager.prependToGroup(ID_SEPARATOR_CONTEXT, collapseAll);
				manager.prependToGroup(ID_SEPARATOR_CONTEXT, filterCompleteTask);
			}
			updateFilterEnablement();
			manager.update(false);
		} finally {
			if (toolBarManager != null) {
				toolBarManager.getControl().setRedraw(true);
			}
		}
Comment 1 Remy Suen CLA 2011-01-04 11:47:18 EST
Not entirely sure if this problem is worth pursuing at the moment since I believe the tool bar code needs to be revamped, is this correct, Paul?
Comment 2 Remy Suen CLA 2011-10-19 10:08:15 EDT
(In reply to comment #0)
>             manager.update(false);

Could you see if calling getViewSite().getActionBars().updateActionBars() will fix the problem? Also see bug 336613. Calling update(boolean) on the IContributionManager is not the way to go about updating a view's action bars.
Comment 3 Steffen Pingel CLA 2011-10-19 14:56:10 EDT
Created attachment 205560 [details]
mylyn/context/zip
Comment 4 Steffen Pingel CLA 2011-10-19 14:56:35 EDT
Thanks for the hint! That fixes it. Committed 8d5132e57c898e8826764fe3ad29c4ea8f912d1f.

The only differences to 3.x besides ordering of the buttons is that some buttons get disabled when the Task List view looses focus. The get re-enabled once the view is clicked. This seems to apply to all actions registered through the "org.eclipse.ui.viewActions" extension point. Do you have any thoughts why that would be happening?
Comment 5 Remy Suen CLA 2011-10-19 14:59:06 EDT
(In reply to comment #4)
> The only differences to 3.x besides ordering of the buttons is that some
> buttons get disabled when the Task List view looses focus. The get re-enabled
> once the view is clicked.

I haven't installed Mylyn to check yet but I think I see what you mean.

This is like how 'Remove Selected Breakpoints' and 'Remove All Breakpoints' is enabled when the 'Breakpoints' view is active but they get disabled when you activate another view, correct?
Comment 6 Steffen Pingel CLA 2011-10-19 15:19:03 EDT
(In reply to comment #5)
> This is like how 'Remove Selected Breakpoints' and 'Remove All Breakpoints' is
> enabled when the 'Breakpoints' view is active but they get disabled when you
> activate another view, correct?

Yes, that's exactly the same in the for the 'Synchronize All' and 'Focus on Workweek' buttons. Is that intentional or is there a bug that tracks that?
Comment 7 Remy Suen CLA 2011-10-19 16:15:34 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > This is like how 'Remove Selected Breakpoints' and 'Remove All Breakpoints' is
> > enabled when the 'Breakpoints' view is active but they get disabled when you
> > activate another view, correct?
> 
> Yes, that's exactly the same in the for the 'Synchronize All' and 'Focus on
> Workweek' buttons. Is that intentional or is there a bug that tracks that?

I've opened bug 361472 for this problem. I will close this bug as the original problem is gone. Thank for your help, Steffen.