Examples of ColumnLabels


Examples of core.ColumnLabels

    private Relation resultRelation;
    private ColumnLabels labels;

    public Result() {
        formulas = new Formulas();
        labels = new ColumnLabels();
        dummyRelation = Utils.getCaf().getEmptyRelation();
        resultRelation = Utils.getCaf().getEmptyRelation();
    }
View Full Code Here

Examples of core.ColumnLabels

    private static final class BasicSpreadsheetLayout implements SpreadsheetLayout {

        @Override
        public void populateSheet(ExcelFileFormulas eff, Result result) {
            Formulas forms = result.getFormulas();
            ColumnLabels labels = result.getLabels();
            Sheet s = eff.s;
            Cell c;

            Row[] row = new Row[]{s.getRow(0), s.getRow(1)};

            for (Entry<core.Cell, String> entry : forms.entrySet()) {
                c = row[entry.getKey().getRow() - 1].createCell(entry.getKey().getColumn() - 1);
                c.setCellType(XSSFCell.CELL_TYPE_FORMULA);
                c.setCellFormula(entry.getValue());
//                System.out.println(c.getColumnIndex()+"-"+c.getRowIndex());
//                System.out.println(entry.getValue());
//                c.setCellValue(entry.getValue());
            }

            Drawing drawing = s.createDrawingPatriarch();
            CreationHelper factory = eff.wb.getCreationHelper();
            for (Column col : labels) {
//                System.out.println("label="+(c.getNumber()-1));
//                System.out.println( Arrays.toString(labels.get(c).toArray(new String[0])));
//                System.out.println(r[0]);
//                System.out.println(r[0].getCell(c.getNumber()-1));
                eff.addAllCommentsToOneCell(drawing, factory, row[0].getCell(col.getNumber()-1), labels.get(col).toArray(new String[0]));
            }
        }
View Full Code Here

Examples of core.ColumnLabels

            for (Term inputTable : inputTables) {
                // add input tables to {@link results} so that they get borders
                // also add labels with column names
                // TODO refactor this and move to QuietSpreadsheetLayout
                Result result = inputTable.execute();
                ColumnLabels labels = result.getLabels();
                String tableName = tableNamesIter.next();
                ColumnNamesImpl cn = databaseSchema.schemaTable(tableName);
                ColumnIndexesImpl ci = cn.asColumnIndexesLookup();
                Iterator<SimpleColumn> scs = ci.iterator();
                for (Column c : result.getResultRelation()) {
                    SimpleColumn sc = scs.next();
                    labels.put(c, tableName+"."+sc.name());
                }

                results.add(result);
            }

            // add the SQL query to the comments for the result columns
            // TODO add column name or expression
            // TODO add only one formula's sql code, not all sql formulas' codes
            // TODO make sure the comment is wide enough so that no wrapping occurs
            String sourceComment = "|--SQL query:\n"+sqlSource;
            sourceComment = sourceComment.replace("\n", "\n|   ");
            for (Term formula : formulas) {
                // TODO refactor this and move to QuietSpreadsheetLayout
                Result result = formula.execute();
                ColumnLabels labels = result.getLabels();
                Relation resultRelation = result.getResultRelation();
                for (Column col : resultRelation) {
                    labels.put(col, sourceComment);
                }
                results.add(result);
            }

            // TODO move the following inner try block outside the outer try block
View Full Code Here

Examples of pl.zgora.uz.wmie.fe.action.ColumnLabels

    return EVAL_BODY_INCLUDE;
  }

  public int doEndTag() throws JspException {
    String findClickAction = "";
    ColumnLabels label=new ColumnLabels();
    String labelText="";
    String findClickActionSort = "";
    try {
      Writer out = pageContext.getOut();
      out.write("<div id=\"" + id
          + "ContentField\" class=\"tableContentField\">");
     
      out.write("<input type=\"hidden\" id=\"" + this.id
          + "Sort\" value=\""+this.defaultColumnSort+"\"> "
          + "<input type=\"hidden\" id=\"" + this.id
          + "SortDir\" value=\""+this.defaultColumnSortDir+"\">");
     
      out.write("<div id=\"" + id
          + "FilterField\" class=\"tableFilterField\">");

      for (FilterBean element : filters) {
        String filerHtml =element.getBody().replace(element.getName(), element.getName()+id);
        String filterId = element.getName() + id;
        out.write(filerHtml);
        if (!"".equals(filtersArrayJS)) {
          filtersArrayJS = filtersArrayJS + ",'" + filterId
              + "'";
        } else {
          filtersArrayJS = "'" + filterId + "'";
        }
      }
     
     
      String projections = "";
      for (ColumnBean columnBean : columnList) {
        if (!ValidatorUtil.isBlankOrNull(projections)) {
          projections += ",";
        }
        projections = projections + "'" + columnBean.getColumn() + "'";
      }
      findClickAction = "\"tableRefresh('" + id + "',new Array("
          + filtersArrayJS + "),new Array(" + projections + "), "
          + tableAjaxActionClass + "." + tableAjaxActionMethod
          + ")\"";
      out.write("<button id=\"" + id + "FindButton\" onclick="
          + findClickAction + ">znajdz</button>");
      out.write("</div>");
      String filterParameter = "div#" + id + "ContentField div#" + id
          + "FilterField";
      out.write("<table id=\"" + id
          + "\" border=\"1\" class=\"standardTable\">");
      if (title != null) {
        out.write("<caption onclick=\"switchFilter('" + filterParameter
            + "')\">" + title);
        out.write("<button  class=\"filterTableButton\"></button>");
        out.write("</caption>");
      }
      out.write("<tr>");
      for (ColumnBean columnBean : columnList) {
        //wyswietla label jesli nie ma w tablicy wartosci odpowiadajacych
        //parametrom. Mozna zmodyfikowac, do wyswietlania komunikatu.
        if (columnBean.getLabel()==null) {
            labelText=label.getLabelByName(columnBean.getColumn(),columnBean.getSource());
          }
          else {
            labelText=(columnBean.getLabel())
          }
       
View Full Code Here

Examples of pl.zgora.uz.wmie.fe.action.ColumnLabels

  }

  @Override
  public int doStartTag() throws JspException {
    try {
      ColumnLabels label=new ColumnLabels();
      Writer out = pageContext.getOut();
      //System.out.print("poszlo");
      out.write(label.getLabelByName(id, source));
      //out.write("TEST");
    } catch (Exception e) {
      throw new JspTagException("IO Error: " + e.getMessage());
    }
    return SKIP_BODY;
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.