]> source.dussan.org Git - gitblit.git/commitdiff
Show busy cursors when executing workers
authorJames Moger <james.moger@gitblit.com>
Thu, 10 Nov 2011 12:56:07 +0000 (07:56 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Nov 2011 12:56:07 +0000 (07:56 -0500)
src/com/gitblit/client/GitblitWorker.java
src/com/gitblit/client/SearchDialog.java

index 5926a77be3a21adfc6a60a7eae97f747b04361b4..93c35d6ba94323468bb0cac1373c02de3e5ea788 100644 (file)
@@ -16,6 +16,7 @@
 package com.gitblit.client;\r
 \r
 import java.awt.Component;\r
+import java.awt.Cursor;\r
 import java.io.IOException;\r
 import java.text.MessageFormat;\r
 \r
@@ -37,6 +38,7 @@ public abstract class GitblitWorker extends SwingWorker<Boolean, Void> {
        public GitblitWorker(Component parent, RpcRequest request) {\r
                this.parent = parent;\r
                this.request = request;\r
+               parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\r
        }\r
 \r
        protected RpcRequest getRequestType() {\r
@@ -49,6 +51,7 @@ public abstract class GitblitWorker extends SwingWorker<Boolean, Void> {
        }\r
 \r
        protected void done() {\r
+               parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r
                try {\r
                        Boolean success = get();\r
                        if (success) {\r
index cf171160e976466100cf04b0560cb441c329630f..0f25e9a0117e524a9c91cc3c3ecbbd6bf02a4baa 100644 (file)
@@ -16,6 +16,7 @@
 package com.gitblit.client;\r
 \r
 import java.awt.BorderLayout;\r
+import java.awt.Cursor;\r
 import java.awt.FlowLayout;\r
 import java.awt.Insets;\r
 import java.awt.Rectangle;\r
@@ -328,6 +329,7 @@ public class SearchDialog extends JFrame {
                if (isSearch && StringUtils.isEmpty(fragment)) {\r
                        return;\r
                }\r
+               setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\r
                SwingWorker<List<FeedEntryModel>, Void> worker = new SwingWorker<List<FeedEntryModel>, Void>() {\r
                        @Override\r
                        protected List<FeedEntryModel> doInBackground() throws IOException {\r
@@ -341,6 +343,7 @@ public class SearchDialog extends JFrame {
 \r
                        @Override\r
                        protected void done() {\r
+                               setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r
                                try {\r
                                        List<FeedEntryModel> results = get();\r
                                        if (isSearch) {\r