不幸的是,我还不能发布图片,但我会尽力解释。我有图像,我想像 chrome 浏览器或歌剧中的空白页中的按钮一样使用它们。但结果我与图像有一条线,下一张图像在下一行,并且所有行(不仅是图像)都处于活动状态。
那么,我该怎么做。我一直在尝试找出我的代码与 ext gwt 2.2 资源管理器站点上给出的示例代码之间的任何差异(重要差异)。这是我的代码:
public class QueryPanel extends LayoutContainer {
public QueryPanel(final String customerId, final String login, final String password){
setLayout(new FitLayout());
final ContentPanel gallery = new ContentPanel();
gallery.setHeading("Reports");
gallery.setLayout(new FitLayout());
gallery.setCollapsible(true);
gallery.setAnimCollapse(false);
gallery.setFrame(true);
gallery.setId("images-view");
gallery.setWidth(535);
ListStore<GalleryButtonModel> store = new ListStore<GalleryButtonModel>();
store.add(new GalleryButtonModel("Copy all messages", "CopyIcon.png", new CopyMsgs(customerId)));
store.add(new GalleryButtonModel("Spam report", "spam.gif", new SpamReport(customerId, login, password)));
store.add(new GalleryButtonModel("Top customers report", "topCustomers.gif", new TopCustomersReport(customerId, login, password)));
store.add(new GalleryButtonModel("Total report", "total-report.gif", new TotalReport(customerId, login, password)));
store.add(new GalleryButtonModel("Message througput report", "message-troughput.gif", new MessageThroughputReport(customerId, login, password)));
store.add(new GalleryButtonModel("Delivery time report", "delivery-time.gif", new DeliveryTimeReport(customerId, login, password)));
store.add(new GalleryButtonModel("Action type report", "report.gif", new ActionTypeReport(customerId, login, password)));
ListView<GalleryButtonModel> view = new ListView<GalleryButtonModel>() {
@Override
protected GalleryButtonModel prepareData(GalleryButtonModel model) {
String s = model.get("name");
model.set("shortName", Format.ellipse(s, 15));
return model;
}
};
view.setId("img-chooser-view");
view.setTemplate(getTemplate(""));
view.setStore(store);
view.setItemSelector("div.thumb-wrap");
view.getSelectionModel().select(0, false);
view.getSelectionModel().addListener(Events.SelectionChange,
new Listener<SelectionChangedEvent<GalleryButtonModel>>() {
public void handleEvent(SelectionChangedEvent<GalleryButtonModel> be) {
be.getSelectedItem().getExample().getButtonModel();
}
});
VBoxLayoutData vFlex = new VBoxLayoutData();
vFlex.setFlex(1);
gallery.add(view, new FitData(5,5,5,5));
add(gallery, vFlex);
}
private native String getTemplate(String base)/*-{
return ['<tpl for=".">',
'<div class="thumb-wrap" id="{name}">',
'<div class="thumb"><img src="/gxt/images/default/button/{path}" title="{name}"></div>',
'<span class="x-editable">{shortName}</span></div>',
'</tpl>',
'<div class="x-clear"></div>'].join("");
}-*/;
}