Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Setting up Netbeans: Difference between revisions

From MoodleDocs
(→‎Optimization: categories added)
(separate section for setting up NetBeans for Moodle development)
Line 15: Line 15:
== Installation ==
== Installation ==


1. Checkout your Moodle project with a CVS client - see [[CVS (developer)|Moodle CVS for developers]]. I personally prefer to use an external client in order to realise the CVS Delete operation on my own.
* I recommend to download the latest [http://www.netbeans.org/downloads/index.html 6.5 version with PHP support ]. It's only a 26 MB download.
* Install and run it.


2. I now recommend to download the latest [http://www.netbeans.org/downloads/index.html 6.5 version with PHP support ]. It's only a 26 MB download.
== Set up for Moodle development ==


3. Install and run it
* Checkout your Moodle project with a CVS client - see [[CVS (developer)|Moodle CVS for developers]]. I personally prefer to use an external client in order to realise the CVS Delete operation on my own.


4. Open File > New Project > PHP > PHP Application > Next.
* Open File > New Project > PHP > PHP Application > Next  
You're going to set the project now. ''Name'', ''Location'' and ''Folder'' are used by NetBeans and are not related to the source code. So you can choose whatever you like, except your source folder. ''Sources'' has to be your checked out Moodle branch/head folder. The rest is clear enough. Don't forget to choose UTF-8 for ''Default Encoding''.
: You're going to set the project now. ''Name'', ''Location'' and ''Folder'' are used by NetBeans and are not related to the source code. So you can choose whatever you like, except your source folder. ''Sources'' has to be your checked out Moodle branch/head folder. The rest is clear enough. Don't forget to choose UTF-8 for ''Default Encoding''.


Example:
: Example:


          Project Name:        Moodle 1.9 Stable
Project Name:        Moodle 1.9 Stable
          Project Location:    C:\Users\jerome\Documents\NetBeansProjects
Project Location:    C:\Users\jerome\Documents\NetBeansProjects
          Project Folder:      C:\Users\jerome\Documents\NetBeansProjects\Moodle 1.9 Stable
Project Folder:      C:\Users\jerome\Documents\NetBeansProjects\Moodle 1.9 Stable
          Project Sources:    C:\Users\jerome\Projects\branch19_STABLE\moodle
Project Sources:    C:\Users\jerome\Projects\branch19_STABLE\moodle
          Project URL:        http://localhost/moodle19/
Project URL:        http://localhost/moodle19/
          Index File:          index.php
Index File:          index.php
          Create:              unchecked
Create:              unchecked
          Default Encoding:    UTF-8
Default Encoding:    UTF-8
          Set as Main Project: unchecked
Set as Main Project: unchecked


Click on Finish.
* Click on Finish.


5. You can start coding.
* Start coding!


== Optimization ==
== Optimization ==

Revision as of 13:53, 11 March 2009

NetBeans has got a good PHP support. You find a host of information on the website (tutorials, developer blog, screen casts, etc.).

  • CVS integration: see all changes, lines deletion, diff in real time, show annotations, diff history...
  • Ctrl+Click: Go to declaration
  • Export/Import Diff Patch
  • Easy navigation
  • List of functions
  • Code completion
  • Instant rename
  • HTML, CSS, JavaScript support
  • MySQL manager
  • Quick Search
  • Very few bugs

Installation

Set up for Moodle development

  • Checkout your Moodle project with a CVS client - see Moodle CVS for developers. I personally prefer to use an external client in order to realise the CVS Delete operation on my own.
  • Open File > New Project > PHP > PHP Application > Next
You're going to set the project now. Name, Location and Folder are used by NetBeans and are not related to the source code. So you can choose whatever you like, except your source folder. Sources has to be your checked out Moodle branch/head folder. The rest is clear enough. Don't forget to choose UTF-8 for Default Encoding.
Example:
Project Name:        Moodle 1.9 Stable
Project Location:    C:\Users\jerome\Documents\NetBeansProjects
Project Folder:      C:\Users\jerome\Documents\NetBeansProjects\Moodle 1.9 Stable
Project Sources:     C:\Users\jerome\Projects\branch19_STABLE\moodle
Project URL:         http://localhost/moodle19/
Index File:          index.php
Create:              unchecked
Default Encoding:    UTF-8
Set as Main Project: unchecked
  • Click on Finish.
  • Start coding!

Optimization

1. You could want to run Netbeans with the Sun JDK. Netbeans seems to work a bit better with the Sun JDK. Download it from there: [1]. You'll have to edit Netbeans config file. Open netbeans/etc/netbeans.conf. Then uncomment and edit:

   netbeans_jdkhome="your_JDK_path"

2. To change the Netbeans look and feel run netbeans in command line with this parameter:

   "netbeans"  --laf javax.swing.plaf.metal.MetalLookAndFeel 

3. If Netbeans starts to slow down, give it more memory

   "netbeans" -J-Xmx600m