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

