combo_state.setTerms(stateTerms);
combo_state.setSelection(entity.getState());
section_modifiers.setEntity(entity);
+ section_modifiers.setExpanded(!entity.getModifiers().isEmpty());
if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
}
+ if(getEntity().getId()>0){
+ combo_state.removeEmptyElement();
+ }
}
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style);
- section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
+ section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
}
public void handleEvent(Object eventSource) {
if(eventSource == combo_state){
getEntity().setState(combo_state.getSelection());
+ combo_state.removeEmptyElement();
}
if(eventSource == text_modifyingText){
getEntity().putModifyingText(LanguageString.NewInstance(text_modifyingText.getText(), CdmStore.getDefaultLanguage()));