Project

General

Profile

Download (2.05 KB) Statistics
| Branch: | Tag: | Revision:
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

    
10
package eu.etaxonomy.taxeditor.ui.section.agent;
11

    
12
import org.apache.commons.lang.StringUtils;
13
import org.eclipse.swt.SWT;
14

    
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.model.agent.AgentBase;
17
import eu.etaxonomy.cdm.model.agent.Person;
18
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
19
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
21
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
22

    
23
/**
24
 * <p>PersonWizardPage class.</p>
25
 *
26
 * @author n.hoffmann
27
 * @created Jun 1, 2010
28
 * @version 1.0
29
 */
30
public class PersonWizardPage extends AbstractCdmEntityWizardPage<Person> {
31

    
32
	/**
33
	 * <p>Constructor for PersonWizardPage.</p>
34
	 *
35
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
36
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37
	 * @param entity a {@link eu.etaxonomy.cdm.model.agent.Person} object.
38
	 */
39
	public PersonWizardPage(CdmFormFactory formFactory, ConversationHolder conversation,
40
			Person entity) {
41
		super(formFactory, conversation, entity);
42
		setTitle("Person");
43
	}
44

    
45

    
46
	/* (non-Javadoc)
47
	 * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
48
	 */
49
	/** {@inheritDoc} */
50
	@Override
51
	public AbstractCdmDetailElement<Person> createElement(ICdmFormElement rootElement) {
52
		PersonDetailElement personElement = formFactory.createPersonDetailElement(rootElement, SWT.NULL);
53
		personElement.setEntity(entity);
54
		return personElement;
55
	}
56

    
57
	@Override
58
    protected boolean titleCacheIsNotEmpty() {
59
        if (getEntity() instanceof AgentBase) {
60

    
61

    
62
            return !StringUtils.isEmpty(entity.getTitleCache());
63
        }
64
        return true;
65
    }
66
}
(6-6/12)