How ViewPart response to some EditorPart Action [message #513830] |
Thu, 11 February 2010 07:43  |
Eclipse User |
|
|
|
Hi,
I am writing an RCP Application and new to RCP. Now I have a editor part with a Text Control..When I select text in the Text Control and right click , a pop up menu will pop up. When I push one of the menu, I want to another viewpart can respond it? Now I am using following code to achieve this:
//In Editor Part
Event drawTextEvent = new Event();
drawTextEvent.data = selectText;
handlerService.executeCommand(
"command.drawText",
drawTextEvent);
//In command handler
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
IWorkbenchPage page = window.getActivePage();
GlyphLayoutView layout = (GlyphLayout)page.findView(GlyphLayout.ID);
layout.call(event.getTrigger().data);
............
I wonder if there is better way to achieve this between editor and viewpart? Because some parameter should be passed to viewpart.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04032 seconds