Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/eclipse/refactor/abstraction_of_local/abstraction_of_local.html on line 30

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/eclipse/refactor/abstraction_of_local/abstraction_of_local.html on line 30
 
トップページ >  Eclipse >  ローカル変数の抽出
初版2006/07/10: 最終更新日2006/07/10
  ローカル変数の抽出
目次
ローカル変数の抽出
ローカル変数の抽出
式やメソッドなどを選択して、「リファクタリング」 - 「ローカル変数の抽出」を選択すると、式やメソッドなどをローカル変数の抽出することが出来ます。
まず、抽出したいメソッドや式を反転させて、「リファクタリング」 - 「ローカル変数の抽出」を選択すると、下図ウィンドウが開きます。

ローカル変数の抽出
ローカル変数の抽出

変数名欄で変数名を指定します。また、選択した式やメソッドを使用している部分全て変更したい場合、「選択された式のすべてのオカレンスをローカル変数への~」にチェックをいれます。
ローカル変数を定数にしたい場合は、「ローカル変数を'final'として宣言」にチェックを入れます。
変更後、ソースがどのように変更するかを確認したい場合は「プレビュー」を押して確認できます。
それでよければ、「OK」をクリックします。


Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/eclipse/refactor/abstraction_of_local/abstraction_of_local.html on line 86

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/eclipse/refactor/abstraction_of_local/abstraction_of_local.html on line 86