private void loadFormParameters( Map formParameters, FormControl[] controls ) { for (int i = 0; i < controls.length; i++) { if (controls[i].getName().length() == 0) continue; FormParameter parameter = (FormParameter) formParameters.get( controls[i].getName() ); if (parameter == null) { parameter = new FormParameter(); formParameters.put( controls[i].getName(), parameter ); } parameter.addControl( controls[i] ); } }
/** * get the control for this form Parameter (assuming it * has only one as for a text control * @return the controls */ public FormControl getControl() { FormControl[] controls=getControls(); if (controls.length!=1) { throw new RuntimeException("getControl can only be called if the number of controls is 1 but it is "+controls.length+" you might want to use getControls instead"); } return controls[0]; }
/** * Returns the number of text parameters in this form with the specified name. **/ public int getNumTextParameters( String name ) { return getParameter( name ).getNumTextParameters(); }
public void setParameterValue( String name, String value ) { final Object scriptableObject = getParameter( name ).getScriptableObject(); if (scriptableObject instanceof ScriptableDelegate) { ((ScriptableDelegate) scriptableObject).set( "value", value ); } else if (scriptableObject instanceof ScriptableDelegate[]) { ((ScriptableDelegate[]) scriptableObject)[0].set( "value", value ); } }
/** * Returns true if the named parameter is disabled. If more than one control exists with the same name, * will return true only if all such controls are read-only. **/ public boolean isDisabledParameter( String name ) { return getParameter( name ).isDisabledParameter(); }
void addControl( FormControl control ) { _controls = null; if (_name == null) _name = control.getName(); if (!_name.equalsIgnoreCase( control.getName() )) throw new RuntimeException( "all controls should have the same name" ); if (control.isExclusive()) { getRadioGroup( control.getForm() ).addRadioButton( (RadioButtonFormControl) control ); } else { _controlList.add( control ); } }
/** * Returns the option values defined for the specified parameter name. **/ public String[] getOptionValues( String name ) { return getParameter( name ).getOptionValues(); }
/** * Returns the displayed options defined for the specified parameter name. **/ public String[] getOptions( String name ) { return getParameter( name ).getOptions(); }
/** * Returns the multiple default values of the named parameter. **/ public String[] getParameterValues( String name ) { final FormParameter parameter = getParameter( name ); return parameter.getValues(); }
public void setParameterValue( String name, String value ) { final Object scriptableObject = getParameter( name ).getScriptableObject(); if (scriptableObject instanceof ScriptableDelegate) { ((ScriptableDelegate) scriptableObject).set( "value", value ); } else if (scriptableObject instanceof ScriptableDelegate[]) { ((ScriptableDelegate[]) scriptableObject)[0].set( "value", value ); } }
/** * Returns true if the named parameter is disabled. If more than one control exists with the same name, * will return true only if all such controls are read-only. **/ public boolean isDisabledParameter( String name ) { return getParameter( name ).isDisabledParameter(); }
void addControl( FormControl control ) { _controls = null; if (_name == null) _name = control.getName(); if (!_name.equalsIgnoreCase( control.getName() )) throw new RuntimeException( "all controls should have the same name" ); if (control.isExclusive()) { getRadioGroup( control.getForm() ).addRadioButton( (RadioButtonFormControl) control ); } else { _controlList.add( control ); } }
/** * Returns the option values defined for the specified parameter name. **/ public String[] getOptionValues( String name ) { return getParameter( name ).getOptionValues(); }
/** * Returns the displayed options defined for the specified parameter name. **/ public String[] getOptions( String name ) { return getParameter( name ).getOptions(); }
/** * Returns the multiple default values of the named parameter. **/ public String[] getParameterValues( String name ) { final FormParameter parameter = getParameter( name ); return parameter.getValues(); }
/** * get the control for this form Parameter (assuming it * has only one as for a text control * @return the controls */ public FormControl getControl() { FormControl[] controls=getControls(); if (controls.length!=1) { throw new RuntimeException("getControl can only be called if the number of controls is 1 but it is "+controls.length+" you might want to use getControls instead"); } return controls[0]; }
private void loadFormParameters( Map formParameters, FormControl[] controls ) { for (int i = 0; i < controls.length; i++) { if (controls[i].getName().length() == 0) continue; FormParameter parameter = (FormParameter) formParameters.get( controls[i].getName() ); if (parameter == null) { parameter = new FormParameter(); formParameters.put( controls[i].getName(), parameter ); } parameter.addControl( controls[i] ); } }
public void setParameterValue( String name, String value ) { final Object scriptableObject = getParameter( name ).getScriptableObject(); if (scriptableObject instanceof ScriptableDelegate) { ((ScriptableDelegate) scriptableObject).set( "value", value ); } else if (scriptableObject instanceof ScriptableDelegate[]) { ((ScriptableDelegate[]) scriptableObject)[0].set( "value", value ); } }
/** * Returns true if the named parameter is disabled. If more than one control exists with the same name, * will return true only if all such controls are read-only. **/ public boolean isDisabledParameter( String name ) { return getParameter( name ).isDisabledParameter(); }
void addControl( FormControl control ) { _controls = null; if (_name == null) _name = control.getName(); if (!_name.equalsIgnoreCase( control.getName() )) throw new RuntimeException( "all controls should have the same name" ); if (control.isExclusive()) { getRadioGroup( control.getForm() ).addRadioButton( (RadioButtonFormControl) control ); } else { _controlList.add( control ); } }