Je développe (ou essaye) une application RCP, et j'essaie de donner une action à un bouton qui permette de lancer une connexion à la base à partir d'un username et un password passés à l'aide de 2 composants Text.
Par la suite j'essaie de donner une action à mon bouton Submit:
Quand on clique sur le bouton, il doit faire appel à l'action d'identification, qui va connecter l'utilisateur à la base, mais j'ai une erreur sur la ligne:Code:
1
2
3
4
5
6
7 btnSubmit.addSelectionListener(new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { Identification(txtUsername.getText(),txtPassword.getText()); MessageDialog.openInformation(getSite().getShell(),"Connexion","Censé ouvrir une connexion"); } });
Code:Identification(txtUsername.getText(),txtPassword.getText());
Pourtant j'ai bien dans ma class Identification:Citation:
The method Identification(String, String) is undefined for the type new SelectionAdapter(){}
Donc je comprends pas le problème...Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public class Identification extends Action{ String username; String password; IWorkbenchWindow window; Identification(String username,String password) { this.username = username; this.password = password; } public boolean authentication(String username,String password) { ... return true; } public void run() { if (authentication(username,password) == false) return ; } }
J'espère avoir été assez compréhensible pour que vous puissiez m'aider :oops:.