Add SWT section on button press event [message #1551264] |
Wed, 07 January 2015 14:14 |
Amruta Sardeshmukh Messages: 25 Registered: September 2014 |
Junior Member |
|
|
I need to add a section with Text area on the composite.This I need to do on push button press.
addPostButton.addSelectionListener(new SelectionListener(){
@Override
public void widgetSelected(SelectionEvent e) {
postSection = new PostSection(parent);
}
PostSection.java
public void renderUI(Composite parent, String title) {
int style = 0x2102;
m_section = createSection(parent, style);
m_section.setText(getSession().getUserName());
m_section.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
secComposite = createComposite(m_section, SWT.NONE);
GridLayout localGridLayout = new GridLayout(1, false);
secComposite.setLayout(localGridLayout);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
secComposite.setLayoutData(data);
m_section.setClient(secComposite);
final Composite postPanel = new Composite(this.getSecComposite(),SWT.NONE);
FillLayout locGridLayout = new FillLayout(SWT.VERTICAL);
//localGridLayout.marginHeight = 0;
//localGridLayout.marginWidth = 0;
postPanel.setLayout(locGridLayout);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true,true);
gridData.heightHint = 50;
postPanel.setLayoutData(gridData);
localGridLayout.makeColumnsEqualWidth = false;
//postPanel.setSize(200,300);
StyledText widget = new StyledText(postPanel, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
}
This is not adding the composite on the button press.
|
|
|
Powered by
FUDForum. Page generated in 0.03060 seconds