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 231605 Details for
Bug 409264
[JFace/SWT] TableColumnLayout problem on mac os
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.
Code snippet displaying the problem
snippet.txt (text/plain), 2.18 KB, created by
Cedric Moonen
on 2013-05-28 06:03:12 EDT
(
hide
)
Description:
Code snippet displaying the problem
Filename:
MIME Type:
Creator:
Cedric Moonen
Created:
2013-05-28 06:03:12 EDT
Size:
2.18 KB
patch
obsolete
>class ViewContentProvider implements IStructuredContentProvider { > public void inputChanged(Viewer v, Object oldInput, Object newInput) { > } > > public void dispose() { > } > > public Object[] getElements(Object parent) { > if (parent instanceof Object[]) { > return (Object[]) parent; > } > return new Object[0]; > } > } > > class ViewLabelProvider extends ColumnLabelProvider { > > private int columnIndex; > > public ViewLabelProvider(int colIndex) { > columnIndex = colIndex; > } > > @Override > public String getText(Object element) { > if (columnIndex == 0) { > return ""; > } > return super.getText(element); > } > } > > public void createPartControl(Composite parent) { > TableColumnLayout tableLayout = new TableColumnLayout(); > parent.setLayout(tableLayout); > > viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL > | SWT.V_SCROLL); > viewer.setContentProvider(new ViewContentProvider()); > viewer.setLabelProvider(new ViewLabelProvider(0)); > // Provide the input to the ContentProvider > viewer.setInput(new String[] { "One", "Two", > "A loooooooooooooooooooooooooooooooooooooooooooooooooooooong string" }); > > createColumns(viewer, tableLayout); > refreshViewer(); > } > > > private void createColumns(TableViewer viewer, TableColumnLayout tableLayout) { > TableViewerColumn firstColumn = new TableViewerColumn(viewer, SWT.FILL); > firstColumn.getColumn().setResizable(false); > ViewLabelProvider labelProvider = new ViewLabelProvider(0); > firstColumn.setLabelProvider(labelProvider); > > TableViewerColumn secondColumn = new TableViewerColumn(viewer, SWT.FILL); > secondColumn.getColumn().setResizable(false); > labelProvider = new ViewLabelProvider(1); > secondColumn.setLabelProvider(labelProvider); > > tableLayout.setColumnData(firstColumn.getColumn(), > new ColumnWeightData(0, 22)); > tableLayout.setColumnData(secondColumn.getColumn(), > new ColumnWeightData(100, 100)); > viewer.getTable().setLinesVisible(false); > viewer.getTable().setHeaderVisible(false); > } > > protected void refreshViewer() { > viewer.refresh(); > Table table = viewer.getTable(); > for (TableColumn column : table.getColumns()) { > column.pack(); > } > }
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 409264
: 231605 |
231606