Skip to content

Package: CustomSelectionColorCellRenderer$1

CustomSelectionColorCellRenderer$1

nameinstructionbranchcomplexitylinemethod
widgetDisposed(DisposeEvent)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
{...}
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Mathias Schaefer - initial API and implementation
13: ******************************************************************************/
14: /*******************************************************************************
15: * Copyright (c) 2006 IBM Corporation and others.
16: * All rights reserved. This program and the accompanying materials
17: * are made available under the terms of the Eclipse Public License 2.0
18: * which accompanies this distribution, and is available at
19: * https://www.eclipse.org/legal/epl-2.0/
20: *
21: * SPDX-License-Identifier: EPL-2.0
22: *
23: * Contributors:
24: * chris.gross@us.ibm.com - initial API and implementation
25: * Chuck.Mastrandrea@sas.com - wordwrapping in bug 222280
26: * smcduff@hotmail.com - wordwrapping in bug 222280
27: * Claes Rosell<claes.rosell@solme.se> - rowspan in bug 272384
28: *******************************************************************************/
29: package org.eclipse.emf.ecp.view.internal.table.nebula.grid;
30:
31: import org.eclipse.nebula.widgets.grid.Grid;
32: import org.eclipse.nebula.widgets.grid.GridCellRenderer;
33: import org.eclipse.nebula.widgets.grid.GridColumn;
34: import org.eclipse.nebula.widgets.grid.GridItem;
35: import org.eclipse.nebula.widgets.grid.IInternalWidget;
36: import org.eclipse.nebula.widgets.grid.internal.BranchRenderer;
37: import org.eclipse.nebula.widgets.grid.internal.CheckBoxRenderer;
38: import org.eclipse.nebula.widgets.grid.internal.ToggleRenderer;
39: import org.eclipse.swt.SWT;
40: import org.eclipse.swt.events.DisposeEvent;
41: import org.eclipse.swt.events.DisposeListener;
42: import org.eclipse.swt.graphics.Color;
43: import org.eclipse.swt.graphics.GC;
44: import org.eclipse.swt.graphics.Image;
45: import org.eclipse.swt.graphics.Point;
46: import org.eclipse.swt.graphics.Rectangle;
47: import org.eclipse.swt.graphics.TextLayout;
48:
49: // REUSED CLASS
50: /**
51: * Copy of the Nebula Grid DefaultCellRenderer (temporary fix to be able to set the selection colors)
52: *
53: */
54: @SuppressWarnings({ "restriction", "nls" })
55: public class CustomSelectionColorCellRenderer extends GridCellRenderer {
56:
57:         int leftMargin = 4;
58:
59:         int rightMargin = 4;
60:
61:         int topMargin = 0;
62:
63:         int bottomMargin = 0;
64:
65:         int textTopMargin = 1;
66:
67:         int textBottomMargin = 2;
68:
69:         private final int insideMargin = 3;
70:
71:         int treeIndent = 20;
72:
73:         private ToggleRenderer toggleRenderer;
74:
75:         private BranchRenderer branchRenderer;
76:
77:         private CheckBoxRenderer checkRenderer;
78:
79:         private TextLayout textLayout;
80:
81:         private Color selectionBackgroundColor;
82:         private Color selectionForegroundColor;
83:
84:         // TODO: fix disabled/out of focus state
85:         public CustomSelectionColorCellRenderer(Color selectionForegroundColor, Color selectionBackgroundColor) {
86:                 this.selectionForegroundColor = selectionForegroundColor;
87:                 this.selectionBackgroundColor = selectionBackgroundColor;
88:         }
89:
90:         /**
91:          * {@inheritDoc}
92:          */
93:         @Override
94:         public void paint(GC gc, Object value) {
95:                 final GridItem item = (GridItem) value;
96:
97:                 gc.setFont(item.getFont(getColumn()));
98:
99:                 boolean drawAsSelected = isSelected();
100:
101:                 boolean drawBackground = true;
102:
103:                 if (isCellSelected()) {
104:                         drawAsSelected = true;// (!isCellFocus());
105:                 }
106:
107:                 if (drawAsSelected) {
108:                         gc.setBackground(selectionBackgroundColor);
109:                         gc.setForeground(selectionForegroundColor);
110:                 } else {
111:                         if (item.getParent().isEnabled()) {
112:                                 final Color back = item.getBackground(getColumn());
113:
114:                                 if (back != null) {
115:                                         gc.setBackground(back);
116:                                 } else {
117:                                         drawBackground = false;
118:                                 }
119:                         } else {
120:                                 gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
121:                         }
122:                         gc.setForeground(item.getForeground(getColumn()));
123:                 }
124:
125:                 if (drawBackground) {
126:                         gc.fillRectangle(getBounds().x, getBounds().y, getBounds().width,
127:                                 getBounds().height);
128:                 }
129:
130:                 int x = leftMargin;
131:
132:                 if (isTree()) {
133:                         final boolean renderBranches = item.getParent().getTreeLinesVisible();
134:                         if (renderBranches) {
135:                                 branchRenderer.setBranches(getBranches(item));
136:                                 branchRenderer.setIndent(treeIndent);
137:                                 branchRenderer.setBounds(
138:                                         getBounds().x + x, getBounds().y,
139:                                         getToggleIndent(item), getBounds().height + 1); // Take into account border
140:                         }
141:
142:                         x += getToggleIndent(item);
143:
144:                         toggleRenderer.setExpanded(item.isExpanded());
145:
146:                         toggleRenderer.setHover(getHoverDetail().equals("toggle"));
147:
148:                         toggleRenderer.setLocation(getBounds().x + x, (getBounds().height - toggleRenderer
149:                                 .getBounds().height)
150:                                 / 2 + getBounds().y);
151:                         if (item.hasChildren()) {
152:                                 toggleRenderer.paint(gc, null);
153:                         }
154:
155:                         if (renderBranches) {
156:                                 branchRenderer.setToggleBounds(toggleRenderer.getBounds());
157:                                 branchRenderer.paint(gc, null);
158:                         }
159:
160:                         x += toggleRenderer.getBounds().width + insideMargin;
161:
162:                 }
163:
164:                 if (isCheck()) {
165:                         checkRenderer.setChecked(item.getChecked(getColumn()));
166:                         checkRenderer.setGrayed(item.getGrayed(getColumn()));
167:                         if (!item.getParent().isEnabled()) {
168:                                 checkRenderer.setGrayed(true);
169:                         }
170:                         checkRenderer.setHover(getHoverDetail().equals("check"));
171:
172:                         if (isCenteredCheckBoxOnly(item)) {
173:                                 // Special logic if this column only has a checkbox and is centered
174:                                 checkRenderer.setBounds(getBounds().x + (getBounds().width - checkRenderer.getBounds().width) / 2,
175:                                         (getBounds().height - checkRenderer.getBounds().height)
176:                                                 / 2 + getBounds().y,
177:                                         checkRenderer
178:                                                 .getBounds().width,
179:                                         checkRenderer.getBounds().height);
180:                         } else {
181:                                 checkRenderer.setBounds(getBounds().x + x, (getBounds().height - checkRenderer
182:                                         .getBounds().height)
183:                                         / 2 + getBounds().y,
184:                                         checkRenderer
185:                                                 .getBounds().width,
186:                                         checkRenderer.getBounds().height);
187:
188:                                 x += checkRenderer.getBounds().width + insideMargin;
189:                         }
190:
191:                         checkRenderer.paint(gc, null);
192:                 }
193:
194:                 final Image image = item.getImage(getColumn());
195:                 if (image != null) {
196:                         int y = getBounds().y;
197:
198:                         y += (getBounds().height - image.getBounds().height) / 2;
199:
200:                         gc.drawImage(image, getBounds().x + x, y);
201:
202:                         x += image.getBounds().width + insideMargin;
203:                 }
204:
205:                 final int width = getBounds().width - x - rightMargin;
206:
207:                 if (drawAsSelected) {
208:                         gc.setForeground(selectionForegroundColor);
209:                 } else {
210:                         gc.setForeground(item.getForeground(getColumn()));
211:                 }
212:
213:                 if (!isWordWrap()) {
214:                         final String text = TextUtils.getShortStr(gc, item.getText(getColumn()), width);
215:
216:                         if (getAlignment() == SWT.RIGHT) {
217:                                 final int len = gc.stringExtent(text).x;
218:                                 if (len < width) {
219:                                         x += width - len;
220:                                 }
221:                         } else if (getAlignment() == SWT.CENTER) {
222:                                 final int len = gc.stringExtent(text).x;
223:                                 if (len < width) {
224:                                         x += (width - len) / 2;
225:                                 }
226:                         }
227:
228:                         gc.drawString(text, getBounds().x + x, getBounds().y + textTopMargin + topMargin, true);
229:                 } else {
230:                         if (textLayout == null) {
231:                                 textLayout = new TextLayout(gc.getDevice());
232:                                 item.getParent().addDisposeListener(new DisposeListener() {
233:                                         @Override
234:                                         public void widgetDisposed(DisposeEvent e) {
235:                                                 textLayout.dispose();
236:                                         }
237:                                 });
238:                         }
239:                         textLayout.setFont(gc.getFont());
240:                         textLayout.setText(item.getText(getColumn()));
241:                         textLayout.setAlignment(getAlignment());
242:                         textLayout.setWidth(width < 1 ? 1 : width);
243:                         if (item.getParent().isAutoHeight()) {
244:                                 // Look through all columns (except this one) to get the max height needed for this item
245:                                 final int columnCount = item.getParent().getColumnCount();
246:                                 int maxHeight = textLayout.getBounds().height + textTopMargin + textBottomMargin;
247:                                 for (int i = 0; i < columnCount; i++) {
248:                                         final GridColumn column = item.getParent().getColumn(i);
249:                                         if (i != getColumn() && column.getWordWrap()) {
250:                                                 final int height = column.getCellRenderer().computeSize(gc, column.getWidth(), SWT.DEFAULT,
251:                                                         item).y;
252:                                                 maxHeight = Math.max(maxHeight, height);
253:                                         }
254:                                 }
255:
256:                                 // Also look at the row header if necessary
257:                                 if (item.getParent().isWordWrapHeader()) {
258:                                         final int height = item.getParent().getRowHeaderRenderer().computeSize(gc, SWT.DEFAULT, SWT.DEFAULT,
259:                                                 item).y;
260:                                         maxHeight = Math.max(maxHeight, height);
261:                                 }
262:
263:                                 if (maxHeight != item.getHeight()) {
264:                                         item.setHeight(maxHeight);
265:                                 }
266:                         }
267:                         textLayout.draw(gc, getBounds().x + x, getBounds().y + textTopMargin + topMargin);
268:                 }
269:
270:                 if (item.getParent().getLinesVisible()) {
271:                         if (isCellSelected()) {
272:                                 gc.setForeground(selectionForegroundColor);
273:                         } else {
274:                                 gc.setForeground(item.getParent().getLineColor());
275:                         }
276:                         gc.drawLine(getBounds().x, getBounds().y + getBounds().height, getBounds().x
277:                                 + getBounds().width - 1,
278:                                 getBounds().y + getBounds().height);
279:                         gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
280:                                 getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height);
281:                 }
282:
283:                 if (isCellFocus()) {
284:                         final Rectangle focusRect = new Rectangle(getBounds().x, getBounds().y, getBounds().width - 1,
285:                                 getBounds().height);
286:
287:                         gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
288:                         gc.drawRectangle(focusRect);
289:
290:                         if (isFocus()) {
291:                                 focusRect.x++;
292:                                 focusRect.width -= 2;
293:                                 focusRect.y++;
294:                                 focusRect.height -= 2;
295:
296:                                 gc.drawRectangle(focusRect);
297:                         }
298:                 }
299:         }
300:
301:         /**
302:          * Calculates the sequence of branch lines which should be rendered for the provided item
303:          *
304:          * @param item
305:          * @return an array of integers composed using the constants in {@link BranchRenderer}
306:          */
307:         private int[] getBranches(GridItem item) {
308:                 final int[] branches = new int[item.getLevel() + 1];
309:                 final GridItem[] roots = item.getParent().getRootItems();
310:
311:                 // Is this a node or a leaf?
312:                 if (item.getParentItem() == null) {
313:                         // Add descender if not last item
314:                         if (!item.isExpanded() && roots[roots.length - 1].equals(item)) {
315:                                 if (item.hasChildren()) {
316:                                         branches[item.getLevel()] = BranchRenderer.LAST_ROOT;
317:                                 } else {
318:                                         branches[item.getLevel()] = BranchRenderer.SMALL_L;
319:                                 }
320:                         } else {
321:                                 if (item.hasChildren()) {
322:                                         branches[item.getLevel()] = BranchRenderer.ROOT;
323:                                 } else {
324:                                         branches[item.getLevel()] = BranchRenderer.SMALL_T;
325:                                 }
326:                         }
327:
328:                 } else if (item.hasChildren()) {
329:                         if (item.isExpanded()) {
330:                                 branches[item.getLevel()] = BranchRenderer.NODE;
331:                         } else {
332:                                 branches[item.getLevel()] = BranchRenderer.NONE;
333:                         }
334:                 } else {
335:                         branches[item.getLevel()] = BranchRenderer.LEAF;
336:                 }
337:
338:                 // Branch for current item
339:                 GridItem parent = item.getParentItem();
340:                 if (parent == null) {
341:                         return branches;
342:                 }
343:
344:                 // Are there siblings below this item?
345:                 if (parent.indexOf(item) < parent.getItemCount() - 1) {
346:                         branches[item.getLevel() - 1] = BranchRenderer.T;
347:                 } else if (parent.getParentItem() == null && !parent.equals(roots[roots.length - 1])) {
348:                         branches[item.getLevel() - 1] = BranchRenderer.T;
349:                 } else {
350:                         branches[item.getLevel() - 1] = BranchRenderer.L;
351:                 }
352:
353:                 final Grid grid = item.getParent();
354:                 item = parent;
355:                 parent = item.getParentItem();
356:
357:                 // Branches for parent items
358:                 while (item.getLevel() > 0) {
359:                         if (parent.indexOf(item) == parent.getItemCount() - 1) {
360:                                 if (parent.getParentItem() == null && !grid.getRootItem(grid.getRootItemCount() - 1).equals(parent)) {
361:                                         branches[item.getLevel() - 1] = BranchRenderer.I;
362:                                 } else {
363:                                         branches[item.getLevel() - 1] = BranchRenderer.NONE;
364:                                 }
365:                         } else {
366:                                 branches[item.getLevel() - 1] = BranchRenderer.I;
367:                         }
368:                         item = parent;
369:                         parent = item.getParentItem();
370:                 }
371:                 // item should be null at this point
372:                 return branches;
373:         }
374:
375:         /**
376:          * {@inheritDoc}
377:          */
378:         @Override
379:         public Point computeSize(GC gc, int wHint, int hHint, Object value) {
380:                 final GridItem item = (GridItem) value;
381:
382:                 gc.setFont(item.getFont(getColumn()));
383:
384:                 int x = 0;
385:
386:                 x += leftMargin;
387:
388:                 if (isTree()) {
389:                         x += getToggleIndent(item);
390:
391:                         x += toggleRenderer.getBounds().width + insideMargin;
392:
393:                 }
394:
395:                 if (isCheck()) {
396:                         x += checkRenderer.getBounds().width + insideMargin;
397:                 }
398:
399:                 int y = 0;
400:
401:                 final Image image = item.getImage(getColumn());
402:                 if (image != null) {
403:                         y = topMargin + image.getBounds().height + bottomMargin;
404:
405:                         x += image.getBounds().width + insideMargin;
406:                 }
407:
408:                 // MOPR-DND
409:                 // MOPR: replaced this code (to get correct preferred height for cells in word-wrap columns)
410:                 //
411:                 // x += gc.stringExtent(item.getText(column)).x + rightMargin;
412:                 //
413:                 // y = Math.max(y,topMargin + gc.getFontMetrics().getHeight() + bottomMargin);
414:                 //
415:                 // with this code:
416:
417:                 int textHeight = 0;
418:                 if (!isWordWrap()) {
419:                         x += gc.textExtent(item.getText(getColumn())).x + rightMargin;
420:
421:                         textHeight = topMargin + textTopMargin + gc.getFontMetrics().getHeight() + textBottomMargin + bottomMargin;
422:                 } else {
423:                         int plainTextWidth;
424:                         if (wHint == SWT.DEFAULT) {
425:                                 plainTextWidth = gc.textExtent(item.getText(getColumn())).x;
426:                         } else {
427:                                 plainTextWidth = wHint - x - rightMargin;
428:                         }
429:
430:                         final TextLayout currTextLayout = new TextLayout(gc.getDevice());
431:                         currTextLayout.setFont(gc.getFont());
432:                         currTextLayout.setText(item.getText(getColumn()));
433:                         currTextLayout.setAlignment(getAlignment());
434:                         currTextLayout.setWidth(plainTextWidth < 1 ? 1 : plainTextWidth);
435:
436:                         x += plainTextWidth + rightMargin;
437:
438:                         textHeight += topMargin + textTopMargin;
439:                         for (int cnt = 0; cnt < currTextLayout.getLineCount(); cnt++) {
440:                                 textHeight += currTextLayout.getLineBounds(cnt).height;
441:                         }
442:                         textHeight += textBottomMargin + bottomMargin;
443:
444:                         currTextLayout.dispose();
445:                 }
446:
447:                 y = Math.max(y, textHeight);
448:
449:                 return new Point(x, y);
450:         }
451:
452:         /**
453:          * {@inheritDoc}
454:          */
455:         @Override
456:         public boolean notify(int event, Point point, Object value) {
457:
458:                 final GridItem item = (GridItem) value;
459:
460:                 if (isCheck()) {
461:                         if (event == IInternalWidget.MouseMove) {
462:                                 if (overCheck(item, point)) {
463:                                         setHoverDetail("check");
464:                                         return true;
465:                                 }
466:                         }
467:
468:                         if (event == IInternalWidget.LeftMouseButtonDown) {
469:                                 if (overCheck(item, point)) {
470:                                         if (!item.getCheckable(getColumn())) {
471:                                                 return false;
472:                                         }
473:
474:                                         item.setChecked(getColumn(), !item.getChecked(getColumn()));
475:                                         item.getParent().redraw();
476:
477:                                         item.fireCheckEvent(getColumn());
478:
479:                                         return true;
480:                                 }
481:                         }
482:                 }
483:
484:                 if (isTree() && item.hasChildren()) {
485:                         if (event == IInternalWidget.MouseMove) {
486:                                 if (overToggle(item, point)) {
487:                                         setHoverDetail("toggle");
488:                                         return true;
489:                                 }
490:                         }
491:
492:                         if (event == IInternalWidget.LeftMouseButtonDown) {
493:                                 if (overToggle(item, point)) {
494:                                         item.setExpanded(!item.isExpanded());
495:                                         item.getParent().redraw();
496:
497:                                         if (item.isExpanded()) {
498:                                                 item.fireEvent(SWT.Expand);
499:                                         } else {
500:                                                 item.fireEvent(SWT.Collapse);
501:                                         }
502:
503:                                         return true;
504:                                 }
505:                         }
506:                 }
507:
508:                 return false;
509:         }
510:
511:         private boolean overCheck(GridItem item, Point point) {
512:                 if (isCenteredCheckBoxOnly(item)) {
513:                         point = new Point(point.x, point.y);
514:                         point.x -= getBounds().x;
515:                         point.y -= getBounds().y;
516:
517:                         final Rectangle checkBounds = new Rectangle(0, 0, 0, 0);
518:                         checkBounds.x = (getBounds().width - checkRenderer.getBounds().width) / 2;
519:                         checkBounds.y = (getBounds().height - checkRenderer.getBounds().height) / 2;
520:                         checkBounds.width = checkRenderer.getBounds().width;
521:                         checkBounds.height = checkRenderer.getBounds().height;
522:
523:                         return checkBounds.contains(point);
524:                 }
525:                 point = new Point(point.x, point.y);
526:                 point.x -= getBounds().x;
527:                 point.y -= getBounds().y;
528:
529:                 int x = leftMargin;
530:                 if (isTree()) {
531:                         x += getToggleIndent(item);
532:                         x += toggleRenderer.getSize().x + insideMargin;
533:                 }
534:
535:                 if (point.x >= x && point.x < x + checkRenderer.getSize().x) {
536:                         final int yStart = (getBounds().height - checkRenderer.getBounds().height) / 2;
537:                         if (point.y >= yStart && point.y < yStart + checkRenderer.getSize().y) {
538:                                 return true;
539:                         }
540:                 }
541:
542:                 return false;
543:
544:         }
545:
546:         private int getToggleIndent(GridItem item) {
547:                 return item.getLevel() * treeIndent;
548:         }
549:
550:         private boolean overToggle(GridItem item, Point point) {
551:
552:                 point = new Point(point.x, point.y);
553:
554:                 point.x -= getBounds().x - 1;
555:                 point.y -= getBounds().y - 1;
556:
557:                 int x = leftMargin;
558:                 x += getToggleIndent(item);
559:
560:                 if (point.x >= x && point.x < x + toggleRenderer.getSize().x) {
561:                         // return true;
562:                         final int yStart = (getBounds().height - toggleRenderer.getBounds().height) / 2;
563:                         if (point.y >= yStart && point.y < yStart + toggleRenderer.getSize().y) {
564:                                 return true;
565:                         }
566:                 }
567:
568:                 return false;
569:         }
570:
571:         /**
572:          * {@inheritDoc}
573:          */
574:         @Override
575:         public void setTree(boolean tree) {
576:                 super.setTree(tree);
577:
578:                 if (tree) {
579:                         toggleRenderer = new ToggleRenderer();
580:                         toggleRenderer.setDisplay(getDisplay());
581:
582:                         branchRenderer = new BranchRenderer();
583:                         branchRenderer.setDisplay(getDisplay());
584:                 }
585:         }
586:
587:         /**
588:          * {@inheritDoc}
589:          */
590:         @Override
591:         public void setCheck(boolean check) {
592:                 super.setCheck(check);
593:
594:                 if (check) {
595:                         checkRenderer = new CheckBoxRenderer();
596:                         checkRenderer.setDisplay(getDisplay());
597:                 } else {
598:                         checkRenderer = null;
599:                 }
600:         }
601:
602:         /**
603:          * {@inheritDoc}
604:          */
605:         @Override
606:         public Rectangle getTextBounds(GridItem item, boolean preferred) {
607:                 int x = leftMargin;
608:
609:                 if (isTree()) {
610:                         x += getToggleIndent(item);
611:
612:                         x += toggleRenderer.getBounds().width + insideMargin;
613:
614:                 }
615:
616:                 if (isCheck()) {
617:                         x += checkRenderer.getBounds().width + insideMargin;
618:                 }
619:
620:                 final Image image = item.getImage(getColumn());
621:                 if (image != null) {
622:                         x += image.getBounds().width + insideMargin;
623:                 }
624:
625:                 final Rectangle bounds = new Rectangle(x, topMargin + textTopMargin, 0, 0);
626:
627:                 final GC gc = new GC(item.getParent());
628:                 gc.setFont(item.getFont(getColumn()));
629:                 final Point size = gc.stringExtent(item.getText(getColumn()));
630:
631:                 bounds.height = size.y;
632:
633:                 if (preferred) {
634:                         bounds.width = size.x - 1;
635:                 } else {
636:                         bounds.width = getBounds().width - x - rightMargin;
637:                 }
638:
639:                 gc.dispose();
640:
641:                 return bounds;
642:         }
643:
644:         private boolean isCenteredCheckBoxOnly(GridItem item) {
645:                 return !isTree() && item.getImage(getColumn()) == null && item.getText(getColumn()).equals("")
646:                         && getAlignment() == SWT.CENTER;
647:         }
648:
649:         /**
650:          * @param selectionForegroundColor the selectionForegroundColor to set
651:          */
652:         public void setSelectionForegroundColor(Color selectionForegroundColor) {
653:                 this.selectionForegroundColor = selectionForegroundColor;
654:         }
655:
656:         /**
657:          * @param selectionBackgroundColor the selectionBackgroundColor to set
658:          */
659:         public void setSelectionBackgroundColor(Color selectionBackgroundColor) {
660:                 this.selectionBackgroundColor = selectionBackgroundColor;
661:         }
662:
663: }
664: // END REUSED CLASS