精华内容
下载资源
问答
  • Eclipse自动调整代码格式

    千次阅读 2019-05-22 09:06:20
    Eclipse自动调整代码格式 **快捷简便的方法:Ctrl+Shift+f(不继续看下去可能你按下去没有任何反应,这是经过很多人测试了的!) 因为自己写了很久的java代码,也用了Eclipse有一段时间了,而自己一直比较苦恼的...

    Eclipse自动调整代码格式

    • **快捷简便的方法:Ctrl+Shift+f(不继续看下去可能你按下去没有任何反应,这是经过很多人测试了的!)
      因为自己写了很久的java代码,也用了Eclipse有一段时间了,而自己一直比较苦恼的问题就是当自己从网上摘抄一段代码或者自己复制其他的一段代码的时候(因为自己敲的时候一般都默认有格式),很多时候总是不能将代码的格式调整好,如果一行一行的去调整,那样简直是难受至极呀,然后自己也上网收集了很多关于如何去调整的方法,一般说的都是快捷键:Ctrl+shift+f;但是当我们按了这三个键后,却没有反应,这是怎么回事呢?

      原来当我查阅了很多资料后也没有找到结果后,我就只能在自己的电脑上进行测试了,测试了很多次很多方法后,当我将我的搜狗输入法其他输入法,并调整为英文状态后,我再次按Ctrl+Shift+f的时候竟然有反应了,哈哈,终于试成功了,原来是是我开启了搜狗输入法,哪怕是英文状态也不行。终于能享受自动调整代码的乐趣了! 
      普遍的方法:就是直接从软件中去找调整代码的那个子菜单:点击菜单栏中的source->format也可以。不过这样的话显得很没有逼格。**
      
    展开全文
  • eclipse自动调整代码格式

    千次阅读 2018-03-29 16:36:38
    Ctrl + Shift + F 或者 右键 source -> format 1 设置自己的style 如果需要设置自己的风格 window -> preference -> java ->code style ->formatter ...new 一个 然后 选中后edit ...

    Ctrl + Shift + F

    或者 右键 source -> format
    eclipse自动调整代码格式

    1 设置自己的style

    如果需要设置自己的风格

    window -> preference -> java ->code style ->formatter

    eclipse自动调整代码格式

    new 一个 然后 选中后edit

    设置成自己的风格,就OK了

    eclipse自动调整代码格式

    转载于:https://blog.51cto.com/12348890/2092555

    展开全文
  • Eclipse自动调整格式

    2015-03-19 16:37:00
    Format 后,将自动调整格式,若想要{ 单独占一行,则可以自己定义相关格式模板 新建 CodeFormatter.xml <?xml version="1.0" encoding="UTF-8"?> <profiles version="11"> <profile kind="C.....

    Eclipse 编写Java代码的时候,使用右键Source -> Format 后,将自动调整格式,若想要{ 单独占一行,则可以自己定义相关格式模板

    新建 CodeFormatter.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <profiles version="11">
    <profile kind="CodeFormatterProfile" name="CodeFormatter" version="11">
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="20"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="37"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
    <setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
    <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="37"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
    </profile>
    </profiles>
    

      

    导入方法:

    点击 Edit 还可以自定义去 编辑对应的格式

    转载于:https://www.cnblogs.com/panie2015/p/4350857.html

    展开全文
  • 一、Eclipse 保存文件时自动格式化代码 具体方法:windows–>Preferences–>Java --> Editor–>Save Actions, 看到右边的选项了吧,勾选“Perform the selected actions on save”,其他选项根据需要...

    一、Eclipse 保存文件时自动格式化代码
    具体方法:windows–>Preferences–>Java --> Editor–>Save Actions, 看到右边的选项了吧,勾选“Perform the selected actions on save”,其他选项根据需要自己选择或者配置就可以了。
    在这里插入图片描述

    在这里插入图片描述

    二、快捷键Ctrl+Shift+F

    展开全文
  • eclipse自动调整代码格式

    万次阅读 2013-01-04 11:18:37
    0 快捷键 Ctrl + Shift + F  或者 右键 source -> format 1 设置自己的style 如果需要设置自己的风格 ...window -> preference -> java ->code style ->formatter ...设置成自己的风格,就OK了
  • 如何使用eclipse自动调整代码格式

    千次阅读 2015-10-23 20:05:57
    刚开始学安卓,看老罗的视频,他说用ctrl+alt+f就自动调整代码格式了。然而我尝试了一下,发现没有任何变化。 其实这个问题的原因很简单,我开启了搜狗输入法。哪怕是搜狗输入法是英文状态,按ctrl+alt+f也没有用。...
  • eclipse 自动调整 格式

    2010-09-29 11:20:00
    eclipse中采用 ctrl + Shift + f 自动调整源代码的格式
  • 快捷键 Ctrl+Shift+f
  • 很多文章目前对于eclipse防止空格自动补全的方法有很多,但对于小白(没错!说的就是我)来说,文章内容太过于繁复,所以这篇文章谈一谈我找到的方法,希望能帮助到大家。 1.首先打开window窗口下的Preferences(首...
  • eclipse格式自动调整的问题

    千次阅读 2018-09-27 14:40:19
    可以Source-&gt;format 但是快捷键ctrl+shift+f不起作用??? 因为:是与输入法的快捷键起了冲突,把输入法快捷键改了就好了 备注:不用全选,即可使用格式自动调整...
  • Eclipse设置自动格式排版

    千次阅读 2019-08-22 18:25:30
    window-->preferences-->Web-->HTML Files-->Editor, 将Line width设置为720,使代码不会很容易换行, 然后在Inline Elements中选中第一个拖动滚动条到底部按着Shift点击最后一项,点击Remove,将所有... ......
  •  ECLIPSE中设置自己的代码格式 如果需要设置自己的风格 window -> preference -> java ->code style ->formatter 新建一个, 选中后edit
  • 1.打开Eclipse ,找到window--->perferences->java->Code Style->Formatter 2.想设计自己想要的格式需要点击‘new’按键,重新新建一个并重命名(不可以与已有名称重复) 3.点击进入编辑页面 4.选择...
  • eclipse自动排版快捷键 按了没有用 的解决办法

    万次阅读 多人点赞 2016-04-19 20:02:39
    快捷键按了没有用,通常是因为该快捷键方式被其他软件占用了,即别的...eclipse格式对齐快捷键是Ctrl+Shift+F,如果你按了没有用,那么你很可能安装了搜狗输入法,它默认的简繁切换的快捷键即为Ctrl+Shift+F,如下图:
  • eclipse设置代码格式化(详解)

    千次阅读 2020-05-29 20:06:30
    解决方法是写完代码后让eclipse自动格式化(排版) (错误演示) 方法一:直接在代码界面右键,选择Source—》format 方法二:一劳永逸,设置自动格式化,Window—》Preferences 写完代码后保存即可 (正确演示)...
  • Eclipse自动排版快捷键失效(转)

    千次阅读 2017-09-13 09:08:04
    1.格式化java代码 :  ①Ctrl+Shift+F  但是我们会遇到按 Ctrl+Shift+F不起作用的时候?...换成其他的时候果然可以在eclipse里使用格式化快捷键了。  其实一般可以归纳为这几点: 1.Ctrl或Sh
  • 有时代码是从各个地方拷贝过来,格式会有些混乱,就需要format一下 格式化的方法: 在代码附近任何位置点击右键 选择source—>format 但此时很多被注释掉的代码也会格式化,就很烦 设置注释语句不被格式化的方法...
  • Eclipse版本 问题描述 自动补全显示顺序不尽人意,如下: 输入equals使用自动补全后,显然并不是我们希望使用的方法。 解决方法1 进入Windows选项卡下的Perferences,搜索Content Assist,找到Java选项卡下的...
  • 修改eclipse自动格式化代码长度

    千次阅读 2018-03-29 17:32:29
    eclipse默认的行长度特别短,总觉得空间没用完。解决方法:Java代码:打开Eclipse的Window菜单,然后Preferences-&gt;Java-&gt;Code Style-&gt;Formatter-&gt;Edit -&gt;Line Wrapping-&gt;...
  • Eclipse主菜单选择“窗口→首选项”,进入“代码格式化程序”设置页。如下图所示: 确认选择的是格式化配置是Eclipse [built-in]。 注意:编写好代码后需要按Ctrl+Shift+F格式化代码。(Eclipse适应) 二、...
  • eclipse大括号格式调整

    2013-01-04 16:04:00
    打开eclipse,找到菜单Windows->Preferences->Java->Code Style->Formatter, 点击new, OK之后,选择Braces标签,修改里面的选项(一般都选Next line)推荐大家除了最后一个不修改外其他的都选择...
  • 前段时间在Eclipse里面设置了java文件保存时自动格式化,在java-&gt;Code Style-&gt;Formatter里设置了自定义的格式化的样式,这样每次保存后都会自动格式化代码,用了一段时间感觉还不错,高科技,自动化 后来...
  • eclipse自动退出

    2016-08-04 17:58:54
    eclipse目录下eclipse.ini文件的设置上有问题,一般的ini文件设置主要包括以下几项: -vmargs -Xms40m -Xmx256m -XX:PermSize=64M -XX:MaxPermSize=128M 以下解释其意思。 -vmargs:说明后面是VM的参数 -Xms...
  • eclipse怎样自动排版

    千次阅读 2019-06-10 16:33:26
    https://zhidao.baidu.com/question/42321945.html
  • Eclipse格式化JS代码

    2019-11-30 23:42:02
    格式化前: 格式化后: 步骤如下: 1. Windows -> Preferences -> JavaScript -> Code Style -> Formatter -> New… 2.创建新的模板: 3. 设置参数:
  • 本篇主要分享一个小技巧:为 Eclipse 设置链式调用的代码格式化(Formatter)。 首先,我们要明白什么是链式调用,来看代码: AccountParam.builder().uid(uid).url(AccountParam.hongbao_url).type("红包"); 一个...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 28,841
精华内容 11,536
关键字:

eclipse自动调整格式