I´m currently developing an Eclipse4 RCP Application and I was wondering if there is a possibility to define tokens in SWT Text Fields, so that they are not accessible characterwise.
So for example I have a Text Field and I want to make tokens that match "[anytext]" not accessible characterwise. (Where the parenthesis define the token)
That means: I cannot put my cursor inside the parenthesis and if I press delete directly in front of the left parenthesis or backspace directly behind the right parenthesis, the whole token gets deleted.
I´m currently doing it with listeners but that seems somehow a little to complex and expensive, as I need a KeyListener with lots of logic and a mouse listener to prevent clicks inside the token and an adjusted Drop Listener as Drops inside token shouldn´t be allowed neither obviously.
Am I just missing some fancy way of doing it?
Hope you can help me, thank you!