|
|
Re: Is there a practical limit to the number of columns in a Table? [message #501312 is a reply to message #501287] |
Tue, 01 December 2009 15:12  |
Eclipse User |
|
|
|
Found the problem see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=251379
"drew" <drew@acm.org> wrote in message
news:hf3n32$mpe$1@build.eclipse.org...
> It seems related to the count of characters comprising the sum of all
> column headers, at a certain point for a table the column hearder text
> will get truncated. Somehwere around 2470 characters. I tried this in 2
> different applications, one is the application I am working and another is
> just a SWTSnippet like example both fail in aproximately the same count of
> characters.
>
> public static void main(String[] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> shell.setLayout(new GridLayout());
> Table table = new Table (shell, SWT.VIRTUAL | SWT.MULTI | SWT.BORDER |
> SWT.FULL_SELECTION);
> table.setLinesVisible (true);
> table.setHeaderVisible (true);
> GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
> data.heightHint = 200;
> table.setLayoutData(data);
> int item=0;
> int charCnt = 0;
> // truncates on win32 at around 2470 characters
> for(int x=0;x<900;x++)
> {
> TableColumn column = new TableColumn (table, SWT.NONE);
> StringBuffer b = new StringBuffer();
> b.append(item++);
> column.setText (b.toString());
> charCnt+=b.toString().length();
> column.setToolTipText(Integer.toString(charCnt));
> }
> int tCnt = table.getColumnCount();
> for (int i=0; i<tCnt; i++)
> {
> table.getColumn (i).pack ();
> }
> shell.pack ();
> shell.open ();
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
>
>
> }
>
>
> "drew" <drew@acm.org> wrote in message
> news:hf3h5j$bsd$1@build.eclipse.org...
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03675 seconds