[sandbox.akabana]/trunk/yui/yui-framework/src/main/flex/org/seasar/akabana/yui/framework/mixin/YuiFrameworkMixin.as
Parent Directory
|
Revision Log
Revision 992 -
(show annotations)
Mon Jan 25 19:55:45 2010 JST (3 years, 4 months ago) by e1arkw
File size: 4288 byte(s)
Mon Jan 25 19:55:45 2010 JST (3 years, 4 months ago) by e1arkw
File size: 4288 byte(s)
ResourceBundleの取り扱いを変更しました。 直接クラス情報を取得しています。
| 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.akabana.yui.framework.mixin |
| 17 | { |
| 18 | |
| 19 | import flash.events.Event; |
| 20 | import flash.net.registerClassAlias; |
| 21 | import flash.system.ApplicationDomain; |
| 22 | |
| 23 | import mx.core.ClassFactory; |
| 24 | import mx.core.IFactory; |
| 25 | import mx.core.IFlexModuleFactory; |
| 26 | import mx.managers.ISystemManager; |
| 27 | import mx.resources.ResourceManager; |
| 28 | import mx.styles.CSSStyleDeclaration; |
| 29 | import mx.styles.StyleManager; |
| 30 | |
| 31 | import org.seasar.akabana.yui.core.yui_internal; |
| 32 | import org.seasar.akabana.yui.framework.YuiFrameworkGlobals; |
| 33 | import org.seasar.akabana.yui.framework.bridge.FrameworkBridge; |
| 34 | import org.seasar.akabana.yui.framework.convention.NamingConvention; |
| 35 | import org.seasar.akabana.yui.framework.core.YuiFrameworkContainer; |
| 36 | import org.seasar.akabana.yui.framework.core.event.FrameworkEvent; |
| 37 | import org.seasar.akabana.yui.logging.LogManager; |
| 38 | import org.seasar.akabana.yui.logging.config.ConfigurationProvider; |
| 39 | import org.seasar.akabana.yui.logging.config.factory.LogConfigurationFactory; |
| 40 | |
| 41 | [Mixin] |
| 42 | [ResourceBundle("conventions")] |
| 43 | /** |
| 44 | * YuiFramework初期設定用Mixinクラス |
| 45 | * |
| 46 | * @author $Author$ |
| 47 | * @version $Revision$ |
| 48 | */ |
| 49 | public class YuiFrameworkMixin |
| 50 | { |
| 51 | { |
| 52 | LogConfigurationFactory; |
| 53 | registerClassAlias(ConfigurationProvider.FACTORY_CLASS_NAME,LogConfigurationFactory); |
| 54 | } |
| 55 | |
| 56 | private static var _this:YuiFrameworkMixin; |
| 57 | |
| 58 | private static var _container:YuiFrameworkContainer; |
| 59 | |
| 60 | private static var _namingConventionClassFactory:IFactory; |
| 61 | |
| 62 | public static function init( flexModuleFactory:IFlexModuleFactory ):void{ |
| 63 | LogManager.init(); |
| 64 | |
| 65 | _this = new YuiFrameworkMixin(); |
| 66 | _container = new YuiFrameworkContainer(); |
| 67 | YuiFrameworkGlobals.yui_internal::frameworkBridge = FrameworkBridge.initialize(); |
| 68 | |
| 69 | if( flexModuleFactory is ISystemManager ){ |
| 70 | var systemManager_:ISystemManager = flexModuleFactory as ISystemManager; |
| 71 | |
| 72 | systemManager_ |
| 73 | .addEventListener( |
| 74 | FrameworkEvent.APPLICATION_MONITOR_START, |
| 75 | applicationMonitorStartHandler, |
| 76 | false, |
| 77 | int.MAX_VALUE |
| 78 | ); |
| 79 | _container.yui_internal::monitoringSystemManager(systemManager_); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | protected static function applicationMonitorStartHandler(event:Event):void{ |
| 84 | var appDomain:ApplicationDomain = ApplicationDomain.currentDomain; |
| 85 | if(appDomain.hasDefinition("ja_JP$log4yui_properties")) |
| 86 | { |
| 87 | trace("a"); |
| 88 | } |
| 89 | |
| 90 | initNamingConventionClassFactory(); |
| 91 | initNamingConvention(); |
| 92 | } |
| 93 | |
| 94 | protected static function initNamingConvention():void{ |
| 95 | var namingConvention:NamingConvention = _namingConventionClassFactory.newInstance() as NamingConvention; |
| 96 | namingConvention.conventions = ResourceManager.getInstance().getStringArray("conventions","package"); |
| 97 | YuiFrameworkGlobals.yui_internal::namingConvention = namingConvention; |
| 98 | } |
| 99 | |
| 100 | protected static function initNamingConventionClassFactory():void{ |
| 101 | var namingConventionClassFactoryDef:CSSStyleDeclaration = StyleManager.getStyleDeclaration("org.seasar.akabana.yui.framework.core.YuiFrameworkSettings"); |
| 102 | if( namingConventionClassFactoryDef == null ){ |
| 103 | _namingConventionClassFactory = new ClassFactory(NamingConvention); |
| 104 | } else { |
| 105 | var classFactory:Class = namingConventionClassFactoryDef.getStyle("namingConventionClass") as Class; |
| 106 | _namingConventionClassFactory = new ClassFactory(classFactory); |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | } |
Properties
| Name | Value |
|---|---|
| svn:keywords | Author Revision |
| Repository Top ViewVC Help |
![]() |
| Powered by ViewVC |

