Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ExpandItem header height?
ExpandItem header height? [message #557519] Tue, 07 September 2010 23:05 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 16
Registered: May 2010
Junior Member
Hi all,
I'm sure this is quite the newbie question, but is there an easy way to change an ExpandItem's header height? I see that there is a getHeaderHeight() method, but no setter. Can the height be adjusted somehow by using layouts?

Re: ExpandItem header height? [message #557832 is a reply to message #557519] Thu, 09 September 2010 07:01 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 275
Registered: July 2009
Location: India
Senior Member

The height of the ExpandItem's header is automatically computed and adjusted based on the font size, image size and chevron size, so that the text and image are properly displayed. So, you don't need to set the size of the header. Why do you want to change the header size?

Lakshmi P Shanmugam
Re: ExpandItem header height? [message #1061093 is a reply to message #557832] Wed, 29 May 2013 21:08 Go to previous message
Anatoliy Pogorelov is currently offline Anatoliy PogorelovFriend
Messages: 10
Registered: April 2013
Junior Member
Hi, when I'm change the size of the font or set image, heigth in header computed. But expandbar control does not fall (see pictures).
My code is:

FormToolkit toolkit = new FormToolkit(parent.getDisplay());
ScrolledForm form = toolkit.createScrolledForm(parent);
form.setText("Реестр оказанных услуг");

final Composite container = form.getBody();
container.setLayout(new FormLayout());

final ExpandBar expBarFilters = new ExpandBar(container, SWT.V_SCROLL);
final FormData fdExpBarFilters = new FormData(); = new FormAttachment(0, 0);
fdExpBarFilters.left = new FormAttachment(0, 10);
fdExpBarFilters.right = new FormAttachment(100, -10);

Composite expBarComposite = new Composite (expBarFilters, SWT.NONE);
final FormData fdExpBarComposite = new FormData(); = new FormAttachment(0, 0);
fdExpBarComposite.left = new FormAttachment(0, 0);
fdExpBarComposite.right = new FormAttachment(100, 0);
expBarComposite.setLayout(new FormLayout());

ExpandItem expItemFilters = new ExpandItem(expBarFilters, SWT.NONE, 0);

expBarFilters.addExpandListener(new ExpandListener() {
private static final long serialVersionUID = -7185326081415952521L;

public void itemExpanded(ExpandEvent arg0) {

public void itemCollapsed(ExpandEvent arg0) {

Label lblProfile = BaseWidgets.createLabel(expBarComposite, "Profile", SWT.NONE, null, 12, null, 10);
expItemFilters.setHeight(expBarComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 10);

Please, Help.
  • Attachment: pict.jpg
    (Size: 34.79KB, Downloaded 150 times)
Previous Topic:How to detect that code is running in Development environment or in generic Eclipse using Plugins?
Next Topic:[GTK-Linux] All context disappeared when open embedded view
Goto Forum:

Current Time: Thu Jul 19 04:00:06 GMT 2018

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

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

Back to the top