Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsResources manager
https://www.eclipse.org/forums/index.php/mv/msg/218582/693357/#msg_693357
I'm newbie to Eclipse RCP and I'm only discovering its' features.
I am designig editor application which has 3 basic resources - Foo, Bar, Lorem. Lorem can be of 3 types, A, B, C.
I have created 3 views to display the resources and now I show the resources Foo and Bar in TableViewer, Lorem in TreeViewer and double-left-clicking on each resource executes own editor for resource Foo, Bar and Lorem.A, Lorem.B, Lorem.C. I want context popup menu which shows when right-clicked on the resource. Foo and Bar is OK, but problem is with Lorem.
The context menu should have some basic commands, but I would like it in general.
Add Foo - when not clicked on Foo Resource in FooResourcesListView
Edit Foo, Remove Foo - when clicked on Foo Resource in FooResourceListView
Add Bar - when not clicked on Bar Resource in BarResourcesListView
Edit Bar, Remove Bar - when clicked on Bar Resource in BarResourceListView
Lorem Resources view is a tree with 3 parents - A, B, C. There should be resources of type Lorem.A in A parent, etc.
Showing context menu for Foo and Bar is OK, I have used visibleWhen and instanceof, but I have problem with Lorem resources.
The tree model contains 2 classes, TreeParent and TreeObject. TreeObject stores in string type of Lorem resource.
Is it possible to find out the type of selected TreeObject?
Or am I doing it wrong and complicated? I also thought about Project Explorer, but I would like 3 separated views for each resource type.
Thank you very much,
Beax]]>beax 2011-07-06T10:08:48-00:00Re: Resources manager
https://www.eclipse.org/forums/index.php/mv/msg/218582/693368/#msg_693368
if you are using popup menus extension point with object contributions you have to use object state property and the model class (tree object) should implement IActionFilter.
if you are using command framework(menus extension point) you need to use property testers.
]]>Devi Vara Prasad Bandaru2011-07-06T10:37:59-00:00