Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VJET/Semantic Comparison - Java and vjojs"

Line 1: Line 1:
{| style="background-color: #F9F9F9; border: 1px solid #AAAAAA;border-collapse: collapse;color: black; margin: 1em 0;"
+
Documentation for VJET JavaScript IDE is available in 2 forms:
|-
+
* [[#Wiki Documents]] <nowiki>-</nowiki> Informational and referential documentation; located on the VJET open source site.
! header 1
+
* [[VJET:Overview#CheatSheets|Eclipse Cheat Sheets, Samples, and Help]] <nowiki>-</nowiki> Tutorial and task related topics available in Eclipse
! header 2
+
! header 3
+
|-
+
| row 1, cell 1
+
| row 1, cell 2
+
| row 1, cell 3
+
|-
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
|}
+
  
 +
Since VJET JavaScript IDE is an Eclipse plugin, most of the documentation will be in Eclipse.&nbsp; With Eclipse Cheat Sheets, you can view documentation, step through tutorials, and code at the same time.
  
The following tables summarize the semantic similarities between Java and VjO. <!-- table start -->
 
  
{| width="100%" style="background-color: #F9F9F9; border: 1px solid #AAAAAA;border-collapse: collapse;color: black; margin: 1em 0;"
 
|-
 
! '''Semantic'''
 
! '''Java'''
 
! '''VJET VJO''' <!-- header row end -->
 
|}
 
|-
 
| Declare a Namespace
 
| package vjo.x.y
 
| <br>
 
|}
 
<!-- table end -->
 
<br> <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("vjo.x.y.Z") // where Z is the name of a class.
 
</pre><!-- code end-->
 
|- | Import a Class | import vjo.utils.X | <br> <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">.needs("vjo.utils.X")
 
</pre><!-- code end-->
 
<br>
 
  
=== Type Definitions and Manipulation  ===
 
  
<!-- table start -->
+
== Wiki Documents  ==
  
{| width="100%" cellspacing="0" cellpadding="4" border="1" class="wikitable sortable" style="border-color:#eee"
 
|-
 
! '''Semantic'''
 
! '''Java'''
 
! '''VJET VJO''' <!-- header row end -->
 
|-
 
| Define a Class
 
|}
 
<!-- table end -->
 
<br> <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X{}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("&lt;namespace&gt;.X")</pre><!-- code end-->
 
|- | Define an Interface <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">interface Y{}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.itype("&lt;namespace&gt;.Y")</pre><!-- code end-->
 
|- | Define an Enum <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">enum E{}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.etype("&lt;namespace&gt;.E")</pre><!-- code end-->
 
|- | Define an Abstract Class <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">abstract class Z{}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt; abstract
 
vjo.ctype("&lt;namespace&gt;.Z")</pre><!-- code end-->
 
|- | Define an Inner Class <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X{}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">X&nbsp;: vjo.ctype()</pre><!-- code end-->
 
|- | Modify a Type <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">final class R{};</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt; final
 
vjo.ctype("vjo.R")</pre><!-- code end-->
 
|- | Define a Constructor <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">D(){}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">constructs: function(){}</pre><!-- code end-->
 
|- | Overload a Constructor <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">D(int arg){}
 
D(String arg){}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt;public void constructs(int arg)
 
//&gt;public void constructs(String arg)
 
constructs:function(arg){}</pre><!-- code end-->
 
|- | Call a Super Constructor | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super()</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base()</pre><!-- code end-->
 
|- | Call a Super Constructor with Arguments | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super(arg)</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base(arg)</pre><!-- code end-->
 
|- | Call a Super Method | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super.doIt()</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base.doIt()</pre><!-- code end-->
 
|- | Extend a Class | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X extends Y</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("&lt;namespace&gt;.X")
 
.inherits("&lt;namespace&gt;.Y")</pre><!-- code end-->
 
|- | Implement an Interface | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X implements Y</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("&lt;namespace&gt;.X")
 
.satisfies("&lt;namespace&gt;.Y")</pre><!-- code end-->
 
|- | Implement an Instance Method | <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">void setName(String name)</pre><!-- code end-->
 
 
 
<!-- code start-->
 
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">.protos({
 
setName: function(String name)</pre><!-- code end-->
 
}) |- | Implement a Static Method | <br> <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">static void setName(String name)
 
</pre><!-- code end-->
 
 
 
<!-- code start-->
 
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">.props({
 
setName: function(String name)
 
})</pre><!-- code end-->
 
|- | Implement a Static Initializer <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">{// static initialization here
 
static{...}</pre><!-- code end-->
 
| <!-- code start-->
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">// static initialization here
 
.inits(function(){...})
 
</pre><!-- code end-->
 
<br>
 
  
test
+
* Getting Started
 +
** [[VJET:VJET JavaScript IDE Installation Guide]] <nowiki>-</nowiki> Installation instructions, brief VJET JavaScript overview, where to find VJET JavaScript documentation
 +
** [[https://www.ebayopensource.org/wiki/display/VJET/Importing+VJET+JavaScript+Type+Libraries Importing VJET JavaScript Type Libraries]] <nowiki>-</nowiki> Importing VJET JavaScript type libraries and configuring projects to use them
 +
** [[VJET:JS code assist and validation for two or more js files|Code assist and validation for 2 or more js files]] <nowiki>-</nowiki> How to get assist for variables/ functions defined in other files.
 +
* Features:
 +
** [[https://www.ebayopensource.org/wiki/display/VJET/Code+Assistance+Features Code Assistance Features]] <nowiki>-</nowiki> Overview of code assist features
 +
** [[https://www.ebayopensource.org/wiki/display/VJET/Code+Search+Features Code Search Features]] <nowiki>-</nowiki> Overview of code search features
 +
* VJET Docs
 +
** [[VJET:Type Declarations Using VJETDoc|VJETDoc&nbsp;]] <nowiki>-</nowiki> type declarations for JavaScript
 +
** [[VJET:VJETDoc Quick Reference]]
 +
** [[VJET:VJETDoc Reference Guide]]
  
==== Declarations  ====
+
== Eclipse Cheat Sheets, Samples, and Help&nbsp;&nbsp; ==
  
<!-- table start -->  
+
In Eclipse, select menu item '''Help > Welcome'''
  
{| width="100%" cellspacing="0" cellpadding="4" border="1" class="wikitable sortable" style="border-color:#eee"
+
* For an overview of VJET JavaScript select the '''Overview''' page, then '''Developing JavaScript'''
|-
+
* For the VJET JavaScript Hello World tutorial select the '''Tutorials''' page, then '''Hello VJET JavaScript World'''
! '''To Declare'''  
+
 
! '''Java'''  
+
=== Eclipse Cheat Sheets ===
! '''VJET VJO''' <!-- header row end -->
+
 
|-
+
Eclipse cheat sheets will be added as an ongoing documentation effort and are delivered in 2 ways:
| Enum Constants
+
* Bundled with the VJET JavaScript IDE plugin
|}
+
* Published outside the VJET JavaScript IDE plugin and can be installed.
<!-- table end -->
+
 
<br> <!-- code start-->
+
Published cheat sheets are available on the [[https://www.ebayopensource.org/index.php/VJET/Downloads VJET JavaScript Download site]].
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public enum Days {
+
 
MON,TUE,WED,THU,FRI,SAT,SUN
+
 
}</pre><!-- code end-->
+
==== Select a Cheat Sheet<br/> ====
| <!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.etype('&lt;namespace&gt;.Days')
+
 
.values('MON,TUE,WED,THU,FRI,SAT,SUN')</pre><!-- code end-->
+
# Select menu item '''Help > Cheat Sheets'''
|- | Argument Types <!-- code start-->
+
# Select '''Select a cheat sheet from the list''', then open the '''JavaScript Development''' folder
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">void setName(String name){}</pre><!-- code end-->
+
# Double click the cheat sheet you want to view
| <!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt; void setName(String name)
+
 
setName&nbsp;: function(name){}</pre><!-- code end-->
+
 
|- | Method Scope <!-- code start-->
+
==== Install a Cheat Sheet ====
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public void setName(String name){}</pre><!-- code end-->
+
 
| <!-- code start-->
+
# Select the menu item '''Help > Cheat Sheets'''
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt;public void setName(String name)
+
# Select '''Enter the URL of a cheat sheet''', and enter the URL of the cheat sheet. Click '''OK'''.
setName&nbsp;: function(name){}</pre><!-- code end-->
+
# If a dialog pops up that indicates that certain actions/commands may not work, dismiss the dialog.
|- | Return Type <!-- code start-->
+
# The cheat sheet will open in Eclipse.
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(){}</pre><!-- code end-->
+
[[Category:VJET]]
| <!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt; public X getIt()
+
getIt&nbsp;: function(){}</pre><!-- code end-->
+
|- | Overloaded Method | <!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(String x)
+
public X getIt(int x)</pre><!-- code end-->  
+
 
+
<!-- code start-->
+
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt;public X getIt(String x)
+
//&gt;public X getIt(int x)
+
getIt:function(x) {}</pre><!-- code end-->
+
|- | Method with Variable Arguments | <!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(String... x)</pre><!-- code end-->
+
 
+
<!-- code start-->
+
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//&gt;public X getIt(String... x)
+
getIt:function(x) {}</pre><!-- code end-->
+
|- | Local Variable | <!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">int x = 10;
+
String s = "hello";
+
final boolean ok = false;</pre><!-- code end-->
+
| <!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">var x = 10; //&lt; int
+
var s = 'hello'; //&lt; String
+
var ok = false; //&lt; final boolean</pre><!-- code end-->
+

Revision as of 21:36, 3 December 2012

Documentation for VJET JavaScript IDE is available in 2 forms:

Since VJET JavaScript IDE is an Eclipse plugin, most of the documentation will be in Eclipse.  With Eclipse Cheat Sheets, you can view documentation, step through tutorials, and code at the same time.



Wiki Documents

Eclipse Cheat Sheets, Samples, and Help  

In Eclipse, select menu item Help > Welcome

  • For an overview of VJET JavaScript select the Overview page, then Developing JavaScript
  • For the VJET JavaScript Hello World tutorial select the Tutorials page, then Hello VJET JavaScript World

Eclipse Cheat Sheets

Eclipse cheat sheets will be added as an ongoing documentation effort and are delivered in 2 ways:

  • Bundled with the VJET JavaScript IDE plugin
  • Published outside the VJET JavaScript IDE plugin and can be installed.

Published cheat sheets are available on the [VJET JavaScript Download site].


Select a Cheat Sheet

  1. Select menu item Help > Cheat Sheets
  2. Select Select a cheat sheet from the list, then open the JavaScript Development folder
  3. Double click the cheat sheet you want to view


Install a Cheat Sheet

  1. Select the menu item Help > Cheat Sheets
  2. Select Enter the URL of a cheat sheet, and enter the URL of the cheat sheet. Click OK.
  3. If a dialog pops up that indicates that certain actions/commands may not work, dismiss the dialog.
  4. The cheat sheet will open in Eclipse.

Back to the top