public StringEvaluator( boolean tryTrimming ) { this( tryTrimming, DEFAULT_NUMBER_FORMATS, Const.getDateFormats() ); }
/** * @return An array of all default conversion formats, to be used in dialogs etc. */ public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; }
public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) { String[] comboValues = new String[] {}; int type = ValueMetaFactory.getIdForValueMeta( tableItem.getText( colNr - 1 ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: comboValues = Const.getDateFormats(); break; case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: comboValues = Const.getNumberFormats(); break; default: break; } return comboValues; }
public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) { String[] comboValues = new String[] {}; int type = ValueMetaFactory.getIdForValueMeta( tableItem.getText( colNr - 1 ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: comboValues = Const.getDateFormats(); break; case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: comboValues = Const.getNumberFormats(); break; default: break; } return comboValues; }
public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) { String[] comboValues = new String[] {}; int type = ValueMetaFactory.getIdForValueMeta( tableItem.getText( colNr - 1 ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: comboValues = Const.getDateFormats(); break; case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: comboValues = Const.getNumberFormats(); break; default: break; } return comboValues; }
public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) { String[] comboValues = new String[] {}; int type = ValueMetaFactory.getIdForValueMeta( tableItem.getText( colNr - 1 ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: comboValues = Const.getDateFormats(); break; case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: comboValues = Const.getNumberFormats(); break; default: break; } return comboValues; }
@Override public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) { String[] comboValues = new String[] { }; int type = ValueMeta.getType( tableItem.getText( colNr - 1 ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: comboValues = Const.getDateFormats(); break; case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: comboValues = Const.getNumberFormats(); break; default: break; } return comboValues; }
private String[] getComboValues( TableItem row, ColumnInfo colinfo ) { if ( colinfo.getType() == ColumnInfo.COLUMN_TYPE_FORMAT ) { int type = ValueMetaFactory.getIdForValueMeta( row.getText( colinfo.getFieldTypeColumn() ) ); switch ( type ) { case ValueMetaInterface.TYPE_DATE: return Const.getDateFormats(); case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_NUMBER: return Const.getNumberFormats(); case ValueMetaInterface.TYPE_STRING: return Const.getConversionFormats(); default: return new String[0]; } } return colinfo.getComboValues(); }
boolean[][] dateFormat = new boolean[nrfields][Const.getDateFormats().length]; // What are the date formats that Date[][] minDate = new Date[nrfields][Const.getDateFormats().length]; // min date value Date[][] maxDate = new Date[nrfields][Const.getDateFormats().length]; // max date value double[][] minValue = new double[nrfields][Const.getDateFormats().length]; // min number value double[][] maxValue = new double[nrfields][Const.getDateFormats().length]; // max number value int[][] numberPrecision = new int[nrfields][Const.getNumberFormats().length]; // remember the precision? int[][] numberLength = new int[nrfields][Const.getNumberFormats().length]; // remember the length? for ( int j = 0; j < Const.getDateFormats().length; j++ ) { dateFormat[i][j] = true; minDate[i][j] = Const.MAX_DATE; maxDate[i][j] = Const.MIN_DATE; dateFormatCount[i] = Const.getDateFormats().length; for ( int x = 0; x < Const.getDateFormats().length; x++ ) { if ( dateFormat[i][x] ) { message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateFormat2", Const .getDateFormats()[x] ) ); Date mindate = minDate[i][x]; Date maxdate = maxDate[i][x]; daf2.applyPattern( Const.getDateFormats()[x] ); try { Date md = daf2.parse( minstr[i] ); message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateExample", Const .getDateFormats()[x], minstr[i], md.toString() ) );
boolean[][] dateFormat = new boolean[nrfields][Const.getDateFormats().length]; // What are the date formats that Date[][] minDate = new Date[nrfields][Const.getDateFormats().length]; // min date value Date[][] maxDate = new Date[nrfields][Const.getDateFormats().length]; // max date value double[][] minValue = new double[nrfields][Const.getDateFormats().length]; // min number value double[][] maxValue = new double[nrfields][Const.getDateFormats().length]; // max number value int[][] numberPrecision = new int[nrfields][Const.getNumberFormats().length]; // remember the precision? int[][] numberLength = new int[nrfields][Const.getNumberFormats().length]; // remember the length? for ( int j = 0; j < Const.getDateFormats().length; j++ ) { dateFormat[i][j] = true; minDate[i][j] = Const.MAX_DATE; maxDate[i][j] = Const.MIN_DATE; dateFormatCount[i] = Const.getDateFormats().length; for ( int x = 0; x < Const.getDateFormats().length; x++ ) { if ( dateFormat[i][x] ) { message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateFormat2", Const.getDateFormats()[x] ) ); Date mindate = minDate[i][x]; Date maxdate = maxDate[i][x]; daf2.applyPattern( Const.getDateFormats()[x] ); try { Date md = daf2.parse( minstr[i] ); message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateExample", Const.getDateFormats()[x],
new ColumnInfo( BaseMessages.getString( PKG, "SetValueConstantDialog.Value.ConversionMask" ), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getDateFormats() ); colinf[3] = new ColumnInfo(
new ColumnInfo( BaseMessages.getString( PKG, "IfNullDialog.Value.ConversionMask" ), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getDateFormats() ); colinf[1].setUsingVariables( true ); colinf[3] =
wMask = new CCombo( wAllFields, SWT.BORDER | SWT.READ_ONLY ); wMask.setEditable( true ); wMask.setItems( Const.getDateFormats() ); props.setLook( wMask ); wMask.addModifyListener( lsMod ); new ColumnInfo( BaseMessages.getString( PKG, "IfNullDialog.Value.ConversionMask" ), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getDateFormats() ); colval[3] = new ColumnInfo(
wFormat.setItems( Const.getDateFormats() ); index = ( !Utils.isEmpty( formatString ) ) ? wFormat.indexOf( formatString ) : wFormat
String[] dats = Const.getDateFormats();
new ColumnInfo( BaseMessages.getString( PKG, "DataGridDialog.Format.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getDateFormats() ), new ColumnInfo( BaseMessages.getString( PKG, "DataGridDialog.Length.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ),
String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length;
wlDatePattern.setLayoutData( fdlDatePattern ); wDatePattern = new ComboVar( transMeta, wLogSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER ); wDatePattern.setItems( Const.getDateFormats() ); props.setLook( wDatePattern ); fdDatePattern = new FormData();
wMask.setItems( Const.getDateFormats() ); wMask.setEditable( true ); props.setLook( wMask );
wlDatePattern.setLayoutData( fdlDatePattern ); wDatePattern = new ComboVar( jobMeta, wMessageGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER ); wDatePattern.setItems( Const.getDateFormats() ); props.setLook( wDatePattern ); fdDatePattern = new FormData();