Revision df366db5
Added by Katja Luther about 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java | ||
---|---|---|
68 | 68 |
public static final String XML = "xml"; |
69 | 69 |
|
70 | 70 |
public static final String CSV = "csv"; |
71 |
|
|
72 |
|
|
71 |
|
|
72 |
|
|
73 | 73 |
|
74 | 74 |
public static final String ZIP = "zip"; |
75 | 75 |
|
76 | 76 |
private static boolean csvExport = false; |
77 |
|
|
77 |
|
|
78 | 78 |
private static boolean csvNameExport = false; |
79 | 79 |
|
80 | 80 |
private static String CSV_PRINT_EXPORT ="CSV_PRINT_EXPORT"; |
... | ... | |
91 | 91 |
private final String extension; |
92 | 92 |
|
93 | 93 |
private Combo classificationSelectionCombo; |
94 |
|
|
94 |
|
|
95 | 95 |
private List<Classification> classifications; |
96 |
|
|
96 |
|
|
97 | 97 |
private Classification selectedClassification; |
98 | 98 |
|
99 | 99 |
/** |
... | ... | |
190 | 190 |
"Export the contents of the currently selected database into Comma Separated Value format.", |
191 | 191 |
CSV); |
192 | 192 |
} |
193 |
|
|
193 |
|
|
194 | 194 |
/** |
195 | 195 |
* @return |
196 | 196 |
*/ |
... | ... | |
203 | 203 |
"Export the names of the currently selected database into Semicolon Separated Value format.", |
204 | 204 |
CSV); |
205 | 205 |
} |
206 |
|
|
206 |
|
|
207 | 207 |
/** |
208 | 208 |
* @return |
209 | 209 |
*/ |
... | ... | |
240 | 240 |
|
241 | 241 |
@Override |
242 | 242 |
public int compare(Classification o1, Classification o2) { |
243 |
return o1.getTitleCache().compareTo(o2.getTitleCache()); |
|
243 |
if (o1.equals(o2)){ |
|
244 |
return 0; |
|
245 |
} |
|
246 |
int result = o1.getTitleCache().compareTo(o2.getTitleCache()); |
|
247 |
if (result == 0){ |
|
248 |
return o1.getUuid().compareTo(o2.getUuid()); |
|
249 |
} |
|
250 |
return result; |
|
244 | 251 |
} |
245 | 252 |
}); |
246 |
|
|
253 |
|
|
247 | 254 |
selectedClassification = classifications.iterator().next(); |
248 | 255 |
} |
249 | 256 |
|
... | ... | |
251 | 258 |
if(csvExport || csvPrintExport){ |
252 | 259 |
Label comboBoxLabel = new Label(composite, SWT.NONE); |
253 | 260 |
comboBoxLabel.setText("Classification"); |
254 |
|
|
261 |
|
|
255 | 262 |
createClassificationSelectionCombo(composite); |
256 | 263 |
classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, |
257 | 264 |
true, false, 2, 1)); |
258 | 265 |
} |
259 |
|
|
260 |
|
|
266 |
|
|
267 |
|
|
261 | 268 |
|
262 | 269 |
|
263 | 270 |
Label fileLabel = new Label(composite, SWT.NONE); |
... | ... | |
385 | 392 |
@Override |
386 | 393 |
public void widgetSelected(SelectionEvent e) { |
387 | 394 |
selectedClassification = classifications.get(classificationSelectionCombo.getSelectionIndex()); |
388 |
|
|
395 |
|
|
389 | 396 |
} |
390 | 397 |
|
391 | 398 |
@Override |
392 | 399 |
public void widgetDefaultSelected(SelectionEvent e) { |
393 | 400 |
//not needed here |
394 |
|
|
401 |
|
|
395 | 402 |
} |
396 | 403 |
|
397 | 404 |
public UUID getSelectedClassificationUUID() { |
398 |
|
|
405 |
|
|
399 | 406 |
return selectedClassification.getUuid(); |
400 | 407 |
} |
401 | 408 |
|
Also available in: Unified diff
ref #4232: some more comparators to adapt