| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.seasar.uruma.binding.method.impl; |
| 17 | |
|
| 18 | |
import org.seasar.uruma.annotation.EventListenerType; |
| 19 | |
import org.seasar.uruma.binding.method.EventListenerDef; |
| 20 | |
import org.seasar.uruma.binding.method.ListenerBinder; |
| 21 | |
import org.seasar.uruma.binding.method.MethodBinding; |
| 22 | |
import org.seasar.uruma.binding.method.WindowCloseListener; |
| 23 | |
import org.seasar.uruma.context.PartContext; |
| 24 | |
import org.seasar.uruma.context.WidgetHandle; |
| 25 | |
import org.seasar.uruma.ui.UrumaApplicationWindow; |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | 4 | public class UrumaApplicationWindowListenerBinder implements ListenerBinder { |
| 33 | 4 | private static final EventListenerType[] SUPPORT_TYPES = new EventListenerType[] { EventListenerType.WINDOW_CLOSING }; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
public Class<?> bindListener(final WidgetHandle handle, |
| 42 | |
final PartContext context, final MethodBinding binding, |
| 43 | |
final EventListenerDef def) { |
| 44 | 4 | UrumaApplicationWindow window = handle |
| 45 | |
.<UrumaApplicationWindow> getCastWidget(); |
| 46 | 4 | WindowCloseListener closeListener = new WindowCloseListener(context, |
| 47 | |
binding); |
| 48 | 4 | window.addWindowCloseListener(closeListener); |
| 49 | 4 | return WindowCloseListener.class; |
| 50 | |
} |
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
public Class<?> getTargetCLass() { |
| 56 | 420 | return UrumaApplicationWindow.class; |
| 57 | |
} |
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
public EventListenerType[] getEventTypes() { |
| 63 | 4 | return SUPPORT_TYPES; |
| 64 | |
} |
| 65 | |
} |