01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.dialogs;
11:
12: import org.eclipse.jface.viewers.IStructuredContentProvider;
13: import org.eclipse.jface.viewers.Viewer;
14: import org.eclipse.ui.IFileEditorMapping;
15:
16: /**
17: * A content provider for displaying of <code>IFileEditorMapping</code>
18: * objects in viewers.
19: * <p>
20: * This class has a singleton instance,
21: * <code>FileEditorMappingContentProvider.INSTANCE</code>,
22: * which can be used any place this kind of content provider is needed.
23: * </p>
24: *
25: * @see org.eclipse.jface.viewers.IContentProvider
26: */
27: public class FileEditorMappingContentProvider implements
28: IStructuredContentProvider {
29:
30: /**
31: * Singleton instance accessor.
32: */
33: public final static FileEditorMappingContentProvider INSTANCE = new FileEditorMappingContentProvider();
34:
35: /**
36: * Creates an instance of this class. The private visibility of this
37: * constructor ensures that this class is only usable as a singleton.
38: */
39: private FileEditorMappingContentProvider() {
40: super ();
41: }
42:
43: /* (non-Javadoc)
44: * Method declared on IContentProvider.
45: */
46: public void dispose() {
47: }
48:
49: /* (non-Javadoc)
50: * Method declared on IStructuredContentProvider.
51: */
52: public Object[] getElements(Object element) {
53: IFileEditorMapping[] array = (IFileEditorMapping[]) element;
54: return array == null ? new Object[0] : array;
55: }
56:
57: /* (non-Javadoc)
58: * Method declared on IContentProvider.
59: */
60: public void inputChanged(Viewer viewer, Object oldInput,
61: Object newInput) {
62: }
63: }
|