use of org.talend.core.language.ICodeProblemsChecker in project tdi-studio-se by Talend.
the class ProblemsAnalyser method checkProblems.
public List<Problem> checkProblems(ExternalMapperData externalData) {
problems.clear();
if (externalData != null) {
checkLookupTablesKeyProblems(externalData);
ICodeProblemsChecker codeChecker = LanguageProvider.getCurrentLanguage().getCodeChecker();
if (mapperManager.isCheckSyntaxEnabled()) {
List<ExternalMapperTable> extInputTables = new ArrayList<ExternalMapperTable>(externalData.getInputTables());
List<ExternalMapperTable> extVarTables = new ArrayList<ExternalMapperTable>(externalData.getVarsTables());
List<ExternalMapperTable> extOutputTables = new ArrayList<ExternalMapperTable>(externalData.getOutputTables());
checkExpressionSyntaxProblems(extInputTables, codeChecker);
checkExpressionSyntaxProblems(extVarTables, codeChecker);
checkExpressionSyntaxProblems(extOutputTables, codeChecker);
List<? extends IConnection> incomingConnections = new ArrayList<IConnection>(this.mapperManager.getAbstractMapComponent().getIncomingConnections());
ExternalDataConverter converter = new ExternalDataConverter(mapperManager);
MapperMain mapperMain = ((MapperComponent) mapperManager.getAbstractMapComponent()).getMapperMain();
ArrayList<IOConnection> inputsIOConnections = mapperMain.createIOConnections(incomingConnections);
ArrayList<InputTable> inputTables = converter.prepareInputTables(inputsIOConnections, externalData);
checkKeysProblems(inputTables);
checkOutputTablesProblems(extOutputTables);
}
}
return getProblems();
}
use of org.talend.core.language.ICodeProblemsChecker in project tdi-studio-se by Talend.
the class MultipleThreadDynamicComposite method operationInThread.
// refactore to be synchonized with the dispose() method because of TDI-24184
// the synchronized methodis a quick fix but not the ideal one because this method is accessing many attributes
// of the current class that may be modified by other thread (just like "elem" modified by the dispose() method.
protected synchronized void operationInThread() {
if (elem == null) {
return;
}
// hywang modified for
List<? extends IElementParameter> listParam = elem.getElementParametersWithChildrens();
Boolean updateNeeded = (Boolean) elem.getPropertyValue(updataComponentParamName);
if (updateNeeded != null) {
if (updateNeeded) {
if (elem != null) {
addComponents(forceRedraw);
elem.setPropertyValue(updataComponentParamName, new Boolean(false));
forceRedraw = false;
}
}
}
final ECodeLanguage language = ((RepositoryContext) org.talend.core.CorePlugin.getContext().getProperty(org.talend.core.context.Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage();
IRunProcessService service = DesignerPlugin.getDefault().getRunProcessService();
final ICodeProblemsChecker syntaxChecker = service.getSyntaxChecker(language);
List<Problem> javaProblem = null;
for (int i = 0; i < listParam.size(); i++) {
if (listParam.get(i).getCategory() == section) {
if (listParam.get(i).isShow(listParam)) {
final IElementParameter e = listParam.get(i);
e.isReadOnly();
e.isNoCheck();
if (language == ECodeLanguage.JAVA && javaProblem == null) {
if (!e.isReadOnly() && !e.isNoCheck()) {
javaProblem = syntaxChecker.checkProblems(null);
}
}
final List<Problem> nodePros = javaProblem;
if (generator != null) {
AbstractElementPropertySectionController controller = generator.getController(e.getFieldType(), MultipleThreadDynamicComposite.this);
if (controller != null) {
controller.updateCodeProblems(nodePros);
controller.refresh(e, checkErrorsWhenViewRefreshed);
}
}
}
}
}
if (propertyResized) {
try {
removeListener(SWT.Resize, resizeListener);
getParent().layout();
composite.pack();
propertyResized = false;
addListener(SWT.Resize, resizeListener);
} catch (Exception e) {
}
}
checkErrorsWhenViewRefreshed = false;
// long time = TimeMeasure.timeSinceBegin("DC:refresh:" + getCurrentComponent()); //$NON-NLS-1$
// TimeMeasure.end("DC:refresh:" + getCurrentComponent()); //$NON-NLS-1$
// if (DynamicTabbedPropertySection.DEBUG_TIME) {
// System.out.println("DC;total;" + getCurrentComponent() + ";" + time); //$NON-NLS-1$ //$NON-NLS-2$
// }
}
Aggregations