01: /*
02: * @(#)DialogPageListCellRenderer.java
03: *
04: * Copyright 2002 JIDE Software. All rights reserved.
05: */
06: package com.jidesoft.dialog;
07:
08: import javax.swing.*;
09: import java.awt.*;
10:
11: /**
12: * A list cell renderer for AbstractDialogPage.
13: */
14: class DialogPageListCellRenderer extends DefaultListCellRenderer {
15: @Override
16: public Component getListCellRendererComponent(JList list,
17: Object value, int index, boolean isSelected,
18: boolean cellHasFocus) {
19: if (value instanceof AbstractDialogPage) {
20: AbstractDialogPage page = (AbstractDialogPage) value;
21: return super.getListCellRendererComponent(list, page
22: .getTitle(), index, isSelected, cellHasFocus);
23: } else {
24: return super.getListCellRendererComponent(list, value,
25: index, isSelected, cellHasFocus);
26: }
27: }
28: }
|