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.component;
17
18 import org.seasar.uruma.context.PartContext;
19 import org.seasar.uruma.context.WidgetHandle;
20 import org.seasar.uruma.context.WindowContext;
21 import org.seasar.uruma.renderer.Renderer;
22 import org.seasar.uruma.ui.UrumaApplicationWindow;
23
24 /**
25 * レンダリング可能な画面要素を表すインターフェースです。<br />
26 *
27 * @author y-komori
28 */
29 public interface UIComponent extends UIElement {
30 /**
31 * ID を取得します。<br />
32 *
33 * @return ID
34 */
35 public String getId();
36
37 /**
38 * ID を設定します。<br />
39 *
40 * @param id
41 * ID
42 */
43 public void setId(String id);
44
45 /**
46 * スタイルを表す文字列を取得します。<br />
47 *
48 * @return スタイル
49 */
50 public String getStyle();
51
52 /**
53 * スタイルを表す文字列を設定します。<br />
54 *
55 * @param style
56 * スタイル
57 */
58 public void setStyle(String style);
59
60 /**
61 * 親となる {@link UICompositeComponent} を設定します。<br />
62 *
63 * @param parent
64 * 親コンポーネント
65 */
66 public void setParent(UIComponentContainer parent);
67
68 /**
69 * 親となる {@link UICompositeComponent} を取得します。<br />
70 *
71 * @return 親コンポーネント
72 */
73 public UIComponentContainer getParent();
74
75 /**
76 * レンダラを取得します。
77 *
78 * @return レンダラオブジェクト
79 */
80 public Renderer getRenderer();
81
82 /**
83 * レンダラを設定します。<br />
84 *
85 * @param renderer
86 * レンダラオブジェクト
87 */
88 public void setRenderer(Renderer renderer);
89
90 /**
91 * 設定されたレンダラを利用して、レンダリングを行います。<br />
92 * 本メソッドは、シェルが生成される前のタイミングで呼び出されます。<br />
93 * <p>
94 * 具体的には以下のタイミングです。
95 * <dl>
96 * <dt> {@link UrumaApplicationWindow} の場合
97 * <dd> {@link UrumaApplicationWindow}<code>#init()</code> メソッド内 (<code>createContent()</code>
98 * メソッドよりも前のタイミング
99 * </dl>
100 * </p>
101 *
102 * @param parent
103 * 親となる {@link WidgetHandle} オブジェクト
104 * @param context
105 * {@link WindowContext} オブジェクト
106 */
107 public void preRender(WidgetHandle parent, WindowContext context);
108
109 /**
110 * 設定されたレンダラを利用して、レンダリングを行います。</br> 本メソッドは、 {@link UrumaApplicationWindow}<code>#createContents()</code>
111 * メソッドの中で呼び出されます。<br />
112 *
113 * @param parent
114 * 親となる {@link WidgetHandle} オブジェクト
115 * @param context
116 * {@link PartContext} オブジェクト
117 */
118 public void render(WidgetHandle parent, PartContext context);
119 }