Search in sources :

Example 1 with ISyntaxCheckableEditor

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);
}
Also used : IComponentSettingsView(org.talend.core.views.IComponentSettingsView) ISyntaxCheckableEditor(org.talend.designer.core.ISyntaxCheckableEditor)

Example 2 with ISyntaxCheckableEditor

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();
    }
}
Also used : ISyntaxCheckableEditor(org.talend.designer.core.ISyntaxCheckableEditor) JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) ProcessItem(org.talend.core.model.properties.ProcessItem) IProcess2(org.talend.core.model.process.IProcess2) PartInitException(org.eclipse.ui.PartInitException) IJavaBreakpointListener(org.eclipse.jdt.debug.core.IJavaBreakpointListener) IEditorInput(org.eclipse.ui.IEditorInput) IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint)

Example 3 with ISyntaxCheckableEditor

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;
}
Also used : ISyntaxCheckableEditor(org.talend.designer.core.ISyntaxCheckableEditor) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) IEditorPart(org.eclipse.ui.IEditorPart)

Aggregations

ISyntaxCheckableEditor (org.talend.designer.core.ISyntaxCheckableEditor)3 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 IJavaBreakpointListener (org.eclipse.jdt.debug.core.IJavaBreakpointListener)1 IEditorInput (org.eclipse.ui.IEditorInput)1 IEditorPart (org.eclipse.ui.IEditorPart)1 PartInitException (org.eclipse.ui.PartInitException)1 IProcess2 (org.talend.core.model.process.IProcess2)1 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)1 ProcessItem (org.talend.core.model.properties.ProcessItem)1 IComponentSettingsView (org.talend.core.views.IComponentSettingsView)1 AbstractMultiPageTalendEditor (org.talend.designer.core.ui.AbstractMultiPageTalendEditor)1