Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Re: Mutiple Deletes issue
Re: Mutiple Deletes issue [message #199783] Fri, 01 August 2008 11:27 Go to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hi Christian,

Thanks for getting back to me on this.
One issue I am having with the solution below is that the read-only
transaction is not the same for each command that is being built.
Now maybe I am doing something wrong or looking in the wrong place but it
seems to me that in the EditHelperAdvice a different transaction comes in
with each request and therefore the map idea is not working.

Any ideas whats going wrong ?

thanks,
Alan.





Hi, Alan,

You can take advantage of the fact that the edit-helper constructs its
edit command in the context of a read-only transaction. You can use the
InternalTransactionalEditingDomain::getActiveTransaction() API to get
the current transaction and, in a map of some kind, cache your prompting
command with the transaction as the key.

Subsequent invocations of your advice can find the cached prompt command
and append elements to it instead of returning new advice commands.

Just be sure to purge the transaction from the cache when your prompting
command is dispose()d.

HTH,

Christian
Re: Mutiple Deletes issue [message #199855 is a reply to message #199783] Fri, 01 August 2008 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Alan,

Sorry, I had expected that the transactions would be optimized to a
single read. Perhaps these transactions all share a common root; follow
the getParent() references to find it.

HTH,

Christian


Alan wrote:
> Hi Christian,
>
> Thanks for getting back to me on this.
> One issue I am having with the solution below is that the read-only
> transaction is not the same for each command that is being built.
> Now maybe I am doing something wrong or looking in the wrong place but it
> seems to me that in the EditHelperAdvice a different transaction comes in
> with each request and therefore the map idea is not working.
>
> Any ideas whats going wrong ?
>
> thanks,
> Alan.
>
>
>
>
>
> Hi, Alan,
>
> You can take advantage of the fact that the edit-helper constructs its
> edit command in the context of a read-only transaction. You can use the
> InternalTransactionalEditingDomain::getActiveTransaction() API to get
> the current transaction and, in a map of some kind, cache your prompting
> command with the transaction as the key.
>
> Subsequent invocations of your advice can find the cached prompt command
> and append elements to it instead of returning new advice commands.
>
> Just be sure to purge the transaction from the cache when your prompting
> command is dispose()d.
>
> HTH,
>
> Christian
>
>
Re: Mutiple Deletes issue [message #199895 is a reply to message #199855] Fri, 01 August 2008 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hi,

Ya tried that one too as that thought did occur to me but still no go.
The transactions have no parents.

Any other ideas ?

thanks,
Alan.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g6v1n3$e6m$1@build.eclipse.org...
> Hi, Alan,
>
> Sorry, I had expected that the transactions would be optimized to a single
> read. Perhaps these transactions all share a common root; follow the
> getParent() references to find it.
>
> HTH,
>
> Christian
>
>
> Alan wrote:
>> Hi Christian,
>>
>> Thanks for getting back to me on this.
>> One issue I am having with the solution below is that the read-only
>> transaction is not the same for each command that is being built.
>> Now maybe I am doing something wrong or looking in the wrong place but it
>> seems to me that in the EditHelperAdvice a different transaction comes in
>> with each request and therefore the map idea is not working.
>>
>> Any ideas whats going wrong ?
>>
>> thanks,
>> Alan.
>>
>>
>>
>>
>>
>> Hi, Alan,
>>
>> You can take advantage of the fact that the edit-helper constructs its
>> edit command in the context of a read-only transaction. You can use the
>> InternalTransactionalEditingDomain::getActiveTransaction() API to get
>> the current transaction and, in a map of some kind, cache your prompting
>> command with the transaction as the key.
>>
>> Subsequent invocations of your advice can find the cached prompt command
>> and append elements to it instead of returning new advice commands.
>>
>> Just be sure to purge the transaction from the cache when your prompting
>> command is dispose()d.
>>
>> HTH,
>>
>> Christian
Re: Mutiple Deletes issue [message #199923 is a reply to message #199895] Sat, 02 August 2008 16:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Alan,

Is there some request object that is passed around through all of the
edit-helper processing? I seem to recall, for example, that the
DeleteDependentsRequest has a reference to the originating
DeleteElementRequest (or whatever it's called). I imagine that the
delete requests for the nested elements similarly track the original
request. Look in the request's parameters map to see what you can find.

HTH,

Christian


Alan wrote:
> Hi,
>
> Ya tried that one too as that thought did occur to me but still no go.
> The transactions have no parents.
>
> Any other ideas ?
>
> thanks,
> Alan.
>

-----8<-----
Re: Mutiple Deletes issue [message #200389 is a reply to message #199923] Tue, 05 August 2008 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hi Christian,

I have had a look at the parameter map and the only thing in there is a key
of "edit policy command" and a value of DestroyElementCommand.
There does not seem to be any link back to anything I can use.
It just seems to be two seperate DestroyElementRequests not linked in any
way
Unless I am missing something of course.
I was thinking of using the configureRequest method to add something to the
paramter map
but again how do I know how to link them ?

Should I be coming at it in another way....like trying to figure out which
nodes are selected in the diagram when the delete is invoked for example ?

thanks,
Alan.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g7211d$cce$1@build.eclipse.org...
> Hi, Alan,
>
> Is there some request object that is passed around through all of the
> edit-helper processing? I seem to recall, for example, that the
> DeleteDependentsRequest has a reference to the originating
> DeleteElementRequest (or whatever it's called). I imagine that the delete
> requests for the nested elements similarly track the original request.
> Look in the request's parameters map to see what you can find.
>
> HTH,
>
> Christian
>
>
> Alan wrote:
>> Hi,
>>
>> Ya tried that one too as that thought did occur to me but still no go.
>> The transactions have no parents.
>>
>> Any other ideas ?
>>
>> thanks,
>> Alan.
>>
>
> -----8<-----
Re: Mutiple Deletes issue [message #200506 is a reply to message #200389] Tue, 05 August 2008 13:45 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Alan,

Yeah, I'm afraid you exhausted my store of ideas, such as it was.

My knee always jerks against such measures as looking back to a diagram
editor from a reusable component like edit-helper advice that really
shouldn't have knowledge of that context. It should be as usable in the
Project Explorer or any other view (e.g., EcoreTools inheritance
browser) as in the diagram editor.

Perhaps somebody else with more GMF experience than I can help you further.

Cheers,

Christian


Alan wrote:
> Hi Christian,
>
> I have had a look at the parameter map and the only thing in there is a key
> of "edit policy command" and a value of DestroyElementCommand.
> There does not seem to be any link back to anything I can use.
> It just seems to be two seperate DestroyElementRequests not linked in any
> way
> Unless I am missing something of course.
> I was thinking of using the configureRequest method to add something to the
> paramter map
> but again how do I know how to link them ?
>
> Should I be coming at it in another way....like trying to figure out which
> nodes are selected in the diagram when the delete is invoked for example ?
>
> thanks,
> Alan.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:g7211d$cce$1@build.eclipse.org...
>> Hi, Alan,
>>
>> Is there some request object that is passed around through all of the
>> edit-helper processing? I seem to recall, for example, that the
>> DeleteDependentsRequest has a reference to the originating
>> DeleteElementRequest (or whatever it's called). I imagine that the delete
>> requests for the nested elements similarly track the original request.
>> Look in the request's parameters map to see what you can find.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Alan wrote:
>>> Hi,
>>>
>>> Ya tried that one too as that thought did occur to me but still no go.
>>> The transactions have no parents.
>>>
>>> Any other ideas ?
>>>
>>> thanks,
>>> Alan.
>>>
>> -----8<-----
>
>
Previous Topic:[Announce] EuGENia
Next Topic:visual element
Goto Forum:
  


Current Time: Thu Apr 18 22:29:11 GMT 2024

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

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

Back to the top