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/Snippets"

(Snippets)
(Snippets)
Line 20: Line 20:
  
 
* '''LabelRidget'''
 
* '''LabelRidget'''
** binding the Label's text property to a changing model value (like sum)
+
** LabelRidget with text property bound to a changing model value (like a time)
** using icons
+
** LabelRidget with icons
 +
** LabelRidget with a tooltip
  
 
* '''TextRidget'''
 
* '''TextRidget'''
 
** [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/org.eclipse.riena.sample.snippets/src/org/eclipse/riena/sample/snippets/SnippetTextRidget001.java?root=RT_Project&view=markup Text field ridget with minimum length validation rule and direct writing]
 
** [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/org.eclipse.riena.sample.snippets/src/org/eclipse/riena/sample/snippets/SnippetTextRidget001.java?root=RT_Project&view=markup Text field ridget with minimum length validation rule and direct writing]
** TextRidget with markers (output, disabled, hidden, error etc.)
+
** TextRidget with and without direct writing
 +
** TextRidget with 'on edit' validation
 +
** TextRidget with 'on update' validation
 +
** TextRidget with mandatory marker (user input required)
 +
** TextRidget with disabled marker
 +
** TextRidget with error marker
 +
** TextRidget with error marker and error message
 +
** TextRidget with output marker (read only)
 +
** Toggle visibility of a TextRidget
 +
** TextRidget with conversion rule (IConverter)
 +
** Blocked TextRidget
 +
** Non-focusable TextRidget
  
* '''SingleChoiceRidget'''
+
* '''SingleChoiceRidget / ChoiceComposite''' (=Radio Buttons)
* '''MultipleChoiceRidget'''
+
** Binding the SingleChoiceRidget's input to a model
 +
** Binding the SingleChoiceRidget's selection to a model
 +
** SingleChoiceRidget with mandatory marker
 +
** SingleChoiceRidget wird output marker (read only)
 +
 
 +
* '''MultipleChoiceRidget / ChoiceComposite''' (=Check Buttons)
 +
** Binding the MultipleChoiceRidget's input to a model
 +
** Binding the MultipleChoiceRidget's selection to a model
 +
** SingleChoiceRidget with mandatory marker
 +
** SingleChoiceRidget wird output marker (read only)
 +
 
 +
* '''ActionRidget''' (=Button)
 +
** ActionRidget with an ActionListener
 +
** ActionRidget with Text, Icon and an ActionListener
  
* '''ActionRidget'''
 
 
* '''ToggleButtonRidget'''
 
* '''ToggleButtonRidget'''
 +
** ToggleButtonRidget with SWT.PUSH Button and an ActionListener
 +
** ToggleButtonRidget with SWT.CHECK Button and an ActionListener (important: use SingleChoiceRidget for a group of check buttons)
 +
** ToggleButtonRidget with SWT.RADIO Button and an ActionListener (important: this is supported but does not make sense, use MultipleChoiceRidget instead)
 +
** ToggleButtonRidget with icon and text
  
 
* '''ComboRidget'''
 
* '''ComboRidget'''

Revision as of 20:04, 12 September 2008

What are Snippets?

Riena Snippets are small 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.

To run a snippet:

  • create a new project that depends on org.eclipse.riena.client
  • copy the desired snippet to the clipboard
  • select your project and paste the snippet into your project. The snippet class will be created for you
  • run by selecting the class and then selecting Run > Run As > Java Application

Note that the snippets are edited for brevity rather than completeness. They are intended to guide the reader towards the correct solution, rather than be finished products. They are tested against the HEAD stream and may sometimes reference new API or require bug fixes from there.

Snippets also help isolate problems. The best way to report an Riena bug is to write your own snippet showing the problem and paste it into the bug report. For a snippet template, see the "Hello World" example.

To contribute a new snippet, create a snippet contribution in Bugzilla. Thanks in advance for your contribution!

Snippets

  • LabelRidget
    • LabelRidget with text property bound to a changing model value (like a time)
    • LabelRidget with icons
    • LabelRidget with a tooltip
  • TextRidget
    • Text field ridget with minimum length validation rule and direct writing
    • TextRidget with and without direct writing
    • TextRidget with 'on edit' validation
    • TextRidget with 'on update' validation
    • TextRidget with mandatory marker (user input required)
    • TextRidget with disabled marker
    • TextRidget with error marker
    • TextRidget with error marker and error message
    • TextRidget with output marker (read only)
    • Toggle visibility of a TextRidget
    • TextRidget with conversion rule (IConverter)
    • Blocked TextRidget
    • Non-focusable TextRidget
  • SingleChoiceRidget / ChoiceComposite (=Radio Buttons)
    • Binding the SingleChoiceRidget's input to a model
    • Binding the SingleChoiceRidget's selection to a model
    • SingleChoiceRidget with mandatory marker
    • SingleChoiceRidget wird output marker (read only)
  • MultipleChoiceRidget / ChoiceComposite (=Check Buttons)
    • Binding the MultipleChoiceRidget's input to a model
    • Binding the MultipleChoiceRidget's selection to a model
    • SingleChoiceRidget with mandatory marker
    • SingleChoiceRidget wird output marker (read only)
  • ActionRidget (=Button)
    • ActionRidget with an ActionListener
    • ActionRidget with Text, Icon and an ActionListener
  • ToggleButtonRidget
    • ToggleButtonRidget with SWT.PUSH Button and an ActionListener
    • ToggleButtonRidget with SWT.CHECK Button and an ActionListener (important: use SingleChoiceRidget for a group of check buttons)
    • ToggleButtonRidget with SWT.RADIO Button and an ActionListener (important: this is supported but does not make sense, use MultipleChoiceRidget instead)
    • ToggleButtonRidget with icon and text

Snippet002TableRidget.png

Snippet003TableRidgetSorting.png

Snippet004TreeRidget.png

  • TreeTableRidget
  • ShellRidget
  • StatuslineRidget
  • StatuslineNumberRidget
  • EmbeddedTitleBarRidget (?)
  • ModuleTitleBarRidget (?)

Back to the top