Package org.apache.wicket.model

Examples of org.apache.wicket.model.Model


   *            List to cast to Serializable
   * @see org.apache.wicket.Component#Component(String, IModel)
   */
  public ListView(final String id, final List list)
  {
    this(id, new Model((Serializable)list));
  }
View Full Code Here


   *            The list for the new model. The list must implement {@link Serializable}.
   * @return This for chaining
   */
  public Component setList(List list)
  {
    return setModel(new Model((Serializable)list));
  }
View Full Code Here

   * @param tabs
   *            list of ITab objects used to represent tabs
   */
  public TabbedPanel(String id, List tabs)
  {
    super(id, new Model(new Integer(-1)));

    if (tabs == null)
    {
      throw new IllegalArgumentException("argument [tabs] cannot be null");
    }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public IModel<T> model(final T object) {
    if( object instanceof Serializable ) {
      return new Model( (Serializable)object );
    }
    return new AbstractReadOnlyModel<T>() {
      @Override
      public T getObject() {
        return object;
View Full Code Here

  public final BookmarkablePageLink setPageMap(final IPageMap pageMap)
  {
    if (pageMap != null)
    {
      pageMapName = pageMap.getName();
      add(new AttributeModifier("target", true, new Model(pageMapName)));
    }
    return this;
  }
View Full Code Here

   */
  public ExternalLink(final String id, final String href, final String label)
  {
    super(id);

    setModel(href != null ? new Model(href) : null);
    this.label = (label != null ? new Model(label) : null);
  }
View Full Code Here

   * @param choices
   *            The collection of choices in the dropdown
   */
  public AjaxEditableChoiceLabel(String id, IModel model, List choices)
  {
    this(id, model, new Model((Serializable)choices));
  }
View Full Code Here

   * @param renderer
   *            The rendering engine
   */
  public AjaxEditableChoiceLabel(String id, IModel model, List choices, IChoiceRenderer renderer)
  {
    this(id, model, new Model((Serializable)choices), renderer);
  }
View Full Code Here

  }


  protected void onBeforeRender()
  {
    setModel(new Model(new Integer(pageable.getPageCount())));
    // PagingNavigation itself (as well as the PageableListView)
    // may have pages.

    // The index of the first page link depends on the PageableListView's
    // page currently printed.
View Full Code Here

        DateTimeField.this.configure(widgetProperties);
      }
    });
    add(hoursField = new TextField("hours", new PropertyModel(this, "hours"), Integer.class));
    hoursField.add(new HoursValidator());
    hoursField.setLabel(new Model("hours"));
    add(minutesField = new TextField("minutes", new PropertyModel(this, "minutes"),
        Integer.class)
    {
      private static final long serialVersionUID = 1L;

      public IConverter getConverter(Class type)
      {
        return MINUTES_CONVERTER;
      }
    });
    minutesField.add(NumberValidator.range(0, 59));
    minutesField.setLabel(new Model("minutes"));
    add(amOrPmChoice = new DropDownChoice("amOrPmChoice", new PropertyModel(this, "amOrPm"),
        Arrays.asList(AM_PM.values())));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.model.Model

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.