@Override
public void widgetSelected(SelectionEvent e) {
- T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity());
+ T selection = SelectionDialogFactory.getSelectionFromDialog(clazz, getShell(), getConversationHolder(), getEntity(), getParentElement());
setSelectionInternal(selection);
}
service = (IService<T>) CdmStore.getService(IAmplificationService.class);
}
//check if original already exists in data base. If not then do not clone and all changes will be persisted directly -> Warning to user.
- if(service !=null && service.find(originalEntity.getUuid())==null){
+ if(service !=null && service.find(originalEntity.getUuid())==null && originalEntity.getId() != 0){
if(MessagingUtils.confirmDialog(TRANSIENT_EDITING_WARNING_TITLE, "["+originalEntity.getClass().getSimpleName()+"]"+originalEntity + " has to be saved before it can be edited. Save now?")){
service.save(originalEntity);
AbstractUtility.getActiveEditor().doSave(new NullProgressMonitor());
}
}
else{
- try {
- //clone original
- clonedEntity = (T) ((CdmBase) originalEntity).clone();
- } catch (CloneNotSupportedException e1) {
- MessagingUtils.warningDialog(TRANSIENT_EDITING_WARNING_TITLE, this, TRANSIENT_EDITING_WARNING_TEXT);
- }
+ //FIXME temporarily disabled cloning re-opening bug #2645 (EditFromSelectionWizard persists data even when canceled)
+// try {
+// //clone original
+// clonedEntity = (T) ((CdmBase) originalEntity).clone();
+// } catch (CloneNotSupportedException e1) {
+// MessagingUtils.warningDialog(TRANSIENT_EDITING_WARNING_TITLE, this, TRANSIENT_EDITING_WARNING_TEXT);
+// }
}
}
}
//be sure to reset to original in all cases
selectionElement.setEntity(originalEntity);
+ selectionElement.refresh();
}
}