我工作的一个新的安卓
项目(的Java
),并创建了大量的对象变量。因为我计划增加getter和setter所有的人,我想知道:有没有在 Eclipse的快捷方式
自动生成的getter和setter在一个给定的类
解决方案
调出右键菜单(IE右键单击)所需类的源$ C $ C窗口。然后选择来源
子菜单;从菜单中选择生成getter和setter ...
将导致会出现一个向导窗口。
来源 - >生成getter和setter ...
选择您要创建getter和setter方法,然后单击变量确定
。
I am working on a new Android
project (Java
), and created an Object with a large number of variables. Since I am planning to add getters and setters for all of them, I was wondering: is there a shortcut in Eclipse
for automatically generating the getters and setters in a given class?
Bring up the context menu (i.e. right click) in the source code window of the desired class. Then select the Source
submenu; from that menu selecting Generate Getters and Setters...
will cause a wizard window will appear.
Source -> Generate Getters and Setters...
Select the variables you wish to create getters and setters for and click OK
.
上一篇:Android手机通过WiFi的流媒体声音流媒体、声音、手机、Android
下一篇:Android的Facebook的4.0 SDK如何获得电子邮件,出生日期和性别用户的出生日期、如何获得、电子邮件、性别