Search in sources :

Example 1 with LanguageInfo

use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.

the class AnnotationLangInfoDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    container.setLayout(new FillLayout());
    compLangInfo = new LanguageInfoComposite(container, SWT.NONE, null);
    compLangInfo.setLanguageInfos(langInfos.toArray(new LanguageInfo[0]));
    return container;
}
Also used : LanguageInfo(com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo) Composite(org.eclipse.swt.widgets.Composite) LanguageInfoComposite(com.amalto.workbench.detailtabs.sections.composites.LanguageInfoComposite) FillLayout(org.eclipse.swt.layout.FillLayout) LanguageInfoComposite(com.amalto.workbench.detailtabs.sections.composites.LanguageInfoComposite)

Example 2 with LanguageInfo

use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.

the class LanguageInfoModifier method modify.

public void modify(Object element, String property, Object value) {
    LanguageInfo modifiedLangInfo = getLanguageInfoFromSelection(element);
    if (!isLanguageInfo(modifiedLangInfo))
        return;
    if (isColumnLanguage(property) && isComboCellEditorValue(value)) {
        onModfiyColumnLanguage(modifiedLangInfo, (Integer) value);
    }
    if (isColumnLabel(property) && isTextCellEditorValue(value)) {
        onModfiyColumnLable(modifiedLangInfo, (String) value);
    }
    viewer.refresh();
    if (section != null)
        section.autoCommit();
}
Also used : LanguageInfo(com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo)

Example 3 with LanguageInfo

use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.

the class DisplayFormatCommitHandler 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.setDisplayFormat(langCode2Value);
}
Also used : LanguageInfo(com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo) XSDAnnotationsStructure(com.amalto.workbench.utils.XSDAnnotationsStructure) LinkedHashMap(java.util.LinkedHashMap)

Example 4 with LanguageInfo

use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.

the class LanguageInfoComposite method onSelectLanguageInfoFrTree.

private void onSelectLanguageInfoFrTree() {
    if (!isLanguageInfoSelected())
        return;
    LanguageInfo selectedLangInfo = getSelectedLanguageInfo();
    comboLanguage.select(allLanguages.indexOf(selectedLangInfo.getLanguage()));
    txtLabel.setText(selectedLangInfo.getLabel());
}
Also used : LanguageInfo(com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo)

Example 5 with LanguageInfo

use of com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo in project tmdm-studio-se by Talend.

the class LanguageInfoComposite method initLanguageInfos.

private void initLanguageInfos(LanguageInfo[] initLanguageInfos) {
    infos.clear();
    for (LanguageInfo eachLanguageInfo : initLanguageInfos) {
        infos.add(eachLanguageInfo);
    }
    tvInfos.setInput(infos);
}
Also used : LanguageInfo(com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo)

Aggregations

LanguageInfo (com.amalto.workbench.detailtabs.sections.model.annotationinfo.langinfo.LanguageInfo)11 XSDAnnotationsStructure (com.amalto.workbench.utils.XSDAnnotationsStructure)3 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 LanguageInfoComposite (com.amalto.workbench.detailtabs.sections.composites.LanguageInfoComposite)1 Matcher (java.util.regex.Matcher)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1