page.name.39 = Nomenklatur-Code
page.name.100 = Verbreitungs-Daten
page.name.101 = Term Editor
+page.name.201 = Term Tree Editor
page.name.102 = Name Details View
page.name.103 = Namensmerkmale
view.name = Datenquelle
id="eu.etaxonomy.taxeditor.preferences.termEditor"
name="%page.name.101">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.preference.UIPreferences"
+ class="eu.etaxonomy.taxeditor.preference.TermTreePreference"
+ id="eu.etaxonomy.taxeditor.preferences.termTreeEditor"
+ name="%page.name.201">
+ </page>
<page
category="eu.etaxonomy.taxeditor.preference.UIPreferences"
class="eu.etaxonomy.taxeditor.preference.SupplementalDataPreferences"
//composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
GridLayout gridLayout = new GridLayout();
composite.setLayout(gridLayout);
-// if (isPreferencePage){
-// ListComponent list = new ListComponent(composite, composite.getStyle());
-// }
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK);
checkBoxMediaSpecimen.setSelection(configurator.isAddMediaAsMediaSpecimen());
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wb.swt.ResourceManager;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.AbstractPreferenceWizard;
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
/**
*
private static final String BARCODE = "Barcode";
private static final String CATALOGUE_NUMBER = "Catalogue number";
+ private Text textClassification;
+ private Button btnBrowseClassification;
+ private Button btnClear;
private Abcd206ImportConfigurator abcdImportConfigurator;
/** {@inheritDoc} */
@Override
public void createControl(Composite parent) {
- final Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns=2;
- //gridLayout.makeColumnsEqualWidth=true;
- composite.setLayout(gridLayout);
-
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns=2;
+ //gridLayout.makeColumnsEqualWidth=true;
+ composite.setLayout(gridLayout);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace=true;
+ gridData.horizontalSpan = 2;
+ Composite classificationComp = new Composite(composite, SWT.NULL);
+ classificationComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
+ classificationComp.setLayout(new GridLayout(4, false));
+
+ Label labelClassification = new Label(classificationComp, SWT.TOP);
+ labelClassification.setText("Classification");
+// labelClassification.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+ textClassification = new Text(classificationComp, SWT.BORDER);
+ textClassification.setEnabled(false);
+ textClassification.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
+ if (abcdImportConfigurator.getClassificationUuid() != null){
+ if (abcdImportConfigurator.getClassificationName() != null){
+ textClassification.setText(abcdImportConfigurator.getClassificationName());
+ }else{
+ Classification classification = CdmStore.getService(IClassificationService.class).load(abcdImportConfigurator.getClassificationUuid());
+ textClassification.setText(classification.getTitleCache());
+ }
+ }
+ btnBrowseClassification = new Button(classificationComp, SWT.NONE);
+ btnBrowseClassification.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif"));
+ btnBrowseClassification.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Classification classification = SelectionDialogFactory.getSelectionFromDialog(Classification.class,parent.getShell(), null, null);
+ if(classification!=null){
+ textClassification.setText(classification.getTitleCache());
+ abcdImportConfigurator.setClassificationUuid(classification.getUuid());
+ abcdImportConfigurator.setClassificationName(classification.getTitleCache());
+ }
+ }
+ });
+ btnClear = new Button(classificationComp, SWT.NONE);
+ btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
+ btnClear.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ abcdImportConfigurator.setClassificationUuid(null);
+ textClassification.setText("");
+ }
+ });
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace=true;
- gridData.horizontalSpan = 2;
+// Composite composite = new Composite(parent, SWT.NULL);
+// GridLayout gridLayout = new GridLayout();
+// gridLayout.numColumns=2;
+// //gridLayout.makeColumnsEqualWidth=true;
+// composite.setLayout(gridLayout);
+// GridData gridData = new GridData();
+// gridData.horizontalAlignment = GridData.FILL;
+// gridData.grabExcessHorizontalSpace=true;
+// gridData.horizontalSpan = 2;
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK);
//TODO: check prior or message
abcdImportConfigurator.setDnaSoure(null);
}
+
+
PreferencesUtil.setStringValue(IPreferenceKeys.LAST_USED_ABCD_CONFIG, abcdImportConfigurator.toString());
config.setRemoveCountryFromLocalityText(Boolean.valueOf(valueString));
}else if (keyString.equals("getSiblings")){
config.setGetSiblings(Boolean.valueOf(valueString));
+ }else if (keyString.equals("classificationUUID")){
+ config.setClassificationUuid(UUID.fromString(valueString));
+ }else if (keyString.equals("classificationName")){
+ config.setClassificationName(valueString);
}else if (keyString.equals("dnaSource")){
try{
config.setDnaSoure(URI.create(valueString));
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.wb.swt.ResourceManager;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.ImportPreferencesWizard;
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
/**
private SaveImportedSpecimenActionE4 saveImportedSpecimenAction;
- private Text textClassification;
+// private Text textClassification;
- private Classification classification;
+// private Classification classification;
protected Text textReferenceString;
private Abcd206ImportConfigurator config;
- public Classification getClassification() {
- return classification;
- }
-
- public void setClassification(Classification classification) {
- this.classification = classification;
- }
+// public Classification getClassification() {
+// return classification;
+// }
+//
+// public void setClassification(Classification classification) {
+// this.classification = classification;
+// }
private Button btnBrowseClassification;
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
composite_1.setLayout(new GridLayout(3, false));
- Label label = new Label(composite_1, SWT.TOP);
- label.setText("Classification");
- label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
- textClassification = new Text(composite_1, SWT.BORDER);
- textClassification.setEnabled(false);
- GridData gd_textClassification = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
-// gd_textClassification.widthHint = 118;
- textClassification.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
- btnBrowseClassification = new Button(composite_1, SWT.NONE);
- btnBrowseClassification.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif"));
- btnBrowseClassification.addListener(SWT.Selection, this);
- btnClear = new Button(composite_1, SWT.NONE);
- btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
- btnClear.addListener(SWT.Selection, this);
+// Label label = new Label(composite_1, SWT.TOP);
+// label.setText("Classification");
+// label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+// textClassification = new Text(composite_1, SWT.BORDER);
+// textClassification.setEnabled(false);
+// GridData gd_textClassification = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+//// gd_textClassification.widthHint = 118;
+// textClassification.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
+// btnBrowseClassification = new Button(composite_1, SWT.NONE);
+// btnBrowseClassification.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif"));
+// btnBrowseClassification.addListener(SWT.Selection, this);
+// btnClear = new Button(composite_1, SWT.NONE);
+// btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
+// btnClear.addListener(SWT.Selection, this);
//source reference
Label labelRef = new Label(composite_1, SWT.NONE);
importButton.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
- saveImportedSpecimenAction.run();
+ IWizard wizard = new ImportPreferencesWizard();
+ WizardDialog dialog = new WizardDialog(e.display.getActiveShell(), wizard);
+ int status = dialog.open();
+ if (status == 0){
+ saveImportedSpecimenAction.run();
+ }
}
});
// new Label(composite_2, SWT.NONE);
@Override
public void handleEvent(Event event) {
- if(event.widget==btnBrowseClassification){
- classification = SelectionDialogFactory.getSelectionFromDialog(Classification.class, event.widget.getDisplay().getActiveShell(), null, null);
- if(classification!=null){
- textClassification.setText(classification.getTitleCache());
- }
- }
- else if(event.widget==btnClear){
- classification = null;
- textClassification.setText("");
- }
-
- else {
+// if(event.widget==btnBrowseClassification){
+// classification = SelectionDialogFactory.getSelectionFromDialog(Classification.class, event.widget.getDisplay().getActiveShell(), null, null);
+// if(classification!=null){
+// textClassification.setText(classification.getTitleCache());
+// }
+// }
+// else if(event.widget==btnClear){
+// classification = null;
+// textClassification.setText("");
+// }
+
+// else {
if(event.widget == table){
TableItem[] item = table.getSelection();
if (item.length == 1){
Object o = item[0].getData();
}
}
- }
+// }
}
public String getReferenceString() {
bioCaseOccurrenceQuery = new OccurenceQuery(unitIdsBioCase);
configuratorAbcd.setOccurenceQuery(bioCaseOccurrenceQuery);
- if (dataImportView.getClassification() != null){
- configuratorAbcd.setClassificationUuid(dataImportView.getClassification().getUuid());
- }
+// if (dataImportView.getClassification() != null){
+// configuratorAbcd.setClassificationUuid(dataImportView.getClassification().getUuid());
+// }
if (dataImportView.getReferenceString() != null){
configuratorAbcd.setSourceReferenceTitle(dataImportView.getReferenceString());
}
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
private final Combo txtAccessPoint;
private final Button btnGbif;
private final Button btnBioCaseProvider;
- private final Label lblAccessPointUrl;
+// private final Label lblAccessPointUrl;
private String[] items;
tableWrapLayout.numColumns = 2;
setLayout(tableWrapLayout);
}
-
- btnGbif = new Button(this, SWT.RADIO);
- toolkit.adapt(btnGbif, true, true);
- btnGbif.setText("GBIF");
- new Label(this, SWT.NONE);
-
btnBioCaseProvider = new Button(this, SWT.RADIO);
toolkit.adapt(btnBioCaseProvider, true, true);
btnBioCaseProvider.setText("BioCASE Provider");
+ btnBioCaseProvider.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 2));
// txtAccessPoint = new Combo(this, SWT.BORDER);
//
-
+ Label lblAccessPointUrl = new Label(this, SWT.NONE);
+ lblAccessPointUrl.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
+ toolkit.adapt(lblAccessPointUrl, true, true);
+ lblAccessPointUrl.setText("Access Point URL");
txtAccessPoint = new Combo(this, SWT.BORDER);
+ txtAccessPoint.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ toolkit.adapt(txtAccessPoint, true, true);
+// new Label(this, SWT.NONE);
+ btnGbif = new Button(this, SWT.RADIO);
+ toolkit.adapt(btnGbif, true, true);
+ btnGbif.setText("GBIF");
+ btnGbif.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 2));
Set<String> itemList = new HashSet<>();
URL url;
String response = null;
items = new String[itemList.size()];
items = itemList.toArray(items);
- GridData dataProviderUri = new GridData();
- dataProviderUri.horizontalAlignment = GridData.FILL;
- dataProviderUri.horizontalSpan = 3;
- txtAccessPoint.setLayoutData(dataProviderUri);
+// GridData dataProviderUri = new GridData();
+// dataProviderUri.horizontalAlignment = GridData.FILL;
+// dataProviderUri.horizontalSpan = 3;
+// txtAccessPoint.setLayoutData(dataProviderUri);
// providerURI.setVisible(false);
ContentProposalAdapter adapter = new ContentProposalAdapter(txtAccessPoint, new ComboContentAdapter(), getProposalProvider(), null, null);
// String[] proposals = new String[providerURI.getItems().length];
- txtAccessPoint.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
- toolkit.adapt(txtAccessPoint, true, true);
- lblAccessPointUrl = new Label(this, SWT.NONE);
- lblAccessPointUrl.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
- toolkit.adapt(lblAccessPointUrl, true, true);
- lblAccessPointUrl.setText("Access Point URL");
+//
+
}
public Combo getTxtAccessPoint() {
return txtAccessPoint;
}
- public Label getLblAccessPointUrl() {
- return lblAccessPointUrl;
- }
+// public Label getLblAccessPointUrl() {
+// return lblAccessPointUrl;
+// }
/**
* @return
composite.getTxtAccessPoint().addListener(SWT.Modify, this);
composite.getBtnGbif().setSelection(true);
composite.getTxtAccessPoint().setEnabled(false);
- composite.getLblAccessPointUrl().setEnabled(false);
-
loadLastState();
}
}
composite.getBtnGbif().setSelection(false);
composite.getTxtAccessPoint().setEnabled(true);
- composite.getLblAccessPointUrl().setEnabled(true);
+
}
}
public void handleEvent(Event event) {
if(event.widget==composite.getBtnBioCaseProvider()){
composite.getTxtAccessPoint().setEnabled(true);
- composite.getLblAccessPointUrl().setEnabled(true);
}
else if(event.widget==composite.getBtnGbif()){
- composite.getLblAccessPointUrl().setEnabled(false);
composite.getTxtAccessPoint().setEnabled(false);
}
wizard.getContainer().updateButtons();