modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
| 11 ++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 7858c19bb57e15e718ac21c473fef8a68e642081
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Sat Feb 26 00:31:22 2011 -0500
when the window is closed, make sure we stop auto-refresh by canceling the timer
however, for some reason, I'm not seeing the close click handler called, so this
doesn't do anything althought the code looks right.
need to figure out why close click handler isn't called.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
index e83dc1c..9bebe99 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestRemoteServiceStatisticsView.java
@@ -71,13 +71,13 @@ public class TestRemoteServiceStatisticsView extends Table {
// if this is not null, this view is hosted by this standalone Window
private StatisticsWindow window = null;
- private Timer timer = null;
+ private Timer refreshTimer = null;
private boolean refreshOnPageChange = false;
public TestRemoteServiceStatisticsView(String locatorId) {
super(locatorId, TABLE_TITLE, null, defaultSorts, null, false);
- timer = new Timer() {
+ refreshTimer = new Timer() {
@Override
public void run() {
refresh();
@@ -186,7 +186,7 @@ public class TestRemoteServiceStatisticsView extends Table {
}
// cancel everything - will reinstate if user elected to do one of
these
- timer.cancel();
+ refreshTimer.cancel();
refreshOnPageChange = false;
if (timeout.intValue() == -1) {
@@ -195,7 +195,7 @@ public class TestRemoteServiceStatisticsView extends Table {
refreshOnPageChange = true;
setTableTitle(TABLE_TITLE + " (refresh on page
change)");
} else {
- timer.scheduleRepeating(timeout.intValue() * 1000);
+ refreshTimer.scheduleRepeating(timeout.intValue() * 1000);
setTableTitle(TABLE_TITLE + " (refresh every " +
timeout + "s)");
}
}
@@ -273,6 +273,7 @@ public class TestRemoteServiceStatisticsView extends Table {
setShowMinimizeButton(false);
setShowMaximizeButton(true);
setShowCloseButton(true);
+ setDismissOnEscape(false); // force close button to be pressed to ensure our
close handler is called
setIsModal(true);
setShowModalMask(true);
setAutoSize(true);
@@ -283,6 +284,8 @@ public class TestRemoteServiceStatisticsView extends Table {
addCloseClickHandler(new CloseClickHandler() {
@Override
public void onCloseClick(CloseClientEvent event) {
+ refreshTimer.cancel();
+ refreshOnPageChange = false;
markForDestroy();
}
});