minimize

Eclipse3では、コードフォーマットのカスタマイズが
より細かく出来るようになりました。
あまりにも膨大な量なので、ここだけ別ページに分けることにしました。

では、気合い入れて始めましょう(笑)。
Eclipse3.0.1対応です。

Indentation

インデント関連の設定を行います。

Tab size

タブ幅です。デフォルトは 4 になっています。

Use tab character

タブ文字を使うかどうかを指定します。
デフォルトでは OFF になっています。この場合、半角スペースが使われます。

Align fields in columns

連続した変数定義が並ぶとき、それらの列合わせを行います。
例えば、

int field = 5;
int[] counts = { 1, 2, 3 };

のようなものを

int   field  = 5;
int[] counts = { 1, 2, 3 };

のように自動調節します。
デフォルトは OFF です。

Indent

Declarations within class body

クラス内に定義された全ての定義を、1インデント下げて記述します。
デフォルトは ON です。
OFF にすると、

class ClassA {

int val;

void func() {
}

}

のようになります。

Statements within method/constructor body

ステートメント(メソッド内に記述された全ての文のこと)を
メソッド定義より1インデント下げて記述します。
デフォルトは ON です。
OFF にすると、

void func() {
val = 1;
}

のようになります。

Statements within blocks

for文などのブロック内ステートメントを、
ブロック文より1インデント下げて記述します。
デフォルトは ON です。
OFF にすると、

for (int i = 0 ; i < 10 ; i++) {
System.out.println(i);
}

のようになります。

Statements within 'switch' body

switch文内のステートメントを1インデント下げて記述します。
デフォルトは OFF です。
ON にすると、

switch (i) {
    case 0:
        func();
        break;
}

のようになります。

Statements within 'case' body

caseブロック内のステートメントを1インデント下げて記述します。
デフォルトは ON です。
OFF にすると、

case 0:
func();
break;

のようになります。

'break' statements

break文を1インデント下げて記述します。
デフォルトは ON です。
OFF にすると、

case 0:
    func();
break;

のようになります。

Braces

ブレース(中括弧)関連の設定を行います。

各項目は、以下の状態のいずれかを取ることが出来ます。

Same line

ブレースを同じ行に配置します。

Next line

ブレースを次の行に配置します。

Next line indented

ブレースを次の行に配置してインデントを一つ下げます。

Next line on wrap

Same line との違いがわかりません…

デフォルトでは全て、Same line になっています。

Class declaration

クラス定義のブレース位置を決定します。

Anonymous class

無名クラス定義のブレース位置を決定します。

Constructor declaration

コンストラクタ定義のブレース位置を決定します。

Method declaration

メソッド定義のブレース位置を決定します。

Blocks

ブロック文のブレース位置を決定します。

Blocks in case statement

case文のブレース位置を決定します。

'switch' statement

switch文のブレース位置を決定します。

Array initializer

配列初期化文のブレース位置を決定します。

Keep empty array initializer on one line

空配列の定義時には、上の設定に関わらず Same line を適用します。

White space

ホワイトスペース(空白)関連の設定を行います。

Declarations

Classes

クラス定義

before opening brace of a class

クラス定義の開始ブレース前にスペースを挿入します。

before opening brace of an anonymous class

無名クラス定義の開始ブレース前にスペースを挿入します。

before comma in implements clause

implements節のカンマ前にスペースを挿入します。

after comma in implements clause

implements節のカンマ後にスペースを挿入します。

fields

フィールド定義

before comma in multiple field declarations

フィールドの複数定義時に使うカンマ前にスペースを挿入します。

after comma in multiple field declarations

フィールドの複数定義時に使うカンマ後にスペースを挿入します。

Local variables

ローカル変数定義

before comma in multiple local declarations

ローカル変数の複数定義時に使うカンマ前にスペースを挿入します。

after comma in multiple local declarations

ローカル変数の複数定義時に使うカンマ後にスペースを挿入します。

Constructors

コンストラクタ定義

before opening parenthesis

コンストラクタの(開き)括弧前にスペースを挿入します。

after opening parenthesis

コンストラクタの(開き)括弧後にスペースを挿入します。

before closing parenthesis

コンストラクタの(閉じ)括弧前にスペースを挿入します。

between empty parenthesis

空括弧(パラメータ無)の括弧間にスペースを挿入します。

before opening brace

コンストラクタの開始ブレース前にスペースを挿入します。

before comma in parameters

コンストラクタのパラメータ部で使われるカンマ前にスペースを挿入します。

after comma in parameters

コンストラクタのパラメータ部で使われるカンマ後にスペースを挿入します。

before comma in 'throws' clause

throws節のカンマ前にスペースを挿入します。

after comma in 'throws' clause

throws節のカンマ後にスペースを挿入します。

Methods

メソッド定義

Constructors と全く同じです。

Labels

ラベル定義

before colon

ラベル定義のコロン前にスペースを挿入します。

after colon

ラベル定義のコロン後にスペースを挿入します。

Control statements

Blocks

ブロック

before opening brace

ブロック文の開始ブレース前にスペースを挿入します。

after opening brace

ブロック文の開始ブレース後にスペースを挿入します。

'if else'

if/else文

before opening parenthesis

if/else文の(開き)括弧前にスペースを挿入します。

after opening parenthesis

if/else文の(開き)括弧後にスペースを挿入します。

before closing parenthesis

if/else文の(閉じ)括弧前にスペースを挿入します。

'for'

for文

before opening parenthesis

for文の(開き)括弧前にスペースを挿入します。

after opening parenthesis

for文の(開き)括弧後にスペースを挿入します。

before closing parenthesis

for文の(閉じ)括弧前にスペースを挿入します。

before comma in initialization

for文の初期化節(第1節)で使用するカンマ前にスペースを挿入します。

after comma in initialization

for文の初期化節(第1節)で使用するカンマ後にスペースを挿入します。

before comma in increments

for文のインクリメント節(第3節)で使用するカンマ前にスペースを挿入します。

after comma in increments

for文のインクリメント節(第3節)で使用するカンマ後にスペースを挿入します。

before semicolon

各セミコロンの前にスペースを挿入します。

after semicolon

各セミコロンの後にスペースを挿入します。

'switch'

switch文

before colon in case

case節のコロンの前にスペースを挿入します。

before colon in default

default節のコロンの前にスペースを挿入します。

before opening brace

switch文の開始ブレース前にスペースを挿入します。

beswitche opening parenthesis

switch文の(開き)括弧前にスペースを挿入します。

after opening parenthesis

switch文の(開き)括弧後にスペースを挿入します。

beswitche closing parenthesis

switch文の(閉じ)括弧前にスペースを挿入します。

'while' & 'do while'

while/do while文

'if else' と同じです。

'synchronized'

synchronized文

'if else' と同じです。

'catch'

catch文

'if else' と同じです。

'assert'

assert文

Labels と同じです。

Expressions

Function invocations

メソッド呼出

before opening parenthesis

メソッド呼出の(開き)括弧前にスペースを挿入します。

after opening parenthesis

メソッド呼出の(開き)括弧後にスペースを挿入します。

before closing parenthesis

メソッド呼出の(閉じ)括弧前にスペースを挿入します。

between empty parenthesis

空括弧(パラメータ無)の括弧間にスペースを挿入します。

before comma in method arguments

メソッド呼出の引数部で使われるカンマ前にスペースを挿入します。

after comma in method arguments

メソッド呼出の引数部で使われるカンマ後にスペースを挿入します。

before comma in object allocation arguments

コンストラクタ呼出の引数部で使われるカンマ前にスペースを挿入します。

after comma in object allocation arguments

コンストラクタ呼出の引数部で使われるカンマ後にスペースを挿入します。

before comma in explicit constructor call

コンストラク内でのthis/super呼出の引数部で使われるカンマ前に
スペースを挿入します。

after comma in explicit constructor call

コンストラク内でのthis/super呼出の引数部で使われるカンマ後に
スペースを挿入します。

Assignments

代入文

before assignment operator

代入演算子の前にスペースを挿入します。

after assignment operator

代入演算子の後にスペースを挿入します。

Operators

演算子

before binary operators

演算子の前にスペースを挿入します。

after binary operators

演算子の後にスペースを挿入します。

before unary operators

単項演算子(「-」など)の前にスペースを挿入します。

after unary operators

単項演算子(「-」など)の後にスペースを挿入します。

before prefix operators

前置演算子(「++」など)の前にスペースを挿入します。

after prefix operators

前置演算子(「++」など)の後にスペースを挿入します。

before postfix operators

後置演算子(「++」など)の前にスペースを挿入します。

after postfix operators

後置演算子(「++」など)の後にスペースを挿入します。

Parenthesized expressions

括弧

'if else' と同じです。

Type Casts

キャスト

after opening parenthesis

キャスト文の(開き)括弧後にスペースを挿入します。

before closing parenthesis

キャスト文の(閉じ)括弧前にスペースを挿入します。

after closing parenthesis

キャスト文の(閉じ)括弧後にスペースを挿入します。

Conditionals

条件文

ここでいう条件文とは

int val = (flg) ? 10 : -10;

形式の条件文を指します。

before question mark

? の前にスペースを挿入します。

after question mark

? の後にスペースを挿入します。

before colon

: の前にスペースを挿入します。

after colon

: の後にスペースを挿入します。

Arrays

Array declarations

配列宣言文

before opening bracket

配列宣言文のブラケット(大括弧)の前にスペースを挿入します。

int[] values;
int [] values;

between empty brackets

空ブラケットの間にスペースを挿入します。

int[] values;
int[ ] values;

Array allocations

配列配置文

before opening bracket

配列配置文のブラケットの前にスペースを挿入します。

int[] values = new int[] {};
int[] values = new int [] {};

after opening bracket

配列配置文のブラケットの後にスペースを挿入します。

before closing bracket

配列配置文の(閉じ)ブラケットの前にスペースを挿入します。

int[] values = new int[3];
int[] values = new int[3 ];

between empty brackets

空ブラケットの間にスペースを挿入します。

int[] values = new int[] {};
int[] values = new int[ ] {};

Array initializers

配列初期化文

before opening brace

配列初期化文のブレース(中括弧)の前にスペースを挿入します。

int[] values = new int[]{};
int[] values = new int[] {};

after opening brace

配列初期化文のブレース(中括弧)の後にスペースを挿入します。

before closing brace

配列初期化文の(閉じ)ブレースの前にスペースを挿入します。

int[] values = new int[] { 1, 2, 3};
int[] values = new int[] { 1, 2, 3 };

before comma

カンマの前に スペースを挿入します。

int[] values = new int[] { 1, 2, 3 };
int[] values = new int[] { 1 , 2 , 3 };

after comma

カンマの後に スペースを挿入します。

int[] values = new int[] { 1,2,3 };
int[] values = new int[] { 1, 2, 3 };

between empty braces

空ブレースの間にスペースを挿入します。

int[] values = new int[] {};
int[] values = new int[] { };

Array element access

配列要素へのアクセス

before opening bracket

ブラケットの前にスペースを挿入します。

members[i].func();
members [i].func();

after opening bracket

ブラケットの後にスペースを挿入します。

members[i].func();
members[ i].func();

before closing bracket

(閉じ)ブラケットの前にスペースを挿入します。

members[i].func();
members[i ].func();

Blank Lines

空行関連の設定を行います。

各項目は「指定された位置に何行の空行を挿入するか」という意味になります。

Before package declaration

パッケージ宣言の前に挿入する空行数

After package declaration

パッケージ宣言の後に挿入する空行数

Before import declaration

import宣言の前に挿入する空行数

After import declaration

import宣言の後に挿入する空行数

Between class

[コメント(0)]
[PR] b sYb FXb SEO΍b ҋZb sYSۃ[b vb b nCb nCb AXNb ]Eb یb ev[gb ꗷsb b FXb Ƌhb b zb ҋZb ŗmb Stb wb [VbNb }bT[Wb ݂Xb FXb Mb 365b AtBGCgb эb FXb z[y[Wb fCg[hb FXb zm}\b xXg nC ze [cb ob nCEGfBOb Hawaii hotelsb Hawaii Activitiesb bhhrb Bb nC@Rh~jAb o@zeb
y^cЁup_CVtgvT[rXz nCnIvVicA[ibN}.j - rWlXNXq - iq(1) - iq(2) - COze - ؍s
z[y[W쐬 - ^T[o[ - gуz[y[W - uO - ze \ - iq - ؍ - ^CVFA
[PR] J[h[̎𒲂ׂȂ炱炩I܂͔rČI