KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > dialogs > FileEditorMappingContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.ui.dialogs;
12
13 import org.eclipse.jface.viewers.IStructuredContentProvider;
14 import org.eclipse.jface.viewers.Viewer;
15 import org.eclipse.ui.IFileEditorMapping;
16
17 /**
18  * A content provider for displaying of <code>IFileEditorMapping</code>
19  * objects in viewers.
20  * <p>
21  * This class has a singleton instance,
22  * <code>FileEditorMappingContentProvider.INSTANCE</code>,
23  * which can be used any place this kind of content provider is needed.
24  * </p>
25  *
26  * @see org.eclipse.jface.viewers.IContentProvider
27  */

28 public class FileEditorMappingContentProvider implements
29         IStructuredContentProvider {
30
31     /**
32      * Singleton instance accessor.
33      */

34     public final static FileEditorMappingContentProvider INSTANCE = new FileEditorMappingContentProvider();
35
36     /**
37      * Creates an instance of this class. The private visibility of this
38      * constructor ensures that this class is only usable as a singleton.
39      */

40     private FileEditorMappingContentProvider() {
41         super();
42     }
43
44     /* (non-Javadoc)
45      * Method declared on IContentProvider.
46      */

47     public void dispose() {
48     }
49
50     /* (non-Javadoc)
51      * Method declared on IStructuredContentProvider.
52      */

53     public Object JavaDoc[] getElements(Object JavaDoc element) {
54         IFileEditorMapping[] array = (IFileEditorMapping[]) element;
55         return array == null ? new Object JavaDoc[0] : array;
56     }
57
58     /* (non-Javadoc)
59      * Method declared on IContentProvider.
60      */

61     public void inputChanged(Viewer viewer, Object JavaDoc oldInput, Object JavaDoc newInput) {
62     }
63 }
64
Popular Tags