Examples of AbstractColumn


Examples of com.google.visualization.datasource.query.AbstractColumn

    QuerySelection selection = new QuerySelection();
    selection.addColumn(new SimpleColumn("name"));
    selection.addColumn(new SimpleColumn("weight"));
    q.setSelection(selection);

    AbstractColumn col1 = new ScalarFunctionColumn(
      Lists.<AbstractColumn>newArrayList(), new Constant(new NumberValue(2)));
    AbstractColumn col2 = new ScalarFunctionColumn(
      Lists.<AbstractColumn>newArrayList(new SimpleColumn("weight"), col1),
      Modulo.getInstance());

    QueryFilter filter = new ColumnValueFilter(col2,
      new NumberValue(0), ComparisonFilter.Operator.EQ);
View Full Code Here

Examples of com.google.visualization.datasource.query.AbstractColumn

    QuerySelection selection = new QuerySelection(); // SELECT (sum(sales) / 7)
    List<AbstractColumn> columns = Lists.newArrayList();
    columns.add(new AggregationColumn(new SimpleColumn("Sales"), AggregationType.SUM));
    columns.add(new ScalarFunctionColumn(Lists.<AbstractColumn>newArrayList(),
        new Constant(new NumberValue(7))));
    AbstractColumn selectedColumn = new ScalarFunctionColumn(columns, Quotient.getInstance());
    selection.addColumn(selectedColumn);

    query.setSelection(selection);
    QueryGroup group = new QueryGroup();
    group.addColumn(new SimpleColumn("Year"));
View Full Code Here

Examples of com.google.visualization.datasource.query.AbstractColumn

      QuerySelection completionSelection = new QuerySelection();
      List<AbstractColumn> originalSelectedColumns =
          query.getSelection().getColumns();
      for (int i = 0; i < originalSelectedColumns.size(); i++) {
        AbstractColumn column = originalSelectedColumns.get(i);
        if (query.getGroup().getColumns().contains(column)) {
          completionSelection.addColumn(column);
        } else { // Must be an aggregation column if doesn't appear in the grouping.
          // The id here is the id generated by the data source for the column containing
          // the aggregated data, e.g., max-B.
          String id = column.getId();
          // MIN is chosen arbitrarily, because there will be exactly one.
          completionSelection.addColumn(
              new AggregationColumn(new SimpleColumn(id), AggregationType.MIN));
        }
      }

      completionQuery.setSelection(completionSelection);
    } else {
      // When there is no pivoting, sql does everything (except skipping, options, labels, format).
      dataSourceQuery.copyFrom(query);
      dataSourceQuery.setOptions(null);
      completionQuery.setOptions(query.getOptions());
      try {
        // If there is skipping pagination should be done in the completion query
        if (query.hasRowSkipping()) {
          dataSourceQuery.setRowSkipping(0);
          dataSourceQuery.setRowLimit(-1);
          dataSourceQuery.setRowOffset(0);
         
          completionQuery.copyRowSkipping(query);
          completionQuery.copyRowLimit(query);
          completionQuery.copyRowOffset(query);
        }
        if (query.hasLabels()) {
          dataSourceQuery.setLabels(null);
          QueryLabels labels = query.getLabels();
          QueryLabels newLabels = new QueryLabels();
          for (AbstractColumn column : labels.getColumns()) {
            newLabels.addLabel(new SimpleColumn(column.getId()), labels.getLabel(column));
          }
          completionQuery.setLabels(newLabels);
        }
        if (query.hasUserFormatOptions()) {
          dataSourceQuery.setUserFormatOptions(null);
          QueryFormat formats = query.getUserFormatOptions();
          QueryFormat newFormats = new QueryFormat();
          for (AbstractColumn column : formats.getColumns()) {
            newFormats.addPattern(new SimpleColumn(column.getId()), formats.getPattern(column));
          }
          completionQuery.setUserFormatOptions(newFormats);
        }
      } catch (InvalidQueryException e) {
        // Should not happen.
View Full Code Here

Examples of com.google.visualization.datasource.query.AbstractColumn

    assertTrue(completionQuery.hasLabels());
    // Test that labels and formats changed appropriately
    AbstractColumn[] labelColumns =
        completionQuery.getLabels().getColumns().toArray(new AbstractColumn[]{});
    if (labelColumns[1].getId().equals("A")) {
      AbstractColumn tmp = labelColumns[0];
      labelColumns[0] = labelColumns[1];
      labelColumns[1] = tmp;      
    }
    assertEquals(2, labelColumns.length);
    assertEquals("A", labelColumns[0].getId());
    AbstractColumn col = labelColumns[1];
    assertTrue(col instanceof SimpleColumn);
    assertEquals("max-B", ((SimpleColumn) col).getId());
    assertEquals("maxBLabel", completionQuery.getLabels().getLabel(col));
    AbstractColumn[] formatColumns =
        completionQuery.getUserFormatOptions().getColumns().toArray(new AbstractColumn[]{});
    if (formatColumns[1].getId().equals("A")) {
      AbstractColumn tmp = formatColumns[0];
      formatColumns[0] = formatColumns[1];
      formatColumns[1] = tmp;      
    }
    assertEquals(2, formatColumns.length);
    assertEquals("A", formatColumns[0].getId());
View Full Code Here

Examples of com.google.visualization.datasource.query.AbstractColumn

            QuerySelection completionSelection = new QuerySelection();
            List<AbstractColumn> originalSelectedColumns =
                    query.getSelection().getColumns();
            for(int i = 0; i < originalSelectedColumns.size(); i++) {
                AbstractColumn column = originalSelectedColumns.get(i);
                if(query.getGroup().getColumns().contains(column)) {
                    completionSelection.addColumn(column);
                }
                else { // Must be an aggregation column if doesn't appear in the grouping.
                    // The id here is the id generated by the data source for the column containing
                    // the aggregated data, e.g., max-B.
                    String id = column.getId();
                    // MIN is chosen arbitrarily, because there will be exactly one.
                    completionSelection.addColumn(
                            new AggregationColumn(new SimpleColumn(id), AggregationType.MIN));
                }
            }

            completionQuery.setSelection(completionSelection);
        }
        else {
            // When there is no pivoting, sql does everything (except skipping, options, labels, format).
            dataSourceQuery.copyFrom(query);
            dataSourceQuery.setOptions(null);
            completionQuery.setOptions(query.getOptions());
            try {
                // If there is skipping pagination should be done in the completion query
                if(query.hasRowSkipping()) {
                    dataSourceQuery.setRowSkipping(0);
                    dataSourceQuery.setRowLimit(-1);
                    dataSourceQuery.setRowOffset(0);

                    completionQuery.copyRowSkipping(query);
                    completionQuery.copyRowLimit(query);
                    completionQuery.copyRowOffset(query);
                }
                if(query.hasLabels()) {
                    dataSourceQuery.setLabels(null);
                    QueryLabels labels = query.getLabels();
                    QueryLabels newLabels = new QueryLabels();
                    for(AbstractColumn column : labels.getColumns()) {
                        newLabels.addLabel(new SimpleColumn(column.getId()), labels.getLabel(column));
                    }
                    completionQuery.setLabels(newLabels);
                }
                if(query.hasUserFormatOptions()) {
                    dataSourceQuery.setUserFormatOptions(null);
                    QueryFormat formats = query.getUserFormatOptions();
                    QueryFormat newFormats = new QueryFormat();
                    for(AbstractColumn column : formats.getColumns()) {
                        newFormats.addPattern(new SimpleColumn(column.getId()), formats.getPattern(column));
                    }
                    completionQuery.setUserFormatOptions(newFormats);
                }
            }
            catch(InvalidQueryException e) {
View Full Code Here

Examples of com.inmethod.grid.column.AbstractColumn

                                   WebMarkupContainer rowComponent) {
                target.addComponent(feedback);
            }
        });

        columns.add(new AbstractColumn("move", new ResourceModel("move")) {
            @Override
            public Component newCell(WebMarkupContainer parent, String componentId, IModel rowModel) {
                final AbstractColumn column = this;
                return new MovePanel(componentId, rowModel) {
                    @Override
                    protected DataGrid getGrid() {
                        return (DataGrid) column.getGrid();
                    }
                };
            }
        }.setInitialSize(5).setSizeUnit(SizeUnit.EM).setResizable(false));
View Full Code Here

Examples of org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn

                public Iterator iterator(int first, int count)
                {
                    return new ArrayList(profilingRule.getRuleCriteria()).subList(first, first + count).iterator();
                }
            };
            IColumn[] columns = { new AbstractColumn(new Model("Name")) {

                public void populateItem(Item cellItem, String componentId, IModel rowModel) {
                    //cellItem.add(new CriterionLink(componentId, rowModel));
                    cellItem.add(new ActionPanel(componentId, rowModel, new Link("link", rowModel) {
                        public void onClick()
View Full Code Here

Examples of org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn

   */
  public DataTablePage()
  {
    List columns = new ArrayList();

    columns.add(new AbstractColumn(new Model("Actions"))
    {
      public void populateItem(Item cellItem, String componentId, IModel model)
      {
        cellItem.add(new ActionPanel(componentId, model));
      }
View Full Code Here

Examples of org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn

   * Constructor.
   */
  public AjaxDataTablePage() {
    List columns = new ArrayList();

    columns.add(new AbstractColumn(new Model("Actions"))
    {
      public void populateItem(Item cellItem, String componentId, IModel model)
      {
        cellItem.add(new ActionPanel(componentId, model));
      }
View Full Code Here

Examples of org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn

   */
  public DataTablePage()
  {
    List<IColumn> columns = new ArrayList<IColumn>();

    columns.add(new AbstractColumn(new Model("Actions"))
    {
      public void populateItem(Item cellItem, String componentId, IModel model)
      {
        cellItem.add(new ActionPanel(componentId, model));
      }
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.