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 265545 Details for
Bug 508049
[AutoSuggest] No columns shown in AutoSuggest with ColumnDataProvider
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.
AutoSuggest with Columns
BasicEntryPoint.java (text/x-java), 2.23 KB, created by
Markus Knauer
on 2016-11-23 08:44:38 EST
(
hide
)
Description:
AutoSuggest with Columns
Filename:
MIME Type:
Creator:
Markus Knauer
Created:
2016-11-23 08:44:38 EST
Size:
2.23 KB
patch
obsolete
>package rap.test.autosuggest; > >import java.util.Arrays; > >import org.eclipse.rap.addons.autosuggest.AutoSuggest; >import org.eclipse.rap.addons.autosuggest.ColumnDataProvider; >import org.eclipse.rap.addons.autosuggest.ColumnTemplate; >import org.eclipse.rap.addons.autosuggest.DataSource; >import org.eclipse.rap.rwt.application.AbstractEntryPoint; >import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Text; > >public class BasicEntryPoint extends AbstractEntryPoint { > > private static final long serialVersionUID = 1L; > > @Override > protected void createContents(Composite parent) { > parent.setLayout(new GridLayout(1, false)); > > // code example taken over from https://wiki.eclipse.org/RAP/Incubator/DropDown#Templates > Text text = new Text(parent, SWT.BORDER); > DataSource dataSource = new DataSource(); > dataSource.setTemplate(new ColumnTemplate(50, 150, 150)); > ColumnDataProvider dataProvider = new ColumnDataProvider() { > > @Override > public Iterable<?> getSuggestions() { > return Arrays.asList(createData()); > } > > @Override > public String getValue(Object element) { > String[] value = (String[]) element; > return value[0]; > } > > @Override > public String[] getTexts(Object element) { > String[] value = (String[]) element; > return new String[] { value[0], value[1], value[2] }; > } > }; > > dataSource.setDataProvider(dataProvider); > AutoSuggest autoSuggest = new AutoSuggest(text); > autoSuggest.setDataSource(dataSource); > } > > private String[][] createData() { > return new String[][] { > { "0", "0 FOO", "0 BAR" }, > { "1", "1 FOO", "1 BAR" }, > { "2", "2 FOO", "2 BAR" }, > { "3", "3 FOO", "3 BAR" }, > { "4", "4 FOO", "4 BAR" }, > { "5", "5 FOO", "5 BAR" }, > { "6", "6 FOO", "6 BAR" }, > { "7", "7 FOO", "7 BAR" }, > { "8", "8 FOO", "8 BAR" }, > { "9", "9 FOO", "9 BAR" }, > }; > } > >}
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 508049
: 265545 |
265648