| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.seasar.uruma.component.factory.handler; |
| 17 | |
|
| 18 | |
import org.seasar.framework.xml.TagHandlerContext; |
| 19 | |
import org.seasar.uruma.component.LayoutDataInfo; |
| 20 | |
import org.seasar.uruma.component.LayoutInfo; |
| 21 | |
import org.seasar.uruma.component.UIControlComponent; |
| 22 | |
import org.seasar.uruma.component.UIElement; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
public class LayoutDataTagHandler extends GenericTagHandler { |
| 30 | |
|
| 31 | |
private static final long serialVersionUID = -3959745141934226850L; |
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
public LayoutDataTagHandler( |
| 40 | |
final Class<? extends LayoutDataInfo> layoutDataInfoClass) { |
| 41 | 232 | super(layoutDataInfoClass); |
| 42 | 232 | } |
| 43 | |
|
| 44 | |
@Override |
| 45 | |
@SuppressWarnings("unchecked") |
| 46 | |
protected void setParent(final UIElement uiElement, |
| 47 | |
final TagHandlerContext context) { |
| 48 | 324 | Object parent = context.peek(); |
| 49 | 324 | if (parent instanceof UIControlComponent) { |
| 50 | 176 | UIControlComponent uiControl = (UIControlComponent) parent; |
| 51 | 176 | uiControl.setLayoutDataInfo((LayoutDataInfo) uiElement); |
| 52 | 176 | } else if (parent instanceof LayoutInfo) { |
| 53 | 148 | LayoutInfo<LayoutDataInfo> layoutInfo = LayoutInfo.class |
| 54 | |
.cast(parent); |
| 55 | 148 | layoutInfo.setCommonLayoutDataInfo((LayoutDataInfo) uiElement); |
| 56 | |
} |
| 57 | 324 | } |
| 58 | |
} |