Tabris-Experts,
currently I want to use CTabFolder to have the ability to close CTabItems. Is it correct that CTabFolder is not supported in Tabris until now?
Using following code ...
public class TabFolderExample extends Shell {
public TabFolderExample(Display display) {
super(display, SWT.NO_TRIM);
createContents();
}
private void createContents() {
setMaximized(true);
setLayout(new FillLayout(SWT.VERTICAL));
createTabFolder();
createCTabFolder();
}
private void createTabFolder() {
final TabFolder tabFolder = new TabFolder(this, SWT.NONE);
final TabItem tab0 = new TabItem(tabFolder, SWT.NONE);
tab0.setText("Tab0");
Text text0 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text0.setText("Content Tab0");
tab0.setControl(text0);
final TabItem tab1 = new TabItem(tabFolder, SWT.NONE);
tab1.setText("Tab1");
Text text1 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text1.setText("Content Tab1");
tab1.setControl(text1);
}
private void createCTabFolder() {
final CTabFolder tabFolder = new CTabFolder(this, SWT.NONE);
final CTabItem tab0 = new CTabItem(tabFolder, SWT.NONE);
tab0.setText("Tab0");
Text text0 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text0.setText("Content Tab0");
tab0.setControl(text0);
final CTabItem tab1 = new CTabItem(tabFolder, SWT.NONE);
tab1.setText("Tab1");
Text text1 = new Text(tabFolder, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
text1.setText("Content Tab1");
tab1.setControl(text1);
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
I get this result on the iPad. The CTabFolder in the bottom is empty.
What do you suggest to work around this at the moment? I was thinking about StackLayout and Labels?
Best regards.
On the Tabris client for iOS, CTabFolder and TabFolder are (currently) the same. The "extended functionalities" of CTabFolder are not really applicable to the iOS default Tab/TabFolder UI. So to close a Tab you might want to rethink your user workflow for now.
We will have a look at the CTabFolder again, and see if we might implement it like Tabs are implemented on Safari for iPad. But that will definitely be farther along the roadmap.