use of eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition in project hale by halestudio.
the class ParameterEditorFactoryImpl method getAssociatedParameter.
/**
* @see ParameterEditorFactory#getAssociatedParameter()
*/
@Override
public FunctionParameterDefinition getAssociatedParameter() {
if (associatedFunctionParameter == null) {
// get defined parameters
Collection<FunctionParameterDefinition> definedParameters = FunctionUtil.getFunction(getFunctionId(), HaleUI.getServiceProvider()).getDefinedParameters();
// search for defined parameter, add it to associated params
// XXX throw some exception if param name is not defined?
String name = getParameterName();
for (FunctionParameterDefinition definedParameter : definedParameters) {
if (definedParameter.getName().equals(name)) {
associatedFunctionParameter = definedParameter;
break;
}
}
}
return associatedFunctionParameter;
}
use of eu.esdihumboldt.hale.common.align.extension.function.FunctionParameterDefinition in project hale by halestudio.
the class ParameterPageFactoryImpl method getAssociatedParameters.
/**
* @see eu.esdihumboldt.hale.ui.function.extension.ParameterPageFactory#getAssociatedParameters()
*/
@Override
public Set<FunctionParameterDefinition> getAssociatedParameters() {
if (associatedFunctionParameters == null) {
Set<FunctionParameterDefinition> params = new HashSet<FunctionParameterDefinition>();
// get defined parameters
Collection<FunctionParameterDefinition> definedParameters = FunctionUtil.getFunction(getFunctionId(), HaleUI.getServiceProvider()).getDefinedParameters();
// walk over conf parameters
IConfigurationElement[] parameterElements = conf.getChildren("parameter");
for (IConfigurationElement parameterElement : parameterElements) {
// search for defined parameter, add it to associated params
// XXX throw some exception if param name is not defined?
String name = parameterElement.getAttribute("name");
for (FunctionParameterDefinition definedParameter : definedParameters) if (definedParameter.getName().equals(name)) {
params.add(definedParameter);
break;
}
}
associatedFunctionParameters = Collections.unmodifiableSet(params);
}
return associatedFunctionParameters;
}
Aggregations