01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.internal;
16:
17: import java.util.Arrays;
18: import java.util.List;
19:
20: import org.apache.tapestry.OptionGroupModel;
21: import org.apache.tapestry.OptionModel;
22: import org.apache.tapestry.util.AbstractSelectModel;
23:
24: public final class SelectModelImpl extends AbstractSelectModel {
25: private final List<OptionGroupModel> _optionGroups;
26:
27: private final List<OptionModel> _optionModels;
28:
29: public SelectModelImpl(final List<OptionGroupModel> optionGroups,
30: final List<OptionModel> optionModels) {
31: _optionGroups = optionGroups;
32: _optionModels = optionModels;
33: }
34:
35: public SelectModelImpl(OptionModel... optionModels) {
36: this (null, Arrays.asList(optionModels));
37: }
38:
39: public SelectModelImpl(OptionGroupModel... groupModels) {
40: this (Arrays.asList(groupModels), null);
41: }
42:
43: public List<OptionGroupModel> getOptionGroups() {
44: return _optionGroups;
45: }
46:
47: public List<OptionModel> getOptions() {
48: return _optionModels;
49: }
50:
51: }
|