2012-11-16 45 views

回答

3

這是爲時已晚,但我希望這將有助於其他Google員工。 首先,定義一個接口:

public interface TreeResources extends CellTree.Resources { 

@ImageOptions(flipRtl = true) 
@Source("cellTreeClosedArrow.gif") 
ImageResource cellTreeClosedItem(); 

/** 
* An image indicating an open branch. 
*/ 
@ImageOptions(flipRtl = true) 
@Source("cellTreeOpenArrow.gif") 
ImageResource cellTreeOpenItem(); 
} 

凡cellTreeClosedArrow.gif和cellTreeOpenArrow.gif是名稱(路徑)到您的自定義圖像。 接下來的事情就是實例化上面的接口(在您查看):

CellTree.Resources treeResource = GWT.create(TreeResources.class); 

最後要做的是treeResource關聯到你的樹: 例子:

tree = new CellTree(myTreeViewModel , null,treeResource); 

我希望這是你需要。

乾杯

+0

感謝您的回答。新的圖像文件應放在哪個文件夾中? –