Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » HighlightReconciler doesn't highlight
HighlightReconciler doesn't highlight [message #546985] Wed, 14 July 2010 16:22 Go to next message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
Hi!

I have an instance of "HighlightReconciler".
I use this:
HighlightingReconciler reconcilier = editor.getHighlightingHelper().getReconciler();
reconcilier.addPosition(correspondingTag.getOffset(), correspondingTag.getLength(),	WMLHighlightingConfiguration.RULE_START_END_TAG);


But the highlighting doesn't work. Any sugesstions?

I've checked the offset and it's ok.

Thanks,
Timotei
Re: HighlightReconciler doesn't highlight [message #547034 is a reply to message #546985] Thu, 15 July 2010 02:38 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1151
Registered: July 2009
Senior Member
Hi,

I don't know if this approach is going to work. As far as I know, the
reconciler is triggered only on a model change, i.e. not if merely the
cursor position changes.

Have you looked at the code that does the "boxing" the single character?
Maybe you can implement something similar for multiple characters.
Another hack would be to use the editors "reveal" method. Of course the
highlighting of the revealed area will be different from what you want.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: HighlightReconciler doesn't highlight [message #547065 is a reply to message #546985] Thu, 15 July 2010 08:17 Go to previous messageGo to next message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
The part with MatchingCharacterPainter doesn't work, as only 1 character can pe paint.

Re: HighlightReconciler doesn't highlight [message #547079 is a reply to message #547065] Thu, 15 July 2010 08:54 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Timotei,

did you try to call highlighting reconciler.refresh() to trigger the
reconciler?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 15.07.10 14:18, schrieb Timotei:
> The part with MatchingCharacterPainter doesn't work, as only 1 character
> can pe paint.
>
>
Re: HighlightReconciler doesn't highlight [message #547445 is a reply to message #546985] Fri, 16 July 2010 16:33 Go to previous messageGo to next message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
Hi!
Nice, it works with .refresh(). However there is an issue: In my ISemanticHighlight, I've put some higlightings. And that override some of the highlighted previously area. Is any way I can... detect if I highlighted that portion before, and skip it in my ISemantic? Or better, how I clear my position list?

Thanks,
Timotei
Re: HighlightReconciler doesn't highlight [message #547467 is a reply to message #546985] Sat, 17 July 2010 03:26 Go to previous messageGo to next message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
So, basically i have the following:

[tohigh]

With my custom bracket matching I highlight: [tohigh]
But, my ISemanticHighlighter higlights this: tohigh

So, in the end it looks like:

[tohigh]

Basically I need a way to know if I should/or not use the SemanticHighlighter. One way I was thinking, can I extend the AbstractNode with a "better" class, and use that, instead of AbstractNode, in my xtext editor/other stuff? I would put another property, and based on that I would hihglight/or not with my SemanticHighlgihter.

Thanks,
Timo
Re: HighlightReconciler doesn't highlight [message #547468 is a reply to message #546985] Sat, 17 July 2010 04:40 Go to previous messageGo to next message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
I tried the following:

public class EnhacedLeafNode extends LeafNodeImpl


and then, in MYDSLUiModule.java:
	public Class<? extends LeafNodeImpl> bindLeafNode()
	{
		return EnhacedLeafNode.class;
	}


But that doesn't work, I get exceptions when the editor triies to be instantiated.

UPDATE:
I've tried another route to do this, with this:
	public Class<? extends MergingHighlightedPositionAcceptor> bindMergingHighlightedPositionAcceptor()
	{
		return WMLMergingHighlightedPositionAcceptor.class;
	}


But it neither works.

Do I miss something? It looks like guice can't "override" used classes, only Interfaces?

Timo

[Updated on: Sat, 17 July 2010 06:17]

Report message to a moderator

Re: HighlightReconciler doesn't highlight [message #548312 is a reply to message #547468] Wed, 21 July 2010 08:52 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Timotei,

it is not possible to change the implementation class of the node model.
However, you are free to attach information via leafNode.eAdapters().add(..)

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 17.07.10 10:40, schrieb Timotei:
> I tried the following:
>
> public class EnhacedLeafNode extends LeafNodeImpl
>
> and then, in MYDSLUiModule.java:
>
> public Class<? extends LeafNodeImpl> bindLeafNode()
> {
> return EnhacedLeafNode.class;
> }
>
>
> But that doesn't work, I get exceptions when the editor triies to be
> instantiated.
Re: HighlightReconciler doesn't highlight [message #548315 is a reply to message #546985] Wed, 21 July 2010 09:07 Go to previous message
Timotei D is currently offline Timotei D
Messages: 89
Registered: March 2010
Member
Thanks Sebastian.

That worked.

Timotei
Previous Topic:Generate xtext grammar from xtext grammar
Next Topic:Cross Reference within different classes
Goto Forum:
  


Current Time: Wed Jul 30 19:32:33 EDT 2014

Powered by FUDForum. Page generated in 0.01756 seconds