1 | /** |
2 | * Copyright 2005-2011 Steve McDuff d-duff@users.sourceforge.net |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | package org.deduced.viewer.web.serializer; |
17 | |
18 | import java.io.Serializable; |
19 | |
20 | import org.deduced.PropertyCollection; |
21 | import org.deduced.viewer.model.implementation.TextBoxBaseImplementation; |
22 | import org.deduced.viewer.web.shared.TextBoxBaseModel; |
23 | |
24 | /** |
25 | * TextBoxBaseModel Serializer |
26 | * |
27 | * @author Steve McDuff |
28 | * |
29 | */ |
30 | public abstract class TextBoxBaseModelSerializer extends |
31 | FocusWidgetModelSerializer |
32 | { |
33 | /** |
34 | * fill TextBoxBaseModel |
35 | * |
36 | * @param model collection to serialize |
37 | * @param textBoxBaseModel model to fill |
38 | */ |
39 | public static void fillTextBoxBaseModel( |
40 | PropertyCollection<?, ?> model, TextBoxBaseModel textBoxBaseModel) |
41 | { |
42 | textBoxBaseModel |
43 | .setDirection(serializeEnumeration(TextBoxBaseImplementation |
44 | .getDirection(model))); |
45 | textBoxBaseModel.setReadOnly(TextBoxBaseImplementation |
46 | .isReadOnly(model).booleanValue()); |
47 | textBoxBaseModel.setText(TextBoxBaseImplementation.getText(model)); |
48 | textBoxBaseModel |
49 | .setTextAlignment(serializeEnumeration(TextBoxBaseImplementation |
50 | .getTextAlignment(model))); |
51 | } |
52 | |
53 | /** |
54 | * (non-JSDoc) |
55 | * |
56 | * @see org.deduced.viewer.web.serializer.FocusWidgetModelSerializer#fillSerializedObject(java.io.Serializable, |
57 | * org.deduced.PropertyCollection, |
58 | * org.deduced.viewer.web.serializer.MasterWebSerializer) |
59 | */ |
60 | @Override |
61 | public void fillSerializedObject( |
62 | Serializable serializedObject, PropertyCollection<?, ?> collection, |
63 | MasterWebSerializer masterSerializer) |
64 | { |
65 | fillTextBoxBaseModel(collection, (TextBoxBaseModel) serializedObject); |
66 | super.fillSerializedObject(serializedObject, collection, |
67 | masterSerializer); |
68 | } |
69 | } |