Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Showing the horizontal scroll bar of a Combo
Showing the horizontal scroll bar of a Combo [message #658974] Thu, 10 March 2011 15:30 Go to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi guys,

I have a Viewpart in my Eclipse RCP application. It is positioned left to the editor area and contains only a Combo with few texts.

The problem is, when I re-size the ViewPart to be smaller than the biggest text in the Combo and then show up the content of the Combo. It doesn't show the horizontal scrollbar, but instead it shows the whole list of texts.

But the list is wider than the ViewpPart now, thus the list overlaps to the editor area Sad

http://img16.imageshack.us/img16/576/combouk.png

content.setLayout(new FillLayout());
Composite content = toolkit.createComposite(parent);
content.setLayout(new GridLayout());

LabelProvider labelProvider = new LabelProvider() {

	@Override
	public String getText(Object element) {
		return ((State) element).getState();
	}

};
ComboViewer states = new ComboViewer(content, SWT.H_SCROLL);
states.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
toolkit.adapt(states.getControl(), false, false);
states.setLabelProvider(labelProvider);
states.setContentProvider(new ArrayContentProvider());
states.setInput(getStates());

What am I doing wrong?

[Updated on: Thu, 10 March 2011 15:45]

Report message to a moderator

Re: Showing the horizontal scroll bar of a Combo [message #659191 is a reply to message #658974] Fri, 11 March 2011 12:45 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Nobody?
Previous Topic:Focus listener - inconsistent behavior
Next Topic:Update TrayIcon Tooltip on Windows
Goto Forum:
  


Current Time: Wed Apr 08 09:21:15 GMT 2020

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

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

Back to the top