Ajouter un TabFolder a posterio
Bonjour,
Je voudrais, dans mon plugin propertypage ajouter un tabfolder a posterio, mais je galère un peu avec ses histoires de contenants, contenus .. layout tout ça !
Voici mon code, qui consite à ajouter dans une propertypage 3 composites :
le 1er contenant un label et 2 radios boutons
le 2eme contenant une zone text, un bouton et un label
le 3eme contenant 3 tableaux
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
public void createPartControl(Composite parent) {
// fenetre principale
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
ScrolledForm form = toolkit.createScrolledForm(parent);
// layout principal
form.getBody().setLayout(new GridLayout());
// 1er layout contenant ...
Composite hd = toolkit.createComposite(form.getBody());
GridLayout gl = new GridLayout();
gl.numColumns = 3;
hd.setLayout(gl);
Label l = toolkit.createLabel(hd, Messages.getString("FormHexa.Label1"));
GridData gd = new GridData();
l.setLayoutData(gd);
Button buttonV3 = toolkit.createButton(hd, Messages.getString("FormHexa.V3"), SWT.RADIO);
gd = new GridData();
buttonV3.setSelection(true);
buttonV3.setLayoutData(gd);
Button buttonV4 = toolkit.createButton(hd, Messages.getString("FormHexa.V4"), SWT.RADIO);
gd = new GridData();
buttonV4.setLayoutData(gd);
Composite hdHexa = toolkit.createComposite(form.getBody());
gl = new GridLayout();
gl.numColumns = 3;
gl.marginLeft = 100;
hdHexa.setLayout(gl);
final Label msgError;
tHexa = toolkit.createText(hdHexa, Messages.getString("FormHexa.ExValueReg1"),SWT.WRAP);
gd = new GridData();
tHexa.setLayoutData(gd);
final Button bValue = toolkit.createButton(hdHexa, Messages.getString("FormHexa.ValueField"), SWT.PUSH);
gd = new GridData();
bValue.setLayoutData(gd);
msgError = toolkit.createLabel(hdHexa, Messages.getString("FormHexa.Error1"));
msgError.setVisible(false);
msgError.setForeground(msgError.getDisplay().getSystemColor(SWT.COLOR_RED));
gd = new GridData();
msgError.setLayoutData(gd);
// 2eme layout
Composite hd1 = toolkit.createComposite(form.getBody());
gl = new GridLayout();
gl.numColumns = 3;
hd1.setLayout(gl);
// composite dns ma 1ere colonne
Composite hdCol1 = toolkit.createComposite(hd1);
tCol1 = new Table(hdCol1,SWT.NO_SCROLL|SWT.SINGLE);
hdCol1.setLayout(gl);
TableColumn tc;
tc = new TableColumn(tCol1, SWT.RIGHT);
tc.setWidth(115);
tc.setResizable(false);
tc.setText("CORE_CFG.PCACHE");
// composite dns ma 2eme colonne
Composite hdCol2 = toolkit.createComposite(hd1);
tCol2 = new Table(hdCol2,SWT.NO_SCROLL);
tCol2.setLinesVisible(true);
hdCol2.setLayout(gl);
tc = new TableColumn(tCol2, SWT.LEFT);
tc.setWidth(21);
tc.setResizable(false);
// composite dns ma 3eme colonne
Composite hdCol3 = toolkit.createComposite(hd1);
tCol3 = new Table(hdCol3,SWT.NO_SCROLL);
//tCol3.setLinesVisible(true);
hdCol3.setLayout(gl);
tc = new TableColumn(tCol3, SWT.CENTER);
tc.setWidth(250);
tc.setResizable(false);
setTable1(tCol1);
setTable2(tCol2);
setTable3(tCol3);
} |
Mais apres avoir ecrit tout ça, je me suis aperçu qu'il me fallait des onglets pour mettre d'autres choses qui prendraient trop de place si je mets tout sur la même page.
Du coup je voudrais mettre tout ça (les 3 composites) dans un TabFolder et prévoir 2 autres tabfolder pour mettre des tableaux à venir.
comment faire pour ajouter un tabfolder à tout ça ?
Merci d'avance toutes les pistes sont les bienvenues !
:D