Search in sources :

Example 1 with IDebugEditor

use of com.liferay.ide.portal.ui.debug.IDebugEditor in project liferay-ide by liferay.

the class FMBreakpointProvider method addBreakpoint.

public IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException {
    IStatus retval = Status.OK_STATUS;
    if (fSourceEditingTextTools instanceof IDebugEditor) {
        IDebugEditor debugEditor = (IDebugEditor) fSourceEditingTextTools;
        IStatus status = debugEditor.validateBreakpointPosition(lineNumber, offset);
        if (status.isOK()) {
            if (input instanceof IFileEditorInput) {
                final IFileEditorInput fileEditorInput = (IFileEditorInput) input;
                final IFile file = fileEditorInput.getFile();
                final FMLineBreakpoint bp = new FMLineBreakpoint(file, lineNumber);
                DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(bp);
            }
        } else {
            retval = status;
        }
    }
    return retval;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) IFile(org.eclipse.core.resources.IFile) IFileEditorInput(org.eclipse.ui.IFileEditorInput) IDebugEditor(com.liferay.ide.portal.ui.debug.IDebugEditor) FMLineBreakpoint(com.liferay.ide.portal.core.debug.fm.FMLineBreakpoint)

Aggregations

FMLineBreakpoint (com.liferay.ide.portal.core.debug.fm.FMLineBreakpoint)1 IDebugEditor (com.liferay.ide.portal.ui.debug.IDebugEditor)1 IFile (org.eclipse.core.resources.IFile)1 IStatus (org.eclipse.core.runtime.IStatus)1 IFileEditorInput (org.eclipse.ui.IFileEditorInput)1