Project

General

Profile

« Previous | Next » 

Revision b0ce5b17

Added by Patrick Plitzner over 10 years ago

merged trunk into branch

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
11 11
package eu.etaxonomy.taxeditor.ui.section.description;
12 12

  
13 13
import org.eclipse.swt.events.SelectionListener;
14
import org.eclipse.ui.forms.widgets.Section;
14
import org.eclipse.ui.forms.widgets.ExpandableComposite;
15 15

  
16 16
import eu.etaxonomy.cdm.model.common.LanguageString;
17 17
import eu.etaxonomy.cdm.model.description.State;
......
23 23
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
24 24
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
25 25
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
26
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
27 26
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
28 27

  
29 28
/**
......
34 33
 * @version 1.0
35 34
 */
36 35
public class StateDataElement extends AbstractEntityCollectionElement<StateData> {
37
	
36

  
38 37
	private TermComboElement<State> combo_state;
39 38
	private ModifierSection section_modifiers;
40 39
	private TextWithLabelElement text_modifyingText;
......
53 52
			SelectionListener removeListener, int style) {
54 53
		super(formFactory, section, entity, removeListener, null, style);
55 54
	}
56
	
55

  
57 56
	/** {@inheritDoc} */
58 57
	@Override
59 58
	public void setEntity(StateData entity) {
60 59
		this.entity = entity;
61 60
		combo_state.setSelection(entity.getState());
62 61
		section_modifiers.setEntity(entity);
63
		if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null)
64
			text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
62
		if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
63
            text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
64
        }
65 65
	}
66 66

  
67 67
	/** {@inheritDoc} */
68 68
	@Override
69 69
	public void createControls(ICdmFormElement element, int style) {
70 70
		combo_state = formFactory.createTermComboElement(State.class, element, "State", null, style);
71
		section_modifiers = (ModifierSection) formFactory.createEntityDetailSection(EntityDetailType.MODIFIER, getConversationHolder(), element, Section.TWISTIE);
71
		section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
72 72
		section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
73 73
		text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
74 74
	}

Also available in: Unified diff