Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scrolled ListViewer (New User)
Scrolled ListViewer (New User) [message #460504] Tue, 30 August 2005 12:54
Eclipse UserFriend
Originally posted by: mbletzin.ncsa.uiuc.edu

Hi,
I'm trying to implement the behavior of the Swing function
JList.setVisibleRowCount() using ListViewer. My problem is that
ListViewer seems to size itself to display the entire input list
rather than displaying only a few rows with a vertical scroll bar. I
have tried several different approaches but have not had any luck. I
have pasted my latest below. The variable "profiles" is a List of 20
objects which are handled by the TagLabelProvider class. Thanks in
advance for any suggestions.

Michael


{
ScrolledComposite scroll = new
ScrolledComposite(
profileStuff,
SWT.V_SCROLL | SWT.BORDER);
scroll.setLayout(new FillLayout());
// scroll.setExpandHorizontal(true);
// scroll.setExpandVertical(true);
scroll.setMinSize(new Point(200,40));
profileListViewer = new ListViewer(
scroll, SWT.SINGLE);
profileListViewer.setLabelProvider(new
TagLabelProvider());

profileListViewer.setContentProvider(new ArrayContentProvider());
//
profileListViewer.getControl().setSize(200,40);
// scroll.setSize(200,60);
//
scroll.setContent(profileListViewer.getControl());
log.debug("Size " +
profileListViewer.getControl().getBounds());
// profileListViewer.setInput(profiles);
}
Previous Topic:About using SWT&JFace in Applet?
Next Topic:Scrolled ListViewer problems (New User)
Goto Forum:
  


Current Time: Mon Apr 19 23:00:01 GMT 2021

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

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

Back to the top