-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
step-6 Creating a More Complex Context
* Creating a List view * Creating a Context with an ArrayCollection dataProvider * Contributing both via the extension
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package helloWorld.contexts | ||
{ | ||
import flash.display.DisplayObject; | ||
|
||
import core.appEx.core.contexts.IVisualContext; | ||
import core.data.ArrayCollection; | ||
|
||
import helloWorld.ui.views.StringListView; | ||
|
||
public class StringListContext implements IVisualContext | ||
{ | ||
private var _view :StringListView; | ||
|
||
private var _dataProvider :ArrayCollection; | ||
|
||
public function StringListContext() | ||
{ | ||
_view = new StringListView(); | ||
|
||
_dataProvider = new ArrayCollection(); | ||
_dataProvider.addItem( "Item 1" ); | ||
_dataProvider.addItem( "Item 2" ); | ||
_dataProvider.addItem( "Item 3" ); | ||
|
||
_view.dataProvider = _dataProvider; | ||
} | ||
|
||
public function get view():DisplayObject | ||
{ | ||
return _view; | ||
} | ||
|
||
public function dispose():void | ||
{ | ||
|
||
} | ||
|
||
public function get dataProvider():ArrayCollection { return _dataProvider; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package helloWorld.ui.views | ||
{ | ||
import core.ui.components.List; | ||
|
||
public class StringListView extends List | ||
{ | ||
public function StringListView() | ||
{ | ||
|
||
} | ||
|
||
override protected function init():void | ||
{ | ||
super.init(); | ||
_percentWidth = _percentHeight = 100; | ||
} | ||
} | ||
} |