Revision d1481c18
Added by Patrick Plitzner almost 10 years ago
- query parameters are read from wizard page
- enhanced query's toString() method
.gitattributes | ||
---|---|---|
1269 | 1269 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/SpecimenGeneralSection.java -text |
1270 | 1270 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchComposite.java -text |
1271 | 1271 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchController.java -text |
1272 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchResultsComposite.java -text |
|
1273 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchResultsController.java -text |
|
1274 | 1272 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java -text |
1275 | 1273 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java -text |
1276 | 1274 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java -text |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportSpecimenEditorInput.java | ||
---|---|---|
44 | 44 |
*/ |
45 | 45 |
public DataImportSpecimenEditorInput(BioCaseQuery query) { |
46 | 46 |
this.query = query; |
47 |
this.query.taxonName = "Campanula*"; |
|
48 | 47 |
} |
49 | 48 |
|
50 | 49 |
/* (non-Javadoc) |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.taxeditor.dataimport.DataImportSpecimenEditorInput; |
24 | 24 |
|
25 | 25 |
/** |
26 |
* |
|
26 | 27 |
* @author pplitzner |
27 | 28 |
* @date 11.09.2013 |
28 | 29 |
* |
... | ... | |
32 | 33 |
private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class); |
33 | 34 |
|
34 | 35 |
private BioCaseQuery query; |
36 |
private SpecimenSearchWizardPage searchPage; |
|
35 | 37 |
|
36 | 38 |
/** |
37 | 39 |
* Creates a new SpecimenSearchWizard |
... | ... | |
49 | 51 |
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); |
50 | 52 |
|
51 | 53 |
try { |
54 |
query = searchPage.getQuery(); |
|
52 | 55 |
DataImportSpecimenEditorInput input = new DataImportSpecimenEditorInput(query); |
53 |
input.getToolTipText(); |
|
54 | 56 |
page.openEditor(input, DataImportEditor.ID, true); |
55 | 57 |
} catch ( PartInitException e ) { |
56 | 58 |
//Put your exception handler here if you wish to |
... | ... | |
63 | 65 |
*/ |
64 | 66 |
@Override |
65 | 67 |
public void addPages() { |
66 |
addPage(new SpecimenSearchWizardPage("Specimen Search"));
|
|
68 |
addPage(searchPage);
|
|
67 | 69 |
} |
68 | 70 |
|
69 | 71 |
/* (non-Javadoc) |
... | ... | |
72 | 74 |
@Override |
73 | 75 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
74 | 76 |
query = new BioCaseQuery(); |
77 |
searchPage = new SpecimenSearchWizardPage("Specimen Search"); |
|
75 | 78 |
} |
76 | 79 |
|
77 | 80 |
/** |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizardPage.java | ||
---|---|---|
12 | 12 |
import org.eclipse.jface.wizard.WizardPage; |
13 | 13 |
import org.eclipse.swt.widgets.Composite; |
14 | 14 |
|
15 |
import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery; |
|
15 | 16 |
import eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchController; |
16 | 17 |
|
18 |
|
|
17 | 19 |
/** |
18 | 20 |
* @author pplitzner |
19 | 21 |
* @date 12.09.2013 |
... | ... | |
21 | 23 |
*/ |
22 | 24 |
public class SpecimenSearchWizardPage extends WizardPage{ |
23 | 25 |
|
26 |
private SpecimenSearchController specimenSearchController; |
|
27 |
|
|
24 | 28 |
/** |
25 | 29 |
* @param pageName |
26 | 30 |
*/ |
... | ... | |
33 | 37 |
*/ |
34 | 38 |
@Override |
35 | 39 |
public void createControl(Composite parent) { |
36 |
setControl(new SpecimenSearchController(parent).getComposite()); |
|
40 |
specimenSearchController = new SpecimenSearchController(parent); |
|
41 |
setControl(specimenSearchController.getComposite()); |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* @return |
|
46 |
*/ |
|
47 |
public BioCaseQuery getQuery() { |
|
48 |
BioCaseQuery query = new BioCaseQuery(); |
|
49 |
query.accessionNumber = specimenSearchController.getAccessionNumber(); |
|
50 |
query.collector = specimenSearchController.getCollector(); |
|
51 |
query.collectorsNumber = specimenSearchController.getCollectorNumber(); |
|
52 |
query.country = specimenSearchController.getCountry(); |
|
53 |
// query.date = specimenSearchController.getDate(); |
|
54 |
query.herbarium = specimenSearchController.getHerbarium(); |
|
55 |
query.locality = specimenSearchController.getLocality(); |
|
56 |
query.taxonName = specimenSearchController.getTaxonName(); |
|
57 |
return query; |
|
37 | 58 |
} |
38 | 59 |
|
39 | 60 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchController.java | ||
---|---|---|
32 | 32 |
return specimenSearchComposite; |
33 | 33 |
} |
34 | 34 |
|
35 |
private void runQuery(){ |
|
35 |
/** |
|
36 |
* @return |
|
37 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextTaxonName() |
|
38 |
*/ |
|
39 |
public String getTaxonName() { |
|
40 |
return specimenSearchComposite.getTextTaxonName().getText(); |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* @return |
|
45 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollector() |
|
46 |
*/ |
|
47 |
public String getCollector() { |
|
48 |
return specimenSearchComposite.getTextCollector().getText(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* @return |
|
53 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextCollectorNumber() |
|
54 |
*/ |
|
55 |
public String getCollectorNumber() { |
|
56 |
return specimenSearchComposite.getTextCollectorNumber().getText(); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* @return |
|
61 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextAccessionNumber() |
|
62 |
*/ |
|
63 |
public String getAccessionNumber() { |
|
64 |
return specimenSearchComposite.getTextAccessionNumber().getText(); |
|
65 |
} |
|
36 | 66 |
|
67 |
/** |
|
68 |
* @return |
|
69 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboHerbarium() |
|
70 |
*/ |
|
71 |
public String getHerbarium() { |
|
72 |
return null; |
|
73 |
// return specimenSearchComposite.getComboHerbarium().getItem(specimenSearchComposite.getComboHerbarium().getSelectionIndex()); |
|
37 | 74 |
} |
75 |
|
|
76 |
/** |
|
77 |
* @return |
|
78 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getComboCountry() |
|
79 |
*/ |
|
80 |
public String getCountry() { |
|
81 |
return null; |
|
82 |
// return specimenSearchComposite.getComboCountry().getItem(specimenSearchComposite.getComboCountry().getSelectionIndex()); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* @return |
|
87 |
* @see eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchComposite#getTextLocality() |
|
88 |
*/ |
|
89 |
public String getLocality() { |
|
90 |
return specimenSearchComposite.getTextLocality().getText(); |
|
91 |
} |
|
92 |
|
|
38 | 93 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchResultsComposite.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.ui.campanula.specimenSearch; |
|
11 |
|
|
12 |
import org.eclipse.swt.SWT; |
|
13 |
import org.eclipse.swt.widgets.Composite; |
|
14 |
import org.eclipse.swt.widgets.Display; |
|
15 |
import org.eclipse.swt.widgets.Text; |
|
16 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
17 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
18 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
19 |
|
|
20 |
/** |
|
21 |
* @author pplitzner |
|
22 |
* @date 12.09.2013 |
|
23 |
* |
|
24 |
*/ |
|
25 |
public class SpecimenSearchResultsComposite extends Composite { |
|
26 |
private final FormToolkit formToolkit = new FormToolkit(Display.getDefault()); |
|
27 |
private Text txtNewText; |
|
28 |
|
|
29 |
/** |
|
30 |
* Create the composite. |
|
31 |
* @param parent |
|
32 |
* @param style |
|
33 |
*/ |
|
34 |
public SpecimenSearchResultsComposite(Composite parent, int style) { |
|
35 |
super(parent, style); |
|
36 |
{ |
|
37 |
TableWrapLayout tableWrapLayout = new TableWrapLayout(); |
|
38 |
setLayout(tableWrapLayout); |
|
39 |
} |
|
40 |
|
|
41 |
txtNewText = formToolkit.createText(this, "New Text", SWT.NONE); |
|
42 |
txtNewText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1)); |
|
43 |
|
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
protected void checkSubclass() { |
|
48 |
// Disable the check that prevents subclassing of SWT components |
|
49 |
} |
|
50 |
public Text getTxtNewText() { |
|
51 |
return txtNewText; |
|
52 |
} |
|
53 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/specimenSearch/SpecimenSearchResultsController.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.ui.campanula.specimenSearch; |
|
11 |
|
|
12 |
import org.eclipse.swt.SWT; |
|
13 |
import org.eclipse.swt.widgets.Composite; |
|
14 |
|
|
15 |
/** |
|
16 |
* @author pplitzner |
|
17 |
* @date 12.09.2013 |
|
18 |
* |
|
19 |
*/ |
|
20 |
public class SpecimenSearchResultsController { |
|
21 |
|
|
22 |
private SpecimenSearchResultsComposite specimenSearchResultsComposite; |
|
23 |
|
|
24 |
public SpecimenSearchResultsController(Composite parent) { |
|
25 |
this.specimenSearchResultsComposite = new SpecimenSearchResultsComposite(parent, SWT.NONE); |
|
26 |
} |
|
27 |
|
|
28 |
public Composite getComposite(){ |
|
29 |
return specimenSearchResultsComposite; |
|
30 |
} |
|
31 |
|
|
32 |
public void setText(String text){ |
|
33 |
specimenSearchResultsComposite.getTxtNewText().setText(text); |
|
34 |
} |
|
35 |
} |
Also available in: Unified diff