use of org.talend.designer.core.ISyntaxCheckableEditor in project tdi-studio-se by Talend.
the class AbstractMultiPageTalendEditor method turnToCodePage.
protected void turnToCodePage(int newPageIndex) {
// TDI-25866:In case select a component and switch to the code page,need clean its componentSetting view
IComponentSettingsView viewer = (IComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IComponentSettingsView.ID);
if (viewer != null) {
viewer.cleanDisplay();
}
if (codeEditor instanceof ISyntaxCheckableEditor) {
moveCursorToSelectedComponent();
/*
* Belowing method had been called at line 331 within the generateCode method, as soon as code generated.
*/
// ((ISyntaxCheckableEditor) codeEditor).validateSyntax();
}
codeSync();
// updateCodeEditorContent();
changeContextsViewStatus(true);
}
use of org.talend.designer.core.ISyntaxCheckableEditor in project tdi-studio-se by Talend.
the class AbstractMultiPageTalendEditor method createPage1.
/**
* Creates page 1 of the multi-page editor, which allows you to change the font used in page 2.
*/
protected void createPage1() {
IProcess2 process = getProcess();
codeEditor = CodeEditorFactory.getInstance().getCodeEditor(getCurrentLang(), process);
processor = ProcessorUtilities.getProcessor(process, process.getProperty(), process.getContextManager().getDefaultContext());
if (processor instanceof IJavaBreakpointListener) {
JDIDebugModel.addJavaBreakpointListener((IJavaBreakpointListener) processor);
}
processor.setProcessorStates(IProcessor.STATES_EDIT);
if (codeEditor instanceof ISyntaxCheckableEditor) {
processor.setSyntaxCheckableEditor((ISyntaxCheckableEditor) codeEditor);
}
if (useCodeView) {
try {
IEditorInput editorInput = createFileEditorInput();
if (!(process.getProperty().getItem() instanceof ProcessItem)) {
// shouldn't work for joblet
editorInput = new JobletCodeEditInput();
}
int index = addPage(codeEditor, editorInput);
// init Syntax Validation.
//$NON-NLS-1$
setPageText(index, "Code");
} catch (PartInitException pie) {
// pie.printStackTrace();
ExceptionHandler.process(pie);
}
}
if (DesignerPlugin.getDefault().getPreferenceStore().getBoolean(TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB)) {
generateCode();
}
}
use of org.talend.designer.core.ISyntaxCheckableEditor in project tdi-studio-se by Talend.
the class CodeEditorFactory method getCodeEditor.
public ISyntaxCheckableEditor getCodeEditor(IProcess2 process) {
ISyntaxCheckableEditor codeEditor = null;
IEditorPart part = process.getEditor();
if (part instanceof AbstractMultiPageTalendEditor) {
codeEditor = ((AbstractMultiPageTalendEditor) part).getCodeEditor();
}
return codeEditor;
}
Aggregations