Package jimm.datavision.source

Examples of jimm.datavision.source.Column


      case '%':    // Special field
      case '@':    // Formula
      case '?':    // Parameter
    break;    // ...all are ignored
      default:
    Column col = report.findColumn(str);
    if (col != null// May be null if language uses braces
        list.add(col);
      }
      return "";    // So we don't quit early
  }},
View Full Code Here


}

public void findSelectablesUsed() {
    super.findSelectablesUsed();
    for (Iterator iter = objectCols.iterator(); iter.hasNext(); ) {
  Column col = (Column)iter.next();
  if (!selectables.contains(col)) selectables.add(col);
    }
}
View Full Code Here

    // Walk the list of all columns used by the report, adding the table
    // to the sorted set of tables.
    report.withFieldsDo(new FieldWalker() {
  public void step(Field f) {
      if (f instanceof ColumnField) {
    Column col = ((ColumnField)f).getColumn();
    Table t = col.getTable();
    if (t == null)
        noTableCols.add(col);
    else
        tables.add(t);
      }
  }
  });

    // Add tables and columns under tables
    for (Iterator iter = tables.iterator(); iter.hasNext(); )
  addTableNode(categoryNode,  (Table)iter.next());

    // Add colums that have no table
    for (Iterator iter = noTableCols.iterator(); iter.hasNext(); ) {
  Column column = (Column)iter.next();
  ColumnInfo info = new ColumnInfo(column, designer);
  categoryNode.add(new DefaultMutableTreeNode(info, false));
    }
}
View Full Code Here

    for (iter = tables.iterator(); iter.hasNext(); )
  addTableNode(categoryNode, (Table)iter.next());

    // Add nodes for columns that have no table
    for (iter = noTableCols.iterator(); iter.hasNext(); ) {
  Column column = (Column)iter.next();
  ColumnInfo info = new ColumnInfo(column, designer);
  categoryNode.add(new DefaultMutableTreeNode(info, false));
    }
}
View Full Code Here

    // Remove table node's existing dummy child node.
    tableNode.remove(0);

    // Add columns.
    for (Iterator iter = table.columns(); iter.hasNext(); ) {
  Column column = (Column)iter.next();
  ColumnInfo info = new ColumnInfo(column, designer);
  tableNode.add(new DefaultMutableTreeNode(info, false));
    }

    // A signal that we have loaded the columns.
View Full Code Here

    // If this is a detail section and the field represents a database
    // column, add a title field whose name is the name of the column.
    SectionWidget sw = fw.getSectionWidget();
    Field f = fw.getField();
    if (sw.getSection().isDetail() && (f instanceof ColumnField)) {
  Column col = (Column)((ColumnField)f).getColumn();
  String name = col.getName();
  name = name.substring(0, 1).toUpperCase()
      + name.substring(1).toLowerCase();

  // The title section resize command may not be used.
  Section titleSection = f.getReport().pageHeaders().first();
View Full Code Here

    if (str == null) return null;

    // Column values
    str = StringUtils.replaceDelimited("#", "{", "}", new Replacer() {
  public Object replace(String str) {
      Column col = report.findColumn(str);
      if (col == null)
    return "{" + str + "}";

      Object val = null;
      switch (col.getType()) {
      case java.sql.Types.CHAR:
      case java.sql.Types.VARCHAR:
      case java.sql.Types.DATE:
      case java.sql.Types.TIME:
      case java.sql.Types.TIMESTAMP:
View Full Code Here

  DataFlavor stringFlavor = DataFlavor.stringFlavor;
  Transferable tr = e.getTransferable();
  if (e.isDataFlavorSupported(stringFlavor)) {
      String str = (String)tr.getTransferData(stringFlavor);
      if (str.startsWith("column:")) {
    Column col = report.findColumn(str.substring(7));
    replaceSelection("{" + col.fullName() + "}");
      }
      else if (str.startsWith("parameter:")) {
    Parameter param = report.findParameter(str.substring(10));
    replaceSelection(param.designLabel());
      }
View Full Code Here

    // Now make the formula's expression a Ruby expression that "hides" a
    // column that isn't otherwise in the report. By "hide" I mean that a
    // simple search for "{" won't work; the formula will have to use its
    // "exceptAfter" ivar to ignore the "#{" Ruby expession start.
    f.setExpression("#{{aggregate_test.col1}}");
    Column col = report.findColumn("aggregate_test.col1");
    assertNotNull(col);
    q.findSelectablesUsed();
    assertTrue("col contained in Ruby string expression isn't in query",
         q.indexOfSelectable(col) >= 0);
}
View Full Code Here

public void testColumnInfo() {
    String[] colNames = { "office.name", "jobs.ID", "jobs.title",
        "jobs.hourly rate", "jobs.post_date" };
    for (int i = 0; i < colNames.length; ++i) {
  Column col;
  assertNotNull(col = dataSource.findColumn(colNames[i]));
  assertEquals(i, dataSource.indexOfSelectable(col));
    }
}
View Full Code Here

TOP

Related Classes of jimm.datavision.source.Column

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.