コード例 #1
0
 /** {@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;
 }
コード例 #2
0
 /** {@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;
 }
コード例 #3
0
 /** {@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;
 }
コード例 #4
0
  /** {@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;
  }
コード例 #5
0
  /**
   * Creates a new image selector that displays the images attached to the link destination page.
   *
   * @param wikiService the service used to retrieve the list of image attachments
   * @param useLinkDestination {@code true} to consider that the link destination is the current
   *     page, {@code false} to consider that the link origin is the current page
   */
  public CurrentPageImageSelectorWizardStep(
      WikiServiceAsync wikiService, boolean useLinkDestination) {
    super(wikiService);

    this.useLinkDestination = useLinkDestination;

    getMainPanel().addStyleName("xImagesSelector");

    clearFloatsListItem = new ListItem<Attachment>();
    clearFloatsListItem.setStyleName("clearfloats");

    getList().addSelectionHandler(this);
  }