|Re: refresh properties view [message #1033432 is a reply to message #404503]
||Thu, 04 April 2013 08:13
| Joris Lückenga
Registered: March 2013
i know that this thread is about 3 years old, but I have trouble implementing a
"fake selection event" as Nick mentioned:
I have a generated EMF plugin project and created several Sections/Tabs (extended from AbstractPropertySections) for the Properties View. I´m using two different tabs, a "Basic" tab, and an "Advanced" tab.
Now, i want to have a workflow like this: In my custom Editor View (TreeViewer), i want to select an object and edit its Index in the properties view. If the typed value matches a specific Index, the "Advanced" tab should appear immediatly after the "Index-changed" event.
I created an adapter, listening for a index change. It correctly fires every time the index is changed in the properties view. What i wanted to do is to fire the fake selection event so that the classes with implemented IFilter interface run over the currently edited object and create the "Advanced" tab (if the Filter returns true). This works already when selecting an object with mouse/keyboard when a matching index is found.
I want to avoid that the user has to deselect and reselect the object after editing the index in the "Basic" tab, to be able to see the "Advanced" tab.
The following ideas did not resolve my problem:
- Selecting an empty ISelection in TabbedPropertiesSheetPage-Class and reselecting the ISelection of the editor (This causes a loop!)
- Selecting Objects in the Editor TreeViewer (apperently the PropertiesSheetPage is not affected by the changes when firing these events programmatically)
- Selecting the same Selection twice (if-statement in TabbedPropertiesSheetPage with "currentselection.equals(newSelection)" avoids this...
- Refreshing TabbedPropertiesSheetPage (in the spec, it says that only the current Tab is refreshed. Another problem is, that the "Index-changed" event is fired and this results in a loop again)
I also want to avoid overriding TabbePropertiesSheetPage to get arround the if-statement or to affect the currentSelection-object.
Another idea would be to get a valid selection (like the Resource or something) and change it back? I´m really having trouble finding an ISelection or IStructuredSelection element (except the selected object itself) to switch to and back. If you have an idea or other solutions I would be very happy to get some help
[Updated on: Thu, 04 April 2013 12:09]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.14971 seconds