use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.
the class LanguageInfoComposite method onMidifyLabelText.
private void onMidifyLabelText() {
LanguageInfo correspondLangInfo = getLangInfoBySelectionOfLangCombo();
if (correspondLangInfo == null)
return;
if (correspondLangInfo.getLabel().equals(txtLabel.getText().trim()))
return;
if ("".equals(txtLabel.getText().trim())) {
// $NON-NLS-1$
MessageDialog.openWarning(getShell(), Messages.Warning, Messages.LanguageInfoComposite_InfoCannotbeEmpty);
txtLabel.setText(correspondLangInfo.getLabel());
}
correspondLangInfo.setLabel(txtLabel.getText().trim());
tvInfos.refresh();
if (section != null)
section.autoCommit();
}
use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.
the class LanguageInfoComposite method onAddLanguageInfo.
private void onAddLanguageInfo() {
if ("".equals(txtLabel.getText().trim())) {
// $NON-NLS-1$
MessageDialog.openWarning(getShell(), Messages.Warning, Messages.LanguageInfoComposite_InfoCannotbeEmpty);
return;
}
LanguageInfo correspondLangInfo = getLangInfoBySelectionOfLangCombo();
if (correspondLangInfo == null) {
LanguageInfo newLangInfo = new LanguageInfo(comboLanguage.getText(), Util.lang2iso.get(comboLanguage.getText()), txtLabel.getText().trim());
infos.add(newLangInfo);
} else {
correspondLangInfo.setLabel(txtLabel.getText().trim());
}
tvInfos.refresh();
if (section != null)
section.autoCommit();
}
use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.
the class FacetMsgCommitHandler method doSubmit.
@Override
protected boolean doSubmit() throws CommitException {
XSDAnnotationsStructure xsdAnnoStruct = getXSDAnnotationStruct();
LinkedHashMap<String, String> langCode2Value = new LinkedHashMap<String, String>();
for (Entry<String, LanguageInfo> eachLangCode2LangInfo : getCommitedObj().getLangCode2LangInfo().entrySet()) langCode2Value.put(eachLangCode2LangInfo.getKey(), eachLangCode2LangInfo.getValue().getLabel());
return xsdAnnoStruct.setFactMessage(langCode2Value);
}
use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.
the class LanguageInfoCommitHandler method getNeedAddedObjs.
@Override
protected LanguageInfo[] getNeedAddedObjs() {
List<LanguageInfo> results = new ArrayList<LanguageInfo>();
Map<String, String> originalLangCode2LangInfo = getOriginalLang2Info();
for (LanguageInfo eachCurLangInfo : getCommitedObj().getLanguageInfos()) {
if (originalLangCode2LangInfo.containsKey(eachCurLangInfo.getLanguageISOCode()))
continue;
results.add(eachCurLangInfo);
}
return results.toArray(new LanguageInfo[0]);
}
use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.
the class LanguageInfoSection method initUIContents.
@Override
protected void initUIContents(XSDComponent editedObj) {
super.initUIContents(editedObj);
langInfos.clear();
XSDAnnotationsStructure xsdAnnoStruct = new XSDAnnotationsStructure(curXSDComponent);
for (Entry<String, String> eachLang2Label : getLang2Info(xsdAnnoStruct).entrySet()) {
langInfos.add(new LanguageInfo(Util.iso2lang.get(eachLang2Label.getKey()), eachLang2Label.getKey(), eachLang2Label.getValue()));
}
}
Aggregations