Home » Eclipse Projects » Eclipse 4 » ElementListSelectionDialog on Eclipse 4(No search result)
ElementListSelectionDialog on Eclipse 4 [message #1067203] |
Sun, 07 July 2013 14:48 |
AIT YAHIA Idir Messages: 39 Registered: April 2013 |
Member |
|
|
hello,
i have a basic implementation of ElementListSelectionDialog, like following.
ElementListSelectionDialog dialog =
new ElementListSelectionDialog(shell, new LabelProvider());
dialog.setElements(new String[] { "Linux", "Mac", "Windows" });
dialog.setTitle("Which operating system are you using");
dialog.open();
the dialog open, but the list is empty, and when we type something in the search field, it nothing happens.
i don't have any exception,I have declared dependency to a package org.eclipse.ui.dialogs
I read somewhere that the selection dialog are directly reusable after 4.2 release of eclipse.
someone was confronted a similar problem ?
|
|
|
Re: ElementListSelectionDialog on Eclipse 4 [message #1067299 is a reply to message #1067203] |
Mon, 08 July 2013 08:51 |
AIT YAHIA Idir Messages: 39 Registered: April 2013 |
Member |
|
|
I deeply examined the ElementListSelectionDialog class, and I found that the problem comes from FiltredList not draw the element provided via LabelProvider.
FilteredList list = new FilteredList(workArea,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL,new LabelProvider(),false,true,true);
list.setLayoutData(new GridData(GridData.FILL,
GridData.BEGINNING, true, false, 1, 1));
list.setFilter(""); //$NON-NLS-1$
list.setElements( new Object[] {"Item 1","Item 2","Item 3","Item"});
I don't know why it does not work for me, but one thing is sure is that it works fine in the Eclipse IDE.
I think I have no alternative, i must define my own Dialog based on a TableViewer
[Updated on: Mon, 08 July 2013 08:54] Report message to a moderator
|
|
|
Re: ElementListSelectionDialog on Eclipse 4 [message #1067852 is a reply to message #1067299] |
Wed, 10 July 2013 21:01 |
Erdal Karaca Messages: 854 Registered: July 2009 |
Senior Member |
|
|
The FilteredList depends on Eclipse 3.x Job API which itself depends on the Eclipse 3.x platform to be running... In effect I ended up implementing a list selection dialog using a viewer, too...
AIT YAHIA Idir wrote on Mon, 08 July 2013 10:51I deeply examined the ElementListSelectionDialog class, and I found that the problem comes from FiltredList not draw the element provided via LabelProvider.
FilteredList list = new FilteredList(workArea,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL,new LabelProvider(),false,true,true);
list.setLayoutData(new GridData(GridData.FILL,
GridData.BEGINNING, true, false, 1, 1));
list.setFilter(""); //$NON-NLS-1$
list.setElements( new Object[] {"Item 1","Item 2","Item 3","Item"});
I don't know why it does not work for me, but one thing is sure is that it works fine in the Eclipse IDE.
I think I have no alternative, i must define my own Dialog based on a TableViewer
|
|
| |
Goto Forum:
Current Time: Mon Sep 23 18:04:57 GMT 2024
Powered by FUDForum. Page generated in 0.03848 seconds
|