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 "Scout/Concepts/Field"
m (→Buttons) |
(→Contribution to the Form lifecycle) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
* extends: {{ScoutJavadoc|AbstractFormField|C}} | * extends: {{ScoutJavadoc|AbstractFormField|C}} | ||
− | == | + | == Type of fields == |
− | + | ||
It is possible to distinguish different types of fields: | It is possible to distinguish different types of fields: | ||
Line 20: | Line 19: | ||
! Swing Rayo | ! Swing Rayo | ||
|- | |- | ||
− | | {{ScoutLink|Concepts | + | | {{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 | + | | {{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 | + | | {{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 | + | | {{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 | + | | {{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 | + | | {{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 | + | | {{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 | + | | {{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|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 | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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| | + | | {{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}} | | colspan="5" align="center" | See also the main article on {{ScoutLink|Concepts|ValueField|value fields}} | ||
Line 97: | Line 98: | ||
! Swing Rayo | ! 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]] |
|- | |- | ||
|} | |} | ||
Line 118: | Line 119: | ||
| {{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|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| | + | | {{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|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]] | ||
Line 131: | Line 132: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | |||
+ | == 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 == | == 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/.
- implements: The Scout documentation has been moved to https://eclipsescout.github.io/.
- extends: The Scout documentation has been moved to https://eclipsescout.github.io/.
Contents
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/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | File:Scout 4.0 ProposalField RAP.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/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | only Swing available | only Swing available | ||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
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/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
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/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. |
Other fields
Field | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | ||||
The Scout documentation has been moved to https://eclipsescout.github.io/. | only Swing available | only Swing available | ||
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.
Events
Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.
See Also
- The Scout documentation has been moved to https://eclipsescout.github.io/.
- The Scout documentation has been moved to https://eclipsescout.github.io/.