Search in sources :

Example 1 with IJavaBreakpointListener

use of org.eclipse.jdt.debug.core.IJavaBreakpointListener 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 2 with IJavaBreakpointListener

use of org.eclipse.jdt.debug.core.IJavaBreakpointListener in project tdi-studio-se by Talend.

the class AbstractMultiPageTalendEditor method dispose.

/**
     * The <code>MultiPageEditorPart</code> implementation of this <code>IWorkbenchPart</code> method disposes all
     * nested editors. Subclasses may extend.
     */
@Override
public void dispose() {
    getSite().setSelectionProvider(null);
    getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
    /* after the release of eclipse3.6,this parameter can't be null */
    // setInput(null);
    ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
    getSite().getWorkbenchWindow().getPartService().removePartListener(partListener);
    if (this.lockService != null) {
        this.lockService.unregister();
    }
    super.dispose();
    if (getProcess() != null && !getProcess().isReadOnly()) {
        if (isKeepPropertyLocked()) {
            return;
        }
        // Unlock the process :
        IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
        IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
        try {
            getProcess().getProperty().eAdapters().remove(dirtyListener);
            Property property = getProcess().getProperty();
            if (property.eResource() == null || property.getItem().eResource() == null) {
                property = repFactory.getUptodateProperty(property);
            }
            // fix for bug 12524 for db repository
            // property = repFactory.reload(property);
            JobletUtil jUtil = new JobletUtil();
            jUtil.makeSureUnlockJoblet(getProcess());
            Item item = getProcess().getProperty().getItem();
            boolean keep = jUtil.keepLockJoblet(item);
            if (keep) {
                repFactory.unlock(property.getItem());
            }
        } catch (PersistenceException e) {
            ExceptionHandler.process(e);
        } catch (LoginException e) {
            ExceptionHandler.process(e);
        }
    }
    if (processEditorInput != null) {
        processEditorInput.dispose();
        processEditorInput = null;
    }
    designerEditor = null;
    codeEditor = null;
    if (processor instanceof IJavaBreakpointListener) {
        JDIDebugModel.removeJavaBreakpointListener((IJavaBreakpointListener) processor);
    }
    processor = null;
    dirtyListener = null;
    NodeTransferDragSourceListener.getInstance().setEditPart(null);
}
Also used : JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) ProcessItem(org.talend.core.model.properties.ProcessItem) Item(org.talend.core.model.properties.Item) PersistenceException(org.talend.commons.exception.PersistenceException) LoginException(org.talend.commons.exception.LoginException) IJavaBreakpointListener(org.eclipse.jdt.debug.core.IJavaBreakpointListener) IDynamicProperty(org.talend.core.ui.properties.tab.IDynamicProperty) Property(org.talend.core.model.properties.Property) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory) IRepositoryService(org.talend.repository.model.IRepositoryService) JobletUtil(org.talend.designer.core.ui.editor.jobletcontainer.JobletUtil)

Aggregations

IJavaBreakpointListener (org.eclipse.jdt.debug.core.IJavaBreakpointListener)2 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)2 ProcessItem (org.talend.core.model.properties.ProcessItem)2 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 IEditorInput (org.eclipse.ui.IEditorInput)1 PartInitException (org.eclipse.ui.PartInitException)1 LoginException (org.talend.commons.exception.LoginException)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 IProcess2 (org.talend.core.model.process.IProcess2)1 Item (org.talend.core.model.properties.Item)1 Property (org.talend.core.model.properties.Property)1 IDynamicProperty (org.talend.core.ui.properties.tab.IDynamicProperty)1 ISyntaxCheckableEditor (org.talend.designer.core.ISyntaxCheckableEditor)1 JobletUtil (org.talend.designer.core.ui.editor.jobletcontainer.JobletUtil)1 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)1 IRepositoryService (org.talend.repository.model.IRepositoryService)1