Mercurial > hg > de.mpg.mpiwg.itgroup.digilib.plugin
comparison src/de/mpg/mpiwg/itgroup/digilib/plugin/editors/DigilibLinkEditorInput.java @ 9:e63a64652f4d
added comments
author | dwinter |
---|---|
date | Mon, 03 Jan 2011 16:53:48 +0100 |
parents | 83c58ea33792 |
children | 1a7940ac5169 |
comparison
equal
deleted
inserted
replaced
8:52023cf79d86 | 9:e63a64652f4d |
---|---|
3 import org.eclipse.core.resources.IFile; | 3 import org.eclipse.core.resources.IFile; |
4 import org.eclipse.jface.resource.ImageDescriptor; | 4 import org.eclipse.jface.resource.ImageDescriptor; |
5 import org.eclipse.ui.IEditorInput; | 5 import org.eclipse.ui.IEditorInput; |
6 import org.eclipse.ui.IPersistableElement; | 6 import org.eclipse.ui.IPersistableElement; |
7 | 7 |
8 /** | |
9 * Editor input for {@link de.mpg.mpiwg.itgroup.digilib.plugin.editors.DigilibLinkEditorPart} | |
10 * @author dwinter | |
11 * | |
12 */ | |
8 public class DigilibLinkEditorInput implements IEditorInput { | 13 public class DigilibLinkEditorInput implements IEditorInput { |
9 | 14 |
10 private IFile indexMetaFile; | 15 private IFile file; |
11 public static int INDEX_META=0; | 16 public static int INDEX_META=0; |
12 private int type; | 17 private int type; |
13 | 18 |
14 public IFile getIndexMetaFile() { | 19 /** |
15 return indexMetaFile; | 20 * @return |
21 */ | |
22 public IFile getFile() { | |
23 return file; | |
16 } | 24 } |
17 | 25 |
18 public void setIndexMetaFile(IFile indexMetaFile) { | 26 public void setFile(IFile indexMetaFile) { |
19 this.indexMetaFile = indexMetaFile; | 27 this.file = indexMetaFile; |
20 } | 28 } |
21 | 29 |
22 public int getType() { | 30 public int getType() { |
23 return type; | 31 return type; |
24 } | 32 } |
25 | 33 |
26 public void setType(int type) { | 34 public void setType(int type) { |
27 this.type = type; | 35 this.type = type; |
28 } | 36 } |
29 | 37 |
38 /** | |
39 * | |
40 * @param file File to be worked with | |
41 * @param type currently only @see {{@value #INDEX_META}, file has to be an index.meta file following the | |
42 * standards of the MPIWG | |
43 * | |
44 */ | |
30 public DigilibLinkEditorInput(IFile file, int type) { | 45 public DigilibLinkEditorInput(IFile file, int type) { |
31 indexMetaFile = file; | 46 this.file = file; |
32 setType(type); | 47 setType(type); |
33 } | 48 } |
34 | 49 |
35 public Object getAdapter(Class adapter) { | 50 public Object getAdapter(Class adapter) { |
36 // TODO Auto-generated method stub | 51 // TODO Auto-generated method stub |
46 // TODO Auto-generated method stub | 61 // TODO Auto-generated method stub |
47 return null; | 62 return null; |
48 } | 63 } |
49 | 64 |
50 public String getName() { | 65 public String getName() { |
51 // TODO Auto-generated method stub | 66 |
52 return "hello_name"; | 67 String name = file.getName(); |
68 return name; | |
53 } | 69 } |
54 | 70 |
55 public IPersistableElement getPersistable() { | 71 public IPersistableElement getPersistable() { |
56 // TODO Auto-generated method stub | 72 // TODO Auto-generated method stub |
57 return null; | 73 return null; |
58 } | 74 } |
59 | 75 |
60 public String getToolTipText() { | 76 public String getToolTipText() { |
61 // TODO Auto-generated method stub | 77 |
62 return "hello"; | 78 return file.getFullPath().toOSString(); |
63 } | 79 } |
64 | 80 |
65 } | 81 } |