source: java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/editors/outline/FramclipseEditorOutlineLabelProvider.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain
File size: 1.8 KB
Line 
1package com.framsticks.framclipse.editors.outline;
2
3import org.eclipse.jface.text.BadLocationException;
4import org.eclipse.jface.text.IDocument;
5import org.eclipse.jface.text.IRegion;
6import org.eclipse.jface.viewers.ILabelProvider;
7import org.eclipse.jface.viewers.ILabelProviderListener;
8import org.eclipse.swt.graphics.Image;
9
10import com.framsticks.framclipse.internal.parser.ASTFObject;
11import com.framsticks.framclipse.internal.parser.Node;
12
13
14public 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}
Note: See TracBrowser for help on using the repository browser.