1 11 package org.eclipse.ui.internal.about; 12 13 16 public class AboutItem { 17 private String text; 18 19 private int[][] linkRanges; 20 21 private String [] hrefs; 22 23 26 public AboutItem(String text, int[][] linkRanges, String [] hrefs) { 27 28 this.text = text; 29 this.linkRanges = linkRanges; 30 this.hrefs = hrefs; 31 } 32 33 36 public int[][] getLinkRanges() { 37 return linkRanges; 38 } 39 40 43 public String getText() { 44 return text; 45 } 46 47 50 public boolean isLinkAt(int offset) { 51 for (int i = 0; i < linkRanges.length; i++) { 53 if (offset >= linkRanges[i][0] 54 && offset < linkRanges[i][0] + linkRanges[i][1]) { 55 return true; 56 } 57 } 58 return false; 59 } 60 61 65 public String getLinkAt(int offset) { 66 for (int i = 0; i < linkRanges.length; i++) { 68 if (offset >= linkRanges[i][0] 69 && offset < linkRanges[i][0] + linkRanges[i][1]) { 70 return hrefs[i]; 71 } 72 } 73 return null; 74 } 75 } 76 | Popular Tags |