Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.FindReplaceDocumentAdapter.find()


    protected void parse(IDocument document) {

      try {
        FindReplaceDocumentAdapter frAdapter = new FindReplaceDocumentAdapter(document);
        // do the methods
        IRegion region = frAdapter.find(0, ToolMethod.CEX_SIGNATURE_REGEX, true, false, false, true);
        String methodSignature = null;
        while (region != null){
          int offset = region.getOffset();
          int length = region.getLength();
          Position p = new Position(offset, length);
View Full Code Here


            methodSignature = sig.group(1);
            methodSignature = methodSignature.replaceAll("\\s","");
            methodSignature = methodSignature.substring(methodSignature.indexOf(".")+1);
            fContent.add(new Segment(methodSignature, p, "icons/private_method.gif"));
          }
          region = frAdapter.find(offset+length, ToolMethod.CEX_SIGNATURE_REGEX, true, false, false, true);
        }
        // do the event handlers
        region = frAdapter.find(0, ToolEventHandler.CEX_SIGNATURE_REGEX, true, false, false, true);
        String ehSignature = null;
        while (region != null){
View Full Code Here

            fContent.add(new Segment(methodSignature, p, "icons/private_method.gif"));
          }
          region = frAdapter.find(offset+length, ToolMethod.CEX_SIGNATURE_REGEX, true, false, false, true);
        }
        // do the event handlers
        region = frAdapter.find(0, ToolEventHandler.CEX_SIGNATURE_REGEX, true, false, false, true);
        String ehSignature = null;
        while (region != null){
          int offset = region.getOffset();
          int length = region.getLength();
          Position p = new Position(offset, length);
View Full Code Here

            ehSignature = sig.group(1);
            ehSignature = ehSignature.replaceAll("\\s","");
            ehSignature = ehSignature.substring(ehSignature.indexOf(".")+1);
            fContent.add(new Segment(ehSignature, p, "icons/private_event_handler.gif"));
          }
          region = frAdapter.find(offset+length, ToolEventHandler.CEX_SIGNATURE_REGEX, true, false, false, true);
        }
        // do constants
        region = frAdapter.find(0, ToolConstant.PLAN_REGEX, true, false, false, true);
        String constText = null;
        while (region != null){
View Full Code Here

            fContent.add(new Segment(ehSignature, p, "icons/private_event_handler.gif"));
          }
          region = frAdapter.find(offset+length, ToolEventHandler.CEX_SIGNATURE_REGEX, true, false, false, true);
        }
        // do constants
        region = frAdapter.find(0, ToolConstant.PLAN_REGEX, true, false, false, true);
        String constText = null;
        while (region != null){
          int offset = region.getOffset();
          int length = region.getLength();
          Position p = new Position(offset, length);
View Full Code Here

          int length = region.getLength();
          Position p = new Position(offset, length);
          document.addPosition(SEGMENTS, p);
          constText = document.get(region.getOffset(), region.getLength());
          fContent.add(new Segment(constText, p, "icons/private_constant.gif"));
          region = frAdapter.find(offset+length, ToolConstant.PLAN_REGEX, true, false, false, true);
        }
        // do classes
        region = frAdapter.find(0, ToolClass.CLASS_REGEX, true, false, false, true);
        String classText = null;
        while (region != null){
View Full Code Here

          constText = document.get(region.getOffset(), region.getLength());
          fContent.add(new Segment(constText, p, "icons/private_constant.gif"));
          region = frAdapter.find(offset+length, ToolConstant.PLAN_REGEX, true, false, false, true);
        }
        // do classes
        region = frAdapter.find(0, ToolClass.CLASS_REGEX, true, false, false, true);
        String classText = null;
        while (region != null){
          int offset = region.getOffset();
          int length = region.getLength();
          Position p = new Position(offset, length);
View Full Code Here

          int length = region.getLength();
          Position p = new Position(offset, length);
          document.addPosition(SEGMENTS, p);
          classText = document.get(region.getOffset(), region.getLength());
          fContent.add(new Segment(classText, p, "icons/class.gif"));
          region = frAdapter.find(offset+length, ToolClass.CLASS_REGEX, true, false, false, true);
        }
      } catch (BadLocationException e) {
      } catch (BadPositionCategoryException x) {
      }
     
View Full Code Here

  public static String getNamespacePrefix(final IDocument document) {
    Assert.isNotNull(document);
    FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
    try {
      final IRegion dtd = frda.find(0, QWickieActivator.WICKET_DTD, true, false, false, false);
      if (dtd != null) {
        final IRegion li = document.getLineInformationOfOffset(dtd.getOffset());
        final String line = document.get(li.getOffset(), li.getLength());
        return getWicketNamespace(line);
      }
View Full Code Here

                }
              }
              if (jlc == -1) {
                final int widPos = sc + line.indexOf("\"" + wid + "\"") + 1;
                FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
                IRegion tagBegin = frda.find(widPos, "<", false, true, false, false);
                IRegion tagEnd = frda.find(tagBegin.getOffset(), " ", true, true, false, false);
                String htmlTag = document.get(tagBegin.getOffset() + 1, tagEnd.getOffset() - tagBegin.getOffset() - 1);
                String htmlSnippet = htmlTag.toLowerCase();
                if (htmlFile != null && "input".equals(htmlSnippet)) {
                  tagEnd = frda.find(tagBegin.getOffset(), ">", true, true, false, false);
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.