Package org.eclipse.jface.text

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


              }
              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);
                  htmlSnippet = document.get(tagBegin.getOffset() + 1, tagEnd.getOffset() - tagBegin.getOffset() - 1).toLowerCase().trim();
View Full Code Here


                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);
                  htmlSnippet = document.get(tagBegin.getOffset() + 1, tagEnd.getOffset() - tagBegin.getOffset() - 1).toLowerCase().trim();
                  if (htmlSnippet.contains("type")) {
                    final String[] hss = htmlSnippet.split(" ");
                    if (hss != null) {
                      for (int j = 0; j < hss.length; j++) {
View Full Code Here

    try {
      provider.connect(javaFile);
      final IDocument document = provider.getDocument(javaFile);
      final String className = javaFile.getName().replaceAll(".java", "");
      final FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
      final IRegion region = frda.find(0, "class " + className, true, true, true, false);
      if (region != null) {
        addMarker(javaFile, getErrorText(wid), wid, htmlSnippet, document.getLineOfOffset(region.getOffset()), region.getOffset() + 6,
            className.length());
      }
      provider.disconnect(javaFile);
View Full Code Here

            Assert.isNotNull(document);

            final FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
            try {
              if (JAVA.equals(extension)) {
                IRegion region = frda.find(0, '"' + wicketId + '"', true, true, false, false);
                if (region != null) {
                  while (region != null) {
                    final IRegion li = document.getLineInformationOfOffset(region.getOffset());
                    String line = document.get(li.getOffset(), li.getLength()).trim();
                    if (line.startsWith("*") || line.startsWith("/*") || line.startsWith("//")) {
View Full Code Here

                if (region != null) {
                  while (region != null) {
                    final IRegion li = document.getLineInformationOfOffset(region.getOffset());
                    String line = document.get(li.getOffset(), li.getLength()).trim();
                    if (line.startsWith("*") || line.startsWith("/*") || line.startsWith("//")) {
                      region = frda.find(region.getOffset() + 1, '"' + wicketId + '"', true, true, false, false);
                    } else {
                      DocumentHelper.markOccurrence(textEditor, DocumentHelper.getStringConstantName(line));
                      textEditor.selectAndReveal(region.getOffset() + 1, wicketId.length());
                      found = true;
                      break;
View Full Code Here

                    }
                  }
                }
              } else if (HTML.equals(extension)) {
                String wid_const = DocumentHelper.getNamespacePrefix(document);
                final IRegion region = frda.find(0, wid_const + ":id=\"" + wicketId, true, true, true, false);
                if (region != null) {
                  textEditor.selectAndReveal(region.getOffset() + wid_const.length() + 5, wicketId.length());
                  break;
                }
              } else if (PROPERTIES.equals(extension)) {
View Full Code Here

              } else if (PROPERTIES.equals(extension)) {
                // for the wicket tags that use wicket:message
                if (wicketId.startsWith("value:")) {
                  wicketId = wicketId.substring(6);
                }
                final IRegion regionBegin = frda.find(0, wicketId, true, true, false, false);
                if (regionBegin != null) {
                  IRegion sr = frda.find(regionBegin.getOffset(), "\">", true, true, false, false);
                  if (sr == null) { // properties, select till eol
                    sr = frda.find(regionBegin.getOffset(), "=", true, true, false, false);
                    if (sr == null) {
View Full Code Here

                if (wicketId.startsWith("value:")) {
                  wicketId = wicketId.substring(6);
                }
                final IRegion regionBegin = frda.find(0, wicketId, true, true, false, false);
                if (regionBegin != null) {
                  IRegion sr = frda.find(regionBegin.getOffset(), "\">", true, true, false, false);
                  if (sr == null) { // properties, select till eol
                    sr = frda.find(regionBegin.getOffset(), "=", true, true, false, false);
                    if (sr == null) {
                      activePage.closeEditor(editor, false);
                      continue;
View Full Code Here

                }
                final IRegion regionBegin = frda.find(0, wicketId, true, true, false, false);
                if (regionBegin != null) {
                  IRegion sr = frda.find(regionBegin.getOffset(), "\">", true, true, false, false);
                  if (sr == null) { // properties, select till eol
                    sr = frda.find(regionBegin.getOffset(), "=", true, true, false, false);
                    if (sr == null) {
                      activePage.closeEditor(editor, false);
                      continue;
                    }
                    final IRegion lineRegion = document.getLineInformationOfOffset(sr.getOffset());
View Full Code Here

                    final int selectionLength = lineRegion.getOffset() + lineRegion.getLength() - sr.getOffset();
                    textEditor.selectAndReveal(sr.getOffset() + 1, selectionLength - 1);
                    foundInPropertiesFile = true;
                    break;
                  } else { // xml, select till </
                    final IRegion selEnd = frda.find(regionBegin.getOffset(), "</", true, true, false, false);
                    textEditor.selectAndReveal(sr.getOffset() + 2, selEnd.getOffset() - sr.getOffset() - 2);
                    foundInPropertiesFile = true;
                    break;
                  }
                } else {
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.