KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > UpdateLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.update.internal.ui;
12
13 import org.eclipse.jface.resource.*;
14 import org.eclipse.swt.graphics.*;
15 import org.eclipse.update.configuration.*;
16 import org.eclipse.update.internal.ui.parts.*;
17
18 /**
19  *
20  */

21
22 public class UpdateLabelProvider extends SharedLabelProvider {
23     /**
24      * Constructor for UpdateLabelProvider.
25      */

26     public UpdateLabelProvider() {
27     }
28     
29     public String JavaDoc getText(Object JavaDoc obj) {
30         return super.getText(obj);
31     }
32     
33     public Image getImage(Object JavaDoc obj) {
34         return super.getImage(obj);
35     }
36     
37     public ImageDescriptor getLocalSiteDescriptor(IConfiguredSite csite) {
38         if (csite.isProductSite())
39             return UpdateUIImages.DESC_PSITE_OBJ;
40         if (csite.isExtensionSite())
41             return UpdateUIImages.DESC_ESITE_OBJ;
42         return UpdateUIImages.DESC_LSITE_OBJ;
43     }
44     
45     public Image getLocalSiteImage(IConfiguredSite csite) {
46         ImageDescriptor desc = getLocalSiteDescriptor(csite);
47         return get(desc);
48     }
49 }
50
Popular Tags