From 0ee651f8bc24821e1f225d7c0223857a04f6dd7d Mon Sep 17 00:00:00 2001 From: Patric Plitzner Date: Tue, 14 Jan 2014 16:01:08 +0000 Subject: [PATCH] fix for #3557 - reactivated details view for taxon relationships - added doubtful flag --- .../editor/view/concept/ConceptViewPart.java | 43 ++++++++++--------- .../taxon/TaxonRelationshipDetailElement.java | 27 +++++++----- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java index 4aa081d5c..ebebe817a 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java @@ -1,9 +1,9 @@ // $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. */ @@ -29,6 +29,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; 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; /** @@ -36,12 +37,12 @@ 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) */ @@ -51,17 +52,17 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart { 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(); @@ -94,39 +95,39 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart { @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) */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java index 7b04da49e..9cdcf2ce6 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2009 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. */ @@ -18,6 +18,7 @@ import eu.etaxonomy.taxeditor.store.StoreUtil; 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.element.ICdmFormElement; import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; @@ -30,9 +31,11 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement { private TermComboElement combo_taxonRelationshipType; - + private EntitySelectionElement selection_relatedTaxon; - + + private CheckboxElement checkBoxDoubtful; + public TaxonRelationshipDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) { super(formFactory, formElement); @@ -42,16 +45,17 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement