public ConfigurationDialog( Shell parent, ExecutionConfiguration configuration, AbstractMeta meta ) { super( parent ); this.parent = parent; this.configuration = configuration; this.abstractMeta = meta; // Fill the parameters, maybe do this in another place? Map<String, String> params = configuration.getParams(); params.clear(); String[] paramNames = meta.listParameters(); for ( String name : paramNames ) { params.put( name, "" ); } props = PropsUI.getInstance(); }
if ( meta.listParameters() != null ) { sb.append( "<pdiParameters>\n" ); for ( String param : meta.listParameters() ) { sb.append( "<entry>\n" ); sb.append( "<key>" ).append( param ).append( "</key>\n" );
private void getVariablesData() { wVariables.clearAll( false ); List<String> variableNames = new ArrayList<String>( configuration.getVariables().keySet() ); Collections.sort( variableNames ); for ( int i = 0; i < variableNames.size(); i++ ) { String variableName = variableNames.get( i ); String variableValue = configuration.getVariables().get( variableName ); if ( Const.indexOfString( variableName, abstractMeta.listParameters() ) < 0 ) { TableItem tableItem = new TableItem( wVariables.table, SWT.NONE ); tableItem.setText( 1, variableName ); tableItem.setText( 2, Const.NVL( variableValue, "" ) ); } } wVariables.removeEmptyRows(); wVariables.setRowNums(); wVariables.optWidth( true ); }
@Override public void activateParameters() { String[] keys = listParameters(); for ( String key : keys ) { String value; try { value = getParameterValue( key ); } catch ( UnknownParamException e ) { value = ""; } String defValue; try { defValue = getParameterDefault( key ); } catch ( UnknownParamException e ) { defValue = ""; } if ( Utils.isEmpty( value ) ) { setVariable( key, defValue ); } else { setVariable( key, value ); } } }
}; String[] namedParams = abstractMeta.listParameters(); int nrParams = namedParams.length; wParams =
assertEquals( "z", meta.getParameterDefault( "var2" ) ); String[] params = meta.listParameters(); assertNotNull( params );