return textValue;
}
+
+ public static String deproxyClassName(Class clazz){
+ String name = clazz.getSimpleName();
+ return name.substring(0, name.indexOf("_$$"));
+ }
}
* @param <T> a T object.
*/
public AbstractNewEntityWizard(){
- setWindowTitle("New Entity");
+ setWindowTitle(String.format("New %s", getEntityName()));
}
+ /**
+ * FIXME there might be a smarter way to do this,
+ *
+ * @return
+ */
+ protected abstract String getEntityName();
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
*/
@Override
public void setEntity(Classification entity) {
- setWindowTitle("Edit Classification");
+ setWindowTitle(String.format("Edit %s", getEntityName()));
entity = CdmStore.getService(IClassificationService.class).load(entity.getUuid());
super.setEntity(entity);
}
protected Classification createNewEntity() {
return Classification.NewInstance(null);
}
+
+ @Override
+ protected String getEntityName() {
+ return "Classification";
+ }
}
protected Collection createNewEntity() {
return Collection.NewInstance();
}
+
+ @Override
+ protected String getEntityName() {
+ return "Collection";
+ }
}
protected void saveEntity() {
CdmStore.getService(IOccurrenceService.class).saveOrUpdate(getEntity());
}
+
+ @Override
+ protected String getEntityName() {
+ return "Specimen";
+ }
+
+
}
protected void saveEntity() {
CdmStore.getService(IOccurrenceService.class).saveOrUpdate(getEntity());
}
+
+ @Override
+ protected String getEntityName() {
+ return "Field Observation";
+ }
}
return Group.NewInstance();
}
+ @Override
+ protected String getEntityName() {
+ return "Group";
+ }
+
}
return Institution.NewInstance();
}
+ @Override
+ protected String getEntityName() {
+ return "Institution";
+ }
+
}
protected void saveEntity() {
CdmStore.getService(INameService.class).saveOrUpdate(getEntity());
}
+
+ @Override
+ protected String getEntityName() {
+ return "Scientific Name";
+ }
}
protected void saveEntity() {
CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
}
+
+ @Override
+ protected String getEntityName() {
+ return "Person";
+ }
}
return PolytomousKey.NewInstance();
}
+ @Override
+ protected String getEntityName() {
+ return "Polytomous Key";
+ }
+
}
super.setEntity(entity);
referencePage.getDetailElement().setEntity(entity);
}
+
+ @Override
+ protected String getEntityName() {
+ return "Reference";
+ }
}
public ITreeNode getParentTreeNode(){
return taxonNodePage.getParentTreeNode();
}
+
+ @Override
+ protected String getEntityName() {
+ return "Taxon";
+ }
}
\ No newline at end of file
protected void saveEntity() {
CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
}
+
+ @Override
+ protected String getEntityName() {
+ return "Team";
+ }
}
return User.NewInstance(null, null);
}
+ @Override
+ protected String getEntityName() {
+ return "Institution";
+ }
+
}
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.model.TextHelper;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
*/
public EditFromSelectionWizard(EntitySelectionElement selectionElement) {
this.selectionElement = selectionElement;
- this.setWindowTitle("Edit Entity");
+ this.setWindowTitle(String.format("Edit %s", TextHelper.deproxyClassName(selectionElement.getEntity().getClass())));
}
/** {@inheritDoc} */