01: /*******************************************************************************
02: * Copyright (c) 2007 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.examples.contributions.model;
11:
12: import org.eclipse.jface.resource.ImageDescriptor;
13: import org.eclipse.ui.IEditorInput;
14: import org.eclipse.ui.IPersistableElement;
15:
16: /**
17: * The editor input for looking up a person.
18: *
19: * @since 3.3
20: */
21: public class PersonInput implements IEditorInput {
22: private int index;
23:
24: public PersonInput(int i) {
25: index = i;
26: }
27:
28: public int getIndex() {
29: return index;
30: }
31:
32: /*
33: * (non-Javadoc)
34: *
35: * @see org.eclipse.ui.IEditorInput#exists()
36: */
37: public boolean exists() {
38: return true;
39: }
40:
41: /*
42: * (non-Javadoc)
43: *
44: * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
45: */
46: public ImageDescriptor getImageDescriptor() {
47: return null;
48: }
49:
50: /*
51: * (non-Javadoc)
52: *
53: * @see org.eclipse.ui.IEditorInput#getName()
54: */
55: public String getName() {
56: return "" + index; //$NON-NLS-1$
57: }
58:
59: /*
60: * (non-Javadoc)
61: *
62: * @see org.eclipse.ui.IEditorInput#getPersistable()
63: */
64: public IPersistableElement getPersistable() {
65: return null;
66: }
67:
68: /*
69: * (non-Javadoc)
70: *
71: * @see org.eclipse.ui.IEditorInput#getToolTipText()
72: */
73: public String getToolTipText() {
74: return getName();
75: }
76:
77: /*
78: * (non-Javadoc)
79: *
80: * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
81: */
82: public Object getAdapter(Class adapter) {
83: return null;
84: }
85: }
|