From 932549273899ad99019d4f381b0ed21555a5d981 Mon Sep 17 00:00:00 2001 From: Ken ISHIMOTO Date: Tue, 18 Sep 2012 19:16:08 -0400 Subject: [PATCH] Add Convenience method to get the browser --- .../extensions/components/ERXComponent.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXComponent.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXComponent.java index e9aa2eb496c..299e81e5659 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXComponent.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXComponent.java @@ -8,6 +8,8 @@ import com.webobjects.foundation.NSArray; import com.webobjects.foundation.NSMutableDictionary; +import er.extensions.appserver.ERXBrowser; +import er.extensions.appserver.ERXRequest; import er.extensions.appserver.ERXResponseRewriter; import er.extensions.foundation.ERXUtilities; import er.extensions.foundation.ERXValueUtilities; @@ -531,6 +533,25 @@ public ERXLocalizer localizer() { return ERXLocalizer.currentLocalizer(); } + /** + * + * Convenience method to get the browser. + * + * @return the current browser + * + * + * + * browser オブジェクトを戻します。基本的には session にも directaction にも browser オブジェクトへのアクセスがありますが、 + * session 又は directaction 内にあるかどうか分からない時にはこのコマンドが便利です。 + * + * @return browser オブジェクト + * + */ + public ERXBrowser browser() { + ERXRequest request = (ERXRequest) context().request(); + return request.browser(); + } + /** * * Lazily initialized dictionary which can be used for the 'item' binding in