CTabFolder doesnt work well when exposed

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

CTabFolder doesnt work well when exposed

Postby hyshyshys » Wed Aug 13, 2008 10:43 am

Hi,

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?)
CTabFolder.jpg
CTabFolder.jpg (13.45 KiB) Viewed 1088 times

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
   }

}
hyshyshys
 
Posts: 37
Joined: Thu Jul 03, 2008 12:27 pm

Re: CTabFolder doesnt work well when exposed

Postby Eric Clayberg » Thu Aug 14, 2008 4:43 pm

Try this using the latest SWT Designer build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: CTabFolder doesnt work well when exposed

Postby hyshyshys » Fri Aug 15, 2008 2:32 am

Hi Eric,

Yes it works with the latest stable build (2008.08.15), but not with the current release.

Thanks,

Vincent
hyshyshys
 
Posts: 37
Joined: Thu Jul 03, 2008 12:27 pm

Re: CTabFolder doesnt work well when exposed

Postby Eric Clayberg » Fri Aug 15, 2008 3:27 am

hyshyshys wrote:Yes it works with the latest stable build (2008.08.15), but not with the current release.

That is why I suggested using the latest build. ;-)
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests