的IntelliJ(Android的工作室)成员变量preFIX [英] Intellij (Android studio) member variable prefix

查看:213
本文介绍了的IntelliJ(Android的工作室)成员变量preFIX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么配置的Andr​​oid工作室(或一般的IntelliJ)来正确生成prefixes getter和setter方法​​的成员变量?

How do I configure Android Studio (or Intellij generally) to correctly generate getters and setters for member variables with prefixes?

如果我有一个类

public class Foo{
    int mBar;
}

我想它来创建 getBar()而不是 getMBar 当我这样做重构的 - >封装生成

修改

我发现做每个项目的方式:你刚才去文件>设置 - >项目设置 - > code风格

I found the way to do it per-project basis: You just go File->Settings->Project Settings->Code Style

但它创造了一个设置在我的项目目录里的文件。

But it created a settings file somewhere in my project directory.

我想一个解决方案,让我对所有项目,present和未来做一次。

I want a solution which allows me to do it once for all projects, present and future.

推荐答案

尝试将文件 - >其他设置 - >默认设置。你应该能够使prefixes对于如果更改设置为默认,而不是项目的计划preFIX设置,你做的每一个项目等。在preFIX变化将是Java和code生成。这将解决getter和setter方法​​。

Try going to File-->Other Settings-->Default Settings. Your should be able to make prefixes for every other project that you do if you change prefix settings with the scheme set to default instead of Project. The prefix change would be in Java and Code Generation. That will fix setters and getters.

这篇关于的IntelliJ(Android的工作室)成员变量preFIX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆