Examples of AbstractItem


Examples of org.apache.wicket.markup.html.list.AbstractItem

        RepeatingView repeating = new RepeatingView(ID_REPEATING_SUMMARY_CHARTS);
        addOrReplace(repeating);

        List<ObjectAssociation> numberAssociations = elementSpec.getAssociations(CollectionContentsAsSummaryChartsFactory.OF_TYPE_BIGDECIMAL);
        for (ObjectAssociation numberAssociation : numberAssociations) {
            AbstractItem item = new AbstractItem(repeating.newChildId());

            repeating.add(item);

            String propertyName = numberAssociation.getName();
            item.add(new Label(ID_PROPERTY_NAME, new Model<String>(propertyName)));

            List<ObjectAdapter> adapters = model.getObject();
           
            CollectionContentsAsSummary.Summary summary = new CollectionContentsAsSummary.Summary(propertyName, adapters, numberAssociation);

            BigDecimal min = summary.getMin();
            BigDecimal max = summary.getMax();
           
            addItem(item, ID_SUM, summary.getTotal());
            addItem(item, ID_AVG, summary.getAverage());
            addItem(item, ID_MIN, min);
            addItem(item, ID_MAX, max);

            if(model.isStandalone()) {
                final BigDecimal minElseZero = min!=null?(min.compareTo(BigDecimal.ZERO)<0?min:BigDecimal.ZERO):null;
                final BigDecimal maxElseZero = max!=null?(max.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:max):null;
                final WickedChart chartValue = createChartValue(propertyName, summary.getTitles(), summary.getValuesAsNumbers(), minElseZero, maxElseZero);
                final StandaloneValueAsWickedChart wickedChart = new StandaloneValueAsWickedChart(ID_CHART, asValueModel(chartValue));
                item.add(wickedChart);
            } else {
                item.add(new Label(ID_CHART, ""));
            }
        }
    }
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(headers);

    final IColumn<?>[] columns = table.getColumns();
    for (final IColumn<?> column : columns)
    {
      AbstractItem item = new AbstractItem(headers.newChildId());
      headers.add(item);

      WebMarkupContainer header = null;
      if (column.isSortable())
      {
        header = newSortableHeader("header", column.getSortProperty(), stateLocator);
      }
      else
      {
        header = new WebMarkupContainer("header");
      }

      if (column instanceof IStyledColumn)
      {
        header.add(new DataTable.CssAttributeBehavior()
        {
          private static final long serialVersionUID = 1L;

          @Override
          protected String getCssClass()
          {
            return ((IStyledColumn<?>)column).getCssClass();
          }
        });
      }

      item.add(header);
      item.setRenderBodyOnly(true);
      header.add(column.getHeader("label"));

    }
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(repeating);

    int index = 0;
    while (contacts.hasNext())
    {
      AbstractItem item = new AbstractItem(repeating.newChildId());

      repeating.add(item);
      Contact contact = contacts.next();

      item.add(new ActionPanel("actions", new DetachableContactModel(contact)));
      item.add(new Label("contactid", String.valueOf(contact.getId())));
      item.add(new Label("firstname", contact.getFirstName()));
      item.add(new Label("lastname", contact.getLastName()));
      item.add(new Label("homephone", contact.getHomePhone()));
      item.add(new Label("cellphone", contact.getCellPhone()));

      final int idx = index;
      item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel<String>()
      {
        @Override
        public String getObject()
        {
          return (idx % 2 == 1) ? "even" : "odd";
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(headers);

    final List<IColumn<T>> columns = table.getColumns();
    for (final IColumn<T> column : columns)
    {
      AbstractItem item = new AbstractItem(headers.newChildId());
      headers.add(item);

      WebMarkupContainer header = null;
      if (column.isSortable())
      {
        header = newSortableHeader("header", column.getSortProperty(), stateLocator);
      }
      else
      {
        header = new WebMarkupContainer("header");
      }

      if (column instanceof IStyledColumn)
      {
        header.add(new DataTable.CssAttributeBehavior()
        {
          private static final long serialVersionUID = 1L;

          @Override
          protected String getCssClass()
          {
            return ((IStyledColumn<?>)column).getCssClass();
          }
        });
      }

      item.add(header);
      item.setRenderBodyOnly(true);
      header.add(column.getHeader("label"));

    }
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

        RepeatingView repeating = new RepeatingView(ID_REPEATING_SUMMARY);
        addOrReplace(repeating);

        for (ObjectAssociation numberAssociation : numberAssociations) {
            AbstractItem item = new AbstractItem(repeating.newChildId());

            repeating.add(item);

            String propertyName = numberAssociation.getName();
            item.add(new Label(ID_PROPERTY_NAME, new Model<String>(propertyName)));


            List<ObjectAdapter> adapters = model.getObject();
            Summary summary = new Summary(propertyName, adapters, numberAssociation);
            addItem(item, ID_SUM, summary.getTotal());
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

        RepeatingView repeating = new RepeatingView(ID_REPEATING_SUMMARY);
        addOrReplace(repeating);

        for (ObjectAssociation numberAssociation : numberAssociations) {
            AbstractItem item = new AbstractItem(repeating.newChildId());

            repeating.add(item);

            String propertyName = numberAssociation.getName();
            item.add(new Label(ID_PROPERTY_NAME, new Model<String>(propertyName)));


            List<ObjectAdapter> adapters = model.getObject();
            Summary summary = new Summary(adapters, numberAssociation);
            addItem(item, ID_SUM, summary.getTotal());
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(repeating);

    int index = 0;
    while (contacts.hasNext())
    {
      AbstractItem item = new AbstractItem(repeating.newChildId());

      repeating.add(item);
      Contact contact = contacts.next();

      item.add(new ActionPanel("actions", new DetachableContactModel(contact)));
      item.add(new Label("contactid", String.valueOf(contact.getId())));
      item.add(new Label("firstname", contact.getFirstName()));
      item.add(new Label("lastname", contact.getLastName()));
      item.add(new Label("homephone", contact.getHomePhone()));
      item.add(new Label("cellphone", contact.getCellPhone()));

      final int idx = index;
      item.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>()
      {
        private static final long serialVersionUID = 1L;

        @Override
        public String getObject()
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(headers);

    final List<IColumn<T>> columns = table.getColumns();
    for (final IColumn<T> column : columns)
    {
      AbstractItem item = new AbstractItem(headers.newChildId());
      headers.add(item);

      WebMarkupContainer header = null;
      if (column.isSortable())
      {
        header = newSortableHeader("header", column.getSortProperty(), stateLocator);
      }
      else
      {
        header = new WebMarkupContainer("header");
      }

      if (column instanceof IStyledColumn)
      {
        header.add(new DataTable.CssAttributeBehavior()
        {
          private static final long serialVersionUID = 1L;

          @Override
          protected String getCssClass()
          {
            return ((IStyledColumn<?>)column).getCssClass();
          }
        });
      }

      item.add(header);
      item.setRenderBodyOnly(true);
      header.add(column.getHeader("label"));

    }
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

        RepeatingView repeating = new RepeatingView(ID_REPEATING_SUMMARY_CHARTS);
        addOrReplace(repeating);

        for (ObjectAssociation numberAssociation : numberAssociations) {
            AbstractItem item = new AbstractItem(repeating.newChildId());

            repeating.add(item);

            String propertyName = numberAssociation.getName();
            item.add(new Label(ID_PROPERTY_NAME, new Model<String>(propertyName)));

            List<ObjectAdapter> adapters = model.getObject();
           
            CollectionContentsAsSummary.Summary summary = new CollectionContentsAsSummary.Summary(adapters, numberAssociation);
            BigDecimal min = summary.getMin();
            BigDecimal max = summary.getMax();
           
            addItem(item, ID_SUM, summary.getTotal());
            addItem(item, ID_AVG, summary.getAverage());
            addItem(item, ID_MIN, min);
            addItem(item, ID_MAX, max);

            if(model.isStandalone()) {
                final BigDecimal minElseZero = min!=null?(min.compareTo(BigDecimal.ZERO)<0?min:BigDecimal.ZERO):null;
                final BigDecimal maxElseZero = max!=null?(max.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:max):null;
                final WickedChart chartValue = createChartValue(propertyName, summary.getTitles(), summary.getValuesAsNumbers(), minElseZero, maxElseZero);
                final StandaloneValueAsWickedChart wickedChart = new StandaloneValueAsWickedChart(ID_CHART, asValueModel(chartValue));
                item.add(wickedChart);
            } else {
                item.add(new Label(ID_CHART, ""));
            }
        }
    }
View Full Code Here

Examples of org.apache.wicket.markup.html.list.AbstractItem

    add(headers);

    final List<IColumn<T, S>> columns = table.getColumns();
    for (final IColumn<T, S> column : columns)
    {
      AbstractItem item = new AbstractItem(headers.newChildId());
      headers.add(item);

      WebMarkupContainer header = null;
      if (column.isSortable())
      {
        header = newSortableHeader("header", column.getSortProperty(), stateLocator);
      }
      else
      {
        header = new WebMarkupContainer("header");
      }

      if (column instanceof IStyledColumn)
      {
        CssAttributeBehavior cssAttributeBehavior = new DataTable.CssAttributeBehavior()
        {
          private static final long serialVersionUID = 1L;

          @Override
          protected String getCssClass()
          {
            return ((IStyledColumn<?, S>)column).getCssClass();
          }
        };

        header.add(cssAttributeBehavior);
      }

      item.add(header);
      item.setRenderBodyOnly(true);
      header.add(column.getHeader("label"));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.