本文整理汇总了Java中org.jdesktop.swingx.tree.DefaultXTreeCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java DefaultXTreeCellRenderer类的具体用法?Java DefaultXTreeCellRenderer怎么用?Java DefaultXTreeCellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultXTreeCellRenderer类属于org.jdesktop.swingx.tree包,在下文中一共展示了DefaultXTreeCellRenderer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDelegatingRendererUseDefault
import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
* Issue #817-swingx: Delegating renderer must create list's default.
* Delegating has default from list initially, here: default default.
*
* Note: this test has to be changed once we switch to default to DefaultTreeRenderer.
*/
@Test
public void testDelegatingRendererUseDefault() {
JXTree list = new JXTree();
TreeCellRenderer defaultRenderer = list.createDefaultCellRenderer();
assertEquals("sanity: creates default", DefaultXTreeCellRenderer.class,
defaultRenderer.getClass());
DelegatingRenderer renderer = (DelegatingRenderer) list.getCellRenderer();
assertEquals(defaultRenderer.getClass(), renderer.getDelegateRenderer().getClass());
}
示例2: interactiveUpdateUIXTreeDefaultRenderer
import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
* Issue #1060-swingx: JXTree must update renderer
*
* tree renderer not updated if set on the tree (as opposed to using the
* default set by the ui-delegate)
*/
public void interactiveUpdateUIXTreeDefaultRenderer() {
JXTree tree = new JXTree();
tree.getModel().valueForPathChanged(tree.getPathForRow(0), "x with ui provided renderer");
tree.setEditable(true);
JXTree treeSetRenderer = new JXTree();
treeSetRenderer.getModel().valueForPathChanged(treeSetRenderer.getPathForRow(0), "x with renderer set");
treeSetRenderer.setCellRenderer(new DefaultXTreeCellRenderer());
treeSetRenderer.setEditable(true);
JXFrame frame = wrapWithScrollingInFrame(tree, treeSetRenderer, "JXTree/core renderer: updateUI must update renderer");
addComponentOrientationToggle(frame);
show(frame);
}
示例3: createDefaultCellRenderer
import org.jdesktop.swingx.tree.DefaultXTreeCellRenderer; //导入依赖的package包/类
/**
* Creates and returns the default cell renderer to use. Subclasses may
* override to use a different type.
* <p>
*
* This implementation returns a renderer of type
* <code>DefaultTreeCellRenderer</code>. <b>Note:</b> Will be changed to
* return a renderer of type <code>DefaultTreeRenderer</code>,
* once WrappingProvider is reasonably stable.
*
* @return the default cell renderer to use with this tree.
*/
protected TreeCellRenderer createDefaultCellRenderer() {
// return new DefaultTreeCellRenderer();
return new DefaultXTreeCellRenderer();
}