Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Adding TextEditor behavior in a Ktable cell
Adding TextEditor behavior in a Ktable cell [message #465686] Mon, 19 December 2005 15:04 Go to next message
Greg is currently offline GregFriend
Messages: 21
Registered: July 2009
Junior Member
I'd like to get a some of the swt TextEditor behavior in a Ktable.

Besides just using StyledText for the text display, does anyone know if it
would be possible to just put a AbstractDecoratedTextEditor (or anything
like it) in a cell?

I'd really like to get Content Assist to work without having to do too much
wiring myself.

-greg
Re: Adding TextEditor behavior in a Ktable cell [message #465876 is a reply to message #465686] Wed, 21 December 2005 10:40 Go to previous messageGo to next message
Lorenz Maierhofer is currently offline Lorenz MaierhoferFriend
Messages: 88
Registered: July 2009
Member
Hi,

That should be absolutely possible.

Try implementing a KTableCellEditor that uses a composite as the control
- and create the texteditor on that composite.

Lorenz


Greg wrote:
> I'd like to get a some of the swt TextEditor behavior in a Ktable.
>
> Besides just using StyledText for the text display, does anyone know if it
> would be possible to just put a AbstractDecoratedTextEditor (or anything
> like it) in a cell?
>
> I'd really like to get Content Assist to work without having to do too much
> wiring myself.
>
> -greg
>
>
Re: Adding TextEditor behavior in a Ktable cell [message #465943 is a reply to message #465876] Fri, 23 December 2005 20:45 Go to previous message
Greg is currently offline GregFriend
Messages: 21
Registered: July 2009
Junior Member
"Lorenz Maierhofer" <lorenz.m@gmx.at> wrote in message
news:dobbhk$tjh$1@utils.eclipse.org...
> Hi,
>
> That should be absolutely possible.
>
> Try implementing a KTableCellEditor that uses a composite as the control -
> and create the texteditor on that composite.
>

Thanks, that seems like a good start.

I copied the KTableCellEditorText2 to my own object.

So I have DapCellEditorText extends KTableCellEditor

Modified createControl

protected Control createControl() {
Composite composite = new Composite(m_Table, SWT.NONE) ;
m_Text = new StyledText(composite, SWT.NONE);
composite.addKeyListener(keyListener);
composite.addTraverseListener(travListener);
m_composite = composite ;
return composite;
}

Now the fields behave like they did during display; but the editing is
wierd. When I edit a cell, the cell appears grey. When I navigate off the
cell, the text displays consistently with what I typed.

I think I can make progress from here; but if you have any more tips I'd
really appreciate it.
Previous Topic:expand/collapse SashForm
Next Topic:Custom Text Wdget with Decorator
Goto Forum:
  


Current Time: Sat Sep 21 19:27:13 GMT 2019

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

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

Back to the top