KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > threadgroups > JavaThreadGroupLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.threadgroups;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider;
15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
16 import org.eclipse.jdt.debug.core.IJavaThreadGroup;
17 import org.eclipse.jdt.internal.debug.ui.JavaDebugImages;
18 import org.eclipse.jface.resource.ImageDescriptor;
19 import org.eclipse.jface.viewers.TreePath;
20
21 import com.ibm.icu.text.MessageFormat;
22
23 /**
24  * @since 3.3
25  */

26 public class JavaThreadGroupLabelProvider extends ElementLabelProvider {
27     
28     private static ImageDescriptor fgImage = JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_OBJS_THREAD_GROUP);
29
30     /* (non-Javadoc)
31      * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
32      */

33     protected String JavaDoc getLabel(TreePath elementPath, IPresentationContext presentationContext, String JavaDoc columnId) throws CoreException {
34         IJavaThreadGroup group = (IJavaThreadGroup) elementPath.getLastSegment();
35         return MessageFormat.format(ThreadGroupMessages.AsyncThreadGroupLabelAdapter_0, new String JavaDoc[]{group.getName()});
36     }
37
38     /* (non-Javadoc)
39      * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
40      */

41     protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String JavaDoc columnId) throws CoreException {
42         return fgImage;
43     }
44
45 }
46
Popular Tags