Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Selection Listener
Selection Listener [message #208153] Thu, 09 October 2008 11:26 Go to next message
Till Essers is currently offline Till EssersFriend
Messages: 92
Registered: July 2009
Member
Hi

I know it's a real newbie question, but I'm some kind of helpless right now.
How can I get notified when there is an object selected in the
DiagramEditor?

Sorry in advance :/
Till
Re: Selection Listener [message #208161 is a reply to message #208153] Thu, 09 October 2008 12:04 Go to previous message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Till Essers wrote:
> Hi
>
> I know it's a real newbie question, but I'm some kind of helpless right
> now.
> How can I get notified when there is an object selected in the
> DiagramEditor?
>
> Sorry in advance :/
> Till
See IPartListener, and grab the current IWorkbenchWindow, either through
the editor site or by asking the active workbench window

site.getWorkbenchWindow().getSelectionService().addSelection Listener(myListener);

or

PlatformUI.getWorkbench().getActiveWorkbenchWindow().addSele ctionListener(myListener);

You will have to filter the selection to only listen to the selections
occurring in your editor.

FWIW This works with any editor or part.



Thanks,

Antoine
Previous Topic:[OCL] Unknown type error during validation
Next Topic:Why Notification.getOldValue() don't contains any children
Goto Forum:
  


Current Time: Mon May 17 03:46:53 GMT 2021

Powered by FUDForum. Page generated in 0.01328 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top