layout = new CardLayout();
contents = new JPanel(layout);
list = new JXList();
list.setName("list");
list.setCellRenderer(new DefaultListRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof Component) {
return value.getClass().getSimpleName() + " (" + ((Component) value).getName() + ")";
}
return StringValues.TO_STRING.getString(value);
}
}));
contents.add(list, list.getName());
table = new JXTable();
contents.add(table, "table");
tree = new JXTree();
tree.setName("tree");
tree.setCellRenderer(new DefaultTreeRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof Component) {
return value.getClass().getSimpleName() + " (" + ((Component) value).getName() + ")";
}
return StringValues.TO_STRING.getString(value);
}
}));
contents.add(tree, tree.getName());
treeTable = new JXTreeTable();
treeTable.setName("treeTable");
treeTable.setTreeCellRenderer(new DefaultTreeRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof Component) {
return value.getClass().getSimpleName() + " (" + ((Component) value).getName() + ")";
}
return StringValues.TO_STRING.getString(value);
}
}));
contents.add(treeTable, treeTable.getName());
add(contents);
JPanel control = new JPanel(new GridLayout(2, 2));
control.add(new JLabel("Highlighter Options:"));
stripingOptions = new JComboBox(getStripingOptionsModel());
stripingOptions.setRenderer(new DefaultListRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof HighlighterInfo) {
return ((HighlighterInfo) value).getDescription();
}
return StringValues.TO_STRING.getString(value);
}
}));
control.add(stripingOptions);
highlighters = new JComboBox(getHighlighterOptionsModel());
highlighters.setRenderer(new DefaultListRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof HighlighterInfo) {
return ((HighlighterInfo) value).getDescription();
}
return StringValues.TO_STRING.getString(value);
}
}));
control.add(highlighters);
predicates = new JComboBox(getPredicateOptionsModel());
predicates.setRenderer(new DefaultListRenderer(new StringValue() {
public String getString(Object value) {
if (value instanceof HighlightPredicateInfo) {
return ((HighlightPredicateInfo) value).getDescription();
}