Changeset 3860
- Timestamp:
- Jul 21, 2008, 9:07:04 PM (12 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditor.java
r3858 r3860 4 4 import java.util.List; 5 5 6 import org.eclipse.core.resources.IFile; 6 7 import org.eclipse.core.resources.IProject; 7 8 import org.eclipse.core.runtime.CoreException; … … 49 50 import org.refal.rfpdt.ast.AstVar; 50 51 import org.refal.rfpdt.ast.Searcher; 52 import org.refal.rfpdt.core.RfpCore; 53 import org.refal.rfpdt.core.RfpProject; 51 54 import org.refal.rfpdt.editor.PresentationVisitor.StylePosition; 52 55 import org.refal.rfpdt.editor.color.ColorManager; … … 357 360 return Searcher.search(astImplem, offset); 358 361 } 362 363 public RfpProject getRfpProject () { 364 return RfpCore.getRfpProject(((IFile) getEditorInput().getAdapter(IFile.class)).getProject()); 365 } 359 366 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/OpenDeclarationAction.java
r3859 r3860 3 3 import java.util.List; 4 4 5 import org.eclipse.core.resources.IFile; 5 6 import org.eclipse.jface.text.source.ISourceViewer; 7 import org.eclipse.ui.PartInitException; 8 import org.eclipse.ui.ide.IDE; 6 9 import org.refal.rfpdt.ast.AstCall; 7 10 import org.refal.rfpdt.ast.AstCut; … … 13 16 import org.refal.rfpdt.ast.AstRef; 14 17 import org.refal.rfpdt.ast.AstVar; 18 import org.refal.rfpdt.editor.RfpEditor; 15 19 import org.refal.rfpdt.editor.RfpEditorMessages; 20 import org.refal.rfpdt.ui.RfpUI; 16 21 17 22 public class OpenDeclarationAction extends RfpEditorActionDelegate { … … 34 39 return; 35 40 } 36 int offset = astNode.pos.charStart; 37 sourceViewer.setSelectedRange(offset, 0); 38 sourceViewer.revealRange(offset, 0); 41 try { 42 String ext = astNode.pos.rfpResource.isInterface ? "rfi" : "rf"; 43 IFile file = editor.getRfpProject().getSource(astNode.pos.rfpResource.moduleName, ext); 44 if (file == null) 45 return; 46 editor = (RfpEditor) IDE.openEditor(RfpUI.getActivePage(), file); 47 sourceViewer = editor.sourceViewer(); 48 int offset = astNode.pos.charStart; 49 sourceViewer.setSelectedRange(offset, 0); 50 sourceViewer.revealRange(offset, 0); 51 } catch (PartInitException e) { 52 RfpUI.log(e); 53 } 39 54 } 40 55
Note: See TracChangeset
for help on using the changeset viewer.