Home » Eclipse Projects » Sirius » How to force refresh of Properties View(Properties View)
How to force refresh of Properties View [message #1746340] |
Thu, 27 October 2016 09:04 |
Joerg Hermann Messages: 15 Registered: September 2012 Location: Munich |
Junior Member |
|
|
Hi Sirius/EEF Gurus,
I have created a customized properties view based on this new Sirius feature.
Update of the displayed data works really fine, with just 2 exceptions:
- I'm using 'Dynamic Mapping' to select different widgets depending on the
value of a single feature;
I.e. feature 'self.select' can have values 'A', 'B' or 'C'.
In case of 'A', I show widget for 'self.dataA', in case of 'B', I show widgets for
'self.dataA' and self.dataB' and in case of 'C', I show three widgets for 'self.dataA', 'self.dataB' and 'self.dataC'.
The 'select' element is controlled via a radio button widget.
Everything works fine immediately after selecting an element in the diagram, but when I change the value of 'select', the view is not updated accordingly.
- The other case happens on a 'Select' widget, where I want to reject the update of the feature under certain conditions. If the condition is not met, the value should remain unchanged. I have implemented this as conditional processing within the operation of the Select-widget. This as well works fine to suppress the update of the value. Unfortunately, the Select-widget still shows the value selected by the user.
I would like to see the original (=unchanged) value again.
In both cases, I see correct data if I select a different object in the diagram and then go back to the original object.
I was wondering, if I could force a refresh on the Properties View as workaround.
I tried to invoke following code to do a refresh, but this did not show any change:
public static void refreshPropertiesView(EObject obj) {
String id = "org.eclipse.ui.views.PropertySheet";
IViewPart view = getWorkbenchWindow().getActivePage().findView(id);
if (view instanceof PropertySheet) {
PropertySheet propertySheet = (PropertySheet) view;
IPage currentPage = propertySheet.getCurrentPage();
if (currentPage instanceof EEFTabbedPropertySheetPage) {
EEFTabbedPropertySheetPage propertySheetPage = (EEFTabbedPropertySheetPage) currentPage;
propertySheetPage.refreshPage();
}
}
}
Is there any other solution to achieve this?
Any hints are welcome
best regards,
Joerg
|
|
|
Re: How to force refresh of Properties View [message #1746354 is a reply to message #1746340] |
Thu, 27 October 2016 12:43 |
|
Hi,
Quote:
I'm using 'Dynamic Mapping' to select different widgets depending on the
value of a single feature;
I.e. feature 'self.select' can have values 'A', 'B' or 'C'.
In case of 'A', I show widget for 'self.dataA', in case of 'B', I show widgets for
'self.dataA' and self.dataB' and in case of 'C', I show three widgets for 'self.dataA', 'self.dataB' and 'self.dataC'.
The 'select' element is controlled via a radio button widget.
Everything works fine immediately after selecting an element in the diagram, but when I change the value of 'select', the view is not updated accordingly.
This level of dynamicity is not supported at the moment. Because the mapping between semantic model and widget is almost completely arbitrary from the point of view of the runtime (as it can use opaque expressions and Java code), we would need to perform a full refresh of the page on every model change just in case something in the new model would produce a different set of widgets. This would have negative performance implication on all scenarios, even the vast majority for which it would not be needed. The point is that we can not be sure beforehand, so everybody would need to pay the price...
Either the runtime must be made much smarter (but more complexity means more chance for bugs), or we would need a way for specifiers who know they need this kind of dynamicity to "opt-in" and declare explicity (for example on the radio button in your case), "changes performed by this widget may invalidate the whole view, please do a full refresh when I'm modified". This way only those would pay the price of the full refresh.
Can you open a bugzilla about this?
Quote:
The other case happens on a 'Select' widget, where I want to reject the update of the feature under certain conditions. If the condition is not met, the value should remain unchanged. I have implemented this as conditional processing within the operation of the Select-widget. This as well works fine to suppress the update of the value. Unfortunately, the Select-widget still shows the value selected by the user.
I would like to see the original (=unchanged) value again.
I confirm the bug, and I suspect some other widgets are impacted too. I'll open a bugzilla.
Regards,
Pierre-Charles David
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: How to force refresh of Properties View [message #1746356 is a reply to message #1746340] |
Thu, 27 October 2016 13:01 |
|
Quote:
The other case happens on a 'Select' widget, where I want to reject the update of the feature under certain conditions. If the condition is not met, the value should remain unchanged. I have implemented this as conditional processing within the operation of the Select-widget. This as well works fine to suppress the update of the value. Unfortunately, the Select-widget still shows the value selected by the user.
I would like to see the original (=unchanged) value again.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=506621 for the bug (you may want to add yourself in CC to follow it).
Note taht in this case a possible solution is simply to remove the invalid values (the ones you would reject) from the choices proposed by the combo, or to use the "Is Enabled Expression" on the combo definition to completely disable it if the condition is not met and no change is allowed at all.
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Re: How to force refresh of Properties View [message #1746658 is a reply to message #1746409] |
Wed, 02 November 2016 14:38 |
|
Hi, sorry for the delay.
Unfortunately, I don't think its possible to force the full page refresh on your side in the current state. Your code by itself looks correct, but the only place you can invoke it is inside the definition of your widget's behavior, and this will be invoked too early to have the desired effect. Is it how you invoked it, or did you find another way that I didn't think of?
Regards,
Pierre-Charles David
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Goto Forum:
Current Time: Thu Apr 25 22:27:12 GMT 2024
Powered by FUDForum. Page generated in 0.03131 seconds
|