Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Unmodifiable model
Unmodifiable model [message #396835] Wed, 16 November 2005 18:43 Go to next message
Brad Townsend is currently offline Brad TownsendFriend
Messages: 9
Registered: July 2009
Junior Member
I'm writing a plug-in that uses an EMF model and that model will be
accessible through an extension point. While my plugin needs to modify
the model, I only intend to provide read-only access through the
extension point.

Is there a mechanism in EMF that can create an unmodifiable model
reference from an EMF model? The functionality I'm looking for would be
similar to the Java API method
java.util.Collections.unmodifiableCollection(Collection c) but for EMF.

Thanks,
-Brad
Re: Unmodifiable model [message #396837 is a reply to message #396835] Wed, 16 November 2005 18:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Brad,

You could add an EContentAdapter that throws an exception for any change
that it sees. Something like an ChangeRecorder could be used to do the
same thing, and could be used to undo the change to restore the state.


Brad Townsend wrote:

>
> I'm writing a plug-in that uses an EMF model and that model will be
> accessible through an extension point. While my plugin needs to modify
> the model, I only intend to provide read-only access through the
> extension point.
>
> Is there a mechanism in EMF that can create an unmodifiable model
> reference from an EMF model? The functionality I'm looking for would
> be similar to the Java API method
> java.util.Collections.unmodifiableCollection(Collection c) but for EMF.
>
> Thanks,
> -Brad
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How do YOU lazily load EMF objects from a server?
Next Topic:[Announce] EMF 2.1.2 M200511161952 is available
Goto Forum:
  


Current Time: Tue Apr 16 21:09:56 GMT 2024

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

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

Back to the top