KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > processor > form > ControlContainer


1 package org.apache.slide.projector.processor.form;
2
3 import org.apache.slide.projector.ConfigurationException;
4 import org.apache.slide.projector.descriptor.ParameterDescriptor;
5 import org.apache.slide.projector.descriptor.StringValueDescriptor;
6 import org.apache.slide.projector.i18n.ParameterMessage;
7 import org.apache.slide.projector.value.StreamableValue;
8
9 public class ControlContainer extends Control {
10     private final static String JavaDoc CONTROL = "control";
11
12     private ParameterDescriptor[] parameterDescriptors;
13
14     public ParameterDescriptor[] getParameterDescriptors() {
15         return parameterDescriptors;
16     }
17
18     public void configure(StreamableValue config) throws ConfigurationException {
19         super.configure(config);
20         ParameterDescriptor[] parentParameterDescriptors = super.getParameterDescriptors();
21         parameterDescriptors = new ParameterDescriptor[parentParameterDescriptors.length - 2];
22         int counter = 0;
23         for ( int i = 0; i < parentParameterDescriptors.length; i++ ) {
24             if (!parentParameterDescriptors[i].getName().equals(ACTION)
25                     && !parentParameterDescriptors[i].getName().equals(PARAMETER)
26                     && !parentParameterDescriptors[i].getName().equals(VALUE)) {
27                 parameterDescriptors[counter] = parentParameterDescriptors[i];
28                 counter++;
29             }
30         }
31         parameterDescriptors[parentParameterDescriptors.length - 3] =
32                 new ParameterDescriptor(CONTROL, new ParameterMessage("controlContainer/control"), new StringValueDescriptor());
33     }
34 }
Popular Tags