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 "Scout/Concepts/Field"

(add Contribution to the Form lifecycle)
(Contribution to the Form lifecycle)
Line 134: Line 134:
  
  
== Contribution to the Form lifecycle ==
+
== Contribution to unsaved changes ==
Each field control if he contains modifications or not. This information is used by the form for the lifecycle management (for example: when is a save action is required).
+
Each field controls if he contains modifications or not. This information is used by the form for its {{ScoutLink|Concepts|Form#Form_lifecycle|lifecycle management}} in particular to decide if a save action is required or not.
  
Each field define if it contains modifications with the method <tt>isSaveNeeded()</tt>. The property is updated when <tt>checkSaveNeeded()</tt> is called. The implementation of this method check:
+
Each field defines if it contains unsaved modifications with the method <tt>isSaveNeeded()</tt>. The property is updated when <tt>checkSaveNeeded()</tt> is called on the field. The implementation of this method checks:
* the value of the touch flag.
+
* the value of the <tt>m_touched</tt> flag.
* the value returned by execIsSaveNeeded() ({{ScoutEvent|IsSaveNeeded}} event).
+
* the value returned by <tt>execIsSaveNeeded()</tt> ({{ScoutEvent|IsSaveNeeded}} event).
  
The touch flag can be modified with <tt>touch()</tt> (flag is set to true) and <tt>markSaved()</tt> (flag is set to false). Additionally when the flag is set to false the event {{ScoutEvent|MarkSaved}} is triggered.
+
The <tt>m_touched</tt> flag can be modified with <tt>touch()</tt> (flag is set to true) and <tt>markSaved()</tt> (flag is set to false). Additionally when the flag is set to false the event {{ScoutEvent|MarkSaved}} is triggered. Depending on the type of field this event will: reset the initial value to the current value for value fields or propagate the call to all the children for a composite field.
  
 
The <tt>execIsSaveNeeded()</tt> method provides a way to add field-specific logic to tell if the field contains informations that require a save action (at form level) or not. The default implementation just compares the initial value with the current value. If they are not equals the method return true (to indicate that a save action is needed to save the content of this field).
 
The <tt>execIsSaveNeeded()</tt> method provides a way to add field-specific logic to tell if the field contains informations that require a save action (at form level) or not. The default implementation just compares the initial value with the current value. If they are not equals the method return true (to indicate that a save action is needed to save the content of this field).
 
  
 
== Properties ==
 
== Properties ==

Revision as of 13:27, 25 September 2014

The Scout documentation has been moved to https://eclipsescout.github.io/.

Field are elements in The Scout documentation has been moved to https://eclipsescout.github.io/.

Type of fields

It is possible to distinguish different types of fields:

Value fields

These fiels contain a value. There are specific implementation depending on the The Scout documentation has been moved to https://eclipsescout.github.io/.:

Field RAP SWT Swing Swing Rayo
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 StringField RAP.png Scout 3.8 StringField SWT.png Scout 3.8 StringField Swing.png Scout 3.8 StringField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 LabelField RAP.png Scout 3.8 LabelField SWT.png Scout 3.8 LabelField Swing.png Scout 3.8 LabelField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 IntegerField RAP.png Scout 3.8 IntegerField SWT.png Scout 3.8 IntegerField Swing.png Scout 3.8 IntegerField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 LongField RAP.png Scout 3.8 LongField SWT.png Scout 3.8 LongField Swing.png Scout 3.8 LongField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 BigIntegerField RAP.png Scout 3.8 BigIntegerField SWT.png Scout 3.8 BigIntegerField Swing.png Scout 3.8 BigIntegerField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 DoubleField RAP.png Scout 3.8 DoubleField SWT.png Scout 3.8 DoubleField Swing.png Scout 3.8 DoubleField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 BigDecimalField RAP.png Scout 3.8 BigDecimalField SWT.png Scout 3.8 BigDecimalField Swing.png Scout 3.8 BigDecimalField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 FileChooserField RAP.png Scout 3.8 FileChooserField SWT.png Scout 3.8 FileChooserField Swing.png Scout 3.8 FileChooserField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 BooleanField RAP.png Scout 3.8 BooleanField SWT.png Scout 3.8 BooleanField Swing.png Scout 3.8 BooleanField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 SmartField RAP.png Scout 3.8 SmartField SWT.png Scout 3.8 SmartField Swing.png Scout 3.8 SmartField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. File:Scout 4.0 ProposalField RAP.png Scout 4.0 ProposalField SWT.png File:Scout 4.0 ProposalField Swing.png File:Scout 4.0 ProposalField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 DateField RAP.png Scout 3.8 DateField SWT.png Scout 3.8 DateField Swing.png Scout 3.8 DateField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 TimeField RAP.png Scout 3.8 TimeField SWT.png Scout 3.8 TimeField Swing.png Scout 3.8 TimeField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 DateTimeField RAP.png Scout 3.8 DateTimeField SWT.png Scout 3.8 DateTimeField Swing.png Scout 3.8 DateTimeField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 CalendarField RAP.png Scout 3.8 CalendarField SWT.png Scout 3.8 CalendarField Swing.png Scout 3.8 CalendarField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 ListBox RAP.png Scout 3.8 ListBox SWT.png Scout 3.8 ListBox Swing.png Scout 3.8 ListBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 TreeBox RAP.png Scout 3.8 TreeBox SWT.png Scout 3.8 TreeBox Swing.png Scout 3.8 TreeBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. only Swing available only Swing available Scout 3.8 MailField Swing.png Scout 3.8 MailField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 HtmlField RAP.png Scout 3.8 HtmlField SWT.png Scout 3.8 HtmlField Swing.png Scout 3.8 HtmlField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 BrowserField RAP.png Scout 3.8 BrowserField SWT.png Scout 3.8 BrowserField Swing.png Scout 3.8 BrowserField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. This will be released soon as a scout swing fragment under epl.
See also the main article on The Scout documentation has been moved to https://eclipsescout.github.io/.

Composite fields

To group other fields

Field RAP SWT Swing Swing Rayo
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 GroupBox RAP.png Scout 3.8 GroupBox SWT.png Scout 3.8 GroupBox Swing.png Scout 3.8 GroupBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 TabBox RAP.png Scout 3.8 TabBox SWT.png Scout 3.8 TabBox Swing.png Scout 3.8 TabBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 SequenceBox RAP.png Scout 3.8 SequenceBox SWT.png Scout 3.8 SequenceBox Swing.png Scout 3.8 SequenceBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 SplitBox RAP.png Scout 3.8 SplitBox SWT.png Scout 3.8 SplitBox Swing.png Scout 3.8 SplitBox Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 RadioButtonGroup RAP.png Scout 3.8 RadioButtonGroup SWT.png Scout 3.8 RadioButtonGroup Swing.png Scout 3.8 RadioButtonGroup Swing Rayo.png
See also the main article on The Scout documentation has been moved to https://eclipsescout.github.io/.

Buttons

Button RAP SWT Swing Swing Rayo
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 Button RAP.png Scout 3.8 Button SWT.png Scout 3.8 Button Swing.png Scout 3.8 Button Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 ToggleButton RAP.png Scout 3.8 ToggleButton SWT.png Scout 3.8 ToggleButton Swing.png Scout 3.8 ToggleButton Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 LinkButton RAP.png Scout 3.8 LinkButton SWT.png Scout 3.8 LinkButton Swing.png Scout 3.8 LinkButton Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 RadioButton RAP.png Scout 3.8 RadioButton SWT.png Scout 3.8 RadioButton Swing.png Scout 3.8 RadioButton Swing Rayo.png

Other fields

Field RAP SWT Swing Swing Rayo
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 TableField RAP.png Scout 3.8 TableField SWT.png Scout 3.8 TableField Swing.png Scout 3.8 TableField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/.
Note.png
TODO
Add screenshots for the TreeField
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 PageField RAP.png Scout 3.8 PageField SWT.png Scout 3.8 PageField Swing.png Scout 3.8 PageField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 ImageField RAP.png Scout 3.8 ImageField SWT.png Scout 3.8 ImageField Swing.png Scout 3.8 ImageField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Scout 3.8 SVGField RAP.png Scout 3.8 SVGField SWT.png Scout 3.8 SVGField Swing.png Scout 3.8 SVGField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. only Swing available only Swing available Scout 3.8 PlannerField Swing.png Scout 3.8 PlannerField Swing Rayo.png
The Scout documentation has been moved to https://eclipsescout.github.io/. Contains another form


Contribution to unsaved changes

Each field controls if he contains modifications or not. This information is used by the form for its The Scout documentation has been moved to https://eclipsescout.github.io/. in particular to decide if a save action is required or not.

Each field defines if it contains unsaved modifications with the method isSaveNeeded(). The property is updated when checkSaveNeeded() is called on the field. The implementation of this method checks:

  • the value of the m_touched flag.
  • the value returned by execIsSaveNeeded() (The Scout documentation has been moved to https://eclipsescout.github.io/. event).

The m_touched flag can be modified with touch() (flag is set to true) and markSaved() (flag is set to false). Additionally when the flag is set to false the event The Scout documentation has been moved to https://eclipsescout.github.io/. is triggered. Depending on the type of field this event will: reset the initial value to the current value for value fields or propagate the call to all the children for a composite field.

The execIsSaveNeeded() method provides a way to add field-specific logic to tell if the field contains informations that require a save action (at form level) or not. The default implementation just compares the initial value with the current value. If they are not equals the method return true (to indicate that a save action is needed to save the content of this field).

Properties

Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.

Note.png
TODO
Add a description of important properties. The idea is not to recreate the JavaDoc of the getConfiguredXxxxxx() methods but to provide explanations, best practice, example... Group the properties by domain.


Events

Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.

Note.png
TODO
Add a description of important events. The idea is not to recreate the JavaDoc of the execXxxxxx() methods but to provide explanations, best practice, example... Group the events by domain.


See Also

Copyright © Eclipse Foundation, Inc. All Rights Reserved.