Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » SubClassing TransactionalEditingDomain
SubClassing TransactionalEditingDomain [message #222519] Wed, 25 March 2009 06:51 Go to next message
maatari is currently offline maatariFriend
Messages: 74
Registered: July 2009
Member
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3320812309_4294961695
Content-type: multipart/alternative;
boundary="B_3320812309_14152"


--B_3320812309_14152
Content-type: text/plain;
charset="ISO-8859-1"
Content-transfer-encoding: 8bit

Hi All,

Because I need to customize the behavior of the AdapterFactoryEditingDomain
to manage an EMF Problem of deletion, and because I already Made the EMF GMF
integration, I need to subclass / customize TransactionalEditingDomain Class
to override method coming from AdapterFactoryEditingDomain.

Because, it is also a GMF issue I post it here as well. If you want to
understand the EMF issue, you can see the thread on the EMF forum about
Locally managing global shared object as non-contain-child.

But mainly, my concern here is that once I have done the subclassing which I
hope I did correctly, then when I change the famous line of the
initialization of the TransactionalEditingDomain from:
TransactionalEditingDomain domain =
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain();
To
TransactionalEditingDomain domain =
OperaTransactionalEditingDomain.Factory.INSTANCE.createEditi ngDomain();

It just doesn
Re: SubClassing TransactionalEditingDomain [message #222811 is a reply to message #222519] Thu, 26 March 2009 08:40 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Daniel,

I subclass TransactionalEditingDomain to solve the problem with
"read-only" if the resource is a hibernate resource. Perhaps to some use
for you.


Here is my example:


// INITIALIZE

editingDomain = new HibernateAdapterFactoryEditingDomain(
adapterFactory, commandStack,
new HashMap<Resource, Boolean>());







// The EDITINGDOMAIN

public class HibernateTransactionalEditingDomain extends
TransactionalEditingDomainImpl {

public HibernateTransactionalEditingDomain() {
super(new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
((TransactionalEditingDomainImpl.FactoryImpl)
TransactionalEditingDomain.Factory.INSTANCE)
.mapResourceSet(this);

}

protected boolean isReadOnlyURI(URI uri) {
boolean defaultReadOnly = super.isReadOnlyURI(uri);
if (defaultReadOnly == true) {
// if (defaultReadOnly == true
// && uri.fileExtension().compareTo("ndiag") == 0) {
return false;
} else {
return defaultReadOnly;
}
}

}





Daniel OKOUYA wrote:
> Hi All,
>
> Because I need to customize the behavior of the
> AdapterFactoryEditingDomain to manage an EMF Problem of deletion, and
> because I already Made the EMF GMF integration, I need to subclass /
> customize TransactionalEditingDomain Class to override method coming
> from AdapterFactoryEditingDomain.
>
> Because, it is also a GMF issue I post it here as well. If you want to
> understand the EMF issue, you can see the thread on the EMF forum about
> Locally managing global shared object as non-contain-child.
>
> But mainly, my concern here is that once I have done the subclassing
> which I hope I did correctly, then when I change the famous line of the
> initialization of the TransactionalEditingDomain from:
> TransactionalEditingDomain domain =
> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain();
> To
> TransactionalEditingDomain domain =
> OperaTransactionalEditingDomain.Factory.INSTANCE.createEditi ngDomain();
>
> It just doesn’t work anymore. I mean, my TreeEditor works but not the
> Diagram my which is weird because I don’t change anything. Therefore I
> indentify the problem as being possibly caused by:
>
> 1-/ I’m not subclassing correctely the Class/Interface couple
> TransactionalEditingDomain
> I have attached the two files (impl with its interface) to let you see
> how I did the subclassing.
>
> 2-/ I’m missing something about GMF:
> Does it check the instance class which is used as
> TransacationalEditingDomain, even if we don’t use the Registry approach
> ? Otherwise I don’t understand why the same class cause two different
> behavior. Indeed, with this couple of class, my Diagram doesn’t open
> anymore.
>
>
>
> Please, if anyone has an idea or suggestion that may help me to further
> understand, do not hesitate.
>
>
> Kind regards,
> Daniel
Previous Topic:Palette group backgound change problem
Next Topic:Dynamic palette and parts
Goto Forum:
  


Current Time: Thu Apr 25 09:00:53 GMT 2024

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

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

Back to the top