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 251228 Details for
Bug 446075
[GTK3] [GTK 3.10] Garbled bold text when used with icons
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.
Small SWT + Jface program
Bug446075.java (text/plain), 1.60 KB, created by
Marc-André Laperle
on 2015-03-02 18:01:47 EST
(
hide
)
Description:
Small SWT + Jface program
Filename:
MIME Type:
Creator:
Marc-André Laperle
Created:
2015-03-02 18:01:47 EST
Size:
1.60 KB
patch
obsolete
>import org.eclipse.jface.viewers.StyledCellLabelProvider; >import org.eclipse.jface.viewers.TableViewer; >import org.eclipse.jface.viewers.ViewerCell; >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.StyleRange; >import org.eclipse.swt.graphics.Font; >import org.eclipse.swt.graphics.FontData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class Bug446075 { > private static final int NUM_OF_LINES = 100; > private static final int BOLD_TEXT_LENGTH = 10; > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout()); > > FontData fd = shell.getFont().getFontData()[0]; > final Font boldFont = new Font(display, fd.getName(), fd.getHeight(), SWT.BOLD); > > TableViewer viewer = new TableViewer(shell); > viewer.setLabelProvider(new MyLabelProvider(boldFont)); > > for (int i = 0; i < NUM_OF_LINES; i++) { > viewer.add("Some garbled text in a table"); > } > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } > > static private class MyLabelProvider extends StyledCellLabelProvider { > > private Font boldFont; > > private MyLabelProvider(Font font) { > boldFont = font; > } > > @Override > public void update(ViewerCell cell) { > StyleRange range = new StyleRange(); > range.start = 0; > range.length = BOLD_TEXT_LENGTH; > range.font = boldFont; > cell.setStyleRanges(new StyleRange[] { range }); > > cell.setText((String) cell.getElement()); > super.update(cell); > } > } >}
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 446075
:
247650
|
251141
| 251228 |
251813
|
251840
|
252557
|
254963