Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » ElementListSelectionDialog on Eclipse 4(No search result)
ElementListSelectionDialog on Eclipse 4 [message #1067203] Sun, 07 July 2013 14:48 Go to next message
AIT YAHIA Idir is currently offline AIT YAHIA Idir
Messages: 29
Registered: April 2013
Junior 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 Go to previous messageGo to next message
AIT YAHIA Idir is currently offline AIT YAHIA Idir
Messages: 29
Registered: April 2013
Junior 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 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 743
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:51
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

Re: ElementListSelectionDialog on Eclipse 4 [message #1067860 is a reply to message #1067852] Wed, 10 July 2013 22:44 Go to previous message
AIT YAHIA Idir is currently offline AIT YAHIA Idir
Messages: 29
Registered: April 2013
Junior Member
I finally implemented my own dialog for selection based on and TitleAreaDialog and JFace TableViewer, I was inspired from the ElementListSelectionDialog source I defined it so as to be standard and reusable in any Eclipse project, and I think it is better it is much more flexible
Previous Topic:Need clarification of extending E4 app by fragments
Next Topic:Toolbar items disappears when no parts opened (compatibilty mode)
Goto Forum:
  


Current Time: Mon Sep 15 04:10:43 GMT 2014

Powered by FUDForum. Page generated in 0.01694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software