// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.taxeditor.ui.section.description;
-import org.apache.log4j.Logger;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.description.State;
import eu.etaxonomy.cdm.model.description.StateData;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.EntityDetailType;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.TermComboType;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
-import eu.etaxonomy.taxeditor.ui.term.AbstractTermComboElement;
/**
* <p>StateDataElement class.</p>
* @version 1.0
*/
public class StateDataElement extends AbstractEntityCollectionElement<StateData> {
-
- private static final Logger logger = Logger
- .getLogger(StateDataElement.class);
- private AbstractTermComboElement<State> combo_state;
+
+ private TermComboElement<State> combo_state;
private ModifierSection section_modifiers;
private TextWithLabelElement text_modifyingText;
/**
* <p>Constructor for StateDataElement.</p>
*
- * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
- * @param section a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection} object.
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param section a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
* @param entity a {@link eu.etaxonomy.cdm.model.description.StateData} object.
* @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
* @param style a int.
SelectionListener removeListener, int style) {
super(formFactory, section, entity, removeListener, null, style);
}
-
+
/** {@inheritDoc} */
@Override
public void setEntity(StateData entity) {
this.entity = entity;
combo_state.setSelection(entity.getState());
section_modifiers.setEntity(entity);
- if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null)
- text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+ if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
+ text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+ }
}
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
- combo_state = formFactory.createTermComboElement(TermComboType.STATE, element, "State", null, style);
- section_modifiers = (ModifierSection) formFactory.createEntityDetailSection(EntityDetailType.MODIFIER, getConversationHolder(), element, Section.TWISTIE);
- section_modifiers.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1));
+ combo_state = formFactory.createTermComboElement(State.class, element, "State", null, style);
+ section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
+ section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
}
getEntity().setState(combo_state.getSelection());
}
if(eventSource == text_modifyingText){
- getEntity().addModifyingText(LanguageString.NewInstance(text_modifyingText.getText(), CdmStore.getDefaultLanguage()));
+ getEntity().putModifyingText(LanguageString.NewInstance(text_modifyingText.getText(), CdmStore.getDefaultLanguage()));
}
}
}