Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ISourceModule.codeSelect()


  public IMethod[] findMethods(final String methodName, int argCount, int sourcePosition) {
    final List methods = new ArrayList();
    ISourceModule module = this.method.getSourceModule();
    try {
      IModelElement[] elements = module.codeSelect(sourcePosition, methodName.length());
      for (int i = 0; i < elements.length; ++i) {
        if (elements[i] instanceof IMethod) {
          methods.add(elements[i]);
        }
      }
View Full Code Here


          IModelElement member = (IModelElement) match.getElement();
          ISourceModule module = (ISourceModule) member.getAncestor(IModelElement.SOURCE_MODULE);
          SimpleReference ref = new SimpleReference(match.getOffset(), match.getOffset()
                  + match.getLength(), "");
          try {
            IModelElement[] e = module.codeSelect(match.getOffset(), 1);
            for (int j = 0; j < e.length; ++j) {
              if (e[j].equals(parent)) {
                elements.put(ref, member);
              }
            }
View Full Code Here

  public IMethod[] findMethods(final String methodName, int argCount, int sourcePosition) {
    final List methods = new ArrayList();
    ISourceModule module = this.method.getSourceModule();
    try {
      IModelElement[] elements = module.codeSelect(sourcePosition, methodName.length());
      for (int i = 0; i < elements.length; ++i) {
        if (elements[i] instanceof IMethod) {
          methods.add(elements[i]);
        }
      }
View Full Code Here

          IModelElement member = (IModelElement) match.getElement();
          ISourceModule module = (ISourceModule) member.getAncestor(IModelElement.SOURCE_MODULE);
          SimpleReference ref = new SimpleReference(match.getOffset(), match.getOffset()
                  + match.getLength(), "");
          try {
            IModelElement[] e = module.codeSelect(match.getOffset(), 1);
            for (int j = 0; j < e.length; ++j) {
              if (e[j].equals(parent)) {
                elements.put(ref, member);
              }
            }
View Full Code Here

  }

  protected static IModelElement[] getSelection(String data) throws Exception {
    SourceRange range = createFile(data);
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(testFile);
    IModelElement[] elements = sourceModule.codeSelect(range.getOffset(),
        range.getLength());
    return elements;
  }
}
View Full Code Here

  }

  protected IModelElement[] getSelection(String data) throws Exception {
    SourceRange range = createFile(data);
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(testFile);
    IModelElement[] elements = sourceModule.codeSelect(range.getOffset(),
        range.getLength());
    return elements;
  }

  // protected static ISourceModule getSourceModule() {
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.