Probleme avec TextEditor et layout SWT
Bonjour,
j'essai d'implementer le code de la méthode createPartControl d'une class qui etend AbsrtactTextEditor.
Au départ qd on clickai sur open dans le menu contextuel lié a un fichier, alors le textEditor s'ouvrai dans un onglet sans pb.
Maintenant je dois implementer du code pour afficher un bandereau au dessus du textEditor, afin de pouvoir placer des bouton permettant un certain nombre d'action.
Or le probleme est que le textEditor ne se colle pas bien et j'ai tout essayer au nivo des layout pour resoudre le pb
voici le code de la methode
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
| @Override
public void createPartControl(Composite parent) {
// create main layout
GridLayout gl = new GridLayout(1, false);
gl.marginHeight = 0;
gl.marginWidth = 0;
gl.horizontalSpacing = 0;
parent.setLayout(gl);
// instantiate form toolkit
toolkit = new FormToolkit(parent.getDisplay());
form = toolkit.createForm(parent);
GridData gd = new GridData(GridData.FILL_BOTH);
form.getBody().setLayoutData(gd);//
gl = new GridLayout(1, false);
gl.marginHeight = 0;
gl.marginWidth = 0;
gl.horizontalSpacing = 0;
form.getBody().setLayout(gl);
super.createPartControl(form.getBody());
StyledText st = (StyledText) super.getAdapter(Control.class);
st.setLayoutData(new GridData(GridData.FILL_BOTH));
// GridLayout gg = new GridLayout();
// gg.marginWidth = 0;
// gg.marginHeight = 0;
// gg.verticalSpacing = 0;
// st.setLayout(gg);
toolkit.decorateFormHeading(form);
createFormToolBarManager(form);
}
/**
* @param form2
*/
private void createFormToolBarManager(Form form2) {
IToolBarManager toolBarManager = form.getToolBarManager();
// TODO
// toolBarManager.add(new HidePerturbationAction(graph));
ExportPrelogAction action = new ExportPrelogAction();
action.setChecked(true);
toolBarManager.add(action);
// toolBarManager.add(new ShowLegendAction(graph));
// toolBarManager.add(new ChangeScaleAction(graph.getYAxis()));
toolBarManager.update(true);
} |
ainsi que si joint l'affichage que j'obtient...
Merci d'avance