TableEditor [message #118858] |
Tue, 20 January 2009 06:13  |
Eclipse User |
|
|
|
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 07:59   |
Eclipse User |
|
|
|
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
>
|
|
|
|
|
Antw: Re: TableEditor [message #121016 is a reply to message #118887] |
Sun, 08 February 2009 15:37  |
Eclipse User |
|
|
|
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
>>
|
|
|
Powered by
FUDForum. Page generated in 0.05037 seconds