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 130237 Details for
Bug 270440
List control draws wrong focus rect when DefaultSelection listener calls setItems(..)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
modified Snippet59.java
Snippet59.java (text/plain), 2.15 KB, created by
Markus Keller
on 2009-03-30 08:49:16 EDT
(
hide
)
Description:
modified Snippet59.java
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2009-03-30 08:49:16 EDT
Size:
2.15 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.snippets; > >/* > * List example snippet: print selected items in a list > * > * For a list of all SWT example snippets see > * http://www.eclipse.org/swt/snippets/ > */ >import org.eclipse.swt.SWT; >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 Snippet59 { > >public static void main (String [] args) { > Display display = new Display (); > Shell shell = new Shell (display); > final List list = new List (shell, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); > for (int i=0; i<128; i++) list.add ("Item " + i); > list.setBounds (0, 0, 100, 100); > list.addListener (SWT.Selection, new Listener () { > public void handleEvent (Event e) { > String string = ""; > int [] selection = list.getSelectionIndices (); > for (int i=0; i<selection.length; i++) string += selection [i] + " "; > System.out.println ("Selection={" + string + "}"); > } > }); > list.addListener (SWT.DefaultSelection, new Listener () { > public void handleEvent (Event e) { > String string = ""; > int [] selection = list.getSelectionIndices (); > for (int i=0; i<selection.length; i++) string += selection [i] + " "; > System.out.println ("DefaultSelection={" + string + "}"); > > String[] items= list.getItems(); > items[selection[0]]+= "<"; > list.setItems(items); > list.select(selection[0]); > } > }); > shell.pack (); > 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 270440
: 130237