Examples of ISourceLocator


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) {
                if (type instanceof JDIReferenceType) {
                    String[] sourcePaths = ((JDIReferenceType) type)
                            .getSourcePaths(null);
                    if (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

            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

              dbgpService, "hello", launch, null);
      IOConsole cs = new IOConsole("aa", null);
      ScriptStreamProxy proxy = new ScriptStreamProxy(cs);
      target.setStreamProxy(proxy);
      launch.addDebugTarget(target);
      final ISourceLocator sourceLocator = launch.getSourceLocator();
      final RutaSourceLookupDirector l = new RutaSourceLookupDirector();
      launch.setSourceLocator(new ISourceLocator() {

        public Object getSourceElement(IStackFrame stackFrame) {
          Object sourceElement = sourceLocator.getSourceElement(stackFrame);
          if (sourceElement != null)
            return sourceElement;
          return l.getSourceElement(stackFrame);
        }
View Full Code Here

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

      String type = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
      if (type == null) {
        type = config.getType().getSourceLocatorId();
      }
      ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
      ISourceLocator locator = launchManager.newSourceLocator(type);
      if (locator instanceof IPersistableSourceLocator2 == false) {
        return null;
      }
      ISourceLookupDirector director = (ISourceLookupDirector) locator;
      director.initializeFromMemento(memento, config);
View Full Code Here

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

    if (stack == null) {
      return;
    }

    ISourceLocator sourceLocator = launch.getSourceLocator();
    if (sourceLocator == null) {
      return;
    }

    Object element = sourceLocator.getSourceElement(stack);

    // Element is a file in workspace, record it:
    if (element != null && element instanceof IFile) {
      IFile file = (IFile) element;
      Set<IPath> filePaths = launchFiles.get(launch);
View Full Code Here

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

      public void run() {
        // This works in UI thread.
        IWorkbench workbench = PlatformUI.getWorkbench();
        final IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();

        ISourceLocator sourceLocator =
            connectedTargetData.getDebugTarget().getLaunch().getSourceLocator();
        if (sourceLocator instanceof ISourceLookupDirector == false) {
          return;
        }
        ISourceLookupDirector director = (ISourceLookupDirector) sourceLocator;
View Full Code Here

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

      String type = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
      if (type == null) {
        type = config.getType().getSourceLocatorId();
      }
      ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
      ISourceLocator locator = launchManager.newSourceLocator(type);
      if (locator instanceof IPersistableSourceLocator2 == false) {
        return null;
      }
      ISourceLookupDirector director = (ISourceLookupDirector) locator;
      director.initializeFromMemento(memento, config);
View Full Code Here

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

              null);
      IOConsole cs = new IOConsole("aa", null);
      ScriptStreamProxy proxy = new ScriptStreamProxy(cs);
      target.setStreamProxy(proxy);
      launch.addDebugTarget(target);
      final ISourceLocator sourceLocator = launch.getSourceLocator();
      final RutaSourceLookupDirector l = new RutaSourceLookupDirector();
      launch.setSourceLocator(new ISourceLocator() {

        public Object getSourceElement(IStackFrame stackFrame) {
          Object sourceElement = sourceLocator.getSourceElement(stackFrame);
          if (sourceElement != null)
            return sourceElement;
          return l.getSourceElement(stackFrame);
        }
View Full Code Here

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

   * @return file name if applicable; null otherwise
   */
  protected String getFileNameInFrame(DebuggerContext ctx,
      IJavaStackFrame stackFrame)
  {
    ISourceLocator srcLocator = ctx.getDebugTarget().getLaunch()
      .getSourceLocator();
    Object src = srcLocator.getSourceElement(stackFrame);
    String fileName = null;
    if (src instanceof CompilationUnit) {
      fileName = (((CompilationUnit) src).getResource()
          .getRawLocation().toOSString());
    }
View Full Code Here

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

    for (IProject p : projects) {
      if (p.exists() && p.hasNature(JavaCore.NATURE_ID)){
        javaProjects.add(JavaUtils.getJavaProject(p));
      }
    }
    ISourceLocator srcLocator = new JavaSourceLocator(
        javaProjects.toArray(new IJavaProject[javaProjects.size()]), true);

    ILaunch launch = new Launch(config, ILaunchManager.DEBUG_MODE, srcLocator);
    IProgressMonitor monitor = null;
    Map<String, String> args = new HashMap<String, String>();
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.