Examples of ISourceLocator


Examples of org.eclipse.debug.core.model.ISourceLocator

        .getLaunchManager();
    ILaunch[] launches = launchManager.getLaunches();
    for (ILaunch launch : launches) {
      if (launch.isTerminated())
        continue;
      ISourceLocator locator = launch.getSourceLocator();
      if (locator instanceof ISourceLookupDirector) {
        ISourceLookupDirector director = (ISourceLookupDirector) locator;
        ISourceContainer[] containers = director.getSourceContainers();
        if (isAnyProjectInSourceContainers(containers, projects))
          return launch.getLaunchConfiguration();
View Full Code Here

Examples of org.eclipse.debug.core.model.ISourceLocator

            if (stackFrame == null) {
                return null;
            }

            // find the project the snippets will be compiled in.
            ISourceLocator locator= javaValue.getLaunch().getSourceLocator();
            Object sourceElement= null;
            if (locator instanceof ISourceLookupDirector) {
                String[] sourcePaths = ((IJavaClassType) type).getSourcePaths(null);
                if (sourcePaths != null && sourcePaths.length > 0) {
                    sourceElement = ((ISourceLookupDirector) locator).getSourceElement(sourcePaths[0]);
                }
                if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
                    sourceElement = ((IAdaptable) sourceElement).getAdapter(IJavaElement.class);
                }
            }
            if (sourceElement == null) {
                sourceElement = locator.getSourceElement(stackFrame);
                if (!(sourceElement instanceof IJavaElement) && sourceElement instanceof IAdaptable) {
                    Object newSourceElement = ((IAdaptable) sourceElement).getAdapter(IJavaElement.class);
                    // if the source is a drl during the execution of the rule
                    if (newSourceElement != null) {
                        sourceElement = newSourceElement;
View Full Code Here

Examples of org.eclipse.debug.core.model.ISourceLocator

  private IJavaProject computeJavaProject(IJavaStackFrame stackFrame) {
    ILaunch launch = stackFrame.getLaunch();
    if (launch == null) {
      return null;
    }
    ISourceLocator locator = launch.getSourceLocator();
    if (locator == null)
      return null;

    Object sourceElement = null;
    try {
      if (locator instanceof ISourceLookupDirector
          && !stackFrame.isStatic()) {
        IJavaType thisType = stackFrame.getThis().getJavaType();
        if (thisType instanceof IJavaReferenceType) {
          String[] sourcePaths = ((IJavaReferenceType) thisType)
              .getSourcePaths(null);
          if (sourcePaths != null && sourcePaths.length > 0) {
            sourceElement = ((ISourceLookupDirector) locator)
                .getSourceElement(sourcePaths[0]);
          }
        }
      }
    } catch (DebugException e) {
      DebugPlugin.log(e);
    }
    if (sourceElement == null) {
      sourceElement = locator.getSourceElement(stackFrame);
    }
    if (!(sourceElement instanceof IJavaElement)
        && sourceElement instanceof IAdaptable) {
      Object element = ((IAdaptable) sourceElement)
          .getAdapter(IJavaElement.class);
View Full Code Here

Examples of org.eclipse.debug.core.model.ISourceLocator

   * @return corresponding source element or <code>null</code>
   * @throws CoreException if an exception occurs
   */
  public static Object resolveSourceElement(Object object, ILaunch launch)
      throws CoreException {
    ISourceLocator sourceLocator = launch.getSourceLocator();
    if (sourceLocator instanceof ISourceLookupDirector) {
      ISourceLookupDirector director = (ISourceLookupDirector) sourceLocator;
      Object[] objects = director.findSourceElements(object);
      if (objects.length > 0) {
        return objects[0];
View Full Code Here

Examples of org.eclipse.debug.core.model.ISourceLocator

      if (stackFrame == null) {
        return value;
      }

      // find the project the snippets will be compiled in.
      ISourceLocator locator = javaValue.getLaunch().getSourceLocator();
      Object sourceElement = null;
      if (locator instanceof ISourceLookupDirector) {
        String[] sourcePaths = type.getSourcePaths(null);
        if (sourcePaths != null && sourcePaths.length > 0) {
          sourceElement = ((ISourceLookupDirector) locator)
              .getSourceElement(sourcePaths[0]);
        }
        if (!(sourceElement instanceof IJavaElement)
            && sourceElement instanceof IAdaptable) {
          sourceElement = ((IAdaptable) sourceElement)
              .getAdapter(IJavaElement.class);
        }
      }
      if (sourceElement == null) {
        sourceElement = locator.getSourceElement(stackFrame);
        if (!(sourceElement instanceof IJavaElement)
            && sourceElement instanceof IAdaptable) {
          sourceElement = ((IAdaptable) sourceElement)
              .getAdapter(IJavaElement.class);
        }
View Full Code Here

Examples of org.eclipse.debug.core.model.ISourceLocator

  protected ICompilationUnit getCompilationUnit(IJavaStackFrame frame) {
    ILaunch launch = frame.getLaunch();
    if (launch == null) {
      return null;
    }
    ISourceLocator locator = launch.getSourceLocator();
    if (locator == null) {
      return null;
    }
    IJavaDebugTarget target = (IJavaDebugTarget) frame.getDebugTarget();
    String def = target.getDefaultStratum();
    target.setDefaultStratum("Java"); //$NON-NLS-1$
    Object sourceElement = locator.getSourceElement(frame);
    target.setDefaultStratum(def);
    if (!(sourceElement instanceof IJavaElement)
        && sourceElement instanceof IAdaptable) {
      sourceElement = ((IAdaptable) sourceElement)
          .getAdapter(IJavaElement.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.