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.
Difference between revisions of "JRuby/SWTSnippets"
< JRuby
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The [http://www.eclipse.org/swt/snippets/ SWT Snippets] ported to JRuby. | + | The [http://www.eclipse.org/swt/snippets/ SWT Snippets] ported to [[JRuby]]. |
From the above link: "Snippets are minimal stand-alone programs that demonstrate specific techniques or functionality. Often a small example is the easiest way to understand how to use a particular feature." | From the above link: "Snippets are minimal stand-alone programs that demonstrate specific techniques or functionality. Often a small example is the easiest way to understand how to use a particular feature." | ||
+ | |||
+ | For help setting up and running JRuby with SWT, see [[JRuby/SWTSetup]]. To run one of the snippets, copy/paste the code to a file with the same name as the page, then run it with jruby. For example: | ||
+ | <pre>jruby Snippet1.rb</pre> | ||
+ | |||
+ | * [[JRuby/SWTSnippets/Snippet1.rb|"Hello World"]] | ||
+ | |||
+ | * '''GridLayout''' | ||
+ | ** [[JRuby/SWTSnippets/Snippet6.rb|insert widgets into a grid layout]] | ||
+ | |||
+ | * '''ScrolledComposite''' | ||
+ | ** [[JRuby/SWTSnippets/Snippet5.rb|scroll a control in a scrolled composite]] | ||
+ | |||
+ | * '''Shell''' | ||
+ | ** [[JRuby/SWTSnippets/Snippet4.rb|prevent a shell from closing (prompt the user)]] | ||
+ | |||
+ | * '''Table''' | ||
+ | ** [[JRuby/SWTSnippets/Snippet3.rb|find a table cell from mouse down (SWT.FULL_SELECTION)]] | ||
+ | ** [[JRuby/SWTSnippets/Snippet2.rb|sort a table by column]] |
Latest revision as of 08:17, 28 July 2009
The SWT Snippets ported to JRuby.
From the above link: "Snippets are minimal stand-alone programs that demonstrate specific techniques or functionality. Often a small example is the easiest way to understand how to use a particular feature."
For help setting up and running JRuby with SWT, see JRuby/SWTSetup. To run one of the snippets, copy/paste the code to a file with the same name as the page, then run it with jruby. For example:
jruby Snippet1.rb
- GridLayout
- ScrolledComposite