protected void startThread ( ) { if ( animationActive ) return ; stopAnimation = false ; final Display display = treeViewer == null ? Display . getDefault ( ) : treeViewer . getControl ( ) . getDisplay ( ) ; final int SLEEP = 200 ; final Runnable [ ] animator = new Runnable [ 1 ] ; animator [ 0 ] = new Runnable ( ) { public void run ( ) { if ( ! stopAnimation ) { try { int size = 0 ; String [ ] servers ; synchronized ( starting ) { size = starting . size ( ) ; servers = new String [ size ] ; starting . toArray ( servers ) ; } for ( int i = 0 ; i < size ; i ++ ) { IServer server = ServerCore . findServer ( servers [ i ] ) ; if ( server != null ) { // ServerDecorator.animate(); treeViewer . update ( server , new String [ ] { "ICON" } ) ; } } } catch ( Exception e ) { // if (Trace.FINEST) { // Trace.trace(Trace.STRING_FINEST, // "Error in Servers view animation", e); // } } display . timerExec ( SLEEP , animator [ 0 ] ) ; } } } ; Display . getDefault ( ) . asyncExec ( new Runnable ( ) { public void run ( ) { display . timerExec ( SLEEP , animator [ 0 ] ) ; } } ) ; }
Start the animation thread