Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » TableEditor
TableEditor [message #118858] Tue, 20 January 2009 11:13 Go to next message
Gunnar Wurl is currently offline Gunnar WurlFriend
Messages: 34
Registered: July 2009
Member
Hi,

I have a problem using the TableEditor. When using Text in a TableEditor
the lines of the Table under the Editor disappear. Using a combo box looks
very weird. Scrolling the table is not scrolling the Editors. And
reseizing the columns has no effect to its Editors. Here is my example:

public class View extends ViewPart
{
public static final String ID = "TableEditorTest.view";

public void createPartControl( Composite parent )
{
Table table = new Table( parent, SWT.BORDER | SWT.V_SCROLL );
table.setHeaderVisible( true );
table.setLinesVisible( true );

TableColumn tableColumn = new TableColumn( table, SWT.NONE );
tableColumn.setText( "Parameter" );
tableColumn.setWidth( 100 );

TableColumn tableColumn1 = new TableColumn( table, SWT.NONE );
tableColumn1.setText( "Wert" );
tableColumn1.setWidth( 100 );

for( int i = 0; i < 20; i++ )
{
TableEditor editor = new TableEditor( table );
TableItem item = new TableItem( table, SWT.NONE );
item.setText( new String[] { String.valueOf( i ), String.valueOf(
i ) } );
Control t = null;
if( i == 5 )
{
t = new Combo(table, SWT.NONE);
((Combo) t).setItems( new String[]{"1", "2"} );
}
else
{
t = new Text( table, SWT.None );
((Text) t).setText( String.valueOf( i ) );
}
editor.grabHorizontal = true;
editor.setEditor( t, item, 1 );
}
}

public void setFocus()
{
}
}

It works in RCP, except for the ComboBox looking weird there too. But this
can be avoided using a CCombo Box. Is there another way I could use this
kind of editable fields in a table to use in RAP too?

Thanks

Gunnar
Re: TableEditor [message #118887 is a reply to message #118858] Tue, 20 January 2009 12:59 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
what version of RAP are you using?

Gunnar Wurl wrote:
> Hi,
>
> I have a problem using the TableEditor. When using Text in a TableEditor
> the lines of the Table under the Editor disappear. Using a combo box
> looks very weird. Scrolling the table is not scrolling the Editors. And
> reseizing the columns has no effect to its Editors. Here is my example:
>
> public class View extends ViewPart
> {
> public static final String ID = "TableEditorTest.view";
>
> public void createPartControl( Composite parent )
> {
> Table table = new Table( parent, SWT.BORDER | SWT.V_SCROLL );
> table.setHeaderVisible( true );
> table.setLinesVisible( true );
>
> TableColumn tableColumn = new TableColumn( table, SWT.NONE );
> tableColumn.setText( "Parameter" );
> tableColumn.setWidth( 100 );
>
> TableColumn tableColumn1 = new TableColumn( table, SWT.NONE );
> tableColumn1.setText( "Wert" );
> tableColumn1.setWidth( 100 );
>
> for( int i = 0; i < 20; i++ )
> {
> TableEditor editor = new TableEditor( table );
> TableItem item = new TableItem( table, SWT.NONE );
> item.setText( new String[] { String.valueOf( i ),
> String.valueOf( i ) } );
> Control t = null;
> if( i == 5 )
> {
> t = new Combo(table, SWT.NONE);
> ((Combo) t).setItems( new String[]{"1", "2"} );
> }
> else
> {
> t = new Text( table, SWT.None );
> ((Text) t).setText( String.valueOf( i ) );
> }
> editor.grabHorizontal = true;
> editor.setEditor( t, item, 1 );
> }
> }
>
> public void setFocus()
> {
> }
> }
>
> It works in RCP, except for the ComboBox looking weird there too. But
> this can be avoided using a CCombo Box. Is there another way I could use
> this kind of editable fields in a table to use in RAP too?
>
> Thanks
>
> Gunnar
>
Re: TableEditor [message #118900 is a reply to message #118887] Tue, 20 January 2009 13:15 Go to previous messageGo to next message
Gunnar Wurl is currently offline Gunnar WurlFriend
Messages: 34
Registered: July 2009
Member
I am using the M4 target and the 1.2.0 SDK.

Rüdiger Herrmann wrote:

> what version of RAP are you using?
Re: TableEditor [message #118990 is a reply to message #118900] Wed, 21 January 2009 12:44 Go to previous messageGo to next message
Gunnar Wurl is currently offline Gunnar WurlFriend
Messages: 34
Registered: July 2009
Member
Hi,

playing around with the table a bit I found out that it only applies the
layout when a column is resized. It then also puts the editors on the
right places so that they also fit when the table was scrolled before.
Antw: Re: TableEditor [message #121016 is a reply to message #118887] Sun, 08 February 2009 20:37 Go to previous message
Eclipse UserFriend
Originally posted by: admin.kabe-farben.ch

Hi Rüdiger

i also do have the problem that TableEditors are not scrolled with the
table. All other data is scrolled correctly.
Making a layout()-call to all TableEditors in
ILazyContentProvider.updateElement(..) sets the Tableeditors to the right
place, but unfortunatly, that works only for scrolling down, not up (i guess
because data is cached).

Is it a known bug?

Thanks
Andrej


>>> Rüdiger Herrmann<rherrmann@eclipsesource.com> schrieb am 20.01.2009 um
13:59 in Nachricht <gl4hs7$cef$2@build.eclipse.org>:
> what version of RAP are you using?
>
> Gunnar Wurl wrote:
>> Hi,
>>
>> I have a problem using the TableEditor. When using Text in a TableEditor

>
>> the lines of the Table under the Editor disappear. Using a combo box
>> looks very weird. Scrolling the table is not scrolling the Editors. And
>> reseizing the columns has no effect to its Editors. Here is my example:
>>
>> public class View extends ViewPart
>> {
>> public static final String ID = "TableEditorTest.view";
>>
>> public void createPartControl( Composite parent )
>> {
>> Table table = new Table( parent, SWT.BORDER | SWT.V_SCROLL );
>> table.setHeaderVisible( true );
>> table.setLinesVisible( true );
>>
>> TableColumn tableColumn = new TableColumn( table, SWT.NONE );
>> tableColumn.setText( "Parameter" );
>> tableColumn.setWidth( 100 );
>>
>> TableColumn tableColumn1 = new TableColumn( table, SWT.NONE );
>> tableColumn1.setText( "Wert" );
>> tableColumn1.setWidth( 100 );
>>
>> for( int i = 0; i < 20; i++ )
>> {
>> TableEditor editor = new TableEditor( table );
>> TableItem item = new TableItem( table, SWT.NONE );
>> item.setText( new String[] { String.valueOf( i ),
>> String.valueOf( i ) } );
>> Control t = null;
>> if( i == 5 )
>> {
>> t = new Combo(table, SWT.NONE);
>> ((Combo) t).setItems( new String[]{"1", "2"} );
>> }
>> else
>> {
>> t = new Text( table, SWT.None );
>> ((Text) t).setText( String.valueOf( i ) );
>> }
>> editor.grabHorizontal = true;
>> editor.setEditor( t, item, 1 );
>> }
>> }
>>
>> public void setFocus()
>> {
>> }
>> }
>>
>> It works in RCP, except for the ComboBox looking weird there too. But
>> this can be avoided using a CCombo Box. Is there another way I could use

>
>> this kind of editable fields in a table to use in RAP too?
>>
>> Thanks
>>
>> Gunnar
>>
Previous Topic:JSWriter in 1.2.0M4?
Next Topic:Widget.notifyListeners() and Image scaling
Goto Forum:
  


Current Time: Sun Nov 28 00:53:12 GMT 2021

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

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

Back to the top