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


Java TableColumnExt.setTitle方法代码示例

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


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

示例1: interactiveCustomColumnFactory

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * Issue #1379-swingx: support access to underlying treeTableModel of TreeTableModelAdapter.
 * 
 * Needed f.i. in a custom ColumnFactory to configure the hierarchical column specifically.
 */
public void interactiveCustomColumnFactory() {
    JXTreeTable table = new JXTreeTable();
    ColumnFactory factory = new ColumnFactory() {

        /** 
         * @inherited <p>
         */
        @Override
        public void configureTableColumn(TableModel model,
                TableColumnExt columnExt) {
            super.configureTableColumn(model, columnExt);
            if (model instanceof TreeTableModelProvider) {
                TreeTableModel treeTableModel = ((TreeTableModelProvider) model).getTreeTableModel();
                if (treeTableModel.getHierarchicalColumn() == columnExt.getModelIndex()) {
                    columnExt.setTitle("Hierarchical: " + columnExt.getTitle());
                }
            }
        }
    };
    table.setColumnFactory(factory);
    table.setTreeTableModel(new FileSystemModel());
    showWithScrollingInFrame(table, "custom columnFactory");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:JXTreeTableVisualCheck.java

示例2: bind

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
private void bind() {
    // <snip>JXTreeTable column customization
    // configure and install a custom columnFactory, arguably data related ;-)
    ColumnFactory factory = new ColumnFactory() {
        String[] columnNameKeys = { "componentType", "componentName", "componentLocation", "componentSize" };

        @Override
        public void configureTableColumn(TableModel model,
                TableColumnExt columnExt) {
            super.configureTableColumn(model, columnExt);
            if (columnExt.getModelIndex() < columnNameKeys.length) {
                columnExt.setTitle(DemoUtils.getResourceString(TreeTableDemo.class, 
                        columnNameKeys[columnExt.getModelIndex()]));
            }
        }
        
    };
    treeTable.setColumnFactory(factory);
    // </snip>

}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:TreeTableDemo.java

示例3: createCustomColumnFactory

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * Creates and returns a custom columnFactory for testing. 
 * Sets column title to modelIndex.
 * 
 * @return the custom ColumnFactory.
 */
protected ColumnFactory createCustomColumnFactory() {
    ColumnFactory factory = new ColumnFactory() {

        @Override
        public void configureTableColumn(TableModel model,
                TableColumnExt columnExt) {
            super.configureTableColumn(model, columnExt);
            columnExt.setTitle(String.valueOf(columnExt.getModelIndex()));
        }

    };
    return factory;
    
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:JXTableUnitTest.java

示例4: testPreferredHeight

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * Issue 334-swingx: BasicTableHeaderUI.getPrefSize doesn't respect 
 *   all renderere's size requirements.
 *
 */
@Test
public void testPreferredHeight() {
    JXTable table = new JXTable(10, 2);
    TableColumnExt columnExt = table.getColumnExt(1);
    columnExt.setTitle("<html><center>Line 1<br>Line 2</center></html>");
    JXTableHeader tableHeader = (JXTableHeader) table.getTableHeader();
    TableCellRenderer renderer = tableHeader.getCellRenderer(1);
    Component comp = renderer.getTableCellRendererComponent(table, 
            columnExt.getHeaderValue(), false, false, -1, 1);
    Dimension prefRendererSize = comp.getPreferredSize();
    assertEquals("Header pref height must respect renderer",
            prefRendererSize.height, tableHeader.getPreferredSize().height);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:JXTableHeaderTest.java

示例5: configureTitle

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
private void configureTitle(TableColumnExt columnExt) {
    columnExt.setTitle(DemoUtils.getResourceString(baseClass, columnExt.getIdentifier().toString()));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:4,代码来源:CustomColumnFactory.java

示例6: beautifyColumnTitle

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
private void beautifyColumnTitle(TableColumnExt columnExt) {
    if (titleStringValue != null) {
        columnExt.setTitle(titleStringValue.getString(columnExt.getTitle()));
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:6,代码来源:CustomColumnFactory.java


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