当前位置: 首页>>代码示例>>Java>>正文


Java TableColumnExt.setCellRenderer方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.table.TableColumnExt.setCellRenderer方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnExt.setCellRenderer方法的具体用法?Java TableColumnExt.setCellRenderer怎么用?Java TableColumnExt.setCellRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.table.TableColumnExt的用法示例。


在下文中一共展示了TableColumnExt.setCellRenderer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testStringValueRegistryFromColumnFactory

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * Issue 1145-swingx: re-enable filter to use string representation.
 * Here: test that cell-location StringValue look up initial per-column renderer
 * 
 */
@Test
public void testStringValueRegistryFromColumnFactory() {
    JXTable table = new JXTable();
    final int column = 2;
    // custom column factory which sets per-column renderer
    ColumnFactory factory = new ColumnFactory() {

        @Override
        public void configureTableColumn(TableModel model,
                TableColumnExt columnExt) {
            super.configureTableColumn(model, columnExt);
            if (columnExt.getModelIndex() == column)
                columnExt.setCellRenderer(new DefaultTableRenderer());
        }
        
    };
    table.setColumnFactory(factory);
    table.setModel(createModelDefaultColumnClasses(4));
    StringValueRegistry provider = table.getStringValueRegistry();
    assertEquals(table.getCellRenderer(0, column), provider.getStringValue(0, column));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:JXTableUnitTest.java

示例2: 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);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:CustomColumnFactory.java

示例3: configureTableColumn

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
@Override
public void configureTableColumn(final TableModel model, final TableColumnExt columnExt)
{
	super.configureTableColumn(model, columnExt);

	final TableColumnModel columnModel = getTableColumnModelOrNull(model, columnExt);
	if (columnModel == null)
	{
		return;
	}

	final int width = columnModel.getWidth();
	if (width > 0)
	{
		columnExt.setWidth(width);
		columnExt.setMaxWidth(width);
	}

	if (columnModel instanceof ImpDataLineRowTableColumnModel)
	{
		columnExt.setCellRenderer(new ImpDataCellRenderer());
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:24,代码来源:FileImportPreviewColumnFactory.java

示例4: configureTableColumn

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
@Override
public void configureTableColumn(final TableModel model, final TableColumnExt columnExt)
{
	super.configureTableColumn(model, columnExt);

	final TableModelMetaInfo<?> modelMetaInfo = getTableModelMetaInfoOrNull(model);
	if (modelMetaInfo == null)
	{
		return;
	}

	final int columnIndex = columnExt.getModelIndex();
	final TableColumnInfo columnMetaInfo = modelMetaInfo.getTableColumnInfo(columnIndex);

	columnExt.setCellRenderer(createTableCellRenderer(columnMetaInfo));
	columnExt.setCellEditor(createTableCellEditor(columnMetaInfo));

	if (columnMetaInfo.isSelectionColumn())
	{
		columnExt.setMaxWidth(25);
		columnExt.putClientProperty(AnnotatedColumnControlButton.PROPERTY_DisableColumnControl, true);
	}

	updateColumnExtFromMetaInfo(columnExt, columnMetaInfo);

	//
	// Synchronize: columnMetaInfo -> columnExt
	columnMetaInfo.addPropertyChangeListener(new TableColumnInfo2TableColumnExtSynchronizer(columnExt));
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:30,代码来源:AnnotatedTableColumnFactory.java

示例5: ReturnsSummaryTableColumnModel

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public ReturnsSummaryTableColumnModel(List<String> columns) {
    for (int i = 0; i < columns.size(); i++) {
        TableColumnExt tableColumn = new TableColumnExt(i);
        if (i > 0 && i < columns.size() - 1) {
            tableColumn.setCellRenderer(selectedReturnCellRenderer);
        } else if (i == (columns.size() - 1)) {
            tableColumn.setCellRenderer(totalReturnCellRenderer);
        }
        tableColumn.setIdentifier(columns.get(i));
        tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns.get(i)));
        addColumn(tableColumn);
    }
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:14,代码来源:ReturnsSummaryTable.java

示例6: StatisticsTableColumnModel

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String... columns) {
    for (int i = 0; i < columns.length; i++) {
        TableColumnExt tableColumn = new TableColumnExt(i);
        tableColumn.setCellRenderer(statisticsTableCellRenderer);
        tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
        if (i == 0) {
            tableColumn.setPreferredWidth(165);
        }
        tableColumn.setSortable(false);
        addColumn(tableColumn);
    }
    getSelectionModel().addListSelectionListener(statisticsListSelectionListener);
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:14,代码来源:BenchmarkPortfolioStatisticsTable.java

示例7: StockTableColumnModel

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StockTableColumnModel(List<String> columns) {
    for (int i = 0; i < columns.size(); i++) {
        TableColumnExt tableColumn = new TableColumnExt(i);
        tableColumn.setCellRenderer(stockTableColumnCellRenderer);
        tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns.get(i)));
        addColumn(tableColumn);
    }
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:9,代码来源:StockTable.java


注:本文中的org.jdesktop.swingx.table.TableColumnExt.setCellRenderer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。