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 283813 Details for
Bug 565883
[GTK] Scrolling in Canvas is different than in Table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Snippet with large scroll steps in Canvas
ScrollTest.java (text/plain), 1.43 KB, created by
Thomas Singer
on 2020-08-07 06:17:37 EDT
(
hide
)
Description:
Snippet with large scroll steps in Canvas
Filename:
MIME Type:
Creator:
Thomas Singer
Created:
2020-08-07 06:17:37 EDT
Size:
1.43 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >/** > * @author Thomas Singer > */ >public class ScrollTest { > > public static void main(String[] args) { > final Display display = new Display(); > > final Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > final Composite composite = new Composite(shell, SWT.DOUBLE_BUFFERED | SWT.V_SCROLL); > final ScrollBar verticalBar = composite.getVerticalBar(); > verticalBar.setValues(420, 0, 1002, 24, 1, 24); > > composite.addListener(SWT.Paint, event -> { > int selection = verticalBar.getSelection(); > final Rectangle bounds = composite.getBounds(); > final int rowHeight = event.gc.getFontMetrics().getHeight(); > while (bounds.height > 0) { > event.gc.drawString(Integer.toString(selection++), bounds.x, bounds.y); > bounds.y += rowHeight; > bounds.height -= rowHeight; > } > }); > > verticalBar.addListener(SWT.Selection, event -> composite.redraw()); > > final Table table = new Table(shell, SWT.BORDER | SWT.V_SCROLL | SWT.VIRTUAL); > table.addListener(SWT.SetData, event -> ((Item)event.item).setText("Row " + event.index)); > table.setItemCount(1002); > table.setSelection(420); > > shell.setSize(500, 400); > shell.open(); > > 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 565883
:
283811
|
283812
| 283813