Skip to main content



      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 10:30 Go to next message
Eclipse UserFriend
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 10:45] by Moderator

Re: Showing the horizontal scroll bar of a Combo [message #659191 is a reply to message #658974] Fri, 11 March 2011 07:45 Go to previous message
Eclipse UserFriend
Nobody?
Previous Topic:Focus listener - inconsistent behavior
Next Topic:Update TrayIcon Tooltip on Windows
Goto Forum:
  


Current Time: Sun Jul 13 07:08:08 EDT 2025

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

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

Back to the top