Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Andrew Niefer - IBM Corporation - initial API and implementation /
package org.eclipse.core.runtime.internal.adaptor;
public class DefaultStartupMonitor implements StartupMonitor {
	private Method updateMethod = null;
	private Runnable splashHandler = null;

Create a new startup monitor using the given splash handler. The splash handle must have an updateSplash method.

Parameters:
splashHandler
Throws:
java.lang.IllegalStateException
	public DefaultStartupMonitor(Runnable splashHandlerthrows IllegalStateException {
		this. = splashHandler;
		try {
			 = splashHandler.getClass().getMethod("updateSplash"null); //$NON-NLS-1$
catch (SecurityException e) {
catch (NoSuchMethodException e) {
			//TODO maybe we could do something else in the update method in this case, like print something to the console?
		}
	}
	/* (non-Javadoc)
	 * @see org.eclipse.core.runtime.adaptor.StartupMonitor#update()
	 */
	public void update() {
		if ( != null) {
			try {
catch (Throwable e) {
				// ignore, this is best effort
			}
else {
			//TODO maybe we could print something interesting to the console?
		}
	}
	public void applicationRunning() {
			String timeString = FrameworkProperties.getProperty("eclipse.startTime"); //$NON-NLS-1$ 
			long time = timeString == null ? 0L : Long.parseLong(timeString);
			..println("Application Started: " + (System.currentTimeMillis() - time)); //$NON-NLS-1$
		}
		StatsManager.doneBooting();
	}
New to GrepCode? Check out our FAQ X