Examples of codeSelect()


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

      return null;
    IModelElement[] elements = null;
    ICodeAssist resolve = getCodeAssist();
    if (resolve != null) {
      try {
        elements = resolve.codeSelect(hoverRegion.getOffset(),
            hoverRegion.getLength());

        if ((elements == null || elements.length == 0)
            && resolve instanceof ISourceModule) {
          elements = PHPModelUtils.getTypeInString(
View Full Code Here

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

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

          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

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

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

          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

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

  }

  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

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

  }

  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

Examples of org.eclipse.jdt.core.ICodeAssist.codeSelect()

      // source not found, try location the class file.
      code = JavaUtils.findClassFile(javaProject, filename);
    }

    if (code != null){
      IJavaElement[] elements = code.codeSelect(offset, length);
      if(elements != null && elements.length > 0){
        return elements[0];
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.codeSelect()

//        if (superclassName.toLowerCase().contains("japid")) {
//          useJapid = true;
//        }
       
        // current selected elem
            IJavaElement[] elements= unit.codeSelect(selection.getOffset(), selection.getLength());
            if (elements.length > 0) {
              // TODO extract the current selection to tell if the cursor in on renderJapidXXX line
              System.out.println(elements);
            }
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.codeSelect()

////        String name = JapidController.class.getName(); // this will require play.jar
//        String name = "cn.bran.play.JapidController";
//        IType japidController = jProject.findType(name);
//       
        // current selected elem
            IJavaElement[] elements= unit.codeSelect(selection.getOffset(), selection.getLength());
            if (elements.length > 0) {
              // TODO extract the current selection to tell if the cursor in on renderJapidXXX line
//              System.out.println(elements);
            }
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.