Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 160390 Details for
Bug 304128
[Viewers] Unnecessary horizontal scrollbar shown for TableViewer+TableColumnLayout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Snippet demonstrating the problem
Snippet304128.java (text/x-java), 1.56 KB, created by
Ralf Ebert
on 2010-02-26 22:46:50 EST
(
hide
)
Description:
Snippet demonstrating the problem
Filename:
MIME Type:
Creator:
Ralf Ebert
Created:
2010-02-26 22:46:50 EST
Size:
1.56 KB
patch
obsolete
>import org.eclipse.jface.layout.TableColumnLayout; >import org.eclipse.jface.viewers.ArrayContentProvider; >import org.eclipse.jface.viewers.CellLabelProvider; >import org.eclipse.jface.viewers.ColumnWeightData; >import org.eclipse.jface.viewers.TableViewer; >import org.eclipse.jface.viewers.TableViewerColumn; >import org.eclipse.jface.viewers.ViewerCell; >import org.eclipse.swt.SWT; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class Snippet304128 { > > public Snippet304128(Shell shell) { > final TableViewer viewer = new TableViewer(shell, SWT.FULL_SELECTION | SWT.MULTI > | SWT.V_SCROLL); > TableViewerColumn column1 = new TableViewerColumn(viewer, SWT.NONE); > TableColumnLayout tableLayout = new TableColumnLayout(); > shell.setLayout(tableLayout); > tableLayout.setColumnData(column1.getColumn(), new ColumnWeightData(100)); > > column1.setLabelProvider(new CellLabelProvider() { > > @Override > public void update(ViewerCell cell) { > cell.setText(String.valueOf(cell.getElement())); > } > }); > viewer.setContentProvider(ArrayContentProvider.getInstance()); > String[] values = new String[50]; > for (int i = 0; i < values.length; i++) { > values[i] = "Item " + i; > } > shell.open(); > viewer.setInput(values); > viewer.getTable().setLinesVisible(true); > } > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setSize(200, 200); > new Snippet304128(shell); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > > display.dispose(); > > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 304128
: 160390