[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: create error mark in a text editor

David Rojo wrote:

how do I know that the document has been saved? I mean, is there any method that it is called every time the document is saved that I can overwrite?

No. There are several ways to detect save: in your editor, in the document provider, via file buffer listener, etc. You need to figure out what fits best for you.


Dani


Daniel Megert escribió:

David Rojo wrote:

if I want to do it on save?, is it similar?


On save you simply need to add/remove markers

Dani


Daniel Megert escribió:

David Rojo wrote:

it would be nice to mark it while typing, but I don't know if it is too difficult



OK, here are a few pointers:
- define your own (problem) marker type (see org.eclipse.core.resources.markers extension point)
- define your own annotation type (see org.eclipse.ui.editors.annotationTypes extension point) and hook it to your marker
- define the LAF of your new annotation type via org.eclipse.ui.editors.makerAnnotationSpecification extension point
- create a builder that creates/removes your markers on build
- use a (Mono)Reconciler to create/remove your annotations while typing


Dani


Daniel Megert escribió:

David Rojo wrote:

Hello,
i have created a text editor and I would like to add some kind of symbol to mark the errors (like syntax errors), but I don't know where to start looking for information.


anyone can help me?




At which point do you want to mark the errors (on save or while typing)?

Dani



thanks