[uruma-dev:63] Re: [uruma] 終了処理について
KOMORI Yusuke
[E-MAIL ADDRESS DELETED]
2008年 1月 20日 (日) 15:59:34 JST
釈さま
小森です。
すみません、呼ばれてませんね・・・ m(_ _)m
たぶんバグだと思いますので調べてみます。
On Fri, 18 Jan 2008 18:39:05 +0900, shaku - i-navigator corporation - <[E-MAIL ADDRESS DELETED]> wrote:
> 小森様
>
> お疲れ様です、いつもお世話になります。
> アイ・ナビゲーター@釈です。
>
> お教え頂いた表題の件です。
>
> >> こちらは、メソッドに以下のようなアノテーションを追加するこ
> >> とでウィンドウクローズ時にそのメソッドが呼び出されます。
> >>
> >> @EventListener(type=EventListenerType.CLOSE, id = "xxx")
> >> ※ xxx は 画面定義XML の window 要素につけた id です。
>
> テストしてみたのですがうまくイベントがキャッチできないようなのですが、なにか注意点などありますでしょうか?
>
> ちなみにソースは以下のような感じです。
> urumaは、uruma-0.2.0.jar です。
> よろしくお願い致します。
>
> testMain.xml
> ------------
> <?xml version="1.0" encoding="UTF-8"?>
> <template xmlns="http://uruma.sandbox.seasar.org">
> <!-- Window -->
> <window id="testMain" title="Uruma test"
> height="300" width="300" image="title" statusLine="true" defaultButtonId="okButton">
> <gridLayout numColumns="1"
> horizontalSpacing="0" verticalSpacing="5"
> marginHeight="0" marginWidth="5">
> <gridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"
> verticalAlignment="FILL" grabExcessVerticalSpace="true"/>
> </gridLayout>
>
> <!-- Composite -->
> <composite background="">
> <gridLayout numColumns="1"/>
> </composite>
>
> </window>
> </template>
>
>
> TestMainAction.java
> -------------------
> import org.eclipse.jface.action.IStatusLineManager;
> import org.eclipse.jface.dialogs.MessageDialog;
> import org.eclipse.swt.widgets.Shell;
> import org.seasar.framework.container.annotation.tiger.Binding;
> import org.seasar.framework.container.annotation.tiger.BindingType;
> import org.seasar.uruma.annotation.EventListener;
> import org.seasar.uruma.annotation.EventListenerType;
> import org.seasar.uruma.annotation.InitializeMethod;
> import org.seasar.uruma.core.UrumaWindowManager;
> import org.seasar.extension.datasource.DataSourceFactory;
> import test.util.Config;
>
> public class TestMainAction {
> public UrumaWindowManager windowManager;
> public Shell shell;
> public DataSourceFactory dataSourceFactory;
> @Binding(bindingType = BindingType.MAY)
> public IStatusLineManager statusLineManager;
>
> @EventListener(id={ "testMain" }, type=EventListenerType.CLOSE )
> public void shellCloseEvent() {
> boolean b = MessageDialog.openQuestion(shell, "Warning", "ウインドウを閉じてもよろしいですか?");
> if (b == true){
> shell.close();
> }
> }
>
> @InitializeMethod
> public void initialize() {
> }
> }
> _______________________________________________
> uruma-dev mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/uruma-dev
----------------------------------------------
小森 裕介 / Yusuke Komori
E-Mail : [E-MAIL ADDRESS DELETED]
Blog : http://d.hatena.ne.jp/y-komori/
URL : http://www.littleforest.jp/
uruma-dev メーリングリストの案内