简体   繁体   English

如何在Eclipse JEE Mars 2中重命名变量?

[英]How to rename a variable in Eclipse JEE Mars 2?

I would like to rename a variable and all its references in my code base. 我想在我的代码库中重命名变量及其所有引用。 I am using Eclipse Java EE IDE for Web Developers (Mars.2 Release (4.5.2)) . 我正在将Eclipse Java EE IDE用于Web开发人员(Mars.2版本(4.5.2))

When I right-click, I do not see any menu item called Rename in any of the context-menus or sub-menus. 右键单击时,在任何上下文菜单或子菜单中都看不到任何名为“重命名”的菜单项。

I looked up all the context menu items before posting this question. 发布此问题之前,我查找了所有上下文菜单项。 The first place I looked was the Refactor \\ Rename context-menu item because that's where I would have found it in Visual Studio. 我看的第一处是Refactor \\ Rename上下文菜单项,因为那是我在Visual Studio中找到它的地方。 I am a C# developer. 我是C#开发人员。

When I right-click, I do not see any menu item called Rename 右键单击时,看不到任何名为“重命名”的菜单项

The menu item is Refactor , under which you have Rename . 菜单项是Refactor ,在该菜单项下具有Rename

It is in the context menu Refactor \\ Rename... . 在上下文菜单Refactor \\ Rename...

And the keyboard shortcut is Alt+Shift+R . 键盘快捷键是Alt+Shift+R

You first have to select the variable you want to rename and then use either the context menu (right click) on it, or use the shortcut. 您首先必须选择要重命名的变量,然后使用其上的上下文菜单(右键单击)或使用快捷方式。

Select the variable pres Alt + Shift + R and type new name. 选择变量pre Alt + Shift + R并输入新名称。 Or Select the variable -> right click -> Refactor -> Rename and type new name 或选择变量->右键单击->重构->重命名并输入新名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM