Changeset 3374 for devel-tools/trunk
- Timestamp:
- Feb 5, 2008, 11:57:19 AM (13 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.plus.rfpdt.editor/src/org/refal/plus/rfpdt/editor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.plus.rfpdt.editor/src/org/refal/plus/rfpdt/editor/RfpSourceViewerConfiguration.java
r3359 r3374 19 19 private final RfpEditor editor; 20 20 21 public RfpSourceViewerConfiguration (RfpEditor rfpEditor, IPreferenceStore store) {21 public RfpSourceViewerConfiguration (RfpEditor editor, IPreferenceStore store) { 22 22 super(store); 23 23 doubleClickStrategy = new RfpDoubleClickStrategy(); 24 24 autoIngentStrategy = new RfpAutoIndentStrategy(store); 25 editor = rfpEditor;25 this.editor = editor; 26 26 } 27 27 … … 67 67 68 68 public ITextHover getTextHover (ISourceViewer sourceViewer, String contentType) { 69 return new RfpTextHover( sourceViewer);69 return new RfpTextHover(editor, sourceViewer); 70 70 } 71 71 } -
devel-tools/trunk/eclipse/org.refal.plus.rfpdt.editor/src/org/refal/plus/rfpdt/editor/RfpTextHover.java
r3001 r3374 2 2 3 3 import org.eclipse.jface.text.DefaultTextHover; 4 import org.eclipse.jface.text.source.Annotation; 4 import org.eclipse.jface.text.IRegion; 5 import org.eclipse.jface.text.ITextViewer; 5 6 import org.eclipse.jface.text.source.ISourceViewer; 6 import org.eclipse.ui.texteditor.MarkerAnnotation; 7 import org.refal.plus.rfpdt.comp.ast.AstCall; 8 import org.refal.plus.rfpdt.comp.ast.AstDecl; 9 import org.refal.plus.rfpdt.comp.ast.AstFuncDef; 10 import org.refal.plus.rfpdt.comp.ast.AstImplem; 11 import org.refal.plus.rfpdt.comp.ast.AstNode; 12 import org.refal.plus.rfpdt.comp.ast.AstRef; 7 13 8 14 public class RfpTextHover extends DefaultTextHover { 15 private final RfpEditor editor; 9 16 10 public RfpTextHover(ISourceViewer sourceViewer) { 11 super(sourceViewer); 12 } 13 14 protected boolean isIncluded(Annotation annotation) { 15 if (annotation instanceof MarkerAnnotation) 16 return true; 17 return false; 18 } 17 public RfpTextHover (RfpEditor editor, ISourceViewer sourceViewer) { 18 super(sourceViewer); 19 this.editor = editor; 20 } 19 21 22 public String getHoverInfo (ITextViewer textViewer, IRegion hoverRegion) { 23 if (editor.rfpReconcilingStrategy == null) 24 return null; 25 AstImplem astImplem = editor.rfpReconcilingStrategy.getAstImplem(); 26 if (astImplem == null) 27 return null; 28 AstNode astNode = SearchVisitor.search(astImplem, hoverRegion.getOffset()); 29 AstDecl astDecl = null; 30 if (astNode instanceof AstDecl) 31 astDecl = (AstDecl) astNode; 32 else if (astNode instanceof AstFuncDef) 33 astDecl = ((AstFuncDef) astNode).funcDecl; 34 else if (astNode instanceof AstRef) 35 astDecl = ((AstRef) astNode).decl; 36 else if (astNode instanceof AstCall) 37 astDecl = ((AstCall) astNode).funcDecl; 38 if (astDecl == null) 39 return null; 40 return astDecl.toString(); 41 } 20 42 }
Note: See TracChangeset
for help on using the changeset viewer.