Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » RCP how to make TreeViewer non editable
RCP how to make TreeViewer non editable [message #1783803] Sun, 18 March 2018 10:44 Go to next message
Inaki Berrio is currently offline Inaki BerrioFriend
Messages: 4
Registered: August 2017
Junior Member
Hi all!

I am a university student making my last university project in EMF, so I am new to this technology. I am developing different RCP tools based on different metamodels. In one of the tools I need to make the properties view editable while the TreeViewer must keep read-only. I find the way to make all the resource non-editable doing this in the handleActivate method of the Editor:

Resource res = editingDomain.getResourceSet().getResource().get(0);
editingDomain.getResourceToReadOnlyMap().put(res, true);

But I am unable to make just the TreeViewer non editable.

Any help??

Thanks a lot!
Re: RCP how to make TreeViewer non editable [message #1783952 is a reply to message #1783803] Tue, 20 March 2018 16:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Is this for an exercise? I don't see the practical goal. How is this actually useful?

In the end, the model is modified by commands created by the editing domain, mostly delegating to the item providers for creation. Some commands are used by the properties view and some are used by the tree structure, but in the end, the same command might be used in both places, so selectively disabling a command used to modify the tree structure verses a command used to modify properties in the properties view isn't entirely trivial; it depends on your model and on which properties you support. Likely command that modify containment/container features are used for the tree structure; those that modify attributes and cross references are used in the properties view, so perhaps that will suffice.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF OCL Example cannot find org.eclipse.emf.ecore.codegen.ecore templates
Next Topic:EMF Codegen Photon + New Dependencies
Goto Forum:
  


Current Time: Tue Sep 24 13:08:55 GMT 2024

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

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

Back to the top