Comment gérer l'action "Ok" dans un JFace dialog
Salut !!
Dans une partie de mon plugin j'ai besoin d'ouvrir un dialogue , pour le moment ma classe contient seulement ces méthodes
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
| public class ma classe extends Dialog {
/**
* Create the dialog.
* @param parentShell
*/
public ma classe (Shell parentShell) {
super(parentShell);
setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL);
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
}
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
return container;
}
/**
* Create contents of the button bar.
* @param parent
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
createButton(parent, IDialogConstants.CANCEL_ID,
IDialogConstants.CANCEL_LABEL, false);
}
/**
* Return the initial size of the dialog.
*/
@Override
protected Point getInitialSize() {
return new Point(430, 400);
}
} |
mon problème c'est que je ne sais pas comment gérer l'action d'appui sur les deux boutons ok et cancel
j'ai trouvé une méthode dans la documentation
Code:
protected void buttonPressed(int buttonId)
mais sinon je ne sais vraiment pas comment faire pour exécuter le code du bouton ok et où le mettre :oops:
merci pour votre aide