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.context;
17
18 import java.util.List;
19 import java.util.Set;
20
21 import org.seasar.uruma.binding.enables.EnablesDependingDef;
22
23 /**
24 * ウィンドウやダイアログに関する情報を保持するクラスのためのインターフェースです。<br />
25 *
26 * @author y-komori
27 */
28 public interface WindowContext extends PartContext {
29 /**
30 * ウィンドウの名称を取得します。<br />
31 *
32 * @return ウィンドウの名称
33 */
34 public String getName();
35
36 /**
37 * {@link WindowContext} が保持する {@link PartContext} のリストを返します。<br />
38 * {@link PartContext} を1つも保持しない場合、空のリストを返します。
39 *
40 * @return {@link PartContext} のリスト
41 */
42 public List<PartContext> getPartContextList();
43
44 /**
45 * {@link PartContext} を返します。<br />
46 * {@link PartContext} が複数登録されている場合、最初に登録された {@link PartContext} を返します。<br />
47 * {@link PartContext } が登録されていない場合、<code>null</code> を返します。
48 *
49 * @return {@link PartContext} オブジェクト
50 */
51 public PartContext getPartContext();
52
53 /**
54 * <code>partName</code> で指定された名称を持つ {@link PartContext} を取得します。<br />
55 *
56 * @param partName
57 * パート名称
58 * @return {@link PartContext} オブジェクト。見つからない場合は、<code>null</code>。
59 */
60 public PartContext getPartContext(String partName);
61
62 /**
63 * 親 {@link ApplicationContext} を返します。<br />
64 *
65 * @return {@link ApplicationContext} オブジェクト
66 */
67 public ApplicationContext getApplicationContext();
68
69 /**
70 * {@link WindowContext} 本体および配下のすべての {@link PartContext} から、
71 * <code>handleId</code> にマッチする {@link WidgetHandle} を検索して返します。<br />
72 * 同じ <code>id</code> を持つ {@link WidgetHandle} が複数マッチしても、結果は一つとなります。<br />
73 *
74 * @param handleId
75 * ハンドルID
76 * @return 見つかった {@link WidgetHandle} のリスト
77 */
78 public Set<WidgetHandle> findWidgetHandles(String handleId);
79
80 /**
81 * {@link WindowContext} 本体および配下のすべての {@link PartContext}
82 * から、指定されたクラスのオブジェクトを持つ {@link WidgetHandle} をすべて検索して返します。<br />
83 * 同じ <code>id</code> を持つ {@link WidgetHandle} が複数マッチしても、結果は一つとなります。<br />
84 *
85 * @param clazz
86 * クラス
87 * @return 見つかった {@link WidgetHandle} のリスト
88 * @see WidgetHolder#getWidgetHandles(Class)
89 */
90 public Set<WidgetHandle> getAllWidgetHandles(Class<?> clazz);
91
92 /**
93 * {@link EnablesDependingDef} を追加します。<br />
94 *
95 * @param enablesDependingDef
96 * {@link EnablesDependingDef} オブジェクト
97 */
98 public void addEnablesDependingDef(EnablesDependingDef enablesDependingDef);
99
100 /**
101 * {@link EnablesDependingDef} のリストを返します。<br />
102 *
103 * @return {@link EnablesDependingDef} のリスト
104 */
105 public List<EnablesDependingDef> getEnablesDependingDefList();
106
107 /**
108 * {@link PartContext} オブジェクトを削除します。<br />
109 *
110 * @param partName
111 * パート名称
112 */
113 public void disposePartContext(final String partName);
114
115 }