1 | package com.framsticks.framclipse.editors.outline; |
---|
2 | |
---|
3 | import org.eclipse.jface.text.BadLocationException; |
---|
4 | import org.eclipse.jface.text.IDocument; |
---|
5 | import org.eclipse.jface.text.IRegion; |
---|
6 | import org.eclipse.jface.viewers.ILabelProvider; |
---|
7 | import org.eclipse.jface.viewers.ILabelProviderListener; |
---|
8 | import org.eclipse.swt.graphics.Image; |
---|
9 | |
---|
10 | import com.framsticks.framclipse.internal.parser.ASTFObject; |
---|
11 | import com.framsticks.framclipse.internal.parser.Node; |
---|
12 | |
---|
13 | |
---|
14 | public class FramclipseEditorOutlineLabelProvider implements ILabelProvider |
---|
15 | { |
---|
16 | |
---|
17 | IDocument fDocument; |
---|
18 | |
---|
19 | public FramclipseEditorOutlineLabelProvider(IDocument doc) |
---|
20 | { |
---|
21 | this.fDocument = doc; |
---|
22 | } |
---|
23 | |
---|
24 | public Image getImage(Object element) { |
---|
25 | // TODO Auto-generated method stub |
---|
26 | return null; |
---|
27 | } |
---|
28 | |
---|
29 | public String getText(Object element) { |
---|
30 | |
---|
31 | // if(element instanceof ASTFObject) |
---|
32 | // { |
---|
33 | // ASTFObject obj = (ASTFObject)element; |
---|
34 | // IRegion reg = obj.getIdRegion(); |
---|
35 | // |
---|
36 | // String prefix = "?"; |
---|
37 | // |
---|
38 | // try |
---|
39 | // { |
---|
40 | // if(reg != null) |
---|
41 | // { |
---|
42 | // prefix = fDocument.get(reg.getOffset(), reg.getLength()); |
---|
43 | // prefix = prefix.substring(prefix.indexOf(':') + 1); |
---|
44 | // } |
---|
45 | // } |
---|
46 | // catch(BadLocationException ex) |
---|
47 | // { |
---|
48 | // |
---|
49 | // } |
---|
50 | // |
---|
51 | // String returnVal = prefix + " - " + obj.getClassName() + " : Object"; |
---|
52 | // |
---|
53 | // return returnVal; |
---|
54 | // } |
---|
55 | |
---|
56 | if(element instanceof Node) |
---|
57 | return element.toString(); |
---|
58 | |
---|
59 | return null; |
---|
60 | } |
---|
61 | |
---|
62 | public void addListener(ILabelProviderListener listener) { |
---|
63 | // TODO Auto-generated method stub |
---|
64 | |
---|
65 | } |
---|
66 | |
---|
67 | public void dispose() { |
---|
68 | // TODO Auto-generated method stub |
---|
69 | |
---|
70 | } |
---|
71 | |
---|
72 | public boolean isLabelProperty(Object element, String property) { |
---|
73 | // TODO Auto-generated method stub |
---|
74 | return false; |
---|
75 | } |
---|
76 | |
---|
77 | public void removeListener(ILabelProviderListener listener) { |
---|
78 | // TODO Auto-generated method stub |
---|
79 | |
---|
80 | } |
---|
81 | |
---|
82 | } |
---|