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();
}
}
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);
}
Aggregations