I am using Eclipse RCP and EMF models. I have created my own property tabbed sheets than refreshes when an Object is selected in a view. Until here, everything works fine. Then, I wanted to refresh the property tab when I make a change in my model. I added a Model change listener to my main Property sheet page
public class MyTabbedPropertySheet extends TabbedPropertySheet{...}
private void init(){
try{
MyModelChangeListener = new MyModelChangeListener(){
@Override
public void refreshUI(){
try{
UMLModeler.getTransactionHelper().getEditingDomain().runExclusive(new Runnable() {
@Override
public void run(){
refresh() //This is the eclipse TabbedPropertySheet refresh method
}
});
}catch(){..}
UMLModeler.getTransactionHelper().getEditingDomain().addResourceSetListener(MyModelChangeListener);
}catch{...}
After that, when I change my object, my property sheet does actually refreshes but I have a NullPointerException in the eclipse class as the currenttab is null.
Method in org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage
public void refresh(){
currentTab.refresh();
}
So I was wondering how can I get the current tab while this tab is not active (I am doing the modifications in another view). Or is there another way to refresh the property sheet page?