Package com.vaadin.data.util

Examples of com.vaadin.data.util.IndexedContainer


     *            the Collection containing the options.
     */
    public AbstractSelect(String caption, Collection<?> options) {

        // Creates the options container and add given options to it
        final Container c = new IndexedContainer();
        if (options != null) {
            for (final Iterator<?> i = options.iterator(); i.hasNext();) {
                c.addItem(i.next());
            }
        }

        setCaption(caption);
        setContainerDataSource(c);
View Full Code Here


     * @param newDataSource
     *            the new data source.
     */
    public void setContainerDataSource(Container newDataSource) {
        if (newDataSource == null) {
            newDataSource = new IndexedContainer();
        }

        getCaptionChangeListener().clear();

        if (items != newDataSource) {
View Full Code Here

    public void setContainerDataSource(Container newDataSource) {
        if (newDataSource == null) {
            // Note: using wrapped IndexedContainer to match constructor (super
            // creates an IndexedContainer, which is then wrapped).
            newDataSource = new ContainerHierarchicalWrapper(
                    new IndexedContainer());
        }

        // Assure that the data source is ordered by making unordered
        // containers ordered by wrapping them
        if (Container.Hierarchical.class.isAssignableFrom(newDataSource
View Full Code Here

    public void setContainerDataSource(Container newDataSource) {

        disableContentRefreshing();

        if (newDataSource == null) {
            newDataSource = new IndexedContainer();
        }

        // Assures that the data source is ordered by making unordered
        // containers ordered by wrapping them
        if (newDataSource instanceof Container.Ordered) {
View Full Code Here

  /*
   * create a graph container with a month of random data
   */
  public Container.Indexed createGraphDataSource() {
    Container.Indexed container = new IndexedContainer();

    container.addContainerProperty(Timeline.PropertyId.TIMESTAMP,
        Date.class, null);
    container.addContainerProperty(Timeline.PropertyId.VALUE, Float.class,
        0f);

    // add random data to container
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.MONTH, -1);
    java.util.Date today = new java.util.Date();
    Random generator = new Random();

    while (cal.getTime().before(today)) {
      // create a point in time
      Item item = container.addItem(cal.getTime());

      // set the time stamp property
      item.getItemProperty(Timeline.PropertyId.TIMESTAMP).setValue(
          cal.getTime());

View Full Code Here

  /*
   * Creates a marker container with a marker for each seven days
   */
  public Container.Indexed createmarkerDataSource() {
    Container.Indexed container = new IndexedContainer();

    container.addContainerProperty(Timeline.PropertyId.TIMESTAMP,
        Date.class, null);
    container.addContainerProperty(Timeline.PropertyId.CAPTION,
        String.class, "our marker symbol");
    container.addContainerProperty(Timeline.PropertyId.VALUE, String.class,
        "Our description");

    // add a marker for every 7 days
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.MONTH, -1);
    java.util.Date today = new java.util.Date();
    SimpleDateFormat formatter = new SimpleDateFormat("EEE, MMM d, ''yy");

    while (cal.getTime().before(today)) {
      // create a point in time
      Item item = container.addItem(cal.getTime());

      // set the time stamp property
      item.getItemProperty(Timeline.PropertyId.TIMESTAMP).setValue(
          cal.getTime());

View Full Code Here

  /*
   * Creates an event container with a marker for each Sunday
   */
  public Container.Indexed createEventDateSource() {
    Container.Indexed container = new IndexedContainer();

    container.addContainerProperty(Timeline.PropertyId.TIMESTAMP,
        Date.class, null);
    container.addContainerProperty(Timeline.PropertyId.CAPTION,
        String.class, "our marker symbol");

    // add a marker for every 7 days
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.MONTH, -1);
    java.util.Date today = new java.util.Date();

    while (cal.getTime().before(today)) {
      if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
        // create a point in time
        Item item = container.addItem(cal.getTime());

        // set the time stamp property
        item.getItemProperty(Timeline.PropertyId.TIMESTAMP).setValue(
            cal.getTime());

View Full Code Here

     
      @Override
      public void valueChange(ValueChangeEvent event) {
       
        //filling out the container
        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("Service", String.class, null);
        container.addContainerProperty("Thème", String.class, null);
        container.addContainerProperty("Nombre de Réclamations", Integer.class, null);
        container.addContainerProperty("Observations", String.class, null);
       
        if (am.buildAnalyseTable(String.valueOf(airports.getValue())).size() != 0)
        {
          panel.setCaption("Tableau d'analyse");
          for (AnalyseTable at : am.buildAnalyseTable(String.valueOf(airports.getValue())))
          {
            Item item = container.addItem(at);
            item.getItemProperty("Service").setValue(at.getService());
            item.getItemProperty("Thème").setValue(at.getTheme());
            item.getItemProperty("Nombre de Réclamations").setValue(at.getNbreRecla());
            item.getItemProperty("Observations").setValue(at.getDescriptif());
          }
View Full Code Here

     
      @Override
      public void valueChange(ValueChangeEvent event) {
       
        //getting the container
        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("ID Passager", Integer.class, null);
        container.addContainerProperty("Date", java.sql.Date.class, null);
        container.addContainerProperty("Terminale", String.class, null);
        container.addContainerProperty("Descriptif", String.class, null);
       
        if (rm.getAirportsReclamations(String.valueOf(airports.getValue())).size() != 0){
          panel.setCaption("Tableau de Réclamations");
          //filling out the container
          for (Reclamation a : rm.getAirportsReclamations(String.valueOf(airports.getValue())))
          {
            Item item = container.addItem(a);
            item.getItemProperty("ID Passager").setValue(a.getIdPassager());
            item.getItemProperty("Date").setValue(a.getDate());
            item.getItemProperty("Terminale").setValue(a.getTerminale());
            item.getItemProperty("Descriptif").setValue(a.getDescriptif());
          }
View Full Code Here

    table.setWidth("100%");
    table.setPageLength(0);

    addComponent(table);

    IndexedContainer container = new IndexedContainer();
    container.addContainerProperty("Nom", String.class, null);
    container.addContainerProperty("Email", String.class, null);

    for (Passager p : getPassagerMailList()) {
      Item item = container.addItem(p);
      item.getItemProperty("Nom").setValue(p.getNom());
      item.getItemProperty("Email").setValue(p.getEmail());
    }

    table.setContainerDataSource(container);
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.IndexedContainer

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.