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_fixed_num/abstraction_of_fixed_num.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_fixed_num/abstraction_of_fixed_num.html on line 30
 
トップページ >  Eclipse >  定数の抽出
初版2006/07/06: 最終更新日2006/07/06
  定数の抽出
目次
定数の抽出
定数の抽出
ソース中に書くべきでない特別な意味のある数値や文字列は、定数として定義したほうがソースが読みやすくなります。
「リファクタリング」 - 「定数の抽出」を選択すると、下図ウィンドウが開きます。

定数の抽出
定数の抽出

このウィンドウで、定数名やアクセス修飾子を定義します。
ソース中に複数存在する場合は、「選択された式のすべてのオカレンスを~」にチェックを入れると、全ての文字列や数値を定数に変換します。
「定数の参照をクラス名で~」にチェックを入れると クラス名.定数名 という定数名になります。
「プレビュー」を押すと、変更箇所の確認が出来ます。


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_fixed_num/abstraction_of_fixed_num.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_fixed_num/abstraction_of_fixed_num.html on line 86