refresh all subCannonicalEditPolicies [message #104857] |
Sat, 17 February 2007 13:08  |
Eclipse User |
|
|
|
Hi,
My each operation executes my MainCanonicalEditPolicy.refresh() in order
to refresh all diagram elements.
But some main diagram elements can have another one inside them.
So there is also SubCanonicalEditPolicy for them.
Unfortunatelly refreshing MainCEP does not refresh all SubCEPs.
How should I do that?
Thanks
Wiktor
|
|
|
|
|
|
|
|
Re: refresh all subCannonicalEditPolicies [message #107385 is a reply to message #106620] |
Tue, 27 February 2007 17:00  |
Eclipse User |
|
|
|
Thanks, but my problem seems to be more global . for a moment I forgot
even about my 'parts in parts', and I try to solve my bug on 'flat
structure'. I do not know why
standard CanonicalConnectionEditPolicy cannot find in
protected final Edge createConnectionView(EObject connection, int index) {
EditPart sep = getSourceEditPartFor(connection);
EditPart tep = getTargetEditPartFor(connection);
sep or tep (usually for elements which should exists). Sometimes I have
here null, so new/old connections are not created.
any ideas?
Wiktor
Vlad Ciubotariu napisał(a):
> I'll attach the files for you in an email.
>
> You should extend the editparts that can be created programmatically,
> together with the connection.
>
> vlad
>
> On Sat, 24 Feb 2007 17:47:06 +0100, Wiktor
> wrote:
>
>> Many thanks for your help, but I still do not understand what should I do.
>>
>>
>> 1. which editParts should I extend (all, or only few of them)?
>>
>> I have such a structure:(EP=EditPart, CEP=CannonicalEditPolicy)
>>
>> myNetEP - (with corresponding myNetCEP)
>> |
>> |-myNodePlaceEP
>> |
>> |-myNodeTransitionEP (with corresponding myTransitionCEP)
>> | |-mySubNodePlaceEP
>> |
>> |-myConnectionArrowEP
>>
>>
>> 2. what should B2CanonicalConnectionEditPolicy.refresh(this); do?
>> I suppose that B2CCEP is myNetCEP - also extends CCEP.
>>
>> 3. To be sure - isRefresh should be a private variable of my EP's (not
>> global from for e.g. NetCEP)?
>>
>>
>> Wiktor
>>
>> Vlad Ciubotariu:
>>> You need to refresh when the edit part ends activate, so override these
>>> two methods in you editparts, substituting your canonical refresh
>>> accordingly.
>>>
>>> vlad
>>>
>>> public void activate() {
>>> super.activate();
>>> B2CanonicalConnectionEditPolicy.refresh(this);
>>> }
>>>
>>> public void refresh() {
>>> if (isRefresh == false) {
>>> isRefresh = true;
>>> try {
>>> super.refresh();
>>> } finally {
>>> isRefresh = false;
>>> }
>>> }
>>>
>>> }
>>>
>>>
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03111 seconds