Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Hex cell editor(How to create a text box cell that only allows hexadecimal entry)
Hex cell editor [message #1061237] Thu, 30 May 2013 16:46 Go to next message
desis machino is currently offline desis machino
Messages: 10
Registered: May 2013
Junior Member
I am trying to use nattable for a view where the values users are hexadecimal. I want to restrict the valid keys that users can enter (0-9,A-F) rather then giving an error if users type invalid values. Should I start with extending the TextCellEditor and capturing key stroke events to only allow the characters I want? I also want to have a mask in the value (ie an '_' every 4 nibbles, like DEAD_BEEF) so if users type more than 4 characters it will automatically appear for them. Is the class extending TextCellEditor where I should begin looking to make my changes?

Are there any examples of anything like this that anyone knows of that I can look at to help me get started.

Thanks
Re: Hex cell editor [message #1061250 is a reply to message #1061237] Thu, 30 May 2013 18:46 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1300
Registered: July 2012
Senior Member
Hi,

I'm not sure if anybody did something like that before in NatTable.

Yes I would try to extend the TextCellEditor and add additional key listeners. The TextCellEditor just wraps the Text Control, so maybe there is somebody out there who did something similar with a SWT Text Control.

Greez,
Dirk
Previous Topic:64-bit problem with Web Start example
Next Topic:Multi-cell editing changes between 0.9.0 and 1.0.0
Goto Forum:
  


Current Time: Wed Oct 01 08:26:05 GMT 2014

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

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