-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
rightContainer.setLayout(LayoutConstants.LAYOUT(1, false));
// rightContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
RootElement rightRoot = new RootElement(formFactory, rightContainer);
-
+
createLeftControls(leftRoot);
createRightControls(rightRoot);
-
+
// initialize with default language
setSource(CdmStore.getDefaultLanguage());
private void createLeftControls(ICdmFormElement element){
combo_sourceLanguage = formFactory.createDefinedTermComboElement(TermType.Language, element, null, null, SWT.NULL);
-
+
combo_sourceLanguage.setTerms(getLanguages());
combo_sourceLanguage.addSelectionListener(new SelectionAdapter() {
});
LanguageString preferredLanguageString = MultilanguageTextHelper.getPreferredLanguageString(multilanguageText, getLanguages());
-
+ if (preferredLanguageString == null){
+ preferredLanguageString = LanguageString.NewInstance("", PreferencesUtil.getGlobalLanguage());
+ }
text_source = formFactory.createLanguageStringWithLabelElement(element, null, preferredLanguageString, TEXT_HEIGHT, false, SWT.NULL);
// text_source.setEnabled(false);
-
+
text_source.setText(preferredLanguageString.getText());
}
Language language = combo_targetLanguage.getSelection();
if (language == null){
+ setPageComplete(false);
return;
}