KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > progress > ProgressViewerLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2004, 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 - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.progress;
12
13 import org.eclipse.jface.viewers.LabelProvider;
14 import org.eclipse.swt.widgets.Control;
15
16 /**
17  * The ProgressViewerLabelProvider is the label provider for progress viewers.
18  */

19 public class ProgressViewerLabelProvider extends LabelProvider {
20     private Control control;
21
22     /*
23      * (non-Javadoc)
24      *
25      * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
26      */

27     public String JavaDoc getText(Object JavaDoc element) {
28         JobTreeElement info = (JobTreeElement) element;
29         return ProgressManagerUtil.shortenText(
30                 info.getCondensedDisplayString(), control);
31     }
32
33     /**
34      * Create a new instance of the receiver within the control.
35      *
36      * @param progressControl The control that the label is
37      * being created for.
38      */

39     public ProgressViewerLabelProvider(Control progressControl) {
40         super();
41         control = progressControl;
42     }
43 }
44
Popular Tags