From c7a721aad7c23640d59ad682854e066f4538436c Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 10 Nov 2011 07:56:07 -0500 Subject: [PATCH] Show busy cursors when executing workers --- src/com/gitblit/client/GitblitWorker.java | 3 +++ src/com/gitblit/client/SearchDialog.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/com/gitblit/client/GitblitWorker.java b/src/com/gitblit/client/GitblitWorker.java index 5926a77b..93c35d6b 100644 --- a/src/com/gitblit/client/GitblitWorker.java +++ b/src/com/gitblit/client/GitblitWorker.java @@ -16,6 +16,7 @@ package com.gitblit.client; import java.awt.Component; +import java.awt.Cursor; import java.io.IOException; import java.text.MessageFormat; @@ -37,6 +38,7 @@ public abstract class GitblitWorker extends SwingWorker { public GitblitWorker(Component parent, RpcRequest request) { this.parent = parent; this.request = request; + parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } protected RpcRequest getRequestType() { @@ -49,6 +51,7 @@ public abstract class GitblitWorker extends SwingWorker { } protected void done() { + parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); try { Boolean success = get(); if (success) { diff --git a/src/com/gitblit/client/SearchDialog.java b/src/com/gitblit/client/SearchDialog.java index cf171160..0f25e9a0 100644 --- a/src/com/gitblit/client/SearchDialog.java +++ b/src/com/gitblit/client/SearchDialog.java @@ -16,6 +16,7 @@ package com.gitblit.client; import java.awt.BorderLayout; +import java.awt.Cursor; import java.awt.FlowLayout; import java.awt.Insets; import java.awt.Rectangle; @@ -328,6 +329,7 @@ public class SearchDialog extends JFrame { if (isSearch && StringUtils.isEmpty(fragment)) { return; } + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingWorker, Void> worker = new SwingWorker, Void>() { @Override protected List doInBackground() throws IOException { @@ -341,6 +343,7 @@ public class SearchDialog extends JFrame { @Override protected void done() { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); try { List results = get(); if (isSearch) { -- 2.39.5