Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » howto bind "«" and "»" to keys in eclipse(I need "«" and "»" even inside of strings in my DSL, how can I provide itto my customers?)
howto bind "«" and "»" to keys in eclipse [message #1745538] Wed, 12 October 2016 09:20 Go to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 223
Registered: June 2013
Senior Member
In my DSL, I have to handles some wildcards inside of strings.
To avoid conflichs with normal text, I decided to enclose these in "«" and "»".

The only issue is that the user has to enter these characters when editing his DSL file.

ALT0171 and ALT0187 doesn't seem the best way to do it, but I can not provide some Editor Templates inside of a string.
So is there any (minimal effort, because I'm still a newbie in eclipse) alternative like:
hit "CTRL-<" to enter "«" ?

I think I saw this feature when I edit my xxxGenerator.xtend

TIA, Uli

[Updated on: Wed, 12 October 2016 09:24]

Report message to a moderator

Re: howto bind "«" and "»" to keys in eclipse [message #1745546 is a reply to message #1745538] Wed, 12 October 2016 11:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5396
Registered: July 2009
Senior Member
Hi

Xtend uses guillemets and I think that it was a good design decision however typing them is a nightmare. I have Googled occasionally for help and found rather confusing documentation, certainly the Xtend documentation is not helpful. It seems that part of the problem is Windows-specific and maybe even keyboard-specfic and so simple prefixes don't work for me. I resort to copy-and-paste from a file where the guillemets exist.

It would be nice if Xtend introduced some clear short cuts.

Regards

Ed Willink
Re: howto bind "«" and "»" to keys in eclipse [message #1745569 is a reply to message #1745546] Wed, 12 October 2016 15:04 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 223
Registered: June 2013
Senior Member
Hi Ed,

there is some hope because when I edit an XTEND file, typing CTRL-< will result in a "«" (hip hip hooorayyyy!)
The question is only how I can activate the same functionality inside of my little DSL editor.
Perhaps some insider may give us some clue what needs to be done.
Re: howto bind "«" and "»" to keys in eclipse [message #1745570 is a reply to message #1745546] Wed, 12 October 2016 15:04 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 223
Registered: June 2013
Senior Member
Hi Ed,

there is some hope because when I edit an XTEND file, typing CTRL-< will result in a "«" (hip hip hooorayyyy!)
The question is only how I can activate the same functionality inside of my little DSL editor.
Perhaps some insider may give us some clue what needs to be done.

TIA, Uli
Re: howto bind "«" and "»" to keys in eclipse [message #1745575 is a reply to message #1745570] Wed, 12 October 2016 16:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
do you mean

<extension
         point="org.eclipse.ui.bindings">
      <key
            contextId="org.eclipse.xtend.ide.XtendEditorScope"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+&lt;"
            commandId="org.eclipse.xtend.ide.insertLeftGuillemet">
      </key>
      <key
            contextId="org.eclipse.xtend.ide.XtendEditorScope"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="M1+&gt;"
            commandId="org.eclipse.xtend.ide.insertRightGuillemet">
      </key>



????


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: howto bind "«" and "»" to keys in eclipse [message #1745601 is a reply to message #1745575] Thu, 13 October 2016 04:49 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 223
Registered: June 2013
Senior Member
Hi Christian,

that looks pretty promising as a start. I will experiment how this can be converted to work in mydsl example.

Thanks a lot, Uli

P.S: I found in the github the plugin.xml as well as the Handler under

xtext-xtend/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/edit/InsertStringHandler.java

Now I have to find out how to transfer that to my own little mydsl example project

[Updated on: Thu, 13 October 2016 08:09]

Report message to a moderator

Re: howto bind "«" and "»" to keys in eclipse [message #1746510 is a reply to message #1745601] Mon, 31 October 2016 12:58 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 223
Registered: June 2013
Senior Member
as some alternative, one can create some dynamic template as described in https://www.eclipse.org/forums/index.php?t=msg&th=297566&goto=870958&#msg_870958
Previous Topic:Strange Serialization
Next Topic:One file extension for different plug-ins?
Goto Forum:
  


Current Time: Tue Sep 26 12:56:05 GMT 2017

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

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