Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TabFolderRenderer |
|
| 0.0;0 |
1 | /* | |
2 | * Copyright 2004-2008 the Seasar Foundation and the Others. | |
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, | |
13 | * either express or implied. See the License for the specific language | |
14 | * governing permissions and limitations under the License. | |
15 | */ | |
16 | package org.seasar.uruma.renderer.impl; | |
17 | ||
18 | import org.eclipse.swt.widgets.TabFolder; | |
19 | import org.seasar.uruma.component.jface.TabFolderComponent; | |
20 | import org.seasar.uruma.context.PartContext; | |
21 | import org.seasar.uruma.context.WidgetHandle; | |
22 | ||
23 | /** | |
24 | * {@link TabFolder} のレンダリングを行うクラスです。<br /> | |
25 | * | |
26 | * @author bskuroneko | |
27 | */ | |
28 | 20 | public class TabFolderRenderer extends |
29 | AbstractCompositeRenderer<TabFolderComponent, TabFolder> { | |
30 | ||
31 | /* | |
32 | * @see org.seasar.uruma.renderer.impl.AbstractCompositeRenderer#doRenderComposite(org.seasar.uruma.component.jface.CompositeComponent, | |
33 | * org.eclipse.swt.widgets.Composite) | |
34 | */ | |
35 | @Override | |
36 | protected void doRenderComposite(final TabFolderComponent controlComponent, | |
37 | final TabFolder control) { | |
38 | // Do nothing. | |
39 | 8 | } |
40 | ||
41 | /* | |
42 | * @see org.seasar.uruma.renderer.impl.AbstractWidgetRenderer#doRenderAfter(org.eclipse.swt.widgets.Widget, | |
43 | * org.seasar.uruma.component.UIComponent, | |
44 | * org.seasar.uruma.context.WidgetHandle, | |
45 | * org.seasar.uruma.context.PartContext) | |
46 | */ | |
47 | @Override | |
48 | protected void doRenderAfter(final TabFolder widget, | |
49 | final TabFolderComponent uiComponent, final WidgetHandle parent, | |
50 | final PartContext context) { | |
51 | 8 | setSelection(uiComponent, widget); |
52 | 8 | } |
53 | ||
54 | private void setSelection(final TabFolderComponent controlComponent, | |
55 | final TabFolder control) { | |
56 | 8 | String value = controlComponent.selection; |
57 | 8 | if (value == null) { |
58 | 4 | return; |
59 | } | |
60 | 4 | control.setSelection(Integer.parseInt(value)); |
61 | 4 | } |
62 | ||
63 | /* | |
64 | * @see org.seasar.uruma.renderer.impl.AbstractWidgetRenderer#getWidgetType() | |
65 | */ | |
66 | @Override | |
67 | protected Class<TabFolder> getWidgetType() { | |
68 | 24 | return TabFolder.class; |
69 | } | |
70 | } |