Result table now changes mouse cursor to 'semi-busy' during scanning (just like Firefox while loading a page)

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@378 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2008-04-08 21:13:37 +00:00
parent 3d1eecd744
commit 31395e23b4
2 changed files with 15 additions and 2 deletions

1
TODO
View File

@ -13,7 +13,6 @@ Before 3.0:
* Exporter appending functionality exposed to the user
* make Display: status bar right-clickable
* rename favorite option in the Manager dialog
* change cursor while scanning
* show hours in statistics dialog
* goto prev stuff (alternative shortcuts)
* GIJ + java.util.prefs don't work

View File

@ -12,7 +12,9 @@ import net.azib.ipscan.config.Labels;
import net.azib.ipscan.core.ScanningResult;
import net.azib.ipscan.core.ScanningResultList;
import net.azib.ipscan.core.ScanningResult.ResultType;
import net.azib.ipscan.core.state.ScanningState;
import net.azib.ipscan.core.state.StateMachine;
import net.azib.ipscan.core.state.StateTransitionListener;
import net.azib.ipscan.fetchers.Fetcher;
import net.azib.ipscan.fetchers.FetcherRegistry;
import net.azib.ipscan.fetchers.FetcherRegistryUpdateListener;
@ -34,7 +36,7 @@ import org.eclipse.swt.widgets.TableItem;
*
* @author Anton Keks
*/
public class ResultTable extends Table implements FetcherRegistryUpdateListener {
public class ResultTable extends Table implements FetcherRegistryUpdateListener, StateTransitionListener {
private ScanningResultList scanningResults;
private GUIConfig guiConfig;
@ -74,6 +76,9 @@ public class ResultTable extends Table implements FetcherRegistryUpdateListener
// this one populates table dynamically, taking data from ScanningResultList
addListener(SWT.SetData, new SetDataListener());
// listen to state machine events
stateMachine.addTransitionListener(this);
}
/**
@ -219,4 +224,13 @@ public class ResultTable extends Table implements FetcherRegistryUpdateListener
}
public void transitionTo(final ScanningState state) {
// change cursor while scanning
getDisplay().asyncExec(new Runnable() {
public void run() {
setCursor(getDisplay().getSystemCursor(state == ScanningState.IDLE ? SWT.CURSOR_ARROW : SWT.CURSOR_APPSTARTING));
}
});
}
}