Hi, I have a tab in which I publish a list. I would like to be able to access and modify my list from the tab.
For example please see that code bellow :
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout(3, false);
container.setLayout(layout);
tabfolder = new CTabFolder(container, SWT.BORDER | SWT.MULTI);
CTabItem tab= new CTabItem(tabfolder, SWT.CLOSE);
tab.setControl( createTabContent( tabfolder ));
}
private Composite createTabContent( Composite parent ) {
Composite c = new Composite( parent, SWT.NONE );
c.setLayout( new GridLayout( 2, false ));
List list=new List(c, SWT.MULTI | SWT.V_SCROLL);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
list.setLayoutData(gd);
for (int i=0; i<3; i++) list.add ("Item " + i);
return c;
}
Is there a way to access and modify the list from the tab ?
for example :
List myList = (List) tab.function_to_access_list()
Thanks for your help