1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.ui.section.reference;
|
10
|
|
11
|
import org.eclipse.swt.SWT;
|
12
|
import org.eclipse.swt.widgets.Composite;
|
13
|
|
14
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
15
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
16
|
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
|
17
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
18
|
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
|
19
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
20
|
import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
|
21
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
22
|
|
23
|
/**
|
24
|
* <p>ReferenceBaseWizardPage class.</p>
|
25
|
*
|
26
|
* @author n.hoffmann
|
27
|
* @created Jun 1, 2010
|
28
|
*/
|
29
|
public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference> implements IExceptionHandler{
|
30
|
|
31
|
/**
|
32
|
* <p>Constructor for ReferenceBaseWizardPage.</p>
|
33
|
*
|
34
|
* @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
35
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
36
|
* @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
|
37
|
*/
|
38
|
public ReferenceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
|
39
|
super(formFactory, conversation, entity);
|
40
|
setTitle("Reference");
|
41
|
}
|
42
|
|
43
|
@Override
|
44
|
public void createControl(Composite parent) {
|
45
|
super.createControl(parent);
|
46
|
}
|
47
|
|
48
|
@Override
|
49
|
public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
|
50
|
ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL);
|
51
|
referenceElement.addExceptionHandler(this);
|
52
|
referenceElement.setEntity(entity);
|
53
|
referenceElement.setWarnForReferencingObjectsVisible(true);
|
54
|
return referenceElement;
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
public void handleException(CdmPropertyChangeEvent event) {
|
59
|
setMessage(event.getException().getMessage(), WARNING);
|
60
|
}
|
61
|
|
62
|
@Override
|
63
|
public void clearException() {
|
64
|
setMessage(null);
|
65
|
}
|
66
|
}
|