-
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.
* Add a HelloWorldView * Add a HelloWorldContext * Contribute the context via the ResourceManager
- Loading branch information
Showing
3 changed files
with
52 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package | ||
package | ||
{ | ||
import flash.display.Sprite; | ||
|
||
import core.app.CoreApp; | ||
import core.app.resources.FactoryResource; | ||
|
||
import helloWorld.contexts.HelloWorldContext; | ||
|
||
public class HelloWorldExtension extends Sprite | ||
{ | ||
public function HelloWorldExtension() | ||
{ | ||
trace("Hello World"); | ||
CoreApp.resourceManager.addResource( new FactoryResource( HelloWorldContext, "Hello World" ) ); | ||
} | ||
} | ||
} |
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,27 @@ | ||
package helloWorld.contexts | ||
{ | ||
import helloWorld.ui.views.HelloWorldView; | ||
import flash.display.DisplayObject; | ||
import core.appEx.core.contexts.IVisualContext; | ||
|
||
public class HelloWorldContext implements IVisualContext | ||
{ | ||
private var _view :HelloWorldView; | ||
|
||
public function HelloWorldContext() | ||
{ | ||
_view = new HelloWorldView(); | ||
_view.text = "Hello World"; | ||
} | ||
|
||
public function get view():DisplayObject | ||
{ | ||
return _view; | ||
} | ||
|
||
public function dispose():void | ||
{ | ||
|
||
} | ||
} | ||
} |
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.TextArea; | ||
|
||
public class HelloWorldView extends TextArea | ||
{ | ||
public function HelloWorldView() | ||
{ | ||
|
||
} | ||
|
||
override protected function init():void | ||
{ | ||
super.init(); | ||
_percentWidth = _percentHeight = 100; | ||
} | ||
} | ||
} |