I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would like to increase the maximum line length. How can I do this?
我在用Java工作。如果我在Eclipse Helios中按Ctrl+Shift+F,它会自动格式化我的代码。在某一时刻,它会缠绕线条。我想增加最大长度。我该怎么做呢?
9 个解决方案
#1
673
In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:). In the Comments tab you have a separate option Maximum line width for comments:, which will also need to be changed to affect comment wrapping.
在首选项Java ->代码样式->格式化程序中,编辑配置文件。在行包装标签下面是行宽(最大行宽:)的主要选项。在Comments选项卡中,您有一个单独的选项,用于注释的最大行宽度:,它也需要修改以影响注释包装。
You will need to make your own profile to make these changes in if you using one of the [Built-in]
ones. Just click "New..." on the formatter preferences page.
如果您使用其中一个[内置]配置文件,您将需要创建自己的配置文件来进行这些更改。只需单击格式化程序首选项页面上的“New…”。
#2
116
Take a look of following image:
看看下面的图片:
Java->Code style->Formatter-> Edit
#3
37
Comments have their own line length setting at the bottom of the setting page java->code style->formatter-> Edit... ->comments
注释在设置页面的底部有自己的行长度设置—java->代码样式—>格式化程序—>编辑…- >评论
#4
28
for XML line width, update preferences > XML > XML Files > Editor > Line width
对于XML行宽度,更新首选项> XML > XML文件>编辑>行宽。
#5
18
For HTML / PHP / JSP / JSPF: Web -> HTML Files -> Editor -> Line width
用于HTML / PHP / JSP / JSPF: Web -> HTML文件->编辑器->行宽度
#6
9
Click Project->preferences. Type format into the search - you should see java->code style->formatter. Click that, then edit - finally, the line wrapping tab - its there :)
单击项目- >首选项。输入格式到搜索-你应该看到java->代码样式->格式化程序。点击它,然后编辑——最后,换行标签——它在那里:)
#7
6
For XHTML files: Web -> HTML Files -> Editor -> Line width
用于XHTML文件:Web -> HTML文件->编辑器->行宽度
#8
6
Preferences -> Java -> Code Style -> Formatter / "Edit..."
参数设置-> Java ->代码样式->格式化程序/“编辑…”
Tabs: "Line wrapping" , "Comments"
标签:“换行”、“评论”
Field: "Maximum line width"
:“最大的线宽”
Set both to make comments have the same length too. You might need to create a new profile if you don't have one already.
设置两个注释的长度也是一样的。如果您还没有一个新的概要文件,那么您可能需要创建一个新的概要文件。
#9
1
I use the Eclipse version called Mars which works with Java 7.
我使用名为Mars的Eclipse版本,它与Java 7一起工作。
Go to Preferences -> Java -> Code Style -> Formatter
转到Preferences -> Java ->代码样式->格式化程序
Click on the Edit Button shown in the right side of "Active Profile" drop down
单击“活动概要”下拉的右边显示的编辑按钮
Tabs: "Line wrapping"
标签:“包装”
Field: "Maximum line width", Set the desired value (Default value set to 120) to increase/decrease the line length in the editor
字段:“最大行宽”,将期望的值(默认值设置为120)设置为增加/减少编辑器中的行长
Note: Remember to rename the Active profile to the name of your choice, as the default Eclipse profile won't accept your changes.
注意:请记住将活动概要文件重命名为您所选择的名称,因为默认的Eclipse概要文件不接受您的更改。
#1
673
In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:). In the Comments tab you have a separate option Maximum line width for comments:, which will also need to be changed to affect comment wrapping.
在首选项Java ->代码样式->格式化程序中,编辑配置文件。在行包装标签下面是行宽(最大行宽:)的主要选项。在Comments选项卡中,您有一个单独的选项,用于注释的最大行宽度:,它也需要修改以影响注释包装。
You will need to make your own profile to make these changes in if you using one of the [Built-in]
ones. Just click "New..." on the formatter preferences page.
如果您使用其中一个[内置]配置文件,您将需要创建自己的配置文件来进行这些更改。只需单击格式化程序首选项页面上的“New…”。
#2
116
Take a look of following image:
看看下面的图片:
Java->Code style->Formatter-> Edit
#3
37
Comments have their own line length setting at the bottom of the setting page java->code style->formatter-> Edit... ->comments
注释在设置页面的底部有自己的行长度设置—java->代码样式—>格式化程序—>编辑…- >评论
#4
28
for XML line width, update preferences > XML > XML Files > Editor > Line width
对于XML行宽度,更新首选项> XML > XML文件>编辑>行宽。
#5
18
For HTML / PHP / JSP / JSPF: Web -> HTML Files -> Editor -> Line width
用于HTML / PHP / JSP / JSPF: Web -> HTML文件->编辑器->行宽度
#6
9
Click Project->preferences. Type format into the search - you should see java->code style->formatter. Click that, then edit - finally, the line wrapping tab - its there :)
单击项目- >首选项。输入格式到搜索-你应该看到java->代码样式->格式化程序。点击它,然后编辑——最后,换行标签——它在那里:)
#7
6
For XHTML files: Web -> HTML Files -> Editor -> Line width
用于XHTML文件:Web -> HTML文件->编辑器->行宽度
#8
6
Preferences -> Java -> Code Style -> Formatter / "Edit..."
参数设置-> Java ->代码样式->格式化程序/“编辑…”
Tabs: "Line wrapping" , "Comments"
标签:“换行”、“评论”
Field: "Maximum line width"
:“最大的线宽”
Set both to make comments have the same length too. You might need to create a new profile if you don't have one already.
设置两个注释的长度也是一样的。如果您还没有一个新的概要文件,那么您可能需要创建一个新的概要文件。
#9
1
I use the Eclipse version called Mars which works with Java 7.
我使用名为Mars的Eclipse版本,它与Java 7一起工作。
Go to Preferences -> Java -> Code Style -> Formatter
转到Preferences -> Java ->代码样式->格式化程序
Click on the Edit Button shown in the right side of "Active Profile" drop down
单击“活动概要”下拉的右边显示的编辑按钮
Tabs: "Line wrapping"
标签:“包装”
Field: "Maximum line width", Set the desired value (Default value set to 120) to increase/decrease the line length in the editor
字段:“最大行宽”,将期望的值(默认值设置为120)设置为增加/减少编辑器中的行长
Note: Remember to rename the Active profile to the name of your choice, as the default Eclipse profile won't accept your changes.
注意:请记住将活动概要文件重命名为您所选择的名称,因为默认的Eclipse概要文件不接受您的更改。