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 152940 Details for
Bug 295666
[JFace] 1 failure in org.eclipse.jface.tests @ ListViewerTest
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
SWT Test snippet
ListShowSelection.java (text/x-java), 1.34 KB, created by
Praveen
on 2009-11-24 07:52:27 EST
(
hide
)
Description:
SWT Test snippet
Filename:
MIME Type:
Creator:
Praveen
Created:
2009-11-24 07:52:27 EST
Size:
1.34 KB
patch
obsolete
>package org.eclipse.swt.snippets.MySnippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Combo; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.List; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; > >public class ListShowSelection { > public static void main (String [] args) { > Display display = new Display (); > Shell shell = new Shell (display); > shell.setLayout(new FillLayout()); > > final List list = new List (shell, SWT.BORDER|SWT.V_SCROLL); > for (int i=0; i<10; i++) { > list.add("Item "+i); > } > > final Button bt = new Button(shell, SWT.None); > bt.setText("Show"); > bt.addListener(SWT.Selection, new Listener() { > @Override > public void handleEvent(Event event) { > list.setTopIndex(20); > System.out.println("TopIndex:"+list.getTopIndex()); > } > }); > shell.setSize (300, 300); > shell.open (); > > for (int i=10; i<40; i++) { > list.add("Item "+i); > } > > list.setTopIndex(20); > System.out.println("topIndex:"+list.getTopIndex()); > > list.select(30); > list.showSelection(); > System.out.println("topIndex:"+list.getTopIndex()); > > 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 295666
: 152940 |
154012