b42b7aa3f05b018a87630f5ca500d4287b6c9ca6
[phpeclipse.git] /
1 /*
2  * (c) Copyright IBM Corp. 2000, 2001.
3  * All Rights Reserved.
4  */
5 package net.sourceforge.phpdt.internal.ui.text.template;
6
7 import net.sourceforge.phpdt.internal.corext.template.TemplateSet;
8
9 import org.eclipse.jface.viewers.IStructuredContentProvider;
10 import org.eclipse.jface.viewers.Viewer;
11
12 public class TemplateContentProvider implements IStructuredContentProvider {
13
14         private TemplateSet fTemplateSet;       
15
16         /*
17          * @see IStructuredContentProvider#getElements(Object)
18          */     
19         public Object[] getElements(Object input) {
20                 return fTemplateSet.getTemplates();
21         }
22
23         /*
24          * @see IContentProvider#inputChanged(Viewer, Object, Object)
25          */
26         public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
27                 fTemplateSet= (TemplateSet) newInput;
28         }
29
30         /*
31          * @see IContentProvider#dispose()
32          */
33         public void dispose() {
34                 fTemplateSet= null;
35         }
36         
37 }
38