Janyou's blog

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

1.Custom metatag

[Description("")]          ->property  description
[Category("")]              ->property  category
[Browsable(false)]       ->property  show/hide in property gird
[Enum("")]                   ->property value is enum value; 
[Color]                         ->property value is color value; 

2.VO

ModeBase2.as

   1: package test
   2: {
   3:  
   4:     public class ModelBase2
   5:     {
   6:  
   7:         private var _x:Number=0;
   8:         private var _y:Number=0;
   9:         private var _borderColor:uint=0x000000; //black
  10:         private var _isFilled:Boolean=false;
  11:         private var _context:String="test";
  12:         private var _isExpanded:Boolean=true; //show children 
  13:         private var _location:Number=1;
  14:         
  15:         [Browsable(false)]
  16:         public var _height:Number=0;
  17:         [Color]
  18:         public var _fontColor:uint=0x000000; // Color.Black);
  19:         
  20:         [Category("Appearance")]
  21:         public function get x():Number
  22:         {
  23:             return _x;
  24:         }
  25:  
  26:         public function set x(value:Number):void
  27:         {
  28:             _x=value;
  29:  
  30:         }
  31:         
  32:         [Category("Appearance")]
  33:         public function get y():Number
  34:         {
  35:             return _y;
  36:         }
  37:  
  38:  
  39:         public function set y(value:Number):void
  40:         {
  41:             _y=value;
  42:  
  43:         }
  44:  
  45:  
  46:  
  47:         public function get borderColor():uint
  48:         {
  49:             return _borderColor;
  50:         }
  51:         
  52:         [Color]
  53:         public function set borderColor(value:uint):void
  54:         {
  55:             _borderColor=value;
  56:         }
  57:  
  58:  
  59:         public function get isFilled():Boolean
  60:         {
  61:             return _isFilled;
  62:         }
  63:  
  64:         public function set isFilled(value:Boolean):void
  65:         {
  66:             _isFilled=value;
  67:  
  68:         }
  69:  
  70:  
  71:  
  72:         public function get context():String
  73:         {
  74:             return _context;
  75:         }
  76:  
  77:         public function set context(value:String):void
  78:         {
  79:             _context=value;
  80:  
  81:         }
  82:  
  83:         public function get isExpanded():Boolean
  84:         {
  85:             return _isExpanded;
  86:         }
  87:  
  88:         public function set isExpanded(value:Boolean):void
  89:         {
  90:             _isExpanded=value;
  91:  
  92:         }
  93:  
  94:  
  95:         [Enum("test.ServiceOption")]
  96:         public function get location():Number
  97:         {
  98:             return _location;
  99:         }
 100:  
 101:         public function set location(value:Number):void
 102:         {
 103:             _location=value;
 104:  
 105:         }
 106:  
 107:  
 108:  
 109:  
 110:  
 111:     }
 112: }


3. Enum class

ServiceOption

   1: package test
   2: {
   3:  
   4:     public class ServiceOption
   5:     {
   6:         public static const TOP_LEFT:int=1;
   7:         public static const TOP_MIDDLE:int=2;
   8:         public static const TOP_RIGHT:int=3;
   9:         public static const MIDDLE_LEFT:int=4;
  10:         public static const CENTER_CIRCLE:int=5;
  11:         public static const MIDDLE_RIGHT:int=6;
  12:     
  13:     }
  14: }

4.FlexPropertyGrid

........

flexPropertyGrid.selectObejct=new ModeBase2()

 

5.Demo

 

posted on 2009-07-28 13:15  janyou  阅读(1634)  评论(0编辑  收藏  举报