Priyank Thakkar
Priyank Thakkar

Reputation: 4852

Remove Description from SWT section

I have a class extending from SectionPart.

public class MyData extends SectionPart{

}

In in the initialize method I am creating a section.

public class MyData extends SectionPart{
    public void initialize(){
        Section section = this.getSection();
        section.setText("List Items");
        ....
    }
}

When I see in the UI under the section I can see there is no description provided but still cursor is blinking there. To remove that I added following code in my initialize method.

public class MyData extends SectionPart{
    public void initialize(){
        Section section = this.getSection();
        section.setText("List Items");
        section.getDescriptionControl.setLayout(new GridData());
        section.getDescriptionControl.setVisible(false);
        ((GridData)section.getDescriptionControl().getLayoutData()).exclude = true;
        section.getDescriptionControl().getParent().layout(true);
    }
}

Now the description control is invisible but I am not able to remove it from layout. Please help me.

Upvotes: 1

Views: 183

Answers (1)

Waqas Ilyas
Waqas Ilyas

Reputation: 3241

The description control will not be added if you do not use the Section#DESCRIPTION style flag when creating your section part. If you are seeing the description control then you must be setting this flag in the styles sent to the section's constructor

Upvotes: 4

Related Questions