Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Force editor to (re)validate/refresh(During the configuration changed in the backend, I need to force the validation of the editor with that new informations)
Force editor to (re)validate/refresh [message #1831665] Wed, 26 August 2020 09:02 Go to next message
M. J. is currently offline M. J.Friend
Messages: 6
Registered: September 2018
Junior Member
Hello everyone,

I'm having a eclipse plugin, which includes an editor (extension point org.eclipse.ui.editors), in fact the MultiPageEditorPart. The editor has some more components and related extensions, like the configuration (extension point org.eclipse.wst.sse.ui.editorConfiguration) and validator (extension point org.eclipse.wst.sse.ui.sourcevalidation).

The problem is, sometimes the "configuration" (the internal state of the editor backend) sometimes changes during the runtime, thus the behaviour of the editor may change. The most important is to re-run the validation of the editor input. Secondly, the editor may be rerendered/redrawn, because some elements/regions may then be displayed by different style.

The question is how to force the validation (or, in general, to update/refresh) the editor.

What did I try:
- refresh the file resource opened in the editor
- look for some "validate" method of the editor
- try to incorporate the PropertyChangeEvent s
- debug the Validator calls and try to find out something in the stack trace


All I know is the validation gets triggered some time after user interaction with the editor. (Which is currently the workaround, press some key and wait a few seconds.)

Is there any way to trigger the validation (or rerender) or just the general refresh of the editor by hand?


Regards,
Martin
Re: Force editor to (re)validate/refresh [message #1831671 is a reply to message #1831665] Wed, 26 August 2020 10:19 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
I don't think that you will get proper reaction here, the validation extensions you are using are provided by the WST project. You will have better changes asking it on their forum.

Have a look at the source of interfaces you had to implement to provide the validator, i.e. the IValidator: 'A validator's verification starts when the ValidatorLauncher singleton calls <code>validate</code>.'

The ValidationFramework calls might be helpful too.

https://www.eclipse.org/forums/index.php?t=thread&frm_id=251

Re: Force editor to (re)validate/refresh [message #1834914 is a reply to message #1831671] Fri, 20 November 2020 13:10 Go to previous message
M. J. is currently offline M. J.Friend
Messages: 6
Registered: September 2018
Junior Member
Rolf Theunissen wrote on Wed, 26 August 2020 10:19
I don't think that you will get proper reaction here, the validation extensions you are using are provided by the WST project. You will have better changes asking it on their forum.

Have a look at the source of interfaces you had to implement to provide the validator, i.e. the IValidator: 'A validator's verification starts when the ValidatorLauncher singleton calls <code>validate</code>.'

The ValidationFramework calls might be helpful too.

https://www.eclipse.org/forums/index.php?t=thread&frm_id=251



Excelent! There was a little trick needed. Our validator is org.eclipse.wst.sse.ui.sourcevalidation extension (class implementing org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;), which is not compatible with the org.eclipse.wst.validation.validator validator extension (class implementing org.eclipse.wst.validation.internal.provisional.core.IValidator).

To be able to use the ValidatorLauncher it was needed to make the validator IValidator as well. Finally, I was able to do:

			FileEditorInput input = (FileEditorInput) getEditorInput();
			IFile file = input.getFile();
			ValidationRunner.validate(file, ValType.Manual, null, true);

[Updated on: Fri, 20 November 2020 13:12]

Report message to a moderator

Previous Topic:running "external tools" from context menu
Next Topic:RCP Product always exported old version of eclipse
Goto Forum:
  


Current Time: Thu Apr 25 09:22:13 GMT 2024

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

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

Back to the top