Skip to main content

Please review "Configuration editor [Quick Set mode]: user data are kept i"

4 replies [Last post]
ersh
Offline
Joined: 2006-10-18
Points: 0

Configuration editor [Quick Set mode]: user data are kept in memory

If user closes Quick-Set CE window by X in system menu(upper right corner) and answers 'NO' when he is asked about saving his changes, then his change is not saved into disk, however when he opens Quick-Set CE menu again he *will see* his unsaved changes. Looks like JT keeps user changes in memory.

Evaluation
ConfigEditor does not load actual values in method show(CE_View newView)

Suggested Fix
Index: com/sun/javatest/exec/ConfigEditor.java
===================================================================
--- com/sun/javatest/exec/ConfigEditor.java (revision 51)
+++ com/sun/javatest/exec/ConfigEditor.java (working copy)
@@ -554,6 +554,10 @@
if (newView == null)
throw new NullPointerException();

+ if (currView != null) {
+ currView.load();
+ }
+
if (currView != newView) {
// note whether the focus is in the current view
KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();

Please review the fix
http://fisheye4.cenqua.com/browse/jtharness/branches/users/ersh/pr1/src/...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13
Points: 0

Fix looks ok to me. Seems that it will have no effect if currView is a FullView, since FullView.load() does not do too much. One note though - it seems load() will happen twice if the user is switching views. What if your new code was the else action if if (currView != newView). So:

if (currView != newView) {
// ...
currView.load();
// ...
}
else
currView.load(); // the new line

ersh
Offline
Joined: 2006-10-18
Points: 0

Brian, I agree

This code is better:

if (currView != null && currView == newView) {
currView.load();
}

Brian Kurotsuchi

That seems to be a reasonable alternative. thanks. I think you should go ahead
and integrate this.

jtharness@mobileandembedded.org wrote:
> Brian, I agree
>
> This code is better:
>
> if (currView != null && currView == newView) {
> currView.load();
> }
> [Message sent by forum member 'ersh' (ersh)]
>
> http://forums.java.net/jive/thread.jspa?messageID=228402
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jtharness.dev.java.net
> For additional commands, e-mail: interest-help@jtharness.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jtharness.dev.java.net
For additional commands, e-mail: interest-help@jtharness.dev.java.net

ersh
Offline
Joined: 2006-10-18
Points: 0