Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsUnmodifiable model
https://www.eclipse.org/forums/index.php/mv/msg/128631/396835/#msg_396835
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]]>Brad Townsend2005-11-16T18:43:02-00:00Re: Unmodifiable model
https://www.eclipse.org/forums/index.php/mv/msg/128631/396837/#msg_396837
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 Merks2005-11-16T18:53:06-00:00