Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using EditingDomainActionBarContributor in a view
Using EditingDomainActionBarContributor in a view [message #424433] Sat, 25 October 2008 21:27 Go to next message
Yigal Spinner is currently offline Yigal SpinnerFriend
Messages: 127
Registered: July 2009
Senior Member
I want to create a TreeView that will use the EditingDomain and
EditingDomainActionBarContributor. The issue I can not figure out is
how to initialize the EditingDomainActionBarContributor.
The init(IAationBars, IWorkbenchPage) requiers that the IActionBars will
be the Main menu and I do not know how to get it from inside a view.

Can some one help me?
Or is there a better way to get the EditingDomain to work in a view?

Thanks
Yigal
Re: Using EditingDomainActionBarContributor in a view [message #424436 is a reply to message #424433] Sun, 26 October 2008 11:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Yigal,

Comments below.

Yigal wrote:
> I want to create a TreeView that will use the EditingDomain and
> EditingDomainActionBarContributor. The issue I can not figure out is
> how to initialize the EditingDomainActionBarContributor.
> The init(IAationBars, IWorkbenchPage) requiers that the IActionBars
> will be the Main menu and I do not know how to get it from inside a view.
It expects to be used with an IEditorPart.
>
> Can some one help me?
I've never tried to get editing working in a view that isn't associated
with an editor like the outline view.
> Or is there a better way to get the EditingDomain to work in a view?
I think you need something like EditingDomainActionBarContributor but
one that doesn't assume it's for an editor but only for a view. I
don't see anything like IViewActionBarContributor though, so I'm not
sure what to suggest.

Maybe someone else has ideas...
>
>
> Thanks
> Yigal


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using EditingDomainActionBarContributor in a view [message #424438 is a reply to message #424436] Sun, 26 October 2008 12:46 Go to previous messageGo to next message
Yigal Spinner is currently offline Yigal SpinnerFriend
Messages: 127
Registered: July 2009
Senior Member
Ed,
How do you implement the EMF Command stack in a view?
I want to create a simple view that allows adding and deleting EOjects
from the model (I wrote it by using wizards that fill the data).
I wanted to use the automated command stack of EditingDomain, but
looking at the editor code, I see it uses the
EditingDomainActionBarContributor to switch the UNDO/REDO actions and stack.
Did anyone implemented it not in an Editor?
How do you use the EMF command stack on a view?

Thanks
Yigal

Ed Merks wrote:
> Yigal,
>
> Comments below.
>
> Yigal wrote:
>> I want to create a TreeView that will use the EditingDomain and
>> EditingDomainActionBarContributor. The issue I can not figure out is
>> how to initialize the EditingDomainActionBarContributor.
>> The init(IAationBars, IWorkbenchPage) requiers that the IActionBars
>> will be the Main menu and I do not know how to get it from inside a view.
> It expects to be used with an IEditorPart.
>>
>> Can some one help me?
> I've never tried to get editing working in a view that isn't associated
> with an editor like the outline view.
>> Or is there a better way to get the EditingDomain to work in a view?
> I think you need something like EditingDomainActionBarContributor but
> one that doesn't assume it's for an editor but only for a view. I
> don't see anything like IViewActionBarContributor though, so I'm not
> sure what to suggest.
>
> Maybe someone else has ideas...
>>
>>
>> Thanks
>> Yigal
Re: Using EditingDomainActionBarContributor in a view [message #424439 is a reply to message #424438] Sun, 26 October 2008 13:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Yigal.

Comments below.

Yigal wrote:
> Ed,
> How do you implement the EMF Command stack in a view?
Methods like AdapterFactoryEditingDomain.getEditingDomainFor can find
the editing domain associated with the resource set.
> I want to create a simple view that allows adding and deleting EOjects
> from the model (I wrote it by using wizards that fill the data).
Is that a view associated with an editor?
> I wanted to use the automated command stack of EditingDomain, but
> looking at the editor code, I see it uses the
> EditingDomainActionBarContributor to switch the UNDO/REDO actions and
> stack.
Yes.
>
> Did anyone implemented it not in an Editor?
I wonder about that too. I haven't. I imagine that folks working on
common navigator stuff might have.
> How do you use the EMF command stack on a view?
Well, an AdapterFactoryEditing you can just create, it's how to hook it
up to the context menu you're wanting to know about, and I have no
experience with how to do that in a view. Hopefully someone does.
>
> Thanks
> Yigal
>
> Ed Merks wrote:
>> Yigal,
>>
>> Comments below.
>>
>> Yigal wrote:
>>> I want to create a TreeView that will use the EditingDomain and
>>> EditingDomainActionBarContributor. The issue I can not figure out
>>> is how to initialize the EditingDomainActionBarContributor.
>>> The init(IAationBars, IWorkbenchPage) requiers that the IActionBars
>>> will be the Main menu and I do not know how to get it from inside a
>>> view.
>> It expects to be used with an IEditorPart.
>>>
>>> Can some one help me?
>> I've never tried to get editing working in a view that isn't
>> associated with an editor like the outline view.
>>> Or is there a better way to get the EditingDomain to work in a view?
>> I think you need something like EditingDomainActionBarContributor but
>> one that doesn't assume it's for an editor but only for a view. I
>> don't see anything like IViewActionBarContributor though, so I'm not
>> sure what to suggest.
>>
>> Maybe someone else has ideas...
>>>
>>>
>>> Thanks
>>> Yigal


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using EditingDomainActionBarContributor in a view [message #424441 is a reply to message #424439] Mon, 27 October 2008 09:13 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hi Yigal,

I have implemented something similar into my (TreeViewer) view. I am using
all the EMF edit UI *Actions to undo, redo, delete, copy etc. my model
objects. (I also had a implementation where I also used the create child
and create sibling actions, but this is not working for my
implementation). It was not hard to get it working if you already have
your editing domain instance inside your view (I inject it with the help
of Spring DM, but you can also get it as Ed suggested). The rest was only
some copy and paste from the EditingDomainActionBarContributor source
class.

I am using only the web interface of this newsgroup so I have no chance to
attach my source file. Just write me a short mail to
matthias.treitler@gmail.com and I will send it to you. Maybe I can also
past the source to this post...

Matthias
Previous Topic:Problems with the FAQ about xsi:schemaLocation
Next Topic:Declaration for the UFacekit Project
Goto Forum:
  


Current Time: Thu Apr 25 07:08:16 GMT 2024

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

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

Back to the top