Package org.opensolaris.opengrok.egrok.model

Examples of org.opensolaris.opengrok.egrok.model.Hit


    JSONArray array = (JSONArray) results.get("results");

    List<Hit> resultList = new ArrayList<>();
    for (Object obj : array) {
      JSONObject result = (JSONObject) obj;
      Hit hit = new Hit(result);
      if (hit.isValid()) {
        resultList.add(hit);
      }
    }
    return resultList;
  }
View Full Code Here


      if (element instanceof String) {
        return new StyledString((String) element);
      }

      if (element instanceof Hit) {
        Hit hit = (Hit) element;
        StyledString result = new StyledString();

        StyledString.Styler courierNewSmall = new StyledString.Styler() {
          @Override
          public void applyStyles(TextStyle textStyle) {
            textStyle.font = new Font(null, "Courier New",
                defaultFont.getHeight() - 1, SWT.NORMAL);
          }
        };
        StyledString.Styler courierNew = new StyledString.Styler() {
          @Override
          public void applyStyles(TextStyle textStyle) {
            textStyle.font = new Font(null, "Courier New",
                defaultFont.getHeight(), SWT.NORMAL);
          }
        };
        StyledString.Styler courierNewGrey = new StyledString.Styler() {
          @Override
          public void applyStyles(TextStyle textStyle) {
            textStyle.font = new Font(null, "Courier New",
                defaultFont.getHeight(), SWT.NORMAL);
            textStyle.foreground = JFaceResources.getColorRegistry().get(
                JFacePreferences.QUALIFIER_COLOR);
          }
        };

        result.append(hit.getLineno() + " ", courierNewSmall);

        String line = hit.getLine();

        int startidx = line.indexOf("<b>");
        int endidx = line.indexOf("</b>");
        String before = line.substring(0, startidx);
        String term = line.substring(startidx + "<b>".length(), endidx);
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.egrok.model.Hit

Copyright © 2018 www.massapicom. 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.