Menu

[r327]: / cairngorm3 / trunk / libraries / IntegrationTest / src / CommandScopeSample.mxml  Maximize  Restore  History

Download this file

124 lines (110 with data), 4.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
layout="vertical" minWidth="1024" minHeight="768"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:popup="com.adobe.cairngorm.popup.*"
xmlns:commands="samples.commands.*"
xmlns:cairngorm="com.adobe.cairngorm.*"
xmlns:customscope="samples.commands.customscope.*"
xmlns:localscope="samples.commands.localscope.*"
addedToStage="buildContext()">
<mx:Metadata>
[Event(name="parent", type="samples.commands.ParentEvent")]
[ManagedEvents(names="parent")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.logging.LogEventLevel;
import samples.commands.customscope.CustomScopeContext;
import samples.commands.localscope.LocalScopeContext;
import samples.commands.ParentEvent;
import com.adobe.cairngorm.popup.PopUpEvent;
import samples.commands.ParentContext;
import org.spicefactory.parsley.flex.FlexContextBuilder;
import org.spicefactory.parsley.core.context.Context;
[Inject]
[Bindable]
public var context:Context;
private function buildContext():void
{
FlexContextBuilder.build(ParentContext, this);
dispatchEvent(new Event('configureIOC', true));
}
private function dispatchParent():void
{
var event:ParentEvent = new ParentEvent(ParentEvent.NAME);
dispatchEvent(event);
}
]]>
</mx:Script>
<cairngorm:CairngormIntegrationRPCLib/>
<mx:TraceTarget level="{ LogEventLevel.DEBUG }" includeCategory="true">
<mx:filters>
<mx:Array>
<mx:String>com.adobe.cairngorm.*</mx:String>
<mx:String>org.spicefactory.*</mx:String>
</mx:Array>
</mx:filters>
</mx:TraceTarget>
<mx:Button
label="Dispatch Global Event"
click="dispatchParent()"/>
<mx:HBox
width="100%" height="100%">
<mx:Box id="box1"
width="25%" height="100%"
backgroundColor="0x660099">
<mx:Button
label="Open popup in local scope"
click="localPopup1.open = true"/>
</mx:Box>
<mx:Box id="box2"
width="25%" height="100%"
backgroundColor="0x006699">
<mx:Button
label="Open another popup in local scope"
click="localPopup2.open = true"/>
</mx:Box>
<mx:Box id="box3"
width="25%" height="100%"
backgroundColor="0x009966">
<mx:Button
label="Open popup with custom scope"
click="customScopePopup.open = true"/>
</mx:Box>
</mx:HBox>
<popup:PopUpWrapper id="localPopup1"
parent="{ box1 }">
<localscope:LocalScopePopup/>
<popup:behaviors>
<mx:Array>
<popup:AddPopUpToParsleyContext context="{ context }"
popupContext="{ LocalScopeContext }"/>
</mx:Array>
</popup:behaviors>
</popup:PopUpWrapper>
<popup:PopUpWrapper id="localPopup2"
parent="{ box2 }">
<localscope:LocalScopePopup/>
<popup:behaviors>
<mx:Array>
<popup:AddPopUpToParsleyContext context="{ context }"
popupContext="{ LocalScopeContext }"/>
</mx:Array>
</popup:behaviors>
</popup:PopUpWrapper>
<popup:PopUpWrapper id="customScopePopup"
parent="{ box3 }">
<customscope:CustomScopePopup/>
<popup:behaviors>
<mx:Array>
<popup:AddPopUpToParsleyContext context="{ context }"
popupContext="{ CustomScopeContext }">
<popup:scopes>
<mx:String>custom</mx:String>
</popup:scopes>
</popup:AddPopUpToParsleyContext>
</mx:Array>
</popup:behaviors>
</popup:PopUpWrapper>
</mx:Application>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.