Upload
yi-tan
View
2.846
Download
0
Tags:
Embed Size (px)
DESCRIPTION
This is a handy Eclipse Monkey script generates ActionScript code templates by conventions. Host on Google code: http://code.google.com/p/yis-eclipse-monkey-scripts-for-flash-builder/
Citation preview
COC 风味的 Flash Builder 代码生成脚本
Yi’s Eclipse Monkey Scripts for Flash Builder
Convention Generator
By Yi [email protected]
安装 Eclipse Monkey:Installing Eclipse Monkey:http://download.eclipse.org/technology/dash/update/
安装 Convention Generator 脚本Installing Convention Generator script SVN checkout from http://code.google.com/p/yis-eclipse-monkey-scripts-f
or-flash-builder/
1
2 3
将 .js 文件放置到“ scripts” 子目录中Put .js file to “scripts” sub folder
然后菜单条中即会出现此命令Then the command should be available in the menu
你输入you type:
propertyName:Number
快捷键 : Alt + 1
Shortcut Key: Alt+1
会变成it
becomes:
public var propertyName:Number;
propertyName:n
o : Objects : Stringb : Booleana : Arrayn : Number
i : intu : uintv : Vectorx : XML
使用数据类型缩写更方便
Use abbreviation for data type declaration
你输入you type:
public var propertyName:Number;
会变成it
becomes:
-propertyName:n
访问控制器用符号表示
Handy marks for access control
+: public-: private*: protected
你输入you type:
private var propertyName:Number;
会变成it
becomes:
-propertyName:n=
会根据数据类型自动添加默认值
Automatically adds default values
你输入you type:
private var propertyName:Number= 0;
会变成it
becomes:
*$classMember:a=
$ 表明是类的属性
$ for class property
你输入you type:
protected static var classMember:Array= [];
会变成it
becomes:
$$constantMember:s=
$$ 表明是常量根据习惯常量的名字统统大写
$$ for constant propertyConstant members always have upper case names
你输入you type:
public static const CONSTANT_MEMBER:String= "";
会变成it
becomes:
_internalProperty:i
下划线表明是内部属性,于是自动创建 getter 和 setter 读写器
Underscore is the core of getter and setters
你输入you type:
private var _internalProperty:int;
public function get internalProperty():int{ return _internalProperty;}
public function set internalProperty(value:int):void{
}
会变成it
becomes:
-methodName():b
() 是方法的好朋友
() is a method
你输入you type:
private function methodName():Boolean{
}
会变成it
becomes: