Project

General

Profile

« Previous | Next » 

Revision 18683dc6

Added by Katja Luther over 4 years ago

ref #8631: layout issues

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java
15 15

  
16 16
import org.apache.commons.lang.StringUtils;
17 17
import org.eclipse.jface.layout.GridDataFactory;
18
import org.eclipse.jface.layout.GridLayoutFactory;
19 18
import org.eclipse.swt.SWT;
20 19
import org.eclipse.swt.events.SelectionAdapter;
21 20
import org.eclipse.swt.events.SelectionEvent;
......
94 93
	@Override
95 94
    public void createControl(Composite parent) {
96 95
		final Composite composite = new Composite(parent, SWT.NULL);
97
		//composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
96

  
98 97
		GridLayout gridLayout = new GridLayout();
98
		gridLayout.numColumns=2;
99
		//gridLayout.makeColumnsEqualWidth=true;
99 100
		composite.setLayout(gridLayout);
100
//        if (isPreferencePage){
101
//            ListComponent list = new ListComponent(composite, composite.getStyle());
102
//        }
101

  
102

  
103
		GridData gridData = new GridData();
104
		gridData.horizontalAlignment = GridData.FILL;
105
		gridData.grabExcessHorizontalSpace=true;
106
		gridData.horizontalSpan = 2;
103 107

  
104 108
		Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK);
109

  
105 110
		checkBoxMediaSpecimen.setSelection(abcdImportConfigurator.isAddMediaAsMediaSpecimen());
106 111
		checkBoxMediaSpecimen.setText("Import media as media specimen");
107 112
		checkBoxMediaSpecimen
......
112 117
				abcdImportConfigurator.setAddMediaAsMediaSpecimen(!abcdImportConfigurator.isAddMediaAsMediaSpecimen());
113 118
			}
114 119
		});
120
		checkBoxMediaSpecimen.setLayoutData(gridData);
121
        GridDataFactory.fillDefaults();
115 122

  
116 123
		Button checkBoxIgnoreExisting = new Button(composite, SWT.CHECK);
124
		gridData = new GridData();
125
        gridData.horizontalAlignment = GridData.FILL;
126
        gridData.grabExcessHorizontalSpace=true;
127
        gridData.horizontalSpan = 2;
128

  
117 129
		checkBoxIgnoreExisting.setSelection(abcdImportConfigurator.isIgnoreImportOfExistingSpecimen());
118 130
		checkBoxIgnoreExisting.setText("Do not import existing specimens");
119 131
		checkBoxIgnoreExisting
......
125 137
			}
126 138
		});
127 139

  
140
		checkBoxIgnoreExisting.setLayoutData(gridData);
141
        GridDataFactory.fillDefaults();
142

  
128 143
		Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK);
144
		gridData = new GridData();
145
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
146
        gridData.horizontalSpan = 2;
147
		checkBoxIgnoreAuthorship.setLayoutData(gridData);
148
		GridDataFactory.fillDefaults();
129 149
		checkBoxIgnoreAuthorship.setSelection(abcdImportConfigurator.isIgnoreAuthorship());
130 150
		checkBoxIgnoreAuthorship.setText("Ignore Authorship for name matching");
131 151
		checkBoxIgnoreAuthorship
......
138 158
			}
139 159
		});
140 160

  
141
		Composite unitIdComposite = new Composite(composite, SWT.NULL);
142
		GridLayout gridLayoutUnitId = new GridLayout();
143
        gridLayoutUnitId.numColumns=2;
144
	    unitIdComposite.setLayout(gridLayoutUnitId);
145 161

  
146
        Label unitIdLabel = new Label(unitIdComposite, SWT.NONE);
162
		Label unitIdLabel = new Label(composite, SWT.NONE);
147 163
        unitIdLabel.setText(Messages.AbcdImportPreference_map_unit_nr_catalog_number);
148
        GridDataFactory.fillDefaults().applyTo(unitIdLabel);
149
        checkBoxMapUnitId = new Combo(unitIdComposite, SWT.BORDER| SWT.READ_ONLY);
150
        GridDataFactory.fillDefaults().applyTo(checkBoxMapUnitId);
164

  
165
        GridData gridDataUnitId = new GridData();
166
        gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
167
        unitIdLabel.setLayoutData(gridDataUnitId);
168
        GridDataFactory.fillDefaults();
169

  
170
        checkBoxMapUnitId = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
171
        gridDataUnitId = new GridData();
172
        gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
173
        checkBoxMapUnitId.setLayoutData(gridDataUnitId);
174
        GridDataFactory.fillDefaults();
175

  
151 176
        checkBoxMapUnitId.add(ACCESSION_NUMBER);
152 177
        checkBoxMapUnitId.add(BARCODE);
153 178
        checkBoxMapUnitId.add(CATALOGUE_NUMBER);
......
163 188
            checkBoxMapUnitId.select(2);
164 189
        }
165 190

  
166
        GridLayoutFactory.fillDefaults();
167
		Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK);
191

  
192
        Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK);
193
        gridData = new GridData();
194
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
195
        gridData.horizontalSpan = 2;
196
		checkBoxRemoveCountry.setLayoutData(gridData);
197
		GridDataFactory.fillDefaults();
168 198
		checkBoxRemoveCountry.setSelection(abcdImportConfigurator.isRemoveCountryFromLocalityText());
169 199
		checkBoxRemoveCountry.setText("Remove country from locality text");
170 200
		checkBoxRemoveCountry
......
179 209
		});
180 210

  
181 211
		Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK);
212
		gridData = new GridData();
213
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
214
        gridData.horizontalSpan = 2;
215
		checkBoxMoveToDefaultClassification.setLayoutData(gridData);
216
        GridDataFactory.fillDefaults();
182 217
		checkBoxMoveToDefaultClassification.setSelection(abcdImportConfigurator.isMoveNewTaxaToDefaultClassification());
183 218
		checkBoxMoveToDefaultClassification.setText("Create new classification for new taxa");
184 219
		checkBoxMoveToDefaultClassification
......
192 227
		});
193 228

  
194 229
		Button checkBoxImportSiblings = new Button(composite, SWT.CHECK);
230
		gridData = new GridData();
231
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
232
        gridData.horizontalSpan = 2;
233
		checkBoxImportSiblings.setLayoutData(gridData);
234
        GridDataFactory.fillDefaults();
195 235
		checkBoxImportSiblings.setSelection(abcdImportConfigurator.isGetSiblings());
196 236
		checkBoxImportSiblings.setText("Import all children of cultures or tissue samples");
197 237
		checkBoxImportSiblings
......
204 244
        });
205 245

  
206 246
        Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK);
247
        gridData = new GridData();
248
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
249
        gridData.horizontalSpan = 2;
250
        checkBoxAddIndividualsAssociations.setLayoutData(gridData);
251
        GridDataFactory.fillDefaults();
207 252
        checkBoxAddIndividualsAssociations.setSelection(abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
208 253
        checkBoxAddIndividualsAssociations.setText("Create an Individual Association for each Specimen");
209 254
        checkBoxAddIndividualsAssociations
......
216 261
        });
217 262

  
218 263
        Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK);
264
        gridData = new GridData();
265
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
266
        gridData.horizontalSpan = 2;
267
        checkBoxReuseDescriptiveGroups.setLayoutData(gridData);
268
        GridDataFactory.fillDefaults();
219 269
        checkBoxReuseDescriptiveGroups.setSelection(abcdImportConfigurator.isReuseExistingDescriptiveGroups());
220 270
        checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group");
221 271
        checkBoxReuseDescriptiveGroups
......
228 278
        });
229 279

  
230 280
        Button checkBoxReuseExistingTaxa = new Button(composite, SWT.CHECK);
281
        gridData = new GridData();
282
        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
283
        gridData.horizontalSpan = 2;
284
        checkBoxReuseExistingTaxa.setLayoutData(gridData);
285
        GridDataFactory.fillDefaults();
231 286
        checkBoxReuseExistingTaxa.setSelection(abcdImportConfigurator.isReuseExistingTaxaWhenPossible());
232 287
        checkBoxReuseExistingTaxa.setText("Reuse existing taxa when possible");
233 288
        checkBoxReuseExistingTaxa
......
241 296

  
242 297

  
243 298
        if (!isFileImport){
244
            Composite dnaComposite = new Composite(composite, SWT.NULL);
245
            GridLayout gridLayoutDna = new GridLayout();
246
            gridLayoutDna.numColumns=2;
247
            dnaComposite.setLayout(gridLayoutDna);
248
            Label labelRef = new Label(dnaComposite, SWT.NONE);
299

  
300
            Label labelRef = new Label(composite, SWT.NONE);
301
            gridDataUnitId = new GridData();
302
            gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
303
            labelRef.setLayoutData(gridDataUnitId);
249 304
            labelRef.setText("Biocase provider for associated DNA");
250
            new Label(dnaComposite, SWT.NONE);
251
            textDNAProviderString = new Combo(dnaComposite, SWT.BORDER);
305
            GridDataFactory.fillDefaults().applyTo(labelRef);
306

  
307
            textDNAProviderString = new Combo(composite, SWT.BORDER);
308
            textDNAProviderString.setLayoutData(gridDataUnitId);
252 309
            GridDataFactory.fillDefaults().applyTo(textDNAProviderString);
253 310
            textDNAProviderString.add("Do not search for DNA");
254 311

  
......
272 329
        }else{
273 330
            abcdImportConfigurator.setDnaSoure(null);
274 331
        }
275
//        GridData gridData = new GridData();
276
//        gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
277
//        gridData.horizontalIndent = 5;
278
//      classificationSelection.setLayoutData(gridData);
279
        Composite codeComposite = new Composite(composite, SWT.NULL);
280

  
281
        codeComposite.setLayout(gridLayoutUnitId);
282
        Label labelCode = new Label(codeComposite, SWT.NONE);
332

  
333

  
334
        Label labelCode = new Label(composite, SWT.NONE);
283 335
        labelCode.setText("Nomenclatural Code");
336
        gridData = new GridData();
337
        gridData.horizontalAlignment=SWT.BEGINNING;
338

  
339
        labelCode.setLayoutData(gridData);
284 340
        GridDataFactory.fillDefaults().applyTo(labelCode);
285
        nomenclaturalCodeSelectionCombo = new Combo(codeComposite, SWT.BORDER| SWT.READ_ONLY);
286
        GridDataFactory.fillDefaults().applyTo(nomenclaturalCodeSelectionCombo);
341
        nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
342
        gridData = new GridData();
343
        gridData.horizontalAlignment=SWT.BEGINNING;
344
        nomenclaturalCodeSelectionCombo.setLayoutData(gridData);
345
        GridDataFactory.fillDefaults();
287 346
        for(NomenclaturalCode code: NomenclaturalCode.values()){
288 347
            nomenclaturalCodeSelectionCombo.add(code.getKey());
289 348
        }
290 349

  
291

  
292

  
293
        // TODO remember last selection
294 350
        nomenclaturalCodeSelectionCombo.addSelectionListener(this);
295 351
        int index = 0;
296 352
        if (abcdImportConfigurator.getNomenclaturalCode() != null){

Also available in: Unified diff