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
.api
.service
.CommonServiceImpl
;
17 import eu
.etaxonomy
.cdm
.api
.service
.ReferenceServiceImpl
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
19 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractCdmEntityWizardPage
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmPropertyChangeEvent
;
23 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
24 import eu
.etaxonomy
.taxeditor
.ui
.element
.IExceptionHandler
;
25 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
28 * <p>ReferenceBaseWizardPage class.</p>
31 * @created Jun 1, 2010
34 public class ReferenceWizardPage
extends AbstractCdmEntityWizardPage
<Reference
> implements IExceptionHandler
{
37 * <p>Constructor for ReferenceBaseWizardPage.</p>
39 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
40 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
41 * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
43 public ReferenceWizardPage(CdmFormFactory formFactory
, ConversationHolder conversation
, Reference entity
) {
44 super(formFactory
, conversation
, entity
);
45 setTitle("Reference");
50 * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
54 public AbstractCdmDetailElement
<Reference
> createElement(ICdmFormElement rootElement
){
55 //TODO: looking for referencing objects
56 ReferenceDetailElement referenceElement
= formFactory
.createReferenceDetailElement(rootElement
, SWT
.NULL
);
57 referenceElement
.addExceptionHandler(this);
58 referenceElement
.setEntity(entity
);
59 referenceElement
.setWarnForReferencingObjectsVisible(true);
60 return referenceElement
;
64 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#handleException(eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent)
68 public void handleException(CdmPropertyChangeEvent event
) {
69 setMessage(event
.getException().getMessage(), WARNING
);
73 * @see eu.etaxonomy.taxeditor.forms.IExceptionHandler#clearException()
77 public void clearException() {