/*******************************************************************************
 * Copyright (c) 2012 Torkild U. Resheim.
 * 
 * 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: Torkild U. Resheim - initial API and implementation
 *******************************************************************************/
package no.resheim.eclipse.utils.launcher.macosx;

import no.resheim.eclipse.utils.launcher.core.IWorkspaceDecorator;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TaskBar;
import org.eclipse.swt.widgets.TaskItem;

public class WorkspaceDecorator implements IWorkspaceDecorator {

	public WorkspaceDecorator() {
		// TODO Auto-generated constructor stub
	}

	static TaskItem getTaskBarItem() {
		Display display = Display.getDefault();
		Shell shell = display.getActiveShell();
		TaskBar bar = display.getSystemTaskBar();
		if (bar == null)
			return null;
		TaskItem item = bar.getItem(shell);
		if (item == null)
			item = bar.getItem(null);
		return item;
	}
	@Override
	public void decorateWorkspace(final String name) {
		Display.getDefault().asyncExec(new Runnable() {

			@Override
			public void run() {
				TaskItem item = getTaskBarItem();
				item.setOverlayText(name);
			}
		});
	}

}

@@ -800,16 +800,176 @@
 kItem;%0A%0A
+/**%0A * Obtains the %7B@link TaskItem%7D belonging to the running application and sets%0A * the badge to the workspace name.%0A * %0A * @author Torkild U. Resheim%0A * %0A */%0A
 public c
@@ -1061,50 +1061,8 @@
 ) %7B%0A
-%09%09// TODO Auto-generated constructor stub%0A
 %09%7D%0A%0A

Add type comment.