Project

General

Profile

Revision c0292658

IDc029265834062f8ec9ce7d5a35bde154e8f7c10e
Parent f808cb88
Child 602d39cf

Added by Patrick Plitzner 9 months ago

ref #7827 code cleaning

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/MoveDefinedTermOperation.java
94 94
				cleanTerm(term);
95 95
				DefinedTermBase targetDefinedTerm = (DefinedTermBase) targetTermOrVocabulary;
96 96

  
97
				if(targetTermOrVocabulary instanceof OrderedTermBase && term instanceof OrderedTermBase) {
98
				    TermVocabulary tVoc = ((DefinedTermBase) targetTermOrVocabulary).getVocabulary();
97
				if(targetDefinedTerm instanceof OrderedTermBase && term instanceof OrderedTermBase) {
98
				    OrderedTermBase targetOrderedDefinedTerm = (OrderedTermBase)targetDefinedTerm;
99
				    TermVocabulary tVoc = targetOrderedDefinedTerm.getVocabulary();
99 100
				    if(tVoc instanceof OrderedTermVocabulary) {
100 101
				        OrderedTermVocabulary otVoc = (OrderedTermVocabulary)tVoc;
101 102
				        // the link between the location and the add term (below / above)
......
103 104
				        // DefinedTermEditor's ViewerSorter (DefinedTermSorter) class
104 105
				        if(currentLocation == ViewerDropAdapter.LOCATION_BEFORE) {
105 106
				            otVoc.addTermAbove((OrderedTermBase)term, (OrderedTermBase)targetTermOrVocabulary);
106
				            if (((DefinedTermBase) targetTermOrVocabulary).getPartOf() != null){
107
				                ((DefinedTermBase) targetTermOrVocabulary).getPartOf().addIncludes(term);
107
				            if (targetOrderedDefinedTerm.getPartOf() != null){
108
				                targetOrderedDefinedTerm.getPartOf().addIncludes(term);
108 109
				            }
109 110
				        }
110 111

  
111 112
				        if(currentLocation == ViewerDropAdapter.LOCATION_AFTER) {
112 113
				            otVoc.addTermBelow((OrderedTermBase)term, (OrderedTermBase)targetTermOrVocabulary);
113
				            if (((DefinedTermBase) targetTermOrVocabulary).getPartOf() != null){
114
                                ((DefinedTermBase) targetTermOrVocabulary).getPartOf().addIncludes(term);
114
				            if (targetOrderedDefinedTerm.getPartOf() != null){
115
				                targetOrderedDefinedTerm.getPartOf().addIncludes(term);
115 116
                            }
116 117
				        }
117 118
				        if(currentLocation == ViewerDropAdapter.LOCATION_ON) {
118
						    targetDefinedTerm.addIncludes(term);
119
						    targetDefinedTerm.getVocabulary().addTerm(term);
119
				            targetOrderedDefinedTerm.addIncludes(term);
120
				            targetOrderedDefinedTerm.getVocabulary().addTerm(term);
120 121
						}
121 122
				    }
122 123
				} else{

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)