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"

(Contribution to the Form lifecycle)
(Replaced content with "The Scout documentation has been moved to https://eclipsescout.github.io/.")
 
Line 1: Line 1:
{{ScoutPage|cat=Component Model}}
+
The Scout documentation has been moved to https://eclipsescout.github.io/.
 
+
Field are elements in {{ScoutLink|Concepts|Form|Form}}
+
 
+
* implements: {{ScoutJavadoc|IFormField|I}}
+
* extends: {{ScoutJavadoc|AbstractFormField|C}}
+
 
+
== 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 {{ScoutLink|Concepts|Type of Data|type of data}}:
+
{|{{BMTableStyle}}
+
|-{{BMTHStyle}}
+
! Field
+
! RAP
+
! SWT
+
! Swing
+
! Swing Rayo
+
|-
+
| {{ScoutLink|Concepts|StringField}} || [[Image:Scout_3.8_StringField_RAP.png]] || [[Image:Scout_3.8_StringField_SWT.png]] || [[Image:Scout_3.8_StringField_Swing.png]] || [[Image:Scout_3.8_StringField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|LabelField}} || [[Image:Scout_3.8_LabelField_RAP.png]] || [[Image:Scout_3.8_LabelField_SWT.png]] || [[Image:Scout_3.8_LabelField_Swing.png]] || [[Image:Scout_3.8_LabelField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|IntegerField}} || [[Image:Scout_3.8_IntegerField_RAP.png]] || [[Image:Scout_3.8_IntegerField_SWT.png]] || [[Image:Scout_3.8_IntegerField_Swing.png]] || [[Image:Scout_3.8_IntegerField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|LongField}} || [[Image:Scout_3.8_LongField_RAP.png]] || [[Image:Scout_3.8_LongField_SWT.png]] || [[Image:Scout_3.8_LongField_Swing.png]] || [[Image:Scout_3.8_LongField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|BigIntegerField}} || [[Image:Scout_3.8_BigIntegerField_RAP.png]] || [[Image:Scout_3.8_BigIntegerField_SWT.png]] || [[Image:Scout_3.8_BigIntegerField_Swing.png]] || [[Image:Scout_3.8_BigIntegerField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|DoubleField}} || [[Image:Scout_3.8_DoubleField_RAP.png]] || [[Image:Scout_3.8_DoubleField_SWT.png]] || [[Image:Scout_3.8_DoubleField_Swing.png]] || [[Image:Scout_3.8_DoubleField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|BigDecimalField}} || [[Image:Scout_3.8_BigDecimalField_RAP.png]] || [[Image:Scout_3.8_BigDecimalField_SWT.png]] || [[Image:Scout_3.8_BigDecimalField_Swing.png]] || [[Image:Scout_3.8_BigDecimalField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|FileChooserField}} || [[Image:Scout_3.8_FileChooserField_RAP.png]] || [[Image:Scout_3.8_FileChooserField_SWT.png]] || [[Image:Scout_3.8_FileChooserField_Swing.png]] || [[Image:Scout_3.8_FileChooserField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|BooleanField|BooleanField or CheckBox}} || [[Image:Scout_3.8_BooleanField_RAP.png]] || [[Image:Scout_3.8_BooleanField_SWT.png]] || [[Image:Scout_3.8_BooleanField_Swing.png]] || [[Image:Scout_3.8_BooleanField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|SmartField}} || [[Image:Scout_3.8_SmartField_RAP.png]] || [[Image:Scout_3.8_SmartField_SWT.png]] || [[Image:Scout_3.8_SmartField_Swing.png]] || [[Image:Scout_3.8_SmartField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|ProposalField}} || [[Image:Scout_4.0_ProposalField_RAP.png]] || [[Image:Scout_4.0_ProposalField_SWT.png]] || [[Image:Scout_4.0_ProposalField_Swing.png]] || [[Image:Scout_4.0_ProposalField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|DateField}} || [[Image:Scout_3.8_DateField_RAP.png]] || [[Image:Scout_3.8_DateField_SWT.png]] || [[Image:Scout_3.8_DateField_Swing.png]] || [[Image:Scout_3.8_DateField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|TimeField}} || [[Image:Scout_3.8_TimeField_RAP.png]] || [[Image:Scout_3.8_TimeField_SWT.png]] || [[Image:Scout_3.8_TimeField_Swing.png]] || [[Image:Scout_3.8_TimeField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|DateTimeField}} || [[Image:Scout_3.8_DateTimeField_RAP.png]] || [[Image:Scout_3.8_DateTimeField_SWT.png]] || [[Image:Scout_3.8_DateTimeField_Swing.png]] || [[Image:Scout_3.8_DateTimeField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|CalendarField}} || [[Image:Scout_3.8_CalendarField_RAP.png]] || [[Image:Scout_3.8_CalendarField_SWT.png]] || [[Image:Scout_3.8_CalendarField_Swing.png]] || [[Image:Scout_3.8_CalendarField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|ListBox}} || [[Image:Scout_3.8_ListBox_RAP.png]] || [[Image:Scout_3.8_ListBox_SWT.png]] || [[Image:Scout_3.8_ListBox_Swing.png]] || [[Image:Scout_3.8_ListBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|TreeBox}} || [[Image:Scout_3.8_TreeBox_RAP.png]] || [[Image:Scout_3.8_TreeBox_SWT.png]] || [[Image:Scout_3.8_TreeBox_Swing.png]] || [[Image:Scout_3.8_TreeBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|MailField}} || only Swing available || only Swing available || [[Image:Scout_3.8_MailField_Swing.png]] || [[Image:Scout_3.8_MailField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|HtmlField}} || [[Image:Scout_3.8_HtmlField_RAP.png]] || [[Image:Scout_3.8_HtmlField_SWT.png]] || [[Image:Scout_3.8_HtmlField_Swing.png]] || [[Image:Scout_3.8_HtmlField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|BrowserField}} || [[Image:Scout_3.8_BrowserField_RAP.png]] || [[Image:Scout_3.8_BrowserField_SWT.png]] || [[Image:Scout_3.8_BrowserField_Swing.png]] || [[Image:Scout_3.8_BrowserField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|DocumentField}} ||  colspan="4" align="center" | This will be released soon as a scout swing fragment under epl.
+
|-
+
| colspan="5" align="center" | See also the main article on {{ScoutLink|Concepts|ValueField|value fields}}
+
|-
+
|}
+
 
+
===Composite fields===
+
To group other fields
+
{|{{BMTableStyle}}
+
|-{{BMTHStyle}}
+
! Field
+
! RAP
+
! SWT
+
! Swing
+
! Swing Rayo
+
|-
+
| {{ScoutLink|Concepts|GroupBox|GroupBox}} || [[Image:Scout_3.8_GroupBox_RAP.png]] || [[Image:Scout_3.8_GroupBox_SWT.png]] || [[Image:Scout_3.8_GroupBox_Swing.png]] || [[Image:Scout_3.8_GroupBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|TabBox|TabBox}} || [[Image:Scout_3.8_TabBox_RAP.png]] || [[Image:Scout_3.8_TabBox_SWT.png]] || [[Image:Scout_3.8_TabBox_Swing.png]] || [[Image:Scout_3.8_TabBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|SequenceBox|SequenceBox}} || [[Image:Scout_3.8_SequenceBox_RAP.png]] || [[Image:Scout_3.8_SequenceBox_SWT.png]] || [[Image:Scout_3.8_SequenceBox_Swing.png]] || [[Image:Scout_3.8_SequenceBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|SplitBox|SplitBox}} || [[Image:Scout_3.8_SplitBox_RAP.png]] || [[Image:Scout_3.8_SplitBox_SWT.png]] || [[Image:Scout_3.8_SplitBox_Swing.png]] || [[Image:Scout_3.8_SplitBox_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|RadioButtonGroup|RadioButtonGroup}} || [[Image:Scout_3.8_RadioButtonGroup_RAP.png]] || [[Image:Scout_3.8_RadioButtonGroup_SWT.png]] || [[Image:Scout_3.8_RadioButtonGroup_Swing.png]] || [[Image:Scout_3.8_RadioButtonGroup_Swing_Rayo.png]]
+
|-
+
| colspan="5" align="center" | See also the main article on {{ScoutLink|Concepts|CompositeField|composite field}}
+
|-
+
|}
+
 
+
===Buttons===
+
{|{{BMTableStyle}}
+
|-{{BMTHStyle}}
+
! Button
+
! RAP
+
! SWT
+
! Swing
+
! Swing Rayo
+
|-
+
| {{ScoutLink|Concepts|Button|Button}} || [[Image:Scout_3.8_Button_RAP.png]] || [[Image:Scout_3.8_Button_SWT.png]] || [[Image:Scout_3.8_Button_Swing.png]] || [[Image:Scout_3.8_Button_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|ToggleButton|ToggleButton}} || [[Image:Scout_3.8_ToggleButton_RAP.png]] || [[Image:Scout_3.8_ToggleButton_SWT.png]] || [[Image:Scout_3.8_ToggleButton_Swing.png]] || [[Image:Scout_3.8_ToggleButton_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|LinkButton|LinkButton}} || [[Image:Scout_3.8_LinkButton_RAP.png]] || [[Image:Scout_3.8_LinkButton_SWT.png]] || [[Image:Scout_3.8_LinkButton_Swing.png]] || [[Image:Scout_3.8_LinkButton_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|RadioButton|RadioButton}} || [[Image:Scout_3.8_RadioButton_RAP.png]] || [[Image:Scout_3.8_RadioButton_SWT.png]] || [[Image:Scout_3.8_RadioButton_Swing.png]] || [[Image:Scout_3.8_RadioButton_Swing_Rayo.png]]
+
|-
+
|}
+
 
+
===Other fields===
+
{|{{BMTableStyle}}
+
|-{{BMTHStyle}}
+
! Field
+
! RAP
+
! SWT
+
! Swing
+
! Swing Rayo
+
|-
+
| {{ScoutLink|Concepts|TableField|TableField}} || [[Image:Scout_3.8_TableField_RAP.png]] || [[Image:Scout_3.8_TableField_SWT.png]] || [[Image:Scout_3.8_TableField_Swing.png]] || [[Image:Scout_3.8_TableField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|TableField|TreeField}} || colspan="4" align="center" | {{Note|TODO|Add screenshots for the TreeField}}
+
|-
+
| {{ScoutLink|Concepts|PageField|PageField}} || [[Image:Scout_3.8_PageField_RAP.png]] || [[Image:Scout_3.8_PageField_SWT.png]] || [[Image:Scout_3.8_PageField_Swing.png]] || [[Image:Scout_3.8_PageField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|ImageField|ImageField}} || [[Image:Scout_3.8_ImageField_RAP.png]] || [[Image:Scout_3.8_ImageField_SWT.png]] || [[Image:Scout_3.8_ImageField_Swing.png]] || [[Image:Scout_3.8_ImageField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|SVGField|SVGField}} || [[Image:Scout_3.8_SVGField_RAP.png]] || [[Image:Scout_3.8_SVGField_SWT.png]] || [[Image:Scout_3.8_SVGField_Swing.png]] || [[Image:Scout_3.8_SVGField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|PlannerField|PlannerField}} || only Swing available || only Swing available || [[Image:Scout_3.8_PlannerField_Swing.png]] || [[Image:Scout_3.8_PlannerField_Swing_Rayo.png]]
+
|-
+
| {{ScoutLink|Concepts|WrappedFormField|WrappedFormField}} || colspan="4" align="center" | 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 {{ScoutLink|Concepts|Form#Form_lifecycle|lifecycle management}} in particular to decide if a save action is required or not.
+
 
+
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 <tt>m_touched</tt> flag.
+
* the value returned by <tt>execIsSaveNeeded()</tt> ({{ScoutEvent|IsSaveNeeded}} event).
+
 
+
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).
+
 
+
== Properties ==
+
''Defined with {{ScoutLink|Concepts|GetConfigured Methods|getConfiguredXxxxxx()}} methods''.
+
 
+
{{note|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 {{ScoutLink|Concepts|Exec_Methods|execXxxxxx()}} methods''.
+
 
+
{{note|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 ==
+
* {{ScoutLink|Concepts|ValueField|Value Fields}}
+
* {{ScoutLink|Concepts|Form|Form}}
+

Latest revision as of 05:01, 14 March 2024

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

Back to the top