|
Re: SWTBot for sirius properties [message #1806449 is a reply to message #1806023] |
Thu, 09 May 2019 09:16 |
|
Hi,
Yilong Yang wrote on Tue, 30 April 2019 18:20I refer the testing topic about Sirius properties https://www.eclipse.org/forums/index.php/t/1097616/
However, I have no idea about how to get the object of current EEFTabbedPropertySheetPage?
Something like this (extracted from org.eclipse.gmf.runtime.common.ui.util.PropertySheetUtil.getCurrentPropertySheetPage()) should get you the initial reference. If the returned IPage is an EEFTabbedPropertySheetPage, you can then follow the chain described in the other thread.
private static IPage getCurrentPropertySheetPage() {
IWorkbenchWindow window =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
if (page != null) {
IViewPart view = page.findView(PROPERTY_VIEW_ID);
if (view != null) {
if (view instanceof PropertySheet) {
return ((PropertySheet) view).getCurrentPage();
}
}
}
}
return null;
}
Quote:
In addition, when I use SWTBotSiriusHelper.selectPropertyTabItem(String widget) to get a page of myself designed properties, that will result a exception about widget can not be found.
The SWTBotSiriusHelper class dates from before we added the EEF-based property sheets in Sirius, so that code is actually for testing property sheets based on org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage. It can not be used for EEF-based property sheets. The only way to test those is as described on the thread you referenced.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.02735 seconds