Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Listen to any modyfication of the diagram
Listen to any modyfication of the diagram [message #187722] Mon, 19 May 2008 13:15 Go to next message
Till Essers is currently offline Till EssersFriend
Messages: 92
Registered: July 2009
Member
Hi

I'm using the stp.bpmn modeler and I want to be notified about any
change in the diagram itself. If something is added, removed, changed, etc.
But where do I have to register my listener and what listener do I have
to implement?

Thanks
Till
Re: Listen to any modyfication of the diagram [message #187730 is a reply to message #187722] Mon, 19 May 2008 13:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Look for the EMF EContentAdapter class. That should give you a gread
head start.

Thanks,

Antoine

Till Essers wrote:
> Hi
>
> I'm using the stp.bpmn modeler and I want to be notified about any
> change in the diagram itself. If something is added, removed, changed, etc.
> But where do I have to register my listener and what listener do I have
> to implement?
>
> Thanks
> Till
Re: Listen to any modyfication of the diagram [message #187763 is a reply to message #187730] Mon, 19 May 2008 15:01 Go to previous messageGo to next message
Till Essers is currently offline Till EssersFriend
Messages: 92
Registered: July 2009
Member
Sorry for bugging you again...

Writing my own EContentAdapter and adding it to the Diagram object would
be the way it should work. My only left problem is... where to get the
Diagram object for the active editor?

Thanks
Till

PS: I wrote a small tutorial on hiding the advanced tab, you might
review it and then link it to your component, Antoine.
http://wiki.eclipse.org/STP/BPMN_Component/Hiding_property_t abs

Antoine Toulme schrieb:
> Look for the EMF EContentAdapter class. That should give you a gread
> head start.
>
> Thanks,
>
> Antoine
>
> Till Essers wrote:
>> Hi
>>
>> I'm using the stp.bpmn modeler and I want to be notified about any
>> change in the diagram itself. If something is added, removed, changed,
>> etc.
>> But where do I have to register my listener and what listener do I
>> have to implement?
>>
>> Thanks
>> Till
Re: Listen to any modyfication of the diagram [message #187771 is a reply to message #187763] Mon, 19 May 2008 15:18 Go to previous messageGo to next message
Till Essers is currently offline Till EssersFriend
Messages: 92
Registered: July 2009
Member
Nevermind, I found it and feel stupid :D
Till Essers schrieb:
> Sorry for bugging you again...
>
> Writing my own EContentAdapter and adding it to the Diagram object would
> be the way it should work. My only left problem is... where to get the
> Diagram object for the active editor?
>
> Thanks
> Till
>
> PS: I wrote a small tutorial on hiding the advanced tab, you might
> review it and then link it to your component, Antoine.
> http://wiki.eclipse.org/STP/BPMN_Component/Hiding_property_t abs
>
> Antoine Toulme schrieb:
>> Look for the EMF EContentAdapter class. That should give you a gread
>> head start.
>>
>> Thanks,
>>
>> Antoine
>>
>> Till Essers wrote:
>>> Hi
>>>
>>> I'm using the stp.bpmn modeler and I want to be notified about any
>>> change in the diagram itself. If something is added, removed,
>>> changed, etc.
>>> But where do I have to register my listener and what listener do I
>>> have to implement?
>>>
>>> Thanks
>>> Till
Re: Listen to any modyfication of the diagram [message #187779 is a reply to message #187771] Mon, 19 May 2008 15:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Hey, just for the next folk reading this to feel smarter, would you mind
giving away the secret ? ;)

Till Essers wrote:
> Nevermind, I found it and feel stupid :D
> Till Essers schrieb:
>> Sorry for bugging you again...
>>
>> Writing my own EContentAdapter and adding it to the Diagram object
>> would be the way it should work. My only left problem is... where to
>> get the Diagram object for the active editor?
>>
>> Thanks
>> Till
>>
>> PS: I wrote a small tutorial on hiding the advanced tab, you might
>> review it and then link it to your component, Antoine.
>> http://wiki.eclipse.org/STP/BPMN_Component/Hiding_property_t abs
>>
>> Antoine Toulme schrieb:
>>> Look for the EMF EContentAdapter class. That should give you a gread
>>> head start.
>>>
>>> Thanks,
>>>
>>> Antoine
>>>
>>> Till Essers wrote:
>>>> Hi
>>>>
>>>> I'm using the stp.bpmn modeler and I want to be notified about any
>>>> change in the diagram itself. If something is added, removed,
>>>> changed, etc.
>>>> But where do I have to register my listener and what listener do I
>>>> have to implement?
>>>>
>>>> Thanks
>>>> Till
Re: Listen to any modyfication of the diagram [message #187787 is a reply to message #187763] Mon, 19 May 2008 15:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

> PS: I wrote a small tutorial on hiding the advanced tab, you might
> review it and then link it to your component, Antoine.
> http://wiki.eclipse.org/STP/BPMN_Component/Hiding_property_t abs

That is very nice! I added the categories [[Category:BPMN]] and
[[Category:STP]] to have it referenced properly.

I will add the item to our latest news, and our home page.

Thanks for the contribution !

Antoine
Re: Listen to any modyfication of the diagram [message #187795 is a reply to message #187779] Mon, 19 May 2008 15:53 Go to previous message
Till Essers is currently offline Till EssersFriend
Messages: 92
Registered: July 2009
Member
How to add the ContentAdapter:
After opening the editor call the getDiagram() method and add your
EContentAdapter to the eAdapters list.

An Action for opening the editor will look like this:
IEditorPart editorpart =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEditor(new
FileEditorInput(file), MyBpmnDiagramEditor.ID);
Diagram
((EexBpmnDiagramEditor)editorpart).getDiagram().eAdapters(). add(new
MyContentAdapter());

Thats it ;)

Next step is to understand the Notification passed around ;)

Antoine Toulme schrieb:
> Hey, just for the next folk reading this to feel smarter, would you mind
> giving away the secret ? ;)
>
> Till Essers wrote:
>> Nevermind, I found it and feel stupid :D
>> Till Essers schrieb:
>>> Sorry for bugging you again...
>>>
>>> Writing my own EContentAdapter and adding it to the Diagram object
>>> would be the way it should work. My only left problem is... where to
>>> get the Diagram object for the active editor?
>>>
>>> Thanks
>>> Till
>>>
>>> PS: I wrote a small tutorial on hiding the advanced tab, you might
>>> review it and then link it to your component, Antoine.
>>> http://wiki.eclipse.org/STP/BPMN_Component/Hiding_property_t abs
>>>
>>> Antoine Toulme schrieb:
>>>> Look for the EMF EContentAdapter class. That should give you a gread
>>>> head start.
>>>>
>>>> Thanks,
>>>>
>>>> Antoine
>>>>
>>>> Till Essers wrote:
>>>>> Hi
>>>>>
>>>>> I'm using the stp.bpmn modeler and I want to be notified about any
>>>>> change in the diagram itself. If something is added, removed,
>>>>> changed, etc.
>>>>> But where do I have to register my listener and what listener do I
>>>>> have to implement?
>>>>>
>>>>> Thanks
>>>>> Till
Previous Topic:Multi-valued features
Next Topic:MouseEvent in Properties View
Goto Forum:
  


Current Time: Wed Apr 24 22:19:36 GMT 2024

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

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

Back to the top