Revision ae31507c
Added by Patrick Plitzner about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermDropAdapterE4.java | ||
---|---|---|
39 | 39 |
*/ |
40 | 40 |
public class DefinedTermDropAdapterE4 extends EditViewerDropAdapter { |
41 | 41 |
|
42 |
|
|
43 |
public static final String TERM_TYPE_ERROR_TITLE = Messages.DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE; |
|
44 |
public static final String TERM_TYPE_ERROR_MESSAGE = Messages.DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE; |
|
45 |
|
|
42 | 46 |
public static final String MOVE_FAILED = Messages.DefinedTermDropAdapterE4_MOVE_FAILED; |
43 | 47 |
|
44 | 48 |
private static final String MOVE_FAILED_MESSAGE = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE; |
... | ... | |
80 | 84 |
MOVE_FAILED_MESSAGE); |
81 | 85 |
return false; |
82 | 86 |
} |
83 |
String title = "Term types do not match"; |
|
84 |
String message = "The term type of the dropped term does not match the target term type."; |
|
85 | 87 |
if(target instanceof TermDto){ |
86 | 88 |
TermDto parentTerm = (TermDto)target; |
87 | 89 |
//check term type compatibility |
88 | 90 |
if(droppedObject instanceof TermDto && !((TermDto) droppedObject).getTermType().equals(parentTerm.getTermType())){ |
89 |
MessagingUtils.warningDialog(title, this, message);
|
|
91 |
MessagingUtils.warningDialog(TERM_TYPE_ERROR_TITLE, this, TERM_TYPE_ERROR_MESSAGE);
|
|
90 | 92 |
return false; |
91 | 93 |
} |
92 | 94 |
|
... | ... | |
111 | 113 |
TermVocabularyDto vocDto = (TermVocabularyDto)target; |
112 | 114 |
//check term type compatibility |
113 | 115 |
if(droppedObject instanceof TermDto && !((TermDto) droppedObject).getTermType().equals(vocDto.getTermType())){ |
114 |
MessagingUtils.warningDialog(title, this, message);
|
|
116 |
MessagingUtils.warningDialog(TERM_TYPE_ERROR_TITLE, this, TERM_TYPE_ERROR_MESSAGE);
|
|
115 | 117 |
return false; |
116 | 118 |
} |
117 | 119 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDropAdapter.java | ||
---|---|---|
109 | 109 |
} |
110 | 110 |
for (Object droppedObject : droppedObjects) { |
111 | 111 |
//check term type compatibility |
112 |
String title = "Term types do not match"; |
|
113 |
String message = "The term type of the dropped term does not match the target term type."; |
|
114 | 112 |
TermType targetType = target.getTermType(); |
115 | 113 |
if(droppedObject instanceof IHasTermType){ |
116 | 114 |
TermType droppedType = ((IHasTermType)droppedObject).getTermType(); |
117 | 115 |
if(!droppedType.equals(targetType)){ |
118 |
MessagingUtils.warningDialog(title, this, message);
|
|
116 |
MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
|
|
119 | 117 |
continue; |
120 | 118 |
} |
121 | 119 |
} |
... | ... | |
141 | 139 |
if(termDto.getTermType().equals(TermType.Feature) || termDto.getTermType().isKindOf(TermType.Feature)){ |
142 | 140 |
// check if target feature tree has the same type as the dropped term |
143 | 141 |
if(!termDto.getTermType().equals(targetType)){ |
144 |
MessagingUtils.warningDialog(title, this, message);
|
|
142 |
MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
|
|
145 | 143 |
continue; |
146 | 144 |
} |
147 | 145 |
AddFeatureOperation operation = new AddFeatureOperation( |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java | ||
---|---|---|
149 | 149 |
public static String DefaultFeatureTreePreferenecs_1; |
150 | 150 |
|
151 | 151 |
|
152 |
public static String DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE; |
|
153 |
|
|
154 |
|
|
155 |
public static String DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE; |
|
156 |
|
|
157 |
|
|
152 | 158 |
public static String DefinedTermEditorE4_SAVE_MESSAGE; |
153 | 159 |
public static String DefinedTermEditorE4_SAVE_TITLE; |
154 | 160 |
public static String DefinedTermMenu_FEATURE_TREE; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties | ||
---|---|---|
167 | 167 |
DefinedTermDropAdapterE4_MOVE_FAILED=Move failed |
168 | 168 |
DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE=Cannot move term onto itself or its children |
169 | 169 |
DefinedTermDropAdapterE4_MOVE_FAILED_SAVE_MESSAGE=Moving the term failed. Try saving before. |
170 |
DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE=The term type of the dropped term does not match the target term type. |
|
171 |
DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE=Term types do not match |
|
170 | 172 |
|
171 | 173 |
DebugPreferences_0=Show up widget is disposed error messages |
172 | 174 |
DebugPreferences_1=Disable services api timestamp check |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties | ||
---|---|---|
27 | 27 |
OrderPreferences_Sorting=Sortierung |
28 | 28 |
OrderPreferencePage_NewNavigatorWindowRequired=?nderungen werden erst nach dem erneuten ?ffnen des Navigators sichtbar. |
29 | 29 |
OrderPreferencePage_PleaseReopenNavigator=Um die ?nderungen zu sehen, m?ssen Sie den Navigator schlie?en und neu ?ffnen. |
30 |
|
|
31 | 30 |
DatabaseRepairPage_chooseParameter=Bitte w?hlen Sie, f?r welche B?ume der SortIndex neu berechnet werden soll. |
32 | 31 |
DatabaseRepairPage_updateTaxonNodes=Taxonomischer Baum |
33 | 32 |
DatabaseRepairPage_toolTip_taxonNode=Die Sortier Indizes des Taxonomischen Baums werden aktualisiert. |
... | ... | |
168 | 167 |
DefinedTermDropAdapterE4_MOVE_FAILED=Verschieben fehlgeschlagen |
169 | 168 |
DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE=Terme k?nnen nicht auf sich selbst oder ihre Kindterme verschoben werden |
170 | 169 |
DefinedTermDropAdapterE4_MOVE_FAILED_SAVE_MESSAGE=Das Verschieben des Terms ist fehlgeschlagen. Versuchen Sie vorher zu speichern. |
170 |
DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE=Der Termtyp des verschobenen Terms stimmt nicht mit dem des Ziels ?berein. |
|
171 |
DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE=Termtypen stimmen nicht ?berein |
|
171 | 172 |
|
172 | 173 |
DebugPreferences_0=\"Widget is disposed\" Fehler Meldungen anzeigen |
173 | 174 |
DebugPreferences_1=Deaktiviere die ?berpr?fung des API Timestamp |
Also available in: Unified diff
ref #8146 i18n for term drop adapter