2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.widgets
.Composite
;
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
{
35 * <p>Constructor for ReferenceBaseWizardPage.</p>
37 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
38 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
39 * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
41 public ReferenceWizardPage(CdmFormFactory formFactory
, ConversationHolder conversation
, Reference entity
) {
42 super(formFactory
, conversation
, entity
);
43 setTitle("Reference");
47 public void createControl(Composite parent
) {
49 super.createControl(parent
);
55 * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
59 public AbstractCdmDetailElement
<Reference
> createElement(ICdmFormElement rootElement
){
60 ReferenceDetailElement referenceElement
= formFactory
.createReferenceDetailElement(rootElement
, SWT
.NULL
, true);
61 referenceElement
.addExceptionHandler(this);
62 referenceElement
.setEntity(entity
);
63 referenceElement
.setWarnForReferencingObjectsVisible(true);
64 return referenceElement
;
68 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#handleException(eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent)
72 public void handleException(CdmPropertyChangeEvent event
) {
73 setMessage(event
.getException().getMessage(), WARNING
);
77 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#clearException()
81 public void clearException() {