Changeset 3372 for devel-tools/trunk


Ignore:
Timestamp:
Feb 5, 2008, 9:21:49 AM (13 years ago)
Author:
yura
Message:
  • Annotation highlights only in currnet file.
  • Annotation highlights uses actual AST.
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/RfpEditor.java

    r3365 r3372  
    108108
    109109        public void selectionChanged (SelectionChangedEvent event) {
     110            if (rfpReconcilingStrategy == null)
     111                return;
     112            AstImplem astImplem = rfpReconcilingStrategy.getAstImplem();
    110113            if (astImplem == null)
    111114                return;
     
    127130                annotations.clear();
    128131                for (AstNode astNode : astNodeList) {
     132                    if (!astImplem.pos.rfpResource.equals(astNode.pos.rfpResource))
     133                        continue;
    129134                    Annotation annotation = new Annotation("org.eclipse.jdt.ui.occurrences", false, astNode.toString());
    130135                    annotations.add(annotation);
     
    141146    private RfpSourceViewerConfiguration rfpSourceViewerConfiguration;
    142147
    143     AstImplem astImplem = null;
     148    RfpReconcilingStrategy rfpReconcilingStrategy = null;
    144149
    145150    public RfpEditor () {
     
    201206            }
    202207        });
    203         //Runnable runnable = new Runnable() {
    204         //    public void run () {
    205         //        getSourceViewer().invalidateTextPresentation();
    206         //    }
    207         //};
    208         //if (runnable == null)
    209         //    return;
    210         //IWorkbenchPartSite site = this.getSite();
    211         //if (site == null)
    212         //    return;
    213         //Shell shell = site.getShell();
    214         //if (shell == null || shell.isDisposed())
    215         //    return;
    216         //Display display = shell.getDisplay();
    217         //if (display == null || display.isDisposed())
    218         //    return;
    219         //display.asyncExec(runnable);
     208        // Runnable runnable = new Runnable() {
     209        // public void run () {
     210        // getSourceViewer().invalidateTextPresentation();
     211        // }
     212        // };
     213        // if (runnable == null)
     214        // return;
     215        // IWorkbenchPartSite site = this.getSite();
     216        // if (site == null)
     217        // return;
     218        // Shell shell = site.getShell();
     219        // if (shell == null || shell.isDisposed())
     220        // return;
     221        // Display display = shell.getDisplay();
     222        // if (display == null || display.isDisposed())
     223        // return;
     224        // display.asyncExec(runnable);
    220225    }
    221226
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt.editor/src/org/refal/plus/rfpdt/editor/RfpReconcilingStrategy.java

    r3365 r3372  
    1818        this.editor = editor;
    1919        this.store = store;
     20        editor.rfpReconcilingStrategy = this;
     21    }
     22   
     23    public AstImplem getAstImplem () {
     24        IFile file = (IFile) editor.getEditorInput().getAdapter(IFile.class);
     25        if (document == null || document.get().equals(""))
     26            return null;
     27        return RfpBuilder.checkAndCompileModuleImplem(file.getProject(), file, document.get());
    2028    }
    2129
    2230    public void reconcile (IRegion partition) {
    23         IFile file = (IFile) editor.getEditorInput().getAdapter(IFile.class);
    24         if (document == null || document.get().equals(""))
    25             return;
    26         AstImplem astImplem = RfpBuilder.checkAndCompileModuleImplem(file.getProject(), file, document.get());
    27         this.editor.astImplem = astImplem;
     31        AstImplem astImplem = getAstImplem();
    2832        if (astImplem != null)
    2933            editor.changeTextPresentation(document, PresentationVisitor.updateTextPresentation(astImplem, store));
Note: See TracChangeset for help on using the changeset viewer.