Index: NbPresenter.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/NbPresenter.java,v retrieving revision 1.77 diff -c -r1.77 NbPresenter.java *** NbPresenter.java 6 Feb 2003 13:01:24 -0000 1.77 --- NbPresenter.java 14 Feb 2003 16:05:19 -0000 *************** *** 28,33 **** --- 28,34 ---- import org.openide.WizardDescriptor; import org.openide.util.*; + import org.openide.windows.WindowManager; /** Default implementation of Dialog created from NotifyDescriptor. *************** *** 722,728 **** --- 723,733 ---- return null; } + private boolean waitCursorSet = false; + private void doShow () { + waitCursorSet = true; + NbPresenter prev = null; if (isModal()) { prev = currentModalDialog; *************** *** 736,741 **** --- 741,757 ---- currentModalDialog = prev; fireChangeEvent(); } + } + + public void paint (Graphics g) { + Component glassPane = ((JFrame)WindowManager.getDefault().getMainWindow()) + .getGlassPane(); + if (glassPane.getCursor() != Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) { + System.out.println("Dialog painted, reseting cursor to default."); + glassPane.setVisible(false); + glassPane.setCursor(null); + }; + super.paint(g); } public void propertyChange(final java.beans.PropertyChangeEvent evt) { Index: ModuleActions.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/ModuleActions.java,v retrieving revision 1.26 diff -c -r1.26 ModuleActions.java *** ModuleActions.java 3 Dec 2002 14:10:04 -0000 1.26 --- ModuleActions.java 14 Feb 2003 16:05:19 -0000 *************** *** 13,23 **** --- 13,26 ---- package org.netbeans.core; + import java.awt.Component; + import java.awt.Cursor; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.lang.ref.*; import java.util.*; import javax.swing.Action; + import javax.swing.JFrame; import javax.swing.event.*; import org.openide.actions.ActionManager; *************** *** 28,33 **** --- 31,37 ---- import org.openide.ErrorManager; import org.netbeans.core.modules.ManifestSection; + import org.openide.windows.WindowManager; /** Holds list of all actions added by modules. *************** *** 91,99 **** --- 95,105 ---- //System.err.println ("invokeAction -> run: " + a); try { + showWaitCursor(a); addRunningAction(a, e); a.actionPerformed (e); } finally { + hideWaitCursor(a); removeRunningAction(e); firePropertyChange(PROP_RUNNING_ACTIONS, null, null); } *************** *** 104,110 **** --- 110,137 ---- }; rp.post (r); } + + private void showWaitCursor (Action a) { + System.out.println("action " + a.toString() + "started. Setting wait cursor..."); + JFrame mw = (JFrame)WindowManager.getDefault().getMainWindow(); + mw.getGlassPane().setCursor( + java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR) + ); + mw.getGlassPane().setVisible(true); + } + + private void hideWaitCursor (Action a) { + System.out.println("action " + a.toString() + "completed."); + Component glassPane = ((JFrame)WindowManager.getDefault().getMainWindow()) + .getGlassPane(); + if (glassPane.getCursor() != Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) { + System.out.println("reseting cursor to default."); + glassPane.setVisible(false); + glassPane.setCursor(null); + }; + } + /** Listens on change of modules and if changed, * fires change to all listeners. */