blob: 6ddd0fbd5e68a40a547d93d7002f3b484863c779 [file] [log] [blame]
<div id="midcolumn">
<h3>Getting started</h3>
<div id="doccontent">
<div class="chapter">
<h5>Install</h5>
<div class="content">
<p>You can install NatTable to your environment by using the
<a href="http://www.eclipse.org/nebula/downloads.php" title="Nebula Update Site">Nebula Update Site</a> or
by simply downloading it <a href="/nattable/download.php" title="NatTable download">here</a> and putting it into
the dropins folder manually.</p>
<p>Note that currently NatTable is not included in Nebula releases and the download section is under construction.
Please use the <a href="http://sourceforge.net/projects/nattable/files/" title="NatTable on Sourceforge">Sourceforge version</a>
until the move to Nebula is finished completely.</p>
</div>
</div>
<div class="chapter">
<h5>Examples</h5>
<div class="content">
<p>One of the best ways to get familiar with it is to see example code.
There are lots of examples in the <span class="code">org.eclipse.nebula.widgets.nattable.examples</span> package.</p>
<h6>Running the examples</h6>
<p>Download and run <i>NatTableExamples-xx.jar</i> (executable jar file). It launches <span class="code">NatTableExamples.java</span>
which aggregates the examples in a tabbed window and shows the associated source code.</p>
<p>Note that the NatTableExamples jar does not contain SWT, so you need to include the appropriate SWT jars for your
platform on the command line, e.g.:</p>
<p><span class="code">java -jar org.eclipse.swt_.jar;org.eclipse.swt.win32.win32.x86_.jar;NatTableExamples.jar org.eclipse.nebula.widgets.nattable.examples.NatTableExamples</span></p>
</div>
</div>
<div class="chapter">
<h5>Developer</h5>
<div class="content">
<p>You can also download the source code and contribute it to NatTable. The following information will help you set up
your development environment. The development tools with minimum versions that are used by the NatTable team are listed below.
<ul>
<li>JDK 1.5</li>
<li>Eclipse 3.5</li>
<li>Maven 3 with Tycho</li>
<li>Git</li>
</ul>
</p>
<p>After all of these tools are installed you can download the NatTable sources via Git with the following command:</p>
<p><span class="code">git clone git://git.eclipse.org/gitroot/nattable/org.eclipse.nebula.widgets.nattable.git</span></p>
<p><b>Note:</b> we will refer to the location where you checked out the NatTable trunk code as <b>NATTABLE_TRUNK</b></p>
<p>To build from the command line, first execute the following commands from the NATTABLE_TRUNK/nattable directory:</p>
<p><span class="code">mvn -f deps/pom.xml clean install<br>
mvn -f org.eclipse.nebula.widgets.nattable.parent/pom.xml clean install</span></p>
<p>The first command is to wrap non-OSGi jar dependencies (Apache Poi) as OSGi bundles. The second actually builds NatTable.</p>
<h6>Importing projects into Eclipse</h6>
<p>The first thing you will need to do is import the NatTable projects into Eclipse:
<ul>
<li>select File -> Import from the menubar</li>
<li>choose General -> Existing Projects into Workspace</li>
<li>click Next</li>
<li>Select root directory: (NATTABLE_TRUNK/nattable)</li>
<li>click Finish</li>
</ul>
</p>
<h6>Setting the target platform</h6>
<ul>
<li>Copy 3rd party dependencies:
<ul>
<li>If you have m2eclipse installed, you can right-click on the Copy dependencies.launch file in
the target-platform project and select 'Run As -> Copy dependencies'</li>
<li>Otherwise, you can run
<p><span class="code">mvn dependency:copy-dependencies -DoutputDirectory=dependencies</span><br>
from the command line from within in the target-platform project directory</li>
</ul>
</li>
<li>Open the nattable.target file in the target-platform project
<li>Click on the 'Set as Target Platform' link in the upper-right corner.
</ul>
<p>All of the projects should now compile cleanly.</p>
<h6>Code formatting</h6>
<p>Please use the Eclipse formatter profile in org.eclipse.nebula.widgets.nattable/dev_config/NatTable_style.xml.
Import this and set as the active profile in Eclipse in the Java -> Code Style -> Formatter preferences page.</p>
<h6>Source code organization</h6>
<p>NatTable source is divided into the following projects:
<ul>
<li>org.eclipse.nebula.widgets.nattable.core - Core NatTable code
<li>org.eclipse.nebula.widgets.nattable.extension.glazedlists - NatTable extensions for GlazedLists
<li>org.eclipse.nebula.widgets.nattable.extension.poi - NatTable extensions for Apache POI
<li>org.eclipse.nebula.widgets.examples - example programs
</ul>
</p>
<p>In addition there are also various test projects. All of these projects are packaged as Eclipse plugins/OSGi bundles.</p>
<h6>Code conventions</h6>
<p>Interfaces are prefixed with 'I', e.g. INatTableModel</p>
</div>
</div>
</div>
</div>