Examples of Field


Examples of org.pentaho.jfreereport.castormodel.reportspec.Field

    int totalWidth = reportSpec.getLeftMargin() + reportSpec.getRightMargin();
    List groupsList = new LinkedList();
    List details = new LinkedList();
    // leading spacer
    if ( spacerWidth > 0 ) {
      Field spacer = new Field();
      spacer.setName( "" ); //$NON-NLS-1$
      spacer.setDisplayName( "" ); //$NON-NLS-1$
      spacer.setType( Types.VARCHAR );
      spacer.setFormat( "" ); //$NON-NLS-1$
      spacer.setHorizontalAlignment( "right" ); //$NON-NLS-1$
      spacer.setVerticalAlignment( "middle" ); //$NON-NLS-1$
      spacer.setWidth( new BigDecimal( spacerWidth ) );
      spacer.setWidthLocked( true );
      totalWidth += spacerWidth;
      spacer.setExpression( "none" ); //$NON-NLS-1$
      spacer.setIsWidthPercent( false );
      spacer.setIsDetail( true );
      reportSpec.addField( spacer );
    }
    for ( int i = 0; i < colHeaders.length; i++ ) {
      // System.out.println("header [" + i + "] = " + colHeaders[i]);
      Class typeClass = null;
      for ( int j = 0; j < resultSet.getRowCount(); j++ ) {
        Object value = resultSet.getValueAt( j, i );
        if ( ( value != null ) && !value.toString().equals( "" ) ) { //$NON-NLS-1$
          typeClass = value.getClass();
        }
      }
      String columnName = colHeaders[i].toString();
      Field f = new Field();
      f.setName( columnName );
      f.setNullString( getNullString() );
      if ( isGroup( columnName ) ) {
        f.setDisplayName( getGroupLabel( columnName, i ) );
      } else if ( i < displayNames.length ) {
        f.setDisplayName( displayNames[i] );
      } else {
        f.setDisplayName( columnName );
      }
      f.setIsWidthPercent( false );
      f.setWidth( new BigDecimal( getWidth( columnName ) ) );
      f.setWidthLocked( true );
      f.setIsDetail( !isGroup( columnName ) );
      if ( f.getIsDetail() ) {
        details.add( f );
      } else {
        groupsList.add( f );
      }
      f.setBackgroundColor( "#FFFFFF" ); //$NON-NLS-1$
      f.setType( getType( typeClass ) );
      if ( ( itemHides == null ) || ( itemHides.length == 0 ) ) {
        f.setUseItemHide( getType( typeClass ) == Types.NUMERIC ? false : true );
      } else {
        f.setUseItemHide( useItemHide( columnName ) );
      }
      f.setVerticalAlignment( "middle" ); //$NON-NLS-1$
      f.setFormat( getColumnFormat( columnName ) );
      String alignment = getColumnAlignment( columnName );
      if ( alignment != null ) {
        f.setHorizontalAlignment( alignment );
      } else {
        if ( f.getIsDetail() && ( f.getType() == Types.NUMERIC ) ) {
          f.setHorizontalAlignment( "right" ); //$NON-NLS-1$
        }
      }
      if ( f.getIsDetail() && ( f.getType() == Types.NUMERIC ) ) {
        f.setExpression( "sum" ); //$NON-NLS-1$
      } else {
        f.setExpression( "none" ); //$NON-NLS-1$
      }
      f.setCalculateGroupTotals( createSubTotals );
      reportSpec.addField( f );
      if ( ( spacerWidth > 0 ) && f.getIsDetail() ) {
        // spacer
        Field spacer = new Field();
        spacer.setName( "" ); //$NON-NLS-1$
        spacer.setDisplayName( "" ); //$NON-NLS-1$
        spacer.setType( Types.VARCHAR );
        spacer.setFormat( "" ); //$NON-NLS-1$
        spacer.setHorizontalAlignment( "right" ); //$NON-NLS-1$
        spacer.setVerticalAlignment( "middle" ); //$NON-NLS-1$
        spacer.setWidth( new BigDecimal( spacerWidth ) );
        spacer.setWidthLocked( true );
        totalWidth += spacerWidth;
        spacer.setExpression( "none" ); //$NON-NLS-1$
        spacer.setIsWidthPercent( false );
        spacer.setIsDetail( true );
        reportSpec.addField( spacer );
      }
    }
    for ( int i = 0; i < details.size(); i++ ) {
      Field f = (Field) details.get( i );
      totalWidth += f.getWidth().intValue();
    }
    if ( createTotalColumn ) {
      Field f = new Field();
      f.setName( "TOTAL_COLUMN" ); //$NON-NLS-1$
      f.setDisplayName( totalColumnName );
      f.setType( Types.NUMERIC );
      f.setFormat( totalColumnFormat );
      f.setHorizontalAlignment( "right" ); //$NON-NLS-1$
      f.setVerticalAlignment( "middle" ); //$NON-NLS-1$
      f.setWidth( new BigDecimal( totalColumnWidth ) );
      f.setWidthLocked( true );
      f.setExpression( "sum" ); //$NON-NLS-1$
      f.setIsWidthPercent( false );
      f.setIsDetail( true );
      reportSpec.addField( f );
      totalWidth += totalColumnWidth;
      if ( spacerWidth > 0 ) {
        // spacer
        Field spacer = new Field();
        spacer.setName( "" ); //$NON-NLS-1$
        spacer.setDisplayName( "" ); //$NON-NLS-1$
        spacer.setType( Types.VARCHAR );
        spacer.setFormat( "" ); //$NON-NLS-1$
        spacer.setHorizontalAlignment( "right" ); //$NON-NLS-1$
        spacer.setVerticalAlignment( "middle" ); //$NON-NLS-1$
        spacer.setWidth( new BigDecimal( spacerWidth ) );
        spacer.setWidthLocked( true );
        totalWidth += spacerWidth;
        spacer.setExpression( "none" ); //$NON-NLS-1$
        spacer.setIsWidthPercent( false );
        spacer.setIsDetail( true );
        reportSpec.addField( spacer );
      }
    }
    try {
      reportSpec.setUseCustomPageFormat( true );
View Full Code Here

Examples of org.rascalmpl.ast.Field

    int nFields = selectedFields.length;
    int fieldIndices[] = new int[nFields];
    Type baseType = this.getType();
   
    for (int i = 0; i < nFields; i++) {
      Field f = selectedFields[i];
      if (f.isIndex()) {
        fieldIndices[i] = ((IInteger) f.getFieldIndex()
            .interpret(this.ctx.getEvaluator()).getValue()).intValue();
      } else {
        String fieldName = org.rascalmpl.interpreter.utils.Names
            .name(f.getFieldName());
        try {
          fieldIndices[i] = baseType.getFieldIndex(fieldName);
        } catch (UndeclaredFieldException e) {
          throw new UndeclaredField(fieldName, baseType,
              ctx.getCurrentAST());
View Full Code Here

Examples of org.shiftone.jrat.util.io.csv.field.Field

    current = new String[delimitedFormat.getFieldCount()];
  }

  public void setValue(int fieldIndex, Object value) {

    Field field = delimitedFormat.getField(fieldIndex);
    current[fieldIndex] = field.format(value);
  }
View Full Code Here

Examples of org.springframework.data.elasticsearch.annotations.Field

        for(java.lang.reflect.Field field : fields){
            if(isEntity(field)){
                mapEntity(xContentBuilder, field.getType(), false, EMPTY, field.getName());
            }
            Field fieldAnnotation = field.getAnnotation(Field.class);
            if(isRootObject && fieldAnnotation != null && isIdField(field, idFieldName)){
                applyDefaultIdFieldMapping(xContentBuilder, field);
            }else if(fieldAnnotation != null){
                applyFieldAnnotationMapping(xContentBuilder, field, fieldAnnotation);
            }
View Full Code Here

Examples of org.springframework.data.solr.core.query.Field

      solrQuery.add(StatsParams.STATS_FACET, field.getName());
    }

    for (Entry<Field, Collection<Field>> entry : statsOptions.getSelectiveFacets().entrySet()) {

      Field field = entry.getKey();
      String prefix = CommonParams.FIELD + "." + field.getName() + ".";

      String paramName = prefix + StatsParams.STATS_FACET;
      for (Field facetField : entry.getValue()) {
        solrQuery.add(paramName, facetField.getName());
      }
View Full Code Here

Examples of org.tarantool.facade.annotation.Field

      beanInfo = Introspector.getBeanInfo(cls);
      PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
      Map<Integer, String> order = new HashMap<Integer, String>();
      int max = 0;
      for (PropertyDescriptor prop : descriptors) {
        Field read = prop.getReadMethod().getAnnotation(Field.class);
        Field write = prop.getReadMethod().getAnnotation(Field.class);
        if (read != null || write != null) {
          int fieldNo = read == null ? write.value() : read.value();
          if (order.put(fieldNo, prop.getName()) != null) {
            throw new IllegalArgumentException(fieldNo + " used more than once in " + cls);
          }
          if (fieldNo < 0) {
            throw new IllegalArgumentException(fieldNo + " should be non negative in " + cls);
View Full Code Here

Examples of org.thrudb.thrudex.Field

    return d;
  }

  private void addField(Document doc, String key, String value, int type) {
    Field field = new Field();
    field.setKey(key);
    field.setValue(value);
    field.setType(type);

    doc.getFields().add(field);
  }
View Full Code Here

Examples of org.xBaseJ.micro.fields.Field

   */

  public void addField(Field aField)
    throws xBaseJException, IOException
  {
    Field bField[] = new Field[1];
    bField[0] = aField;
    addField(bField);

  }
View Full Code Here

Examples of play.data.Form.Field

  public java.lang.reflect.Field field() {
    return fieldMetadata.getField();
  }

  public Html render(Form<?> form) {
    Field formField = form.field(fieldName);

    Lang lang = getLang();
    FieldConstructor fc = new FieldConstructor() {
      public Html apply(FieldElements elements) {
        return twitterBootstrapFieldConstructor.apply(elements);
View Full Code Here

Examples of pt.opensoft.dbaccess.Field

    if (fieldNames == null || fieldNames.length == 0) return false;

    boolean equal = true;
    for (int i = 0; i < fieldNames.length; i++) {
      String fieldName = fieldNames[i];
      Field fldThis = this.record.getField(fieldName);
      Field fldOther = other.record.getField(fieldName);
      if (fldThis == null || fldOther == null) return false;

      if (fldThis.getObject() instanceof BigDecimal && fldOther.getObject() instanceof BigDecimal) { // caso especial BigDecimal
        equal &= fldThis.getBigDecimal().compareTo(fldOther.getBigDecimal()) == 0;

      } else if (fldThis.getObject() instanceof BigInteger && fldOther.getObject() instanceof BigInteger) { // caso especial BigInteger
        equal &= fldThis.getBigInteger().compareTo(fldOther.getBigInteger()) == 0;

            } else if (fldThis.getObject() instanceof Date && fldOther.getObject() instanceof Date) {
                equal &= fldThis.getDate().equals(fldOther.getDate());

      } else { // caso comum
        String strThis = fldThis.getString();
        String strOther = fldOther.getString();
        if (strThis == null && strOther != null) return false;
        if (strThis != null && strOther == null) return false;
        if (strThis != null && strOther != null) {
          equal &= strThis.equals(strOther);
        }
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.