Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Add SWT section on button press event(Adding section to composite on button press event)
Add SWT section on button press event [message #1551264] Wed, 07 January 2015 14:14
Amruta Sardeshmukh is currently offline Amruta SardeshmukhFriend
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.
Previous Topic:Simple example to bind combo to enum
Next Topic:Advanced graphics info on SWT FAQ is outdated
Goto Forum:
  


Current Time: Thu Apr 25 01:15:52 GMT 2024

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

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

Back to the top