Package org.apache.wicket.markup.repeater.data

Examples of org.apache.wicket.markup.repeater.data.GridView


   * Constructor
   */
  public GridViewPage()
  {
    IDataProvider dataProvider = new ContactDataProvider();
    GridView gridView = new GridView("rows", dataProvider)
    {
      protected void populateItem(Item item)
      {
        final Contact contact = (Contact)item.getModelObject();
        item.add(new Label("firstName", contact.getFirstName() + " "
            + contact.getLastName()));
      }

      protected void populateEmptyItem(Item item)
      {
        item.add(new Label("firstName", "*empty*"));
      }
    };

    gridView.setRows(4);
    gridView.setColumns(3);

    add(gridView);
    add(new PagingNavigator("navigator", gridView));
  }
View Full Code Here


   * Constructor
   */
  public GridViewPage()
  {
    IDataProvider dataProvider = new ContactDataProvider();
    GridView gridView = new GridView("rows", dataProvider)
    {
      protected void populateItem(Item item)
      {
        final Contact contact = (Contact)item.getModelObject();
        item.add(new Label("firstName", contact.getFirstName() + " " +
            contact.getLastName()));
      }

      protected void populateEmptyItem(Item item)
      {
        item.add(new Label("firstName", "*empty*"));
      }
    };

    gridView.setRows(4);
    gridView.setColumns(3);

    add(gridView);
    add(new PagingNavigator("navigator", gridView));
  }
View Full Code Here

   */
  @SuppressWarnings("serial")
  private void init(IDataProvider provider, final int cols, final int rows)
  {
    add(HeaderContributor.forCss(AnimatedThumbnailGallery.class, "AnimatedThumbnailGallery.css"));
    GridView view;
    add(view = new GridView("rows", dataProvider)
    {
      @Override
      protected void populateEmptyItem(Item item)
      {
        item.add(new Label("animatedThumbnail", "--"));
      }

      @Override
      protected void populateItem(Item item)
      {
        int index = item.getIndex();
        AnimatedThumbnailSettings settings = (AnimatedThumbnailSettings)item.getModelObject();
        settings.setThumbnailDimension(thumbnailWidth, thumbnailHeight);
        settings.setPictureDimension(pictureWidth, pictureHeight);
        settings.setPicturePosition(getPositionLeft(index, cols), getPositionTop(index, cols));
        item.add(new AnimatedThumbnail("animatedThumbnail", settings)
              .add(new AttributeAppender("style", true,
                    new Model("width:"+thumbnailWidth+";height:"+thumbnailHeight+";"),"")));
      }
    });
    view.setColumns(cols);
    view.setRows(rows);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.repeater.data.GridView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.