[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: TabItem and Table

hi.
I've the same case and i do this, it seem to work

  TabFolder tFolder = new TabFolder(composite, SWT.NONE);
  tFolder.setLayout(new FillLayout(SWT.HORIZONTAL));
  tFolder.setLayoutData(
   new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL |
GridData.GRAB_VERTICAL));
  TabItem iFolderLogItem = new TabItem(tFolder, SWT.NONE);
  iFolderLogItem.setText("Log");
  TabItem  iFolderErrItem = new TabItem(tFolder, SWT.NONE);
  iFolderErrItem.setText("Erreur");

// -- Maybe that you can also create your Table directly on the tFolder --
Composite panelLog = tFolder;

  // -- Table des erreurs --
  tTableErr =
   new Table(panelLog, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI
| SWT.FULL_SELECTION);
  tTableErr.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
GridData.FILL_VERTICAL));
  tTableErr.setHeaderVisible(false);
  tTableErr.addSelectionListener(this);
  tTableErr.setLayoutData(
   new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL |
GridData.GRAB_VERTICAL));
  // -- Table des logs --
  tTableMsg =
   new Table(panelLog, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI
| SWT.FULL_SELECTION);
  tTableMsg.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
GridData.FILL_VERTICAL));
  tTableMsg.setHeaderVisible(false);
  tTableMsg.addSelectionListener(this);
  tTableMsg.setLayoutData(
   new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL |
GridData.GRAB_VERTICAL));

// -- Here, i affect my Table control to my TabItem --
  iFolderLogItem.setControl(tTableMsg);
  iFolderErrItem.setControl(tTableErr);


Hope dis will be usefull
philippe


"laurent" <lolodeux00@xxxxxxxxxxx> a écrit dans le message de news:
800pcv8nqq0ieifh0eq0sileojbl6rlhvl@xxxxxxxxxx
> Hi
> This is a simple question for you I think.....
>
> I build a TabFolder and more TabItem.
> I can't add something on my TabItem.
>
> What is the method for add one Table on a TabItem ?
> I have the same problem for add a Combo in a TableItem.
> And no real solution...
>
> thanks ...
> laurent