qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r800550 - /qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
Date Mon, 03 Aug 2009 20:36:17 GMT
Author: robbie
Date: Mon Aug  3 20:36:17 2009
New Revision: 800550

URL: http://svn.apache.org/viewvc?rev=800550&view=rev
Log:
QPID-2014: when a user sets a new message interval to view, use the interval size as the step
change for the Next and Previous buttons

Modified:
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java?rev=800550&r1=800549&r2=800550&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
(original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
Mon Aug  3 20:36:17 2009
@@ -93,15 +93,17 @@
     
     private Text _fromMsgText;
     private Text _toMsgText;
+    private static final String FROM_DEFAULT = "1";
+    private static final String TO_DEFAULT = "50";
+    private long _interval = 50; //(to-from)+1
     private Long _fromMsg = new Long(FROM_DEFAULT);
     private Long _toMsg = new Long(TO_DEFAULT);
     
     private TabularDataSupport _messages = null;
     private ManagedQueue _qmb;
     
-    private static final String FROM_DEFAULT = "1";
-    private static final String TO_DEFAULT = "50";
-    private long INTERVAL = 50;
+    private Button _previousButton;
+    private Button _nextButton;
     
     private static final String MSG_AMQ_ID = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[0];
     private static final String MSG_HEADER = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[1];
@@ -252,9 +254,9 @@
         
         _toolkit.createLabel(viewMessageRangeComposite, "     "); //spacer
         
-        final Button previousButton = _toolkit.createButton(viewMessageRangeComposite, "<
Prev " + INTERVAL, SWT.PUSH);
-        previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
-        previousButton.addSelectionListener(new SelectionAdapter()
+        _previousButton = _toolkit.createButton(viewMessageRangeComposite, "< Prev " +
_interval, SWT.PUSH);
+        _previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
+        _previousButton.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
             {
@@ -266,16 +268,16 @@
                 }
                 
                 //make 'from' be 'from - INTERVAL', or make it 1 if that would make it 0
or less 
-                _fromMsg = (_fromMsg - INTERVAL < 1) ? 1 : _fromMsg - INTERVAL;
+                _fromMsg = (_fromMsg - _interval < 1) ? 1 : _fromMsg - _interval;
                 _fromMsgText.setText(_fromMsg.toString());
                 
                 refresh(_mbean);
             }
         });
         
-        final Button nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next
" + INTERVAL + " >", SWT.PUSH);
-        nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
-        nextButton.addSelectionListener(new SelectionAdapter()
+        _nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next " + _interval
+ " >", SWT.PUSH);
+        _nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
+        _nextButton.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
             {
@@ -287,7 +289,7 @@
                 }
                 
                 //make 'to' be 'to + INTERVAL', or make it Long.MAX_VALUE if that would too
large
-                _toMsg = (Long.MAX_VALUE - _toMsg > INTERVAL) ? _toMsg + INTERVAL : Long.MAX_VALUE;
+                _toMsg = (Long.MAX_VALUE - _toMsg > _interval) ? _toMsg + _interval :
Long.MAX_VALUE;
                 _toMsgText.setText(_toMsg.toString());
                 
                 refresh(_mbean);
@@ -718,6 +720,10 @@
         _fromMsg = from;
         _toMsg = to;
         
+        _interval = (to - from) + 1;
+        _previousButton.setText("< Prev " + _interval);
+        _nextButton.setText("Next " + _interval + " >");
+        
         refresh(_mbean);
     }
     



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message