UPDATE FOR CODEIGNITER 2
Paste the codes in /system/core/controller.php and /system/core/model.php instead.
I use eclipse helios and codeigniter 1.7.2 and php5
- Create a new eclipse php project, choose project at existing location and choose path/to/codeigniter/system. I mean path to the codeigniter folder. 
- edit codeigniter/Base4.php and insert the following before the constructor and insert the following before the constructor/** 
 * @var CI_Config
 */
 var $config;
 /**
 * @var CI_DB_active_record
 */
 var $db;
 /**
 * @var CI_Email
 */
 var $email;
 /**
 * @var CI_Form_validation
 */
 var $form_validation;
 /**
 * @var CI_Input
 */
 var $input;
 /**
 * @var CI_Loader
 */
 var $load;
 /**
 * @var CI_Router
 */
 var $router;
 /**
 * @var CI_Session
 */
 var $session;
 /**
 * @var CI_Table
 */
 var $table;
 /**
 * @var CI_Unit_test
 */
 var $unit;
 /**
 * @var CI_URI
 */
 var $uri;
 /**
 * @var CI_Pagination
 */
 var $pagination; 
 
