1- I have a composite with an CTabFolder on it. The CTabFolder is exposed and contains a few CTabItem on it.
2- I putted this composite on the container of my viewpart.
3- When I edit the viewpart in "design" mode, the CTabFolder looks like this and I can't switch from tab item (There is a message that say to add TabItem?)
4- When I quickly test the viewpart, I have a similar "look" problem problem but I am able to switch page.
5- However, when I run the view as a Eclipse application I don't have any problem.
Note that if I remove the following expose method of the composite, everything works well:
/*
public CTabFolder getTabFolder() {
return tabFolder;
}
*/
I can work anyway, but it changes the look of my panel in design and quick view mode and I can't change the page, so it's a little bit boring.
Is it a know problem?
How can I solve this issues?
Thanks.
Vincent
Here is the code of my composite and viewpart
- Code: Select all
// ********************** composite:
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
public class composite1 extends Composite {
private CTabFolder tabFolder;
/**
* Create the composite
* @param parent
* @param style
*/
public composite1(Composite parent, int style) {
super(parent, style);
setLayout(new FillLayout());
tabFolder = new CTabFolder(this, SWT.NONE);
final CTabItem t1TabItem = new CTabItem(tabFolder, SWT.NONE);
t1TabItem.setText("t1");
final Composite composite = new Composite(tabFolder, SWT.NONE);
t1TabItem.setControl(composite);
final CTabItem t2TabItem = new CTabItem(tabFolder, SWT.NONE);
t2TabItem.setText("t2");
final Composite composite_1 = new Composite(tabFolder, SWT.NONE);
t2TabItem.setControl(composite_1);
//
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
public CTabFolder getTabFolder() {
return tabFolder;
}
}
- Code: Select all
//************ viewpart:
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
public class Test1 extends ViewPart {
public static final String ID = "com.opalrt.rtlab.configuration.view.Test1"; //$NON-NLS-1$
/**
* Create contents of the view part
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout());
final composite1 composite1_ = new composite1(container, SWT.NONE);
//
createActions();
initializeToolBar();
initializeMenu();
}
/**
* Create the actions
*/
private void createActions() {
// Create the actions
}
/**
* Initialize the toolbar
*/
private void initializeToolBar() {
IToolBarManager toolbarManager = getViewSite().getActionBars()
.getToolBarManager();
}
/**
* Initialize the menu
*/
private void initializeMenu() {
IMenuManager menuManager = getViewSite().getActionBars()
.getMenuManager();
}
@Override
public void setFocus() {
// Set the focus
}
}