Gxt ListView项目问题 - 不能通过html代码中的img src捕获图像

时间:2015-04-09 06:52:31

标签: html listview

朋友们,我从这里获得了来自sencha示例的代码http://www.sencha.com/examples/#ExamplePlace:listview

更改了html的参数


    
    {photo.name:shorten(18)}

但是我在IntelliJ Idea中编译后的图像没有在listview中被捕获(角落里有红色的X)

我真的不明白,请帮帮我。

我的Java代码是

ListViewCustomAppearance<InfoPerimetr> appearance = new ListViewCustomAppearance<InfoPerimetr>("." + style.thumbWrap(),
                    style.over(), style.select()) {
                @Override
                public void renderEnd(SafeHtmlBuilder builder) {
                    String markup = new StringBuilder("<div class=\"").append(CommonStyles.get().clear()).append("\"></div>").toString();
                    builder.appendHtmlConstant(markup);
                }

                @Override
                public void renderItem(SafeHtmlBuilder builder, SafeHtml content) {
                    builder.appendHtmlConstant("<div class='" + style.thumbWrap() + "' style='border: 1px solid white'>");
                    builder.append(content);
                    builder.appendHtmlConstant("</div>");
                }
            };

            ListView<InfoPerimetr, InfoPerimetr> listView = new ListView<InfoPerimetr, InfoPerimetr>(store, new IdentityValueProvider<InfoPerimetr>() {
                @Override
                public void setValue(InfoPerimetr object, InfoPerimetr value) {
                }

            }, appearance);
            listView.setCell(/*new IconCellDecorator<String>(AppBundle.IMAGE.userIcon16(), new ImageCell()*/
            new SimpleSafeHtmlCell<InfoPerimetr>(new AbstractSafeHtmlRenderer<InfoPerimetr>() {
                @Override
                public SafeHtml render(InfoPerimetr object) {
                    //ZSafeUri path = new ZSafeUri(object.getPath());
                  //  object.setPath(Images.INSTANCE.image1().getSafeUri().asString());
                    return renderer.renderItem(object, style);
                }
            }));
            listView.getSelectionModel().addSelectionChangedHandler(new SelectionChangedHandler<InfoPerimetr>() {
                @Override
                public void onSelectionChanged(SelectionChangedEvent<InfoPerimetr> event) {
                    panel.setHeadingText("Simple ListView (" + event.getSelection().size() + " items selected)");
                }
            });
            listView.setBorders(false);</i>

0 个答案:

没有答案