use of org.talend.core.language.ECodeLanguage in project tdi-studio-se by Talend.
the class ImplicitContextLoadHelper method reloadValuesFromPreferencePage.
/**
* DOC hcw Comment method "reloadValuesFromPreferencePage".
*
* @param elem
* @param extraComposite
*/
public static void reloadValuesFromPreferencePage(Element element, ExtraComposite extraComposite) {
ECodeLanguage language = LanguageManager.getCurrentLanguage();
//$NON-NLS-1$
String languagePrefix = language.toString() + "_";
Map values = loadPreferenceValues();
List<? extends IElementParameter> elementParameters = element.getElementParameters();
for (IElementParameter elementParameter : elementParameters) {
String name = elementParameter.getName();
if (name.equals(getExtraParameterName(EParameterName.PROPERTY_TYPE))) {
loadPropertyTypeFromPreference(element, extraComposite, languagePrefix, elementParameter);
} else {
Object value = values.get(name);
if (value != null) {
elementParameter.setValue(value);
}
}
}
}
use of org.talend.core.language.ECodeLanguage in project tdi-studio-se by Talend.
the class ImplicitContextLoadHelper method loadPreferenceValues.
/**
* DOC hcw Comment method "loadPreferenceValues".
*
* @return
*/
@SuppressWarnings("unchecked")
private static Map loadPreferenceValues() {
Map values = new HashMap();
ECodeLanguage language = LanguageManager.getCurrentLanguage();
//$NON-NLS-1$
String languagePrefix = language.toString() + "_";
EParameterName[] params = { EParameterName.IMPLICIT_TCONTEXTLOAD, EParameterName.FROM_FILE_FLAG, EParameterName.FROM_DATABASE_FLAG, EParameterName.PRINT_OPERATIONS, EParameterName.DISABLE_WARNINGS, EParameterName.DISABLE_ERROR, EParameterName.DISABLE_INFO };
putValuesToMap(values, languagePrefix, params, Boolean.class);
params = new EParameterName[] { EParameterName.IMPLICIT_TCONTEXTLOAD_FILE, EParameterName.FIELDSEPARATOR, EParameterName.DB_TYPE, EParameterName.LOAD_NEW_VARIABLE, EParameterName.NOT_LOAD_OLD_VARIABLE };
putValuesToMap(values, languagePrefix, params, String.class);
String propertyType = (String) getPreferenceValue(languagePrefix, EParameterName.PROPERTY_TYPE, String.class);
if (!propertyType.equals(EmfComponent.BUILTIN)) {
params = new EParameterName[] { EParameterName.HOST, EParameterName.PORT, EParameterName.DBNAME, EParameterName.SCHEMA_DB, EParameterName.USER, EParameterName.PASS, EParameterName.DBFILE, EParameterName.DBTABLE, EParameterName.QUERY_CONDITION };
putValuesToMap(values, languagePrefix, params, String.class);
}
return values;
}
use of org.talend.core.language.ECodeLanguage in project tmdm-studio-se by Talend.
the class DeployOnMDMExportWizardPage method packageProcess.
private boolean packageProcess(ExportFileResource p, IProgressMonitor monitor) {
String label = getProcessName(p);
monitor.setTaskName(Messages.bind(Messages.DeployOnMDMExportWizardPage_Pacakging, label));
ECodeLanguage curLanguage = LanguageManager.getCurrentLanguage();
if (curLanguage == ECodeLanguage.JAVA) {
reBuildJobZipFile(p);
}
setDesValueForJob(p);
processForEachJob(p);
monitor.worked(W_PACKAGE_PROCESS);
return true;
}
use of org.talend.core.language.ECodeLanguage in project tesb-studio-se by Talend.
the class AbstractBeanAction method openBeanEditor.
public IEditorPart openBeanEditor(BeanItem beanItem, boolean readOnly) throws SystemException, PartInitException {
if (beanItem == null) {
return null;
}
ICodeGeneratorService service = (ICodeGeneratorService) GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
ECodeLanguage lang = ((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage();
ITalendSynchronizer routineSynchronizer = service.createRoutineSynchronizer();
// check if the related editor is open.
IWorkbenchPage page = getActivePage();
IEditorReference[] editorParts = page.getEditorReferences();
// $NON-NLS-1$ //$NON-NLS-2$
String talendEditorID = "org.talend.designer.core.ui.editor.StandAloneTalend" + lang.getCaseName() + "Editor";
boolean found = false;
IEditorPart talendEditor = null;
for (IEditorReference reference : editorParts) {
IEditorPart editor = reference.getEditor(false);
if (talendEditorID.equals(editor.getSite().getId())) {
// TextEditor talendEditor = (TextEditor) editor;
RepositoryEditorInput editorInput = (RepositoryEditorInput) editor.getEditorInput();
if (editorInput.getItem().equals(beanItem)) {
page.bringToTop(editor);
found = true;
talendEditor = editor;
break;
}
}
}
if (!found) {
routineSynchronizer.syncRoutine(beanItem, true);
IFile file = routineSynchronizer.getFile(beanItem);
if (file == null) {
return null;
}
RepositoryEditorInput input = new BeanEditorInput(file, beanItem);
input.setReadOnly(readOnly);
// $NON-NLS-1$
talendEditor = page.openEditor(input, talendEditorID);
}
return talendEditor;
}
Aggregations