-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
* <p>showEmptyPage</p>
*/
public void showEmptyPage(){
+ setPartName(createPartTitle(null));
pageBook.showPage(emptySelectionLabel);
}
this.part = part;
Object element = selection.getFirstElement();
- getViewer().setInput(element);
- showViewer();
+ //avoid widget is disposed exceptions
+ if (getViewer().getControl()==null || getViewer().getControl().isDisposed()){
+ return;
+ }
+
+ setPartName(createPartTitle(element));
+ getViewer().setInput(element);
+ showViewer();
}
/**
// TODO Auto-generated method stub
return null;
}
+
+ protected String createPartTitle(Object selectedObject){
+ if(selectedObject!=null){
+ return getViewName()+": "+selectedObject; //$NON-NLS-1$
+ }
+ return getViewName();
+ }
+
+ protected abstract String getViewName();
}