Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to initiate validation of a SSE StructuredDocument
How to initiate validation of a SSE StructuredDocument [message #208354] Fri, 08 February 2008 21:07 Go to next message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
I have a quick fix proposal that will fix an EL problem by creating a
variable outside of the current source viewer. This means that the
proposal won't update the current text region to become dirty, and
therefore won't re-validate automatically.

Ideally I would like to validate only the current region, but in some
cases I may want to re-validate the entire document. I want to do this
when the proposal is applied.

Is there API to initiate validation of a SSE StructuredDocument or a
region within?

Regards,
Gerry
Re: How to initiate validation of a SSE StructuredDocument [message #208435 is a reply to message #208354] Mon, 11 February 2008 15:25 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Gerry Kessler wrote:
> I have a quick fix proposal that will fix an EL problem by creating a
> variable outside of the current source viewer. This means that the
> proposal won't update the current text region to become dirty, and
> therefore won't re-validate automatically.
> Ideally I would like to validate only the current region, but in some
> cases I may want to re-validate the entire document. I want to do this
> when the proposal is applied.
>
> Is there API to initiate validation of a SSE StructuredDocument or a
> region within?

Gerry,
You'll want to look up the org.eclipse.wst.sse.ui.sourcevalidation
extension point and the
org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceV alidator
interface (which will at least be moved into sse.core at some point).


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: How to initiate validation of a SSE StructuredDocument [message #208465 is a reply to message #208435] Mon, 11 February 2008 18:06 Go to previous messageGo to next message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
Nitin,
Maybe I wasn't quite clear, or maybe I am missing something. We already
have a source validator. During validation, we are attaching an
IQuickFixProcessor using message.setAttribute in the prescribed manner of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=170988.

The issue here is that the source will not change after applying this
particular proposal, so a validation will not re-fire automatically. How
can I cause a re-validation event?
Re: How to initiate validation of a SSE StructuredDocument [message #208567 is a reply to message #208465] Wed, 13 February 2008 03:14 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Gerry Kessler wrote:
> Nitin,
> Maybe I wasn't quite clear, or maybe I am missing something. We already
> have a source validator. During validation, we are attaching an
> IQuickFixProcessor using message.setAttribute in the prescribed manner
> of https://bugs.eclipse.org/bugs/show_bug.cgi?id=170988.
> The issue here is that the source will not change after applying this
> particular proposal, so a validation will not re-fire automatically.
> How can I cause a re-validation event?

There's no direct way of causing this, much less a supported one. I
suppose the only thing you could do as a workaround is to replace
the text spanning the annotation's offset and length with the same
text, forcing the document event to be generated and the area to be
revalidated.

---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: How to initiate validation of a SSE StructuredDocument [message #208611 is a reply to message #208567] Thu, 14 February 2008 18:58 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
What about using this new validation framework object?

Validator[] validators = ValidationFramework.getValidatorsFor(...).

for (Validator validator : validators)
{
validator.validate(...);
}


--Cam
Re: How to initiate validation of a SSE StructuredDocument [message #208620 is a reply to message #208611] Thu, 14 February 2008 22:24 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Cameron Bateman wrote:
> What about using this new validation framework object?
>
> Validator[] validators = ValidationFramework.getValidatorsFor(...).
>
> for (Validator validator : validators)
> { validator.validate(...);
> }

There's a catch in that the output from those validators would need
to be rerouted to create text Annotations (they make the squiggles),
something that's only done by the editor's internals.

---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:StructuredTextEditor and validation ...
Next Topic:Jetty Support
Goto Forum:
  


Current Time: Thu Apr 25 13:37:58 GMT 2024

Powered by FUDForum. Page generated in 0.03531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top