Revision 939829bc
Added by Patrick Plitzner about 7 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingMoveTaxonNodeHandler.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock; |
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
26 | 26 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
27 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
|
27 | 28 |
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels; |
28 | 29 |
import eu.etaxonomy.taxeditor.navigation.navigator.TreeNodeDropAdapter.MovingType; |
29 | 30 |
import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveTaxonOperation; |
... | ... | |
53 | 54 |
// check that only a single taxon tree node has been selected |
54 | 55 |
if(selection.size() > 1) { |
55 | 56 |
return new Status(IStatus.ERROR, |
56 |
"unknown", |
|
57 |
"unknown", //$NON-NLS-1$
|
|
57 | 58 |
TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE); |
58 | 59 |
} |
59 | 60 |
|
60 | 61 |
// check for no taxon tree node selected |
61 | 62 |
if(selection.size() == 0) { |
62 | 63 |
return new Status(IStatus.ERROR, |
63 |
"unknown", |
|
64 |
"unknown", //$NON-NLS-1$
|
|
64 | 65 |
TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE); |
65 | 66 |
} |
66 | 67 |
// check that selected object is a taxon node |
... | ... | |
69 | 70 |
oldTaxonNode = (TaxonNode)obj; |
70 | 71 |
} else { |
71 | 72 |
return new Status(IStatus.ERROR, |
72 |
"unknown", |
|
73 |
"unknown", //$NON-NLS-1$
|
|
73 | 74 |
TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE); |
74 | 75 |
} |
75 | 76 |
return Status.OK_STATUS; |
... | ... | |
94 | 95 |
|
95 | 96 |
parentTaxonNode = TaxonNodeSelectionDialog.select(activeShell, |
96 | 97 |
new ConversationHolderMock(), |
97 |
"Choose the taxon above the moved taxon.",
|
|
98 |
Messages.RemotingMoveTaxonNodeHandler_CHOOSE_TAXON,
|
|
98 | 99 |
excludeTaxa, |
99 | 100 |
null, |
100 | 101 |
oldTaxonNode.getClassification()); |
101 |
String[] buttonLables = {"Child", "Behind","Cancel"};
|
|
102 |
MessageDialog dialog = new MessageDialog(null, "Target node", null, "Do you want to move the Taxonnode as child or behind the target node.", MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
|
|
102 |
String[] buttonLables = {Messages.RemotingMoveTaxonNodeHandler_CHILD, Messages.RemotingMoveTaxonNodeHandler_BEHIND,Messages.RemotingMoveTaxonNodeHandler_CANCEL};
|
|
103 |
MessageDialog dialog = new MessageDialog(null, Messages.RemotingMoveTaxonNodeHandler_TARGET_NODE, null, Messages.RemotingMoveTaxonNodeHandler_TARGET_NODE_MESSAGE, MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
|
|
103 | 104 |
dialog.open(); |
104 | 105 |
int returnCode = dialog.getReturnCode(); |
105 | 106 |
if (returnCode == 0){ |
... | ... | |
110 | 111 |
} else { |
111 | 112 |
parentTaxonNode = TaxonNodeSelectionDialog.select(activeShell, |
112 | 113 |
new ConversationHolderMock(), |
113 |
"Choose new parent",
|
|
114 |
Messages.RemotingMoveTaxonNodeHandler_CHOOSE_PARENT,
|
|
114 | 115 |
excludeTaxa, |
115 | 116 |
null, |
116 | 117 |
oldTaxonNode.getClassification()); |
... | ... | |
120 | 121 |
if(parentTaxonNode != null){ |
121 | 122 |
if(NavigationUtil.isDirty(parentTaxonNode)){ |
122 | 123 |
MessageDialog.openWarning(activeShell, |
123 |
"Unsaved Parent Taxon",
|
|
124 |
"There are unsaved changes in the parent taxon. Please save first.");
|
|
124 |
Messages.RemotingMoveTaxonNodeHandler_UNSAVED_PARENT,
|
|
125 |
Messages.RemotingMoveTaxonNodeHandler_UNSAVED_PARENT_MESSAGE);
|
|
125 | 126 |
return null; |
126 | 127 |
} |
127 | 128 |
|
Also available in: Unified diff
ref #4611 i18n for taxeditor.navigator plugin