|Re: Dual Display - Global SelectionService [message #336207 is a reply to message #336084]
||Fri, 29 May 2009 08:31
| Marcel Hoetter
Registered: July 2009
thank you for your post! Answers and more questions below:
Paul Webster schrieb:
> Well, where do you expect the global SelectionService to be used?
The idea is that selections done in one of the WorbenchWindows are propagated
to the other WorkbenchWindows as well.
Example: If i have two WorkbenchWindows open and i select an object in a view displayed in one of
the WorkbenchWindows, i want:
* That selection listeners are informed about this selection change in both WorkbenchWindows.
* Command handlers to update their enabled state accordingly (thus enabling/disabling menu
contributions, buttons, etc.)
As said before, our current idea for a solution would be to connect the SelectionServices of all
open WorkbenchWindows, possibly by implementing a SelectionService with an application-global scope.
> The workbench window level SelectionServices continually update on part
> activation (within their respective windows), and that includes one of
> the two workbench windows taking focus (it will reset that workbench
> window selection without changing the other workbench window current
> selection, but it will update the IEvaluationService currentState to be
> tracking the selection of the new window that just took focus).
As far as i understand, propagating selection events between all open WorkbenchWindows would not
interfere with the Command FW?
Are there any other services or is there anything else in an RCP application that might be affected
unfavorably by this?
|Re: Dual Display - Global SelectionService [message #336224 is a reply to message #336207]
||Mon, 01 June 2009 13:27
| Paul Webster
Registered: July 2009
Marcel Hoetter wrote:|
> The idea is that selections done in one of the WorbenchWindows are
> to the other WorkbenchWindows as well.
> Example: If i have two WorkbenchWindows open and i select an object in a
> view displayed in one of
> the WorkbenchWindows, i want:
> * That selection listeners are informed about this selection change in
> both WorkbenchWindows.
> * Command handlers to update their enabled state accordingly (thus
> enabling/disabling menu
> contributions, buttons, etc.)
I think you might see unpredictable results. The current selection
service, org.eclipse.ui.ISelectionService, is specifically designed to
work only within one IWorkbenchWindow. For example, the listeners
include the IWorkbenchPart, which is only valid within the window. The
other windows can't really see that part.
> As far as i understand, propagating selection events between all open
> WorkbenchWindows would not
> interfere with the Command FW?
The command framework has a global application context that provides
"selection", so it already sees a global selection. But to provide
compatibility with the current Workbench Window behaviour, contributions
from org.eclipse.ui.menus are restricted from changing unless their
WorkbenchWindow is the active one.
But anything accessing the IEvaluationService directly will see the
global selection (unrestricted).
Powered by FUDForum
. Page generated in 0.02504 seconds