View Javadoc
1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2006, OntoText Lab. / SIRMA Group
4    
5    This library is free software; you can redistribute it and/or modify it under
6    the terms of the GNU Lesser General Public License as published by the Free
7    Software Foundation; either version 2.1 of the License, or (at your option)
8    any later version.
9    This library is distributed in the hope that it will be useful, but WITHOUT
10   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   details.
13   You should have received a copy of the GNU Lesser General Public License along
14   with this library; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16   */
17  
18  /***
19   * <p>Title: WSMO Studio</p>
20   * <p>Description: Semantic Web Service Editor</p>
21   * <p>Copyright:  Copyright (c) 2004-2006</p>
22   * <p>Company: OntoText Lab. / SIRMA </p>
23   */
24  
25  package org.wsmostudio.ui.views.navigator;
26  
27  import org.eclipse.swt.graphics.Image;
28  
29  /***
30   * A specialized extension aware label provider for the WSMO Navigator view.
31   *
32   * @author not attributable
33   * @version $Revision: 1.2 $ $Date: 2006/01/09 12:51:14 $
34   */
35  
36  public class NavigatorLabelProvider extends WSMOLabelProvider {
37  
38  
39      private ContentExtensionManager extensionManager;
40      
41      public NavigatorLabelProvider(ContentExtensionManager extManager) {
42          this.extensionManager = extManager;
43      }
44  
45      public Image getImage(Object element) {
46          Image extImage = extensionManager.getImageFor(element);
47          if (extImage != null) {
48              return extImage;
49          }
50          return super.getImage(element);
51      }
52  
53      public String getText(Object element) {
54          String label = extensionManager.getLabelFor(element);
55          if (label != null) {
56              return label;
57          }
58          return super.getText(element);
59      }
60  }
61  
62  /*
63   * $Log: NavigatorLabelProvider.java,v $
64   * Revision 1.2  2006/01/09 12:51:14  alex_simov
65   * Copyright message in header updated
66   *
67   * Revision 1.1  2005/10/14 13:25:18  alex_simov
68   * WSMO Navigator's extension point creation
69   *
70   */