org.eclipse.debug.core.model.ISuspendResume Java Examples

The following examples show how to use org.eclipse.debug.core.model.ISuspendResume. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScriptRunToLineAdapter.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public boolean canRunToLine( IWorkbenchPart part, ISelection selection,
		ISuspendResume target )
{
	if ( target instanceof ScriptDebugElement )
	{
		IDebugElement element = (IDebugElement) target;
		ScriptDebugTarget adapter = (ScriptDebugTarget) element.getDebugTarget( )
				.getAdapter( IDebugTarget.class );
		return adapter != null;
	}
	return false;
}
 
Example #2
Source File: ScriptRunToLineAdapter.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void runToLine( IWorkbenchPart part, ISelection selection,
		ISuspendResume target ) throws CoreException
{
	ITextEditor textEditor = getTextEditor( part );

	if ( textEditor == null )
	{
		return;
	}
	else
	{
		IEditorInput input = textEditor.getEditorInput( );

		if ( input == null || !( input instanceof DebugJsInput ) )
		{
			return;
		}

		DebugJsInput scriptInput = (DebugJsInput) input;
		IResource resource = (IResource) input.getAdapter( IResource.class );
		if ( resource == null )
		{
			resource = ScriptDebugUtil.getDefaultResource( );
		}

		final IDocument document = textEditor.getDocumentProvider( )
				.getDocument( input );
		if ( document == null )
		{
			return;
		}
		else
		{
			final int[] validLine = new int[1];
			// final String[] typeName = new String[1];
			final int[] lineNumber = new int[1];
			final ITextSelection textSelection = (ITextSelection) selection;
			Runnable r = new Runnable( ) {

				public void run( )
				{
					lineNumber[0] = textSelection.getStartLine( ) + 1;
				}
			};
			BusyIndicator.showWhile( DebugUI.getStandardDisplay( ), r );
			// TODO add the validLine to adjust if the line is validLine
			validLine[0] = lineNumber[0];
			if ( validLine[0] == lineNumber[0] )
			{
				ScriptLineBreakpoint point = new RunToLinebreakPoint( resource,
						scriptInput.getFile( ).getAbsolutePath( ),
						scriptInput.getId( ),
						lineNumber[0] );
				point.setType( ScriptLineBreakpoint.RUNTOLINE );
				if ( target instanceof IAdaptable )
				{
					ScriptDebugTarget debugTarget = (ScriptDebugTarget) ( (IAdaptable) target ).getAdapter( IDebugTarget.class );
					if ( debugTarget != null )
					{
						debugTarget.breakpointAdded( point );
						debugTarget.resume( );
					}
				}
			}
			else
			{
				// invalid line
				return;
			}
		}

	}
}
 
Example #3
Source File: PyRunToLineTarget.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
    return true;
}
 
Example #4
Source File: PySetNextTarget.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public boolean canSetNextToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
    return true;
}
 
Example #5
Source File: ISetNextTarget.java    From Pydev with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * 
 * @param part
 * @param selection
 * @param target
 * @throws CoreException
 */
public boolean setNextToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException;
 
Example #6
Source File: ISetNextTarget.java    From Pydev with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * 
 * @param part
 * @param selection
 * @param target
 * @return
 */
public boolean canSetNextToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target);