Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
UrumaService |
|
| 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.rcp; | |
17 | ||
18 | import java.util.List; | |
19 | import java.util.ResourceBundle; | |
20 | ||
21 | import org.eclipse.ui.IWorkbench; | |
22 | import org.osgi.framework.Bundle; | |
23 | import org.seasar.framework.container.S2Container; | |
24 | import org.seasar.uruma.component.Template; | |
25 | import org.seasar.uruma.component.rcp.ViewPartComponent; | |
26 | import org.seasar.uruma.component.rcp.WorkbenchComponent; | |
27 | import org.seasar.uruma.context.WindowContext; | |
28 | import org.seasar.uruma.rcp.binding.CommandRegistry; | |
29 | import org.seasar.uruma.rcp.configuration.Extension; | |
30 | ||
31 | /** | |
32 | * RCP 環境で Uruma が提供するサービスです。<br /> | |
33 | * | |
34 | * @author y-komori | |
35 | */ | |
36 | public interface UrumaService { | |
37 | /** | |
38 | * Uruma アプリケーションのバンドルを返します。<br /> | |
39 | * | |
40 | * @return {@link Bundle} オブジェクト | |
41 | */ | |
42 | public Bundle getBundle(); | |
43 | ||
44 | /** | |
45 | * 現在のプラグイン ID を返します。<br /> | |
46 | * | |
47 | * @return プラグイン ID | |
48 | */ | |
49 | public String getPluginId(); | |
50 | ||
51 | /** | |
52 | * 画面コンポーネントのIDをRCP上のIDに変換します。<br /> | |
53 | * RCP上のIDは、画面コンポーネントのIDにサフィックスとしてプラグインIDを追加したものになります。<br /> | |
54 | * <p> | |
55 | * 【例】プラグインID: <code>org.seasar.uruma.example</code>、コンポーネントID: | |
56 | * <code>button</code> の場合、本メソッドの戻り値は、 | |
57 | * <code>org.seasar.uruma.example.button</code> となります。 | |
58 | * </p> | |
59 | * | |
60 | * @param id | |
61 | * 画面コンポーネントのID | |
62 | * @return RCP上のID | |
63 | */ | |
64 | public String createRcpId(String id); | |
65 | ||
66 | /** | |
67 | * RCP上のIDから画面コンポーネントのIDを取得します。<br /> | |
68 | * | |
69 | * @param rcpId | |
70 | * RCP上のID | |
71 | * @return 画面コンポーネントのID | |
72 | * @see #createRcpId(String) | |
73 | */ | |
74 | public String getLocalId(String rcpId); | |
75 | ||
76 | /** | |
77 | * 指定されたパスの画面定義XMLを読み込み、{@link Template} オブジェクトを生成します。<br /> | |
78 | * | |
79 | * @param path | |
80 | * 画面定義XMLのパス | |
81 | * @return {@link Template} オブジェクト | |
82 | */ | |
83 | public Template getTemplate(String path); | |
84 | ||
85 | /** | |
86 | * {@link IWorkbench} のインスタンスを返します。<br /> | |
87 | * | |
88 | * @return {@link IWorkbench} のインスタンス | |
89 | */ | |
90 | public IWorkbench getWorkbench(); | |
91 | ||
92 | /** | |
93 | * {@link WorkbenchComponent} を返します。<br /> | |
94 | * | |
95 | * @return {@link WorkbenchComponent} オブジェクト | |
96 | */ | |
97 | public WorkbenchComponent getWorkbenchComponent(); | |
98 | ||
99 | /** | |
100 | * {@link ViewPartComponent} のリストを返します。<br /> | |
101 | * | |
102 | * @return {@link ViewPartComponent} オブジェクト | |
103 | */ | |
104 | public List<ViewPartComponent> getViewPartComponent(); | |
105 | ||
106 | /** | |
107 | * 現在登録されている拡張ポイントのリストを返します。<br /> | |
108 | * | |
109 | * @return 拡張ポイントのリスト | |
110 | */ | |
111 | public List<Extension> getExtensions(); | |
112 | ||
113 | /** | |
114 | * 指定した名前の拡張ポイントを返します。<br /> | |
115 | * | |
116 | * @param point | |
117 | * 拡張ポイントの名称 | |
118 | * @return 拡張ポイント。見つからなかった場合は <code>null</code>。 | |
119 | */ | |
120 | public Extension getExtension(String point); | |
121 | ||
122 | /** | |
123 | * ワークベンチウィンドウに対応する {@link WindowContext} を返します。<br /> | |
124 | * | |
125 | * @return {@link WindowContext} | |
126 | */ | |
127 | public WindowContext getWorkbenchWindowContext(); | |
128 | ||
129 | /** | |
130 | * {@link S2Container} のインスタンスを返します。<br /> | |
131 | * | |
132 | * @return {@link S2Container} のインスタンス | |
133 | */ | |
134 | public S2Container getContainer(); | |
135 | ||
136 | /** | |
137 | * Urumaアプリケーションバンドルのクラスローダを返します。<br /> | |
138 | * | |
139 | * @return Urumaアプリケーションバンドルのクラスローダ | |
140 | */ | |
141 | public ClassLoader getAppClassLoader(); | |
142 | ||
143 | /** | |
144 | * Urumaバンドルのクラスローダを返します。<br /> | |
145 | * | |
146 | * @return Urumaバンドルのクラスローダ | |
147 | */ | |
148 | public ClassLoader getUrumaClassLoader(); | |
149 | ||
150 | /** | |
151 | * コンテクストクラスローダを Uruma アプリケーションのクラスローダに切り替えます。<br /> | |
152 | */ | |
153 | public void switchToAppClassLoader(); | |
154 | ||
155 | /** | |
156 | * コンテクストクラスローダを Uruma バンドルのクラスローダに切り替えます。<br /> | |
157 | */ | |
158 | public void switchToUrumaClassLoader(); | |
159 | ||
160 | /** | |
161 | * イメージ定義を保持する {@link ResourceBundle} を返します。<br /> デフォルトは | |
162 | * <code>urumaImages.properties</code> の内容となります。 | |
163 | * | |
164 | * @return {@link ResourceBundle} オブジェクト | |
165 | */ | |
166 | public ResourceBundle getImageBundle(); | |
167 | ||
168 | /** | |
169 | * 直前に使用していたクラスローダに切り替えます。<br /> 直前に実行された {@link #switchToUrumaClassLoader() | |
170 | * } メソッドまたは、 {@link #switchToAppClassLoader()} メソッド実行前のクラスローダに切り替えます。 | |
171 | */ | |
172 | public void restoreClassLoader(); | |
173 | ||
174 | /** | |
175 | * {@link CommandRegistry} のインスタンスを返します。<br /> | |
176 | */ | |
177 | public CommandRegistry getCommandRegistry(); | |
178 | ||
179 | /** | |
180 | * Uruma アプリケーションのためのデフォルトコンテクスト ID を返します。<br /> デフォルト値は | |
181 | * <code><プラグインID>.context</code> となります。<br /> | |
182 | * | |
183 | * @return デフォルトコンテクスト ID | |
184 | */ | |
185 | public String getDefaultContextId(); | |
186 | } |