Esempio n. 1
0
 protected void updateCell(ItemCell cell) {
   List<StyleRange> list = new ArrayList<StyleRange>();
   boolean selectionFound = false;
   if (cellToMatches != null) {
     List<Match> matches = cellToMatches.get(cell);
     if (matches != null) {
       for (Match match : matches) {
         boolean sel = match.equals(selection);
         selectionFound = selectionFound | sel;
         StyleRange range = createRange(match, sel);
         list.add(range);
       }
     }
   }
   if (!selectionFound && selection != null) {
     ItemCell selCell = (ItemCell) selection.getBlock();
     if (selCell.equals(cell)) {
       list.add(createRange(selection, true));
     }
   }
   StyleRange[] ranges = list.toArray(new StyleRange[list.size()]);
   decorator.setStyles(cell, ranges);
 }
Esempio n. 2
0
 protected ItemCell getCell(Match match) {
   return (ItemCell) match.getBlock();
 }