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.
Difference between revisions of "Scout/Concepts/ToggleButton"
m (→Description) |
|||
Line 1: | Line 1: | ||
{{ScoutPage|cat=Component Model}} | {{ScoutPage|cat=Component Model}} | ||
− | + | Specific type of {{ScoutLink|Concepts|Button}} (one of the {{ScoutLink|Concepts|Field|Scout Form Field}}) | |
* extends: {{ScoutJavadoc|AbstractToggleButton|C}} | * extends: {{ScoutJavadoc|AbstractToggleButton|C}} | ||
== Description == | == Description == | ||
− | The ToggleButton is a Button with 2 states. | + | The ToggleButton is a Button with 2 states (selected booleean). |
If the user clicks on the ToggleButton then the button will be selected as long as the user clicks on it again. | If the user clicks on the ToggleButton then the button will be selected as long as the user clicks on it again. | ||
Line 24: | Line 24: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | == Code Example == | ||
+ | <source lang="java"> | ||
+ | @Order(10.0) | ||
+ | public class ToggleButtonDefaultField extends AbstractButton { | ||
+ | |||
+ | @Override | ||
+ | protected int getConfiguredDisplayStyle() { | ||
+ | return DISPLAY_STYLE_TOGGLE; | ||
+ | } | ||
+ | |||
+ | @Override | ||
+ | protected String getConfiguredLabel() { | ||
+ | return TEXTS.get("PushToSelect"); | ||
+ | } | ||
+ | |||
+ | @Override | ||
+ | protected boolean getConfiguredProcessButton() { | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
== Properties == | == Properties == | ||
Line 30: | Line 52: | ||
See also the {{ScoutLink|Concepts|Field|Field}} page for the properties that all fields have in common. | See also the {{ScoutLink|Concepts|Field|Field}} page for the properties that all fields have in common. | ||
+ | * {{ScoutProp|DisplayStyle}} needs to be configured to <tt>DISPLAY_STYLE_TOGGLE</tt>. | ||
== Events == | == Events == |
Revision as of 17:50, 9 September 2014
The Scout documentation has been moved to https://eclipsescout.github.io/.
Specific type of The Scout documentation has been moved to https://eclipsescout.github.io/. (one of the The Scout documentation has been moved to https://eclipsescout.github.io/.)
- extends: The Scout documentation has been moved to https://eclipsescout.github.io/.
Description
The ToggleButton is a Button with 2 states (selected booleean).
If the user clicks on the ToggleButton then the button will be selected as long as the user clicks on it again.
Screenshot
State | RAP | SWT | Swing | Swing Rayo |
---|---|---|---|---|
Normal | ||||
Selected |
Code Example
@Order(10.0) public class ToggleButtonDefaultField extends AbstractButton { @Override protected int getConfiguredDisplayStyle() { return DISPLAY_STYLE_TOGGLE; } @Override protected String getConfiguredLabel() { return TEXTS.get("PushToSelect"); } @Override protected boolean getConfiguredProcessButton() { return false; } }
Properties
Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.
See also the The Scout documentation has been moved to https://eclipsescout.github.io/. page for the properties that all fields have in common.
- The Scout documentation has been moved to https://eclipsescout.github.io/. needs to be configured to DISPLAY_STYLE_TOGGLE.
Events
Defined with The Scout documentation has been moved to https://eclipsescout.github.io/. methods.
See also the The Scout documentation has been moved to https://eclipsescout.github.io/. page for the events that all fields have in common.
See Also
- The Scout documentation has been moved to https://eclipsescout.github.io/.