1
|
1 package de.mpg.mpiwg.itgroup.digilib.plugin.editors;
|
|
2
|
|
3 import org.eclipse.core.resources.IFile;
|
|
4 import org.eclipse.jface.resource.ImageDescriptor;
|
|
5 import org.eclipse.ui.IEditorInput;
|
|
6 import org.eclipse.ui.IPersistableElement;
|
|
7
|
9
|
8 /**
|
|
9 * Editor input for {@link de.mpg.mpiwg.itgroup.digilib.plugin.editors.DigilibLinkEditorPart}
|
|
10 * @author dwinter
|
|
11 *
|
|
12 */
|
1
|
13 public class DigilibLinkEditorInput implements IEditorInput {
|
|
14
|
9
|
15 private IFile file;
|
1
|
16 public static int INDEX_META=0;
|
|
17 private int type;
|
|
18
|
9
|
19 /**
|
|
20 * @return
|
|
21 */
|
|
22 public IFile getFile() {
|
|
23 return file;
|
1
|
24 }
|
|
25
|
9
|
26 public void setFile(IFile indexMetaFile) {
|
|
27 this.file = indexMetaFile;
|
1
|
28 }
|
|
29
|
|
30 public int getType() {
|
|
31 return type;
|
|
32 }
|
|
33
|
|
34 public void setType(int type) {
|
|
35 this.type = type;
|
|
36 }
|
|
37
|
9
|
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 */
|
1
|
45 public DigilibLinkEditorInput(IFile file, int type) {
|
9
|
46 this.file = file;
|
1
|
47 setType(type);
|
|
48 }
|
|
49
|
|
50 public Object getAdapter(Class adapter) {
|
|
51 // TODO Auto-generated method stub
|
|
52 return null;
|
|
53 }
|
|
54
|
|
55 public boolean exists() {
|
|
56 // TODO Auto-generated method stub
|
|
57 return false;
|
|
58 }
|
|
59
|
|
60 public ImageDescriptor getImageDescriptor() {
|
|
61 // TODO Auto-generated method stub
|
|
62 return null;
|
|
63 }
|
|
64
|
|
65 public String getName() {
|
9
|
66
|
|
67 String name = file.getName();
|
|
68 return name;
|
1
|
69 }
|
|
70
|
|
71 public IPersistableElement getPersistable() {
|
|
72 // TODO Auto-generated method stub
|
|
73 return null;
|
|
74 }
|
|
75
|
|
76 public String getToolTipText() {
|
9
|
77
|
|
78 return file.getFullPath().toOSString();
|
1
|
79 }
|
|
80
|
|
81 }
|