Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Linux-gtk and TableEditors problem
Linux-gtk and TableEditors problem [message #466179] Wed, 04 January 2006 16:24 Go to next message
Salvatore Culcasi is currently offline Salvatore CulcasiFriend
Messages: 6
Registered: July 2009
Junior Member
Hello,

I am using Eclipse 3.1 and I am having some troubles under Linux-gtk with
TableEditors that are not displayed rightly, I will try to explain my
problem with more detail.

I created a TableViewer with moveble TableColumns, one of this columns
(the last one) has associated one TableEditor for each row. The control
set in the TableEditor is a ProgressBar.

When the column containing the ProgressBars is moved (the column order is
changed) there is a display problem, since the ProgressBars and column
header are displayed as first column instead to be displayed where the
column has been moved
If you click on the top of one of the remaining columns to set the row
order, the table layout restored correctly and the Progressbars and header
are associated to the right column.
This misbehavior does not happen under windows

I tried to check the ProgressBars bound but they seem to be rightly set, I
tried to find out some workaround but with no lucky.

Does anyone know a workaround to my problem?
Is this a bug?

Underneath I report a piece of code reproducing the problem.

Thanks in advance for you help
Salvatore


import org.eclipse.swt.*;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

/**
* Displays a table
*/
public class TableTest {
public static void main(String[] args) {
new TableTest().run();
}

public void run() {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
table.setHeaderVisible(true);
table.setLinesVisible(true);

for (int i = 0; i < 6; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setMoveable(true);
column.setResizable(true);
column.setWidth(100);
}


for (int i = 0; i < 10; i++) {
TableItem item = new TableItem(table, SWT.NONE);

for (int j = 0; j < 5; j++) {
item.setText(j, "Row " + i + ", Column " + j);
}

ProgressBar pbar = new ProgressBar(table, SWT.SMOOTH|SWT.RESIZE);
pbar.setMinimum(0);
pbar.setSelection(60);
TableEditor editor = new TableEditor(table);
editor.grabHorizontal = editor.grabVertical = true;
editor.setEditor(pbar,item,5);

}

shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
Re: Linux-gtk and TableEditors problem [message #466283 is a reply to message #466179] Thu, 05 January 2006 20:47 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Please enter a bug report against Eclipse Platform SWT.

"Salvatore" <salvatore.culcasi@st.com> wrote in message
news:a808e7b53730609ac6ec8159265eb785$1@www.eclipse.org...
> Hello,
>
> I am using Eclipse 3.1 and I am having some troubles under Linux-gtk with
> TableEditors that are not displayed rightly, I will try to explain my
> problem with more detail.
>
> I created a TableViewer with moveble TableColumns, one of this columns
> (the last one) has associated one TableEditor for each row. The control
> set in the TableEditor is a ProgressBar.
>
> When the column containing the ProgressBars is moved (the column order is
> changed) there is a display problem, since the ProgressBars and column
> header are displayed as first column instead to be displayed where the
> column has been moved
> If you click on the top of one of the remaining columns to set the row
> order, the table layout restored correctly and the Progressbars and header
> are associated to the right column.
> This misbehavior does not happen under windows
>
> I tried to check the ProgressBars bound but they seem to be rightly set, I
> tried to find out some workaround but with no lucky.
>
> Does anyone know a workaround to my problem?
> Is this a bug?
>
> Underneath I report a piece of code reproducing the problem.
>
> Thanks in advance for you help
> Salvatore
>
>
> import org.eclipse.swt.*;
> import org.eclipse.swt.custom.TableEditor;
> import org.eclipse.swt.layout.*;
> import org.eclipse.swt.widgets.*;
>
> /**
> * Displays a table
> */
> public class TableTest {
> public static void main(String[] args) {
> new TableTest().run();
> }
>
> public void run() {
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setLayout(new FillLayout());
> Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
> table.setHeaderVisible(true);
> table.setLinesVisible(true);
> for (int i = 0; i < 6; i++) {
> TableColumn column = new TableColumn(table, SWT.NONE);
> column.setMoveable(true);
> column.setResizable(true);
> column.setWidth(100);
> }
>
> for (int i = 0; i < 10; i++) {
> TableItem item = new TableItem(table, SWT.NONE);
> for (int j = 0; j < 5; j++) {
> item.setText(j, "Row " + i + ", Column " + j);
> }
> ProgressBar pbar = new ProgressBar(table, SWT.SMOOTH|SWT.RESIZE);
> pbar.setMinimum(0);
> pbar.setSelection(60);
> TableEditor editor = new TableEditor(table);
> editor.grabHorizontal = editor.grabVertical = true;
> editor.setEditor(pbar,item,5);
>
> }
> shell.pack();
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> display.sleep();
> }
> }
> display.dispose();
> }
> }
>
>
>
>
Previous Topic:Table Cell Colors For two Different Tables
Next Topic:Text mimum width and SWT.H_SCROLL
Goto Forum:
  


Current Time: Thu Apr 25 08:13:23 GMT 2024

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

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

Back to the top