Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Riena/Examples"

(Try the Riena Snippets)
 
(6 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
== Try the Riena Snippets ==
 
== Try the Riena Snippets ==
The [[Riena_Snippets|Riena Snippets]] page contains a growing collection of self-contained code examples that show you how to use '''ridgets''' ("Riena widgets") and what you can do with them. For a discussion what Ridgets are, look here http://wiki.eclipse.org/Riena/Custom_Ridgets
+
The [[Riena_Snippets|Riena Snippets]] page contains a growing collection of self-contained code examples that show you how to use '''ridgets''' ("Riena widgets") and what you can do with them. For a description what Ridgets are, look here http://wiki.eclipse.org/Riena/Custom_Ridgets
  
  
 
== Try the communication ping pong example ==
 
== Try the communication ping pong example ==
# File -> Import -> Plug-in Development -> Plug-ins and Fragments -> Next.
+
# Import the 4 plugins <tt>*.communication.sample.pingpong.*</tt> from the target platform. (See [[#Import a Riena plugin]])
# Select "Projects with source folders" unter Import As (since it's more fun with source code) -> Next.
+
# In the Plug-ins Listbox, select the 4 plugins <tt>*.communication.sample.pingpong.*</tt> and click Add and then Finish.
+
 
# In the Run Dialog you can select which of the two components to run (under 'OSGi Framework').
 
# In the Run Dialog you can select which of the two components to run (under 'OSGi Framework').
#* '''Don't forget''' to press the 'Add required Bundles' button for both of them before you start them!
+
#* Select the Bundles <tt>org.eclipse.equinox.console</tt> and <tt>org.apache.felix.gogo.shell</tt> and press the 'Add required Bundles' button for both of them before you start them!
## First, start the Riena Sample PingPong Server.
+
## First, start the '''Riena Sample PingPong Server'''.
##* The server starts at port 8080, make sure it's not taken.
+
##* The server starts on port 8080, make sure it's not taken.
## Then start the Riena Sample PingPong Client.
+
## Then start the '''Riena Sample PingPong Client'''.
 
# On success your client will print a message on the console: <tt>PingPong::Client:: [Pong] says = Thx. I got the ping!</tt>
 
# On success your client will print a message on the console: <tt>PingPong::Client:: [Pong] says = Thx. I got the ping!</tt>
 
# Switch to the server console; it should show a message like this: <tt>PingPong::Server:: [Ping] says = I ping you and you pong me</tt>
 
# Switch to the server console; it should show a message like this: <tt>PingPong::Server:: [Ping] says = I ping you and you pong me</tt>
 +
 +
<div id="Import a Riena plugin">
 +
{{warning2|text= Import a Riena plugin'''
 +
# File -> Import -> Plug-in Development -> Plug-ins and Fragments -> Next.
 +
# Select "Projects with source folders" under "Import As" (since it's more fun with source code) -> Next.
 +
# In the "Plug-ins and Fragments Found" Listbox, select the requested plugins and click Add and then Finish.}}
 +
</div>
  
 
== Try the unit tests ==
 
== Try the unit tests ==
# Import the project <tt>org.eclipse.riena.tests</tt> from the target platform (same as above).
+
# Import the project <tt>org.eclipse.riena.tests</tt> from the target platform. (See [[#Import a Riena plugin]])
 
# There are classes like <tt>AllTests</tt> on various levels that you can run as Junit Plugin Tests.
 
# There are classes like <tt>AllTests</tt> on various levels that you can run as Junit Plugin Tests.
 
# You can also run individual tests as JUnit Plugin Tests.
 
# You can also run individual tests as JUnit Plugin Tests.
  
; Currently there are more than 2000 tests
+
; Currently there are more than 3000 tests
 
: They should all work. Some of them fail if you click or move the mouse while the tests are running (e.g. focus or UI tests).
 
: They should all work. Some of them fail if you click or move the mouse while the tests are running (e.g. focus or UI tests).
 
; Launch Error on starting tests
 
; Launch Error on starting tests
Line 41: Line 46:
  
 
== Install the Riena Sample App Server ==
 
== Install the Riena Sample App Server ==
 
 
Simple server with customer search web service:
 
Simple server with customer search web service:
 
# Stop any previously started client or server.
 
# Stop any previously started client or server.
# Import the projects <tt>org.eclipse.riena.sample.app.server</tt> and <tt>org.eclipse.riena.sample.app.common</tt> from the target platform.
+
# Import the 4 projects <tt>org.eclipse.riena.sample.app.server</tt>, <tt>org.eclipse.riena.sample.app.common</tt>,  <tt>org.eclipse.riena.security.services</tt> and <tt>org.eclipse.riena.security.simpleservices</tt> from the target platform. (See [[#Import a Riena plugin]])
# Start Riena App Server from the Run Dialog:
+
# Start '''Riena App Server''' from the Run Dialog:
#* Don't forget to press the button "Add required bundles".
+
#* Select the Bundles <tt>org.eclipse.equinox.console</tt> and <tt>org.apache.felix.gogo.shell</tt> and press the 'Add required Bundles' button before you start it!
 
#* This server starts on port 8080, make sure that port is not taken.
 
#* This server starts on port 8080, make sure that port is not taken.
# That should bring up a relativly simple app server with just the customer search web service.
+
# That should bring up a simple app server with a secured customer search web service.
 
+
Server with many more services:
+
# Stop the server again.
+
# Bring up the Run Dialog again, select Riena App Server and select the bundles <tt>org.eclipse.riena.security.services</tt> and <tt>org.eclipse.riena.security.simpleservices</tt> (both found in the target platform).
+
# Press "Add required bundles".
+
# Run it.
+
# Now you can see in the console a lot more (security-related) web services.
+
# Now you can also run the <tt>*ITests</tt> from the <tt>tests</tt> bundle, e.g. <tt>SessionServiceITest</tt>.
+
  
 
== Run the Riena Example Client ==
 
== Run the Riena Example Client ==
# File -> Import -> Plug-in Development -> Plug-ins and Fragments -> Next.
+
# Import the project <tt>org.eclipse.riena.example.client</tt> from the target platform. (See [[#Import a Riena plugin]])
# Select "Projects with source folders" unter 'Import As' (since it's more fun with source code) -> Next.
+
# In the "Run Dialog -> Eclipse Application", there are five new entries. Depending on the target platform you have to select the right run configuration.
# In the Plug-ins Listbox, select the plugin <tt>org.eclipse.riena.example.client</tt>, click 'Add' and then 'Finish'.
+
## For the target platform '''3.x''':
# In the Run Dialog -> Eclipse Application, there are two entries "SWT ExampleApplication" and "SWT ExampleApplication (with alternative Lnf)".
+
### Select the '''SWT ExampleApplication''' or '''SWT ExampleApplication (with alternative LnF)''' configuration.
# You can launch them both:
+
### Add the plug-ins <tt>org.eclipse.riena.navigation.ui.swt.rcp</tt> and <tt>org.eclipse.riena.ui.swt.3x</tt> and press the 'Add required Plug-ins' button before you start them!
#* Don't forget to click on Add Required Plug-ins in the Plug-ins Tab.
+
###* Both launchers start the same application based on the same code, but using two distinct Riena Themes (different colors, fonts etc.).
#* Both launchers start the same application based on the same code, but using two distinct Riena Themes (different colors, fonts etc.).
+
## For the target platform '''4.x''':
# Play with it :-)
+
### Select the '''SWT ExampleApplication E4'''
 +
### Add the plug-ins <tt>org.eclipse.riena.navigation.ui.swt.rcp</tt> and <tt>org.eclipse.riena.ui.swt.e4</tt> and press the 'Add required Plug-ins' button before you start it!
 +
## For the target platform '''RAP''':
 +
### Open the plugin.xml in the root folder of the project.
 +
### Uncomment the extension for RAP at the end of the file. (Line 1721 - 1726)
 +
### Run the '''Riena Example Client on RAP''' launcher.
  
There is also a project <tt>org.eclipse.riena.sample.app.client.mail</tt> that you can import and start the same way. (The launcher is "Mail Sample (Riena UI)".)
+
== Run the Riena Example Mail Client ==
 +
# Import the project <tt>org.eclipse.riena.sample.app.client.mail</tt> from the target platform. (See [[#Import a Riena plugin]])
 +
# Start '''Mail Sample (Riena UI)''' from the Run Dialog:
 +
## For the target platform '''3.x''':
 +
### Select at the Main tab <tt>Run an application</tt> and '''org.eclipse.riena.sample.app.client.mail.mailapp'''
 +
### Add the plug-ins <tt>org.eclipse.riena.navigation.ui.swt.rcp</tt> and <tt>org.eclipse.riena.ui.swt.3x</tt> and press the 'Add required Plug-ins' button before you start them!
 +
## For the target platform '''4.x''':
 +
### Coming soon
 +
## For the target platform '''RAP''':
 +
### Open the plugin.xml in the root folder of the project.
 +
### Add the extension: <code> <extension point="org.eclipse.rap.ui.entrypoint"> <entrypoint id="example.application.entrypoint" applicationId="org.eclipse.riena.sample.app.client.mail.mailapp" path="/rap" /> </extension> </code>
 +
### Select the '''RAP Mail Sample (Riena UI)'''
 +
### Add the bundles <tt>org.eclipse.riena.navigation.ui.swt.rap</tt> and <tt>org.eclipse.riena.ui.swt.rap</tt> and press the 'Add required Plug-ins' button before you start it!
  
 
== Run the Riena Demo ==
 
== Run the Riena Demo ==
# File -> Import -> Plug-in Development -> Plug-ins and Fragments -> Next.
+
# Import the 4 projects <tt>org.eclipse.riena.demo.*</tt> from the target platform. (See [[#Import a Riena plugin]])
# Select "Projects with source folders" unter 'Import As' (again: it's more fun with source code) -> Next.
+
# Select the '''Riena Demo Server''' launcher
# In the Plug-ins Listbox, select the 3 plugins <tt>org.eclipse.riena.demo.*</tt>, click 'Add' and then 'Finish'.
+
# Add the Bundles <tt>org.eclipse.equinox.console</tt> and <tt>org.apache.felix.gogo.shell</tt>  and press the 'Add required Plug-ins' button before you start them!
# Run the Riena Demo Server launcher (don't forget Add Required Plug-ins).
+
# Select the '''Riena Demo Client''' launcher
* Run the Riena Demo Client launcher (don't forget Add Required Plug-ins).
+
## For the target platform '''3.x''':
 +
### Select at the Main tab <tt>Run an application</tt> and '''org.eclipse.riena.demo.client.application'''
 +
### Add the plug-ins <tt>org.eclipse.riena.navigation.ui.swt.rcp</tt> and <tt>org.eclipse.riena.ui.swt.3x</tt> and press the 'Add required Plug-ins' button before you start them!
 +
## For the target platform '''4.x''':
 +
### Select at the Main tab <tt>Run a product</tt> and '''org.eclipse.riena.e4.launcher.product'''
 +
### Add the plug-ins <tt>org.eclipse.riena.navigation.ui.swt.rcp</tt> and <tt>org.eclipse.riena.ui.swt.e4</tt> and press the 'Add required Plug-ins' button before you start them!
 +
###* The missing icons will throw some Exceptions
 +
 
  
 
== Next Step ==
 
== Next Step ==
 
+
Get started with the [[Riena/BaseConcepts|Base concepts of Riena]].
Get started with the [[Riena/BaseConcepts|key concepts and features of Riena]].
+

Latest revision as of 06:13, 12 December 2014

{{#eclipseproject:rt.riena}}

Try the Riena Snippets

The Riena Snippets page contains a growing collection of self-contained code examples that show you how to use ridgets ("Riena widgets") and what you can do with them. For a description what Ridgets are, look here http://wiki.eclipse.org/Riena/Custom_Ridgets


Try the communication ping pong example

  1. Import the 4 plugins *.communication.sample.pingpong.* from the target platform. (See #Import a Riena plugin)
  2. In the Run Dialog you can select which of the two components to run (under 'OSGi Framework').
    • Select the Bundles org.eclipse.equinox.console and org.apache.felix.gogo.shell and press the 'Add required Bundles' button for both of them before you start them!
    1. First, start the Riena Sample PingPong Server.
      • The server starts on port 8080, make sure it's not taken.
    2. Then start the Riena Sample PingPong Client.
  3. On success your client will print a message on the console: PingPong::Client:: [Pong] says = Thx. I got the ping!
  4. Switch to the server console; it should show a message like this: PingPong::Server:: [Ping] says = I ping you and you pong me
Import a Riena plugin
  1. File -> Import -> Plug-in Development -> Plug-ins and Fragments -> Next.
  2. Select "Projects with source folders" under "Import As" (since it's more fun with source code) -> Next.
  3. In the "Plug-ins and Fragments Found" Listbox, select the requested plugins and click Add and then Finish.

Try the unit tests

  1. Import the project org.eclipse.riena.tests from the target platform. (See #Import a Riena plugin)
  2. There are classes like AllTests on various levels that you can run as Junit Plugin Tests.
  3. You can also run individual tests as JUnit Plugin Tests.
Currently there are more than 3000 tests
They should all work. Some of them fail if you click or move the mouse while the tests are running (e.g. focus or UI tests).
Launch Error on starting tests
This sometimes happens when you launch a test as JUnit Plugin Test for the first time. => You will need to modify the launch configuration for this class:
  1. In the "Main" tab, change the field "Run an application" to "[No Application] - Headless Mode".
  2. In the "Plug-ins" tab:
    1. Launch with: choose "plug-ins selected below only".
    2. "Deselect All"
    3. Check/select the bundle containing the test you want to run.
    4. "Add Required Plug-ins"
  3. Apply. Run.
Classes ending with *ITest require a server.
That's the Riena App Sample Server (explained in the next step).

Install the Riena Sample App Server

Simple server with customer search web service:

  1. Stop any previously started client or server.
  2. Import the 4 projects org.eclipse.riena.sample.app.server, org.eclipse.riena.sample.app.common, org.eclipse.riena.security.services and org.eclipse.riena.security.simpleservices from the target platform. (See #Import a Riena plugin)
  3. Start Riena App Server from the Run Dialog:
    • Select the Bundles org.eclipse.equinox.console and org.apache.felix.gogo.shell and press the 'Add required Bundles' button before you start it!
    • This server starts on port 8080, make sure that port is not taken.
  4. That should bring up a simple app server with a secured customer search web service.

Run the Riena Example Client

  1. Import the project org.eclipse.riena.example.client from the target platform. (See #Import a Riena plugin)
  2. In the "Run Dialog -> Eclipse Application", there are five new entries. Depending on the target platform you have to select the right run configuration.
    1. For the target platform 3.x:
      1. Select the SWT ExampleApplication or SWT ExampleApplication (with alternative LnF) configuration.
      2. Add the plug-ins org.eclipse.riena.navigation.ui.swt.rcp and org.eclipse.riena.ui.swt.3x and press the 'Add required Plug-ins' button before you start them!
        • Both launchers start the same application based on the same code, but using two distinct Riena Themes (different colors, fonts etc.).
    2. For the target platform 4.x:
      1. Select the SWT ExampleApplication E4
      2. Add the plug-ins org.eclipse.riena.navigation.ui.swt.rcp and org.eclipse.riena.ui.swt.e4 and press the 'Add required Plug-ins' button before you start it!
    3. For the target platform RAP:
      1. Open the plugin.xml in the root folder of the project.
      2. Uncomment the extension for RAP at the end of the file. (Line 1721 - 1726)
      3. Run the Riena Example Client on RAP launcher.

Run the Riena Example Mail Client

  1. Import the project org.eclipse.riena.sample.app.client.mail from the target platform. (See #Import a Riena plugin)
  2. Start Mail Sample (Riena UI) from the Run Dialog:
    1. For the target platform 3.x:
      1. Select at the Main tab Run an application and org.eclipse.riena.sample.app.client.mail.mailapp
      2. Add the plug-ins org.eclipse.riena.navigation.ui.swt.rcp and org.eclipse.riena.ui.swt.3x and press the 'Add required Plug-ins' button before you start them!
    2. For the target platform 4.x:
      1. Coming soon
    3. For the target platform RAP:
      1. Open the plugin.xml in the root folder of the project.
      2. Add the extension: <extension point="org.eclipse.rap.ui.entrypoint"> <entrypoint id="example.application.entrypoint" applicationId="org.eclipse.riena.sample.app.client.mail.mailapp" path="/rap" /> </extension>
      3. Select the RAP Mail Sample (Riena UI)
      4. Add the bundles org.eclipse.riena.navigation.ui.swt.rap and org.eclipse.riena.ui.swt.rap and press the 'Add required Plug-ins' button before you start it!

Run the Riena Demo

  1. Import the 4 projects org.eclipse.riena.demo.* from the target platform. (See #Import a Riena plugin)
  2. Select the Riena Demo Server launcher
  3. Add the Bundles org.eclipse.equinox.console and org.apache.felix.gogo.shell and press the 'Add required Plug-ins' button before you start them!
  4. Select the Riena Demo Client launcher
    1. For the target platform 3.x:
      1. Select at the Main tab Run an application and org.eclipse.riena.demo.client.application
      2. Add the plug-ins org.eclipse.riena.navigation.ui.swt.rcp and org.eclipse.riena.ui.swt.3x and press the 'Add required Plug-ins' button before you start them!
    2. For the target platform 4.x:
      1. Select at the Main tab Run a product and org.eclipse.riena.e4.launcher.product
      2. Add the plug-ins org.eclipse.riena.navigation.ui.swt.rcp and org.eclipse.riena.ui.swt.e4 and press the 'Add required Plug-ins' button before you start them!
        • The missing icons will throw some Exceptions


Next Step

Get started with the Base concepts of Riena.

Back to the top