Revision 81222649
Added by Katja Luther over 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/AbstractTermTreeEditor.java | ||
---|---|---|
296 | 296 |
listToUpdate.clear(); |
297 | 297 |
List<TermTreeDto> rootEntities = getRootEntities(); |
298 | 298 |
CdmStore.getService(ITermTreeService.class).saveOrUpdateTermTreeDtoList(rootEntities); |
299 |
|
|
299 |
updateTrees(); |
|
300 | 300 |
|
301 | 301 |
conversation.commit(true); |
302 | 302 |
// initializeTrees(); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDtoDropAdapter.java | ||
---|---|---|
141 | 141 |
TermNodeDto droppedNode = editor.getNodeDtoForUuid(((TermNodeDto) droppedObject).getUuid()); |
142 | 142 |
TermNodeDto oldParent = editor.getNodeDtoForUuid(droppedNode.getParentUuid()); |
143 | 143 |
boolean isCircle = checkCircle(droppedNode, target); |
144 |
if (isCircle){ |
|
144 |
if (isCircle || droppedNode.equals(target)){
|
|
145 | 145 |
return false; |
146 | 146 |
} |
147 | 147 |
int currentPosition = oldParent.getIndex(droppedNode); |
... | ... | |
225 | 225 |
*/ |
226 | 226 |
private boolean checkCircle(TermNodeDto droppedNode, TermNodeDto newParent) { |
227 | 227 |
boolean result = false; |
228 |
if (droppedNode.getChildren().contains(newParent)){ |
|
228 |
if (droppedNode.getChildren().contains(newParent) ){
|
|
229 | 229 |
return true; |
230 | 230 |
} |
231 | 231 |
|
232 |
|
|
232 | 233 |
if (newParent.getParentUuid() != null){ |
233 | 234 |
result = checkCircle(droppedNode, editor.getNodeDtoForUuid(newParent.getParentUuid())); |
234 | 235 |
|
... | ... | |
248 | 249 |
if(target instanceof TermTreeDto && getCurrentLocation()!=ViewerDropAdapter.LOCATION_ON){ |
249 | 250 |
isSupported = false; |
250 | 251 |
} |
252 |
if (target == null){ |
|
253 |
isSupported = false; |
|
254 |
} |
|
251 | 255 |
return isSupported; |
252 | 256 |
} |
253 | 257 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AbstractAddFeatureHandler.java | ||
---|---|---|
37 | 37 |
import eu.etaxonomy.taxeditor.featuretree.e4.operation.AddFeatureOperation; |
38 | 38 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
39 | 39 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
40 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
41 | 40 |
|
42 | 41 |
/** |
43 | 42 |
* @author k.luther |
... | ... | |
50 | 49 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
51 | 50 |
UISynchronize sync) { |
52 | 51 |
IFeatureTreeEditor editor = ((IFeatureTreeEditor) thisPart.getObject()); |
53 |
if (StoreUtil.promptCheckIsDirty(editor)) { |
|
54 |
return; |
|
55 |
} |
|
52 |
|
|
56 | 53 |
TermNodeDto parent = getParent(selection); |
57 | 54 |
TermType type = null; |
58 | 55 |
if (parent.getTerm() == null){ |
Also available in: Unified diff
ref #8774: save is not necessary for creating new terms