|
From: Scott R. (JIRA) <no...@at...> - 2005-10-03 00:05:10
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-215?page=all ] Scott Russell updated RCP-215: ------------------------------ Attachment: ColorValidationInterceptorFactory.patch Patch supplied. -Scott > ColorValidationInterceptorFactory.ColorChanger does not respond to changing component background > ------------------------------------------------------------------------------------------------ > > Key: RCP-215 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-215 > Project: Spring Framework Rich Client Project > Type: Bug > Components: Binding System > Versions: PR1 > Reporter: Scott Russell > Assignee: Oliver Hutchison > Priority: Minor > Attachments: ColorValidationInterceptorFactory.patch > > ColorValidationInterceptorFactory.ColorChanger stores the JComponent background color upon creation, then uses this color to reset component background to if no errors exist. However, in some circumstances the component might change its background color during form interaction (eg. a JTextField starts off non-editable (bg: grey) when first bound, then changes to editable (bg: white) upon a button click). > a suitable fix would be to replace ColorChanger as follows: > private class ColorChanger implements Guarded { > private Color normalColor; > private boolean enabled = false; > private JComponent component; > public ColorChanger(JComponent component) { > this.component = component; > normalColor = component.getBackground(); > } > public boolean isEnabled() { > return enabled; > } > public void setEnabled(boolean enabled) { > if (enabled == this.enabled) > return; > > this.enabled = enabled; > > if (enabled){ > component.setBackground(normalColor); > } > else { > normalColor = component.getBackground(); > component.setBackground(errorColor); > } > } > } > -Scott -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: Peter De B. (JIRA) <no...@at...> - 2005-10-18 06:45:08
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-215?page=all ] Peter De Bruycker updated RCP-215: ---------------------------------- Attachment: rcp-215.patch.txt I investigated the problem, and I propose another fix: if the component passed to the ColorChanger is disabled, first enable it, get the background color, then disable it again. Another thing that changes is that if a field is disabled, it no longer gets it background painted in the error color private class ColorChanger implements Guarded { private Color normalColor; private JComponent component; private Guarded componentGuard; public ColorChanger(JComponent component) { componentGuard = GuardedGroup.createGuardedAdapter(component); if (!componentGuard.isEnabled()) { componentGuard.setEnabled(true); this.normalColor = component.getBackground(); componentGuard.setEnabled(false); } else { this.normalColor = component.getBackground(); } this.component = component; } public boolean isEnabled() { return false; } public void setEnabled(boolean enabled) { if (componentGuard.isEnabled()) { component.setBackground(enabled ? normalColor : errorColor); } } } > ColorValidationInterceptorFactory.ColorChanger does not respond to changing component background > ------------------------------------------------------------------------------------------------ > > Key: RCP-215 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-215 > Project: Spring Framework Rich Client Project > Type: Bug > Components: Binding System > Versions: PR1 > Reporter: Scott Russell > Assignee: Peter De Bruycker > Priority: Minor > Attachments: ColorValidationInterceptorFactory.patch, rcp-215.patch.txt > > ColorValidationInterceptorFactory.ColorChanger stores the JComponent background color upon creation, then uses this color to reset component background to if no errors exist. However, in some circumstances the component might change its background color during form interaction (eg. a JTextField starts off non-editable (bg: grey) when first bound, then changes to editable (bg: white) upon a button click). > a suitable fix would be to replace ColorChanger as follows: > private class ColorChanger implements Guarded { > private Color normalColor; > private boolean enabled = false; > private JComponent component; > public ColorChanger(JComponent component) { > this.component = component; > normalColor = component.getBackground(); > } > public boolean isEnabled() { > return enabled; > } > public void setEnabled(boolean enabled) { > if (enabled == this.enabled) > return; > > this.enabled = enabled; > > if (enabled){ > component.setBackground(normalColor); > } > else { > normalColor = component.getBackground(); > component.setBackground(errorColor); > } > } > } > -Scott -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: Scott R. (JIRA) <no...@at...> - 2005-10-18 12:21:10
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-215?page=comments#action_15016 ] Scott Russell commented on RCP-215: ----------------------------------- That would also work, except when a user has a component that changes colour for some other reason (eg. button press changes a background to yellow ?) after the form has been setup. I don't currently have a use case that requires such functionality, but that's not to say someone else might not sometime later. > ColorValidationInterceptorFactory.ColorChanger does not respond to changing component background > ------------------------------------------------------------------------------------------------ > > Key: RCP-215 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-215 > Project: Spring Framework Rich Client Project > Type: Bug > Components: Binding System > Versions: PR1 > Reporter: Scott Russell > Assignee: Peter De Bruycker > Priority: Minor > Attachments: ColorValidationInterceptorFactory.patch, rcp-215.patch.txt > > ColorValidationInterceptorFactory.ColorChanger stores the JComponent background color upon creation, then uses this color to reset component background to if no errors exist. However, in some circumstances the component might change its background color during form interaction (eg. a JTextField starts off non-editable (bg: grey) when first bound, then changes to editable (bg: white) upon a button click). > a suitable fix would be to replace ColorChanger as follows: > private class ColorChanger implements Guarded { > private Color normalColor; > private boolean enabled = false; > private JComponent component; > public ColorChanger(JComponent component) { > this.component = component; > normalColor = component.getBackground(); > } > public boolean isEnabled() { > return enabled; > } > public void setEnabled(boolean enabled) { > if (enabled == this.enabled) > return; > > this.enabled = enabled; > > if (enabled){ > component.setBackground(normalColor); > } > else { > normalColor = component.getBackground(); > component.setBackground(errorColor); > } > } > } > -Scott -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: Peter De B. (JIRA) <no...@at...> - 2007-11-29 14:35:17
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter De Bruycker resolved RCP-215.
-----------------------------------
Resolution: Fixed
correct background color is remembered.
if the background color is changed after form is setup, the color is remembered
if the error color is showing while changing the background color, the error color will still be shown, but the new background color will be shown after validation errors are resolved
> ColorValidationInterceptorFactory.ColorChanger does not respond to changing component background
> ------------------------------------------------------------------------------------------------
>
> Key: RCP-215
> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-215
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Binding System
> Affects Versions: 0.1.0
> Reporter: Scott Russell
> Assignee: Peter De Bruycker
> Priority: Minor
> Attachments: ColorValidationInterceptorFactory.patch, rcp-215.patch.txt
>
>
> ColorValidationInterceptorFactory.ColorChanger stores the JComponent background color upon creation, then uses this color to reset component background to if no errors exist. However, in some circumstances the component might change its background color during form interaction (eg. a JTextField starts off non-editable (bg: grey) when first bound, then changes to editable (bg: white) upon a button click).
> a suitable fix would be to replace ColorChanger as follows:
> private class ColorChanger implements Guarded {
> private Color normalColor;
> private boolean enabled = false;
> private JComponent component;
> public ColorChanger(JComponent component) {
> this.component = component;
> normalColor = component.getBackground();
> }
> public boolean isEnabled() {
> return enabled;
> }
> public void setEnabled(boolean enabled) {
> if (enabled == this.enabled)
> return;
>
> this.enabled = enabled;
>
> if (enabled){
> component.setBackground(normalColor);
> }
> else {
> normalColor = component.getBackground();
> component.setBackground(errorColor);
> }
> }
> }
> -Scott
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|