source: gs3-extensions/mat/trunk/src/org/greenstone/mat/CursorController.java@ 21927

Last change on this file since 21927 was 21927, checked in by sjm84, 14 years ago

Renamed package to org.greenstone.mat from org.greenstone.gsdl3_extension.mat

File size: 825 bytes
Line 
1package org.greenstone.mat;
2
3import java.awt.Component;
4import java.awt.Cursor;
5import java.awt.event.ActionEvent;
6import java.awt.event.ActionListener;
7
8public final class CursorController {
9
10 public final static Cursor busyCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
11 public final static Cursor defaultCursor = Cursor.getDefaultCursor();
12 private CursorController() {}
13
14 public static ActionListener createListener(final Component component, final ActionListener mainActionListener) {
15 ActionListener actionListener = new ActionListener() {
16 public void actionPerformed(ActionEvent ae) {
17 try {
18 component.setCursor(busyCursor);
19 mainActionListener.actionPerformed(ae);
20 } finally {
21 component.setCursor(defaultCursor);
22 }
23 }
24 };
25 return actionListener;
26 }
27}
Note: See TracBrowser for help on using the repository browser.