Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366568 - [Compatibility] command service refreshElements(*) not implemented
Summary: [Compatibility] command service refreshElements(*) not implemented
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.2 M6   Edit
Assignee: Remy Suen CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
: 371821 (view as bug list)
Depends on: 374289
Blocks: 366554
  Show dependency tree
 
Reported: 2011-12-13 11:02 EST by Paul Webster CLA
Modified: 2012-03-14 13:48 EDT (History)
3 users (show)

See Also:


Attachments
Patch (3.74 KB, patch)
2012-02-28 15:10 EST, Remy Suen CLA
no flags Details | Diff
Patch v02 (17.51 KB, patch)
2012-02-29 10:13 EST, Remy Suen CLA
no flags Details | Diff
Patch v03 (17.95 KB, patch)
2012-02-29 11:00 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2011-12-13 11:02:21 EST
org.eclipse.ui.commands.ICommandService.refreshElements(String, Map) tries to get the handler from the command, but org.eclipse.ui.internal.MakeHandlersGo is not an IElementUpdater.

This blocks:
org.eclipse.ui.tests.commands.CommandCallbackTest.testNoParametersWithCallbacks()
org.eclipse.ui.tests.commands.CommandCallbackTest.testParametersWithCallbacks()
org.eclipse.ui.tests.commands.CommandCallbackTest.testParmsToSameCommand()
org.eclipse.ui.tests.commands.CommandCallbackTest.testParmsToDifferentProtocol()

org.eclipse.ui.tests.commands.CommandCallbackTest.testCommandThroughWindow()
org.eclipse.ui.tests.commands.CommandCallbackTest.testCallbackCleanup()
Comment 1 Paul Webster CLA 2012-02-21 14:57:19 EST
*** Bug 371821 has been marked as a duplicate of this bug. ***
Comment 2 Remy Suen CLA 2012-02-28 15:10:00 EST
Created attachment 211760 [details]
Patch

Need slave services to ensure that the registered element updaters are removed when the window gets disposed.

The code in MakeHandlersGo is suspect but does seem to work. All seven tests in CommandCallbackTest are green anyway.
Comment 3 Paul Webster CLA 2012-02-28 15:16:02 EST
That's probably half of the loop.  But we converted most CCIs to HCIs in 4.x, so we probably need some kind of register pattern similar to what we do in the CCI constructor for the MHMIs and MHTIs.

Either in the HCI (but abstracted because HCI can't see the 3.x command service) or by walking the model at some point from org.eclipse.ui.workbench.  Then the handler calls methods on the UIElement which updates the model element which is then rendered correctly.  Ta Da!

PW
Comment 4 Remy Suen CLA 2012-02-29 10:13:47 EST
Created attachment 211804 [details]
Patch v02

(In reply to comment #3)
> Either in the HCI (but abstracted because HCI can't see the 3.x command
> service) or by walking the model at some point from org.eclipse.ui.workbench.

First approach seemed more straightforward than the other.
Comment 5 Remy Suen CLA 2012-02-29 11:00:49 EST
Created attachment 211815 [details]
Patch v03
Comment 7 Remy Suen CLA 2012-03-13 09:00:14 EDT
Verified by source code inspection with I20120312-1730.