// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
/**
* @created Jan 24, 2011
* @version 1.0
*/
-public class ConceptViewPart extends AbstractCdmEditorViewPart {
+public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails{
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept";
-
+
private ListViewer viewer;
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
showEmptyPage();
return;
}
-
+
if(part instanceof BulkEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof AbstractGraphKeyEditor){
showEmptyPage();
return;
}
-
+
if(part instanceof MultiPageTaxonEditor){
if(! part.equals(this.part)){
IEditorInput input = ((IEditorPart) part).getEditorInput();
@Override
public void createViewer(Composite parent) {
viewer = new ListViewer(parent);
-
+
viewer.setContentProvider(new ConceptContentProvider());
viewer.setLabelProvider(new ConceptLabelProvider());
-
-
+
+
viewer.setSorter(new ConceptViewerSorter());
-
+
getSite().setSelectionProvider(viewer);
-
+
createMenu();
-
+
createToolbar();
}
-
+
private void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
+
getSite().registerContextMenu(menuManager, viewer);
-
+
Control control = viewer.getControl();
Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
+
+ control.setMenu(menu);
}
-
+
private void createToolbar() {
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
// toolBarManager.add();
// toolBarManager.add();
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.view.AbstractCdmEditorViewPart#changed(java.lang.Object)
*/
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
private NormalExplicitImportConfigurator configurator;
private ImportFromFileDataSourceWizardPage dataSourcePage;
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
*/
URI source = dataSourcePage.getUri();
configurator.setSource(source);
configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-
+
CdmStore.getImportManager().run(configurator);
-
+
return true;
}
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
/** {@inheritDoc} */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
super.init(workbench, selection);
configurator = CdmStore.getImportManager().NormalExplicitConfigurator();
}
@Override
public void addPages() {
super.addPages();
-
- dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit",
- "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls"});
+
+ dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit",
+ "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls" ,"*.xlsx", "*.*"});
addPage(dataSourcePage);
}
}
} else {
if (SpecimenOrObservationType.Media.equals(specOrObsType)
|| ((specOrObsType.getKindOf() != null) && specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
- return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+ return MediaSpecimen.NewInstance(specOrObsType);
} else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
return FieldUnit.NewInstance();
} else {
* @return a boolean.
*/
public static boolean shouldConnectAtStartUp() {
- return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+ //FIXME : force SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
+ //return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+ return false;
}
/**
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
private EntitySelectionElement<Taxon> selection_relatedTaxon;
+ private CheckboxElement checkBoxDoubtful;
+
public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
Taxon.class, getConversationHolder(),
formElement, "Related Taxon", getRelatedTaxon(),
EntitySelectionElement.SELECTABLE, style);
+ checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation is doubtful", entity.isDoubtful(), style);
}
private Taxon getRelatedTaxon() {
getEntity().setToTaxon(relatedTaxon);
}
}
+ else if(eventSource==checkBoxDoubtful){
+ getEntity().setDoubtful(checkBoxDoubtful.getSelection());
+ }
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
}