3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
13 import org
.eclipse
.swt
.SWT
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractCdmEntityWizardPage
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmPropertyChangeEvent
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.IExceptionHandler
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
25 * <p>ReferenceBaseWizardPage class.</p>
28 * @created Jun 1, 2010
31 public class ReferenceWizardPage
extends AbstractCdmEntityWizardPage
<Reference
> implements IExceptionHandler
{
34 * <p>Constructor for ReferenceBaseWizardPage.</p>
36 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
40 public ReferenceWizardPage(CdmFormFactory formFactory
, ConversationHolder conversation
, Reference entity
) {
41 super(formFactory
, conversation
, entity
);
42 setTitle("Reference");
47 * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
51 public AbstractCdmDetailElement
<Reference
> createElement(ICdmFormElement rootElement
){
52 //TODO: looking for referencing objects
53 ReferenceDetailElement referenceElement
= formFactory
.createReferenceDetailElement(rootElement
, SWT
.NULL
, true);
54 referenceElement
.addExceptionHandler(this);
55 referenceElement
.setEntity(entity
);
56 referenceElement
.setWarnForReferencingObjectsVisible(true);
57 return referenceElement
;
61 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#handleException(eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent)
65 public void handleException(CdmPropertyChangeEvent event
) {
66 setMessage(event
.getException().getMessage(), WARNING
);
70 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#clearException()
74 public void clearException() {