Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cursor in an editable table
Cursor in an editable table [message #453852] Tue, 12 April 2005 12:30 Go to next message
Eclipse UserFriend
Originally posted by: stefan_30.gmx.net

Hi there!
(Sorry for my bad english in advance!!) :-)

And here is my question:
I have a table which is assgined to a TableViewer.
The table viewer creates a ContentProvider class. The content provider
implements IStructuredContendProvider and a TaskListViewer Interface of my
own. Furthermore is set to the TableViewer a LabelProvider which implements
ITableLabelProvider.
One of my columns is assigned to a TextCellEditor.
Although I have set a CellModifier class to the TableViewer implementing
ICellModifier.

And now my real problem:
If I select an editable cell in my table, the string in the cell will be
marked complete. My problem is, that i want set the cursor to the last
position of the string. But I don't know how I can do it.
Has someone a solution of my "problem"???

Thanks
Stefan
Re: Cursor in an editable table [message #453910 is a reply to message #453852] Wed, 13 April 2005 17:51 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
In SWT, you would do the following:

Text t = new Text(parent, SWT.BORDER);
t.setText("Hello World");
int count = t.getCharCount();
t.setSelection(count, count);

You could get the Text widget with TextCellEditor.getControl(). Not sure if
there is a better way to do this.

"Stefan Junghans" <stefan_30@gmx.net> wrote in message
news:d3gfak$5hv$1@news.eclipse.org...
> Hi there!
> (Sorry for my bad english in advance!!) :-)
>
> And here is my question:
> I have a table which is assgined to a TableViewer.
> The table viewer creates a ContentProvider class. The content provider
> implements IStructuredContendProvider and a TaskListViewer Interface of my
> own. Furthermore is set to the TableViewer a LabelProvider which
> implements ITableLabelProvider.
> One of my columns is assigned to a TextCellEditor.
> Although I have set a CellModifier class to the TableViewer implementing
> ICellModifier.
>
> And now my real problem:
> If I select an editable cell in my table, the string in the cell will be
> marked complete. My problem is, that i want set the cursor to the last
> position of the string. But I don't know how I can do it.
> Has someone a solution of my "problem"???
>
> Thanks
> Stefan
>
>
>
Previous Topic:run SWT application in 3.1M6
Next Topic:Add Listener for when a checkbox in a tree is checked.
Goto Forum:
  


Current Time: Thu Apr 25 23:22:17 GMT 2024

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

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

Back to the top