Revision 472cdc2e
Added by Katja Luther over 2 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/e4/handler/NewObjectHandler.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
27 | 27 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
28 | 28 |
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor; |
29 |
import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput; |
|
29 | 30 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.GroupCreator; |
30 | 31 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.UserCreator; |
31 | 32 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
... | ... | |
69 | 70 |
} |
70 | 71 |
}; |
71 | 72 |
} |
72 |
InputDialog dialog = new InputDialog(shell, |
|
73 |
InputDialog dialog = null; |
|
74 |
if (!(bulkEditor.getEditorInput() instanceof OccurrenceEditorInput)){ |
|
75 |
dialog = new InputDialog(shell, |
|
73 | 76 |
String.format("Create %s", text), String.format("Enter new %s", text), "", |
74 | 77 |
nonEmptyInputValidator); |
78 |
} |
|
75 | 79 |
|
76 |
if (dialog.open() != Window.CANCEL) { |
|
80 |
if (dialog == null || dialog.open() != Window.CANCEL) {
|
|
77 | 81 |
IEntityCreator<?> entityCreator = bulkEditor.getEditorInput().getEntityCreator(); |
78 |
Object createdEntity = entityCreator.createEntity(key, dialog.getValue()); |
|
82 |
String title = null; |
|
83 |
if (dialog != null){ |
|
84 |
title = dialog.getValue(); |
|
85 |
} |
|
86 |
Object createdEntity = entityCreator.createEntity(key, title); |
|
79 | 87 |
if (createdEntity == null){ |
80 | 88 |
return; |
81 | 89 |
} |
Also available in: Unified diff
ref #5244: do not show title dialog for new specimen