Jump to: navigation, search

Difference between revisions of "EDT:Code snippets"

 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Declaring data|Declaring values of EGL native types]]  
+
* [[EDT:Declaring data|Declaring values of EGL native types]]  
  
[[Working with custom types|Working with custom types]]  
+
* [[EDT:Working with custom types|Working with custom types]]  
  
[[Writing basic logic|Writing basic logic]]  
+
* [[EDT:Writing statements|Writing statements]]  
  
[[Working with a database|Working with a database]]  
+
* [[EDT:Working with a database|Working with a database]]  
  
[[Accessing a service|Accessing a service]]  
+
* [[EDT:Accessing a service|Accessing a service]]  
  
[[Declaring widgets|Declaring widgets]]  
+
* [[EDT:Writing a Rich UI application|Writing a Rich UI application]]  
  
<br>  
+
<br><br>
 
+
*************<br>
+
  
 
To share a code snippet:  
 
To share a code snippet:  
  
#On the page of interest, click '''Edit''' and, if necessary, log in to eclipse.org.  
+
*On the page of interest, click '''Edit''' and, if necessary, log in to eclipse.org.  
#Add a section or update an existing one; but always include your code in the following wikitext markup:
+
*Add a section or update an existing one; but always include your code in the following wikitext markup:<br>
 
+
<pre>       &lt;source lang="java"&gt;
 
+
          // put code here  
<pre>&lt;source lang="java"&gt;
+
        &lt;/source&gt;
// put code here &lt;/source&gt;
+
 
+
</pre>  
 
+
*The &lt;source&gt; tag is used instead of &lt;code&gt; or &lt;pre&gt; since it provides syntax highlighting similar to an advanced source code editor. We use the Java language highlighting, since a highlighter for EGL doesn't exist (yet). If you are interested in writing a syntax highlighter for EGL, the GeSHi (Generic Syntax Highlighter) extension is used.
</pre>
+
* For longer examples, consider adding line numbers using line="GESHI_NORMAL_LINE_NUMBERS" in the source tag, though for some reason then the snippet doesn't appear in a colored background.
 
+
*To add most of your content, click Wikitext or disable the Rich Editor.
<br>
+
*Before you create a new page, read [[EDT:How to Create/Edit Wiki pages|these instructions]].
 
+
:If you need to add that markup, disable the Rich Editor.  
+
  
For help with editing, see [http://meta.wikimedia.org/wiki/Help:Wikitext_examples| Wikitext examples]. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br&gt; *************&lt;br&gt; &lt;br&gt; &lt;br&gt;&lt;br&gt;  
+
For help with editing, see [http://meta.wikimedia.org/wiki/Help:Wikitext_examples Wikitext examples]. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
  
 
[[Category:EDT]]
 
[[Category:EDT]]

Latest revision as of 14:15, 6 March 2012



To share a code snippet:

  • On the page of interest, click Edit and, if necessary, log in to eclipse.org.
  • Add a section or update an existing one; but always include your code in the following wikitext markup:
        <source lang="java">
          // put code here 
        </source>
 
  • The <source> tag is used instead of <code> or <pre> since it provides syntax highlighting similar to an advanced source code editor. We use the Java language highlighting, since a highlighter for EGL doesn't exist (yet). If you are interested in writing a syntax highlighter for EGL, the GeSHi (Generic Syntax Highlighter) extension is used.
  • For longer examples, consider adding line numbers using line="GESHI_NORMAL_LINE_NUMBERS" in the source tag, though for some reason then the snippet doesn't appear in a colored background.
  • To add most of your content, click Wikitext or disable the Rich Editor.
  • Before you create a new page, read these instructions.

For help with editing, see Wikitext examples.