Examples of codeSelect()


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

        final IRegion wcr = DocumentHelper.findWicketComponentRegion(document, context.getInvocationOffset());
        if (wcr != null) {
          final IRegion javaRegion = DocumentHelper.findWord(document, wcr.getOffset());
          try {
            final IJavaElement[] jes = cu.codeSelect(javaRegion.getOffset(), javaRegion.getLength());
            if (jes.length == 1 && TypeHelper.isWicketJavaElement(jes[0])) {

              final IResource resource = cu.getResource();
              final String openKind = jes[0].getElementName().equals(DocumentHelper.GET_STRING) ? WicketHyperlink.PROPERTIES : WicketHyperlink.HTML;
              final WicketHyperlink wh = new WicketHyperlink(new Region(0, 0), "", openKind);
View Full Code Here

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

      if (cu != null) {
        synchronized (cu) {
          int cuDocLength = cu.getBuffer().getLength();
          int javaLength = javaPositionEnd - javaPositionStart;
          if (cuDocLength > 0 && javaPositionStart >= 0 && javaLength >= 0 && javaPositionEnd < cuDocLength) {
            result = cu.codeSelect(javaPositionStart, javaLength);
          }
        }
      }

      if (result == null || result.length == 0)
View Full Code Here

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

      if (cu != null) {
        synchronized (cu) {
          int cuDocLength = cu.getBuffer().getLength();
          int javaLength = javaPositionEnd - javaPositionStart;
          if (cuDocLength > 0 && javaPositionStart >= 0 && javaLength >= 0 && javaPositionEnd < cuDocLength) {
            result = cu.codeSelect(javaPositionStart, javaLength);
          }
        }
      }

      if (result == null || result.length == 0)
View Full Code Here

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

        if (unit == null)
            return null;
        ITextSelection text = getTextSelectionOfJavaEditor();
    int offset = text.getOffset();
    int length = text.getLength();
        IJavaElement[] elements = unit.codeSelect(offset, length);
        if(elements.length == 0) return null;
        return elements[0];
    }
   
    private ITextSelection getTextSelectionOfJavaEditor() throws JavaModelException {
View Full Code Here

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

    int length = commandLine.getIntValue(Options.LENGTH_OPTION);
    //int flags = RenameSupport.NONE;
    int flags = RenameSupport.UPDATE_REFERENCES;

    ICompilationUnit src = JavaUtils.getCompilationUnit(project, file);
    IJavaElement[] elements = src.codeSelect(offset, length);
    if(elements == null || elements.length == 0){
      throw new RefactorException();
    }

    IJavaElement element = elements[0];
View Full Code Here

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

      String file = commandLine.getValue(Options.FILE_OPTION);
      int offset = getOffset(commandLine);
      int length = commandLine.getIntValue(Options.LENGTH_OPTION);

      ICompilationUnit src = JavaUtils.getCompilationUnit(project, file);
      elements = src.codeSelect(offset, length);
    }

    if(elements == null || elements.length == 0){
      return null;
    }
View Full Code Here

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

    boolean callees = commandLine.hasOption(CALLEES_OPTION);
    int length = commandLine.getIntValue(Options.LENGTH_OPTION);
    int offset = getOffset(commandLine);

    ICompilationUnit src = JavaUtils.getCompilationUnit(project, file);
    IJavaElement[] elements = src.codeSelect(offset, length);
    if(elements == null || elements.length == 0){
      return result;
    }

    IJavaElement element = elements[0];
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.