本文整理汇总了Java中org.jdesktop.swingx.table.TableColumnExt.setHighlighters方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnExt.setHighlighters方法的具体用法?Java TableColumnExt.setHighlighters怎么用?Java TableColumnExt.setHighlighters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.table.TableColumnExt
的用法示例。
在下文中一共展示了TableColumnExt.setHighlighters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureTableColumn
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* {@inheritDoc} <p>
*
* Overridden to set the column's identifier, lookup the title
*/
@Override
public void configureTableColumn(TableModel model,
TableColumnExt columnExt) {
super.configureTableColumn(model, columnExt);
columnExt.setIdentifier(model.getColumnName(columnExt.getModelIndex()));
configureTitle(columnExt);
ComponentProvider<?> provider = getComponentProvider(columnExt.getIdentifier());
if (provider != null) {
columnExt.setCellRenderer(new DefaultTableRenderer(provider));
}
Highlighter highlighter = getHighlighter(columnExt.getIdentifier());
if (highlighter != null) {
columnExt.setHighlighters(highlighter);
}
columnExt.setComparator(getComparator(columnExt.getIdentifier()));
columnExt.setPrototypeValue(getPrototypeValue(columnExt.getIdentifier()));
if (getHiddenNames().contains(columnExt.getIdentifier())) {
columnExt.setVisible(false);
}
}
示例2: configureTableColumn
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public void configureTableColumn(TableModel model, TableColumnExt columnExt) {
super.configureTableColumn(model, columnExt);
// String title = columnExt.getTitle();
// title = title.substring(0, 1).toUpperCase()
// + title.substring(1).toLowerCase();
// columnExt.setTitle(title);
// model.getColumnClass(1);
Object id=columnExt.getClientProperty("ID");
System.out.println("CustomColumnFactory.configureTableColumn(): id:"+id);
Highlighter highlighter = null;
Object extid = columnExt.getIdentifier();
String idStr = extid.toString();
if (idStr.equals(I18N.getMsg("msg.dlg.mng.strands.color"))) {
highlighter = new ColorHighlighter();
} else if (idStr.equals(I18N.getMsg("msg.dlg.mng.persons.birthday"))
|| idStr.equals(I18N.getMsg("msg.dlg.person.death"))
|| idStr.equals(I18N.getMsg("msg.dlg.scene.date"))) {
highlighter = new DateHighlighter();
} else if (idStr.equals(I18N.getMsg("msg.idea.table.status"))) {
highlighter = new IdeaStatusHighlighter();
} else if (idStr.equals(I18N.getMsg("msg.status"))) {
highlighter = new SceneStatusHighlighter();
}
if (highlighter != null) {
columnExt.setHighlighters(highlighter);
}
}