From: James Moger Date: Thu, 10 Nov 2011 12:56:07 +0000 (-0500) Subject: Show busy cursors when executing workers X-Git-Tag: v0.7.0~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7a721aad7c23640d59ad682854e066f4538436c;p=gitblit.git Show busy cursors when executing workers --- 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) {