|
Re: refresh all subCannonicalEditPolicies [message #104940 is a reply to message #104857] |
Mon, 19 February 2007 15:05 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
CanonicalEditPolicy has some static methods to reach all policies for a
given semantic element. To see how it's done take a look in
ToggleCanonical...Command (I don't remember the exact name).
vlad
On Sat, 17 Feb 2007 19:08:20 +0100, Wiktor wrote:
> 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 #105856 is a reply to message #105639] |
Wed, 21 February 2007 13:57 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
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;
}
}
}
|
|
|
|
Re: refresh all subCannonicalEditPolicies [message #106620 is a reply to message #106603] |
Sat, 24 February 2007 18:12 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
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;
>> }
>> }
>>
>> }
>>
>>
>>
|
|
|
Re: refresh all subCannonicalEditPolicies [message #107385 is a reply to message #106620] |
Tue, 27 February 2007 22:00 |
Wiktor Messages: 55 Registered: July 2009 |
Member |
|
|
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.03638 seconds