-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
* <p>showEmptyPage</p>
*/
public void showEmptyPage(){
+ setPartName(createPartTitle(null));
pageBook.showPage(emptySelectionLabel);
}
this.part = part;
Object element = selection.getFirstElement();
+ //avoid widget is disposed exceptions
+ if (getViewer().getControl()==null || getViewer().getControl().isDisposed()){
+ return;
+ }
+ setPartName(createPartTitle(element));
getViewer().setInput(element);
-
showViewer();
}
}
@Override
- public List<CdmBase> getRootEntities() {
+ public List<? extends CdmBase> getRootEntities() {
return Arrays.asList((CdmBase)getViewer().getInput());
}
public void forceDirty() {
changed(null);
}
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // 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();
}