Revision 3698034e
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java | ||
---|---|---|
467 | 467 |
if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed()) { |
468 | 468 |
viewer.getControl().setFocus(); |
469 | 469 |
} |
470 |
checklistEditorInput.bind(); |
|
470 | 471 |
} |
471 | 472 |
|
472 | 473 |
//FIXME E4 migrate |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java | ||
---|---|---|
25 | 25 |
import java.util.zip.ZipOutputStream; |
26 | 26 |
|
27 | 27 |
import org.apache.log4j.Logger; |
28 |
import org.eclipse.core.runtime.Assert; |
|
29 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
30 | 28 |
import org.eclipse.core.runtime.IStatus; |
31 |
import org.eclipse.core.runtime.Status; |
|
32 | 29 |
import org.eclipse.core.runtime.jobs.Job; |
33 | 30 |
import org.eclipse.swt.widgets.Display; |
34 | 31 |
|
35 | 32 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
36 | 33 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
37 | 34 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
35 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
|
38 | 36 |
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor; |
39 | 37 |
import eu.etaxonomy.cdm.io.cdmLight.CdmLightExportConfigurator; |
40 | 38 |
import eu.etaxonomy.cdm.io.common.CdmDefaultExport; |
... | ... | |
217 | 215 |
ExportResult result = (ExportResult)remotingMonitor.getResult(); |
218 | 216 |
ExportDataWrapper data = result.getExportData(); |
219 | 217 |
try{ |
220 |
if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY)){ |
|
221 |
byte[] exportData = (byte[])data.getExportData(); |
|
222 |
if(exportData != null){ |
|
223 |
FileOutputStream stream = new FileOutputStream(exportFile); |
|
224 |
stream.write(exportData); |
|
225 |
stream.close(); |
|
226 |
} |
|
218 |
if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY) || result.getExportData().getType().equals(ExportResultType.LIST_BYTE_ARRAY)){ |
|
219 |
if (data.getExportData() instanceof byte[]){ |
|
220 |
byte[] exportData = (byte[])data.getExportData(); |
|
221 |
if(exportData != null){ |
|
222 |
FileOutputStream stream = new FileOutputStream(exportFile); |
|
223 |
Writer out = new BufferedWriter(new OutputStreamWriter( |
|
224 |
stream, "UTF8")); |
|
225 |
|
|
226 |
stream.write(exportData); |
|
227 |
out.flush(); |
|
228 |
stream.close(); |
|
229 |
} |
|
230 |
}else if (data.getExportData() instanceof List<?>){ |
|
231 |
//TODO:This needs to be improved |
|
232 |
List<byte[]> exportData = (List<byte[]>)data.getExportData(); |
|
233 |
if(exportData != null){ |
|
234 |
FileOutputStream stream = new FileOutputStream(exportFile); |
|
235 |
Writer out = new BufferedWriter(new OutputStreamWriter( |
|
236 |
stream, "UTF8")); |
|
237 |
|
|
238 |
stream.write(exportData.get(0)); |
|
239 |
out.flush(); |
|
240 |
stream.close(); |
|
241 |
} |
|
242 |
} |
|
243 |
|
|
227 | 244 |
} else if (result.getExportData().getType().equals(ExportResultType.MAP_BYTE_ARRAY)){ |
228 | 245 |
Map<String, byte[]> resultMap = (Map<String, byte[]>)data.getExportData(); |
229 | 246 |
Set<String> keySet = resultMap.keySet(); |
... | ... | |
329 | 346 |
ExportResult result = ioService.export(configurator); |
330 | 347 |
ExportDataWrapper data = result.getExportData(); |
331 | 348 |
try{ |
332 |
if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY)){ |
|
349 |
if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY) || result.getExportData().getType().equals(ExportResultType.LIST_BYTE_ARRAY)){
|
|
333 | 350 |
byte[] exportData = (byte[])data.getExportData(); |
334 | 351 |
if(exportData != null){ |
335 | 352 |
File file = new File(urlString); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteTaxonBaseConfiguratorComposite.java | ||
---|---|---|
26 | 26 |
import org.eclipse.swt.widgets.Composite; |
27 | 27 |
import org.eclipse.swt.widgets.Display; |
28 | 28 |
import org.eclipse.swt.widgets.Event; |
29 |
import org.eclipse.swt.widgets.Label; |
|
29 | 30 |
import org.eclipse.swt.widgets.Listener; |
30 | 31 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
32 |
import org.eclipse.wb.swt.SWTResourceManager; |
|
31 | 33 |
|
32 | 34 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
33 | 35 |
import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator; |
... | ... | |
61 | 63 |
|
62 | 64 |
Classification selectedClassification; |
63 | 65 |
private List<Classification> classifications; |
66 |
private Composite composite; |
|
64 | 67 |
|
65 | 68 |
|
66 | 69 |
/** |
... | ... | |
82 | 85 |
setBackground(getBackground()); |
83 | 86 |
|
84 | 87 |
btnDeleteTaxonName = new Button(this, SWT.CHECK); |
88 |
btnDeleteTaxonName.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, false, 1, 1)); |
|
85 | 89 |
btnDeleteTaxonName.setText("Delete name if possible"); |
86 | 90 |
btnDeleteTaxonName.setSelection(true); |
87 | 91 |
btnDeleteTaxonName.addListener(SWT.Selection, new Listener() { |
88 | 92 |
@Override |
89 | 93 |
public void handleEvent(Event e) { |
90 | 94 |
Button b = (Button) e.widget; |
91 |
GridData data = (GridData) btnRemoveAllNameRelationships.getLayoutData();
|
|
95 |
GridData data = (GridData) btnDeleteTaxonName.getLayoutData();
|
|
92 | 96 |
data.exclude = b.getSelection(); |
93 |
btnRemoveAllNameRelationships.setVisible(data.exclude); |
|
94 |
btnIgnoreIsBasionym.setVisible(data.exclude); |
|
95 |
btnIgnoreIsReplacedSynonymFor.setVisible(data.exclude); |
|
96 |
btnIgnoreHasBasionym.setVisible(data.exclude); |
|
97 |
btnIgnoreHasReplacedSynonym.setVisible(data.exclude); |
|
98 |
btnRemoveAllTypeDesignations.setVisible(data.exclude); |
|
97 |
composite.setEnabled(data.exclude); |
|
98 |
btnRemoveAllNameRelationships.setSelection(data.exclude); |
|
99 |
btnIgnoreIsBasionym.setSelection(data.exclude); |
|
100 |
btnIgnoreIsReplacedSynonymFor.setSelection(data.exclude); |
|
101 |
btnIgnoreHasBasionym.setSelection(data.exclude); |
|
102 |
btnIgnoreHasReplacedSynonym.setSelection(data.exclude); |
|
103 |
btnRemoveAllTypeDesignations.setSelection(data.exclude); |
|
99 | 104 |
} |
100 | 105 |
}); |
101 | 106 |
|
107 |
composite = new Composite(this, SWT.NO_BACKGROUND); |
|
108 |
GridLayout gl_composite = new GridLayout(1, false); |
|
109 |
gl_composite.horizontalSpacing = 1; |
|
110 |
gl_composite.marginHeight = 1; |
|
111 |
composite.setLayout(gl_composite); |
|
112 |
GridData gd_composite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
113 |
gd_composite.heightHint = 166; |
|
114 |
gd_composite.widthHint = 294; |
|
115 |
composite.setLayoutData(gd_composite); |
|
116 |
composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); |
|
117 |
toolkit.adapt(composite); |
|
118 |
toolkit.paintBordersFor(composite); |
|
119 |
|
|
102 | 120 |
|
103 | 121 |
//DeleteConfigurator for the name |
104 | 122 |
|
105 | 123 |
|
106 |
btnRemoveAllNameRelationships = new Button(this, SWT.CHECK); |
|
124 |
btnRemoveAllNameRelationships = new Button(composite, SWT.CHECK); |
|
125 |
GridData gd_btnRemoveAllNameRelationships = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
126 |
gd_btnRemoveAllNameRelationships.horizontalIndent = 5; |
|
127 |
btnRemoveAllNameRelationships.setLayoutData(gd_btnRemoveAllNameRelationships); |
|
107 | 128 |
btnRemoveAllNameRelationships.setText("Remove all name relations"); |
108 | 129 |
btnRemoveAllNameRelationships.setSelection(true); |
109 | 130 |
|
110 |
btnIgnoreIsBasionym = new Button(this, SWT.CHECK); |
|
111 |
btnIgnoreIsBasionym.setText("Ignore if it is basionym"); |
|
131 |
btnRemoveAllTypeDesignations = new Button(composite, SWT.CHECK); |
|
132 |
GridData gd_btnRemoveAllTypeDesignations = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
133 |
gd_btnRemoveAllTypeDesignations.horizontalIndent = 5; |
|
134 |
btnRemoveAllTypeDesignations.setLayoutData(gd_btnRemoveAllTypeDesignations); |
|
135 |
btnRemoveAllTypeDesignations.setText("Remove all type designations"); |
|
136 |
btnRemoveAllTypeDesignations.setSelection(true); |
|
137 |
|
|
138 |
Label lblDelete = new Label(composite, SWT.NONE); |
|
139 |
GridData gd_lblDelete = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
140 |
gd_lblDelete.horizontalIndent = 5; |
|
141 |
lblDelete.setLayoutData(gd_lblDelete); |
|
142 |
toolkit.adapt(lblDelete, true, true); |
|
143 |
lblDelete.setText("delete even if "); |
|
144 |
|
|
145 |
btnIgnoreHasReplacedSynonym = new Button(composite, SWT.CHECK); |
|
146 |
GridData gd_btnIgnoreHasReplacedSynonym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
147 |
gd_btnIgnoreHasReplacedSynonym.horizontalIndent = 10; |
|
148 |
btnIgnoreHasReplacedSynonym.setLayoutData(gd_btnIgnoreHasReplacedSynonym); |
|
149 |
btnIgnoreHasReplacedSynonym.setText("it has replaced synonym"); |
|
150 |
btnIgnoreHasReplacedSynonym.setSelection(true); |
|
151 |
|
|
152 |
btnIgnoreHasBasionym = new Button(composite, SWT.CHECK); |
|
153 |
GridData gd_btnIgnoreHasBasionym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
154 |
gd_btnIgnoreHasBasionym.horizontalIndent = 10; |
|
155 |
btnIgnoreHasBasionym.setLayoutData(gd_btnIgnoreHasBasionym); |
|
156 |
btnIgnoreHasBasionym.setText("it has basionym"); |
|
157 |
btnIgnoreHasBasionym.setSelection(true); |
|
158 |
|
|
159 |
btnIgnoreIsReplacedSynonymFor = new Button(composite, SWT.CHECK); |
|
160 |
GridData gd_btnIgnoreIsReplacedSynonymFor = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
161 |
gd_btnIgnoreIsReplacedSynonymFor.horizontalIndent = 10; |
|
162 |
btnIgnoreIsReplacedSynonymFor.setLayoutData(gd_btnIgnoreIsReplacedSynonymFor); |
|
163 |
btnIgnoreIsReplacedSynonymFor.setSelection(true); |
|
164 |
btnIgnoreIsReplacedSynonymFor.setText("it is replaced synonym"); |
|
165 |
|
|
166 |
btnIgnoreIsBasionym = new Button(composite, SWT.CHECK); |
|
167 |
GridData gd_btnIgnoreIsBasionym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
168 |
gd_btnIgnoreIsBasionym.horizontalIndent = 10; |
|
169 |
btnIgnoreIsBasionym.setLayoutData(gd_btnIgnoreIsBasionym); |
|
170 |
btnIgnoreIsBasionym.setText("it is basionym"); |
|
112 | 171 |
btnIgnoreIsBasionym.setSelection(true); |
113 | 172 |
|
114 |
btnIgnoreIsReplacedSynonymFor = new Button(this, SWT.CHECK); |
|
115 |
btnIgnoreIsReplacedSynonymFor.setText("Ignore if it is replaced synonym"); |
|
116 |
btnIgnoreIsReplacedSynonymFor.setSelection(true); |
|
117 |
|
|
118 |
btnIgnoreHasBasionym = new Button(this, SWT.CHECK); |
|
119 |
btnIgnoreHasBasionym.setText("Ignore if it has basionym"); |
|
120 |
btnIgnoreHasBasionym.setSelection(true); |
|
121 |
|
|
122 |
btnIgnoreHasReplacedSynonym = new Button(this, SWT.CHECK); |
|
123 |
btnIgnoreHasReplacedSynonym.setText("Ignore if it has replaced synonym"); |
|
124 |
btnIgnoreHasReplacedSynonym.setSelection(true); |
|
125 |
|
|
126 |
btnRemoveAllTypeDesignations = new Button(this, SWT.CHECK); |
|
127 |
btnRemoveAllTypeDesignations.setText("Remove all type designations"); |
|
128 |
btnRemoveAllTypeDesignations.setSelection(true); |
|
129 |
|
|
130 | 173 |
|
131 | 174 |
|
132 | 175 |
// createClassificationSelectionCombo(this); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/ExtensionElement.java | ||
---|---|---|
13 | 13 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
14 | 14 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
15 | 15 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
16 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
|
17 | 16 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
18 | 17 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
19 | 18 |
|
... | ... | |
49 | 48 |
/** {@inheritDoc} */ |
50 | 49 |
@Override |
51 | 50 |
public void createControls(ICdmFormElement element, int style) { |
52 |
combo_extensionType = formFactory.createDefinedTermComboElement(TermType.ExtensionType, this, null, null, style);
|
|
53 |
text_extensionValue = formFactory.createTextWithLabelElement(element, null, null, style);
|
|
54 |
text_extensionValue.getLayoutComposite().setLayoutData(LayoutConstants.FILL_HORIZONTALLY()); |
|
51 |
combo_extensionType = formFactory.createDefinedTermComboElement(TermType.ExtensionType, element, "Type", null, style);
|
|
52 |
text_extensionValue = formFactory.createTextWithLabelElement(element, "Extension", null, style);
|
|
53 |
|
|
55 | 54 |
} |
56 | 55 |
|
57 | 56 |
/* (non-Javadoc) |
... | ... | |
61 | 60 |
@Override |
62 | 61 |
public void setEntity(Extension element) { |
63 | 62 |
this.entity = element; |
64 |
ExtensionType extensionType = (ExtensionType) HibernateProxyHelper.deproxy(element.getType());
|
|
63 |
ExtensionType extensionType = HibernateProxyHelper.deproxy(element.getType()); |
|
65 | 64 |
combo_extensionType.setSelection(extensionType); |
66 | 65 |
text_extensionValue.setText(element.getValue()); |
67 | 66 |
} |
Also available in: Unified diff
smaller changes