/** {@inheritDoc} */
 @Override
 protected ListItem<WikiPage> getNewOptionListItem() {
   ListItem<WikiPage> item = new ListItem<WikiPage>();
   item.setData(null);
   Label newOptionPanel = new Label(Strings.INSTANCE.linkNewPageOptionLabel());
   newOptionPanel.addStyleName("xNewPagePreview");
   item.add(newOptionPanel);
   return item;
 }
 /** {@inheritDoc} */
 @Override
 protected ListItem<Attachment> getNewOptionListItem() {
   ListItem<Attachment> newImageOption = new ListItem<Attachment>();
   newImageOption.setData(null);
   FlowPanel newOptionPanel = new FlowPanel();
   newOptionPanel.addStyleName("xNewImagePreview");
   Label newOptionLabel = new Label(Strings.INSTANCE.imageUploadNewFileLabel());
   newOptionPanel.add(newOptionLabel);
   newImageOption.add(newOptionPanel);
   return newImageOption;
 }
 /** {@inheritDoc} */
 @Override
 protected ListItem<Attachment> getListItem(Attachment image) {
   ListItem<Attachment> imageItem = new ListItem<Attachment>();
   imageItem.setData(image);
   Image htmlImage = new Image(image.getUrl() + "?width=135");
   htmlImage.setTitle(new AttachmentReference(image.getReference()).getFileName());
   FlowPanel previewPanel = new FlowPanel();
   previewPanel.addStyleName("xImagePreview");
   previewPanel.add(htmlImage);
   imageItem.add(previewPanel);
   return imageItem;
 }
  /** {@inheritDoc} */
  @Override
  protected ListItem<WikiPage> getListItem(WikiPage data) {
    ListItem<WikiPage> item = new ListItem<WikiPage>();
    item.setData(data);
    String documentReferenceAsString =
        serializeDocumentReference(new WikiPageReference(data.getReference()));
    Label pageName =
        new Label(Strings.INSTANCE.entityLocatedIn() + " " + documentReferenceAsString);
    pageName.addStyleName("xPagePreviewFullname");
    Label title = new Label(data.getTitle());
    title.addStyleName("xPagePreviewTitle");

    FlowPanel ui = new FlowPanel();
    if (!StringUtils.isEmpty(data.getTitle())) {
      ui.add(title);
    }
    ui.setTitle(data.getTitle());
    ui.add(pageName);
    ui.addStyleName("xPagePreview");
    item.add(ui);
    return item;
  }