KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > actions > ejb > AddEjbMethodActionDelegate


1 /*
2  * Created on 14 févr. 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package com.bull.eclipse.jonas.actions.ejb;
8
9
10 import org.eclipse.jdt.core.ICompilationUnit;
11 import org.eclipse.jdt.internal.ui.JavaPlugin;
12 import org.eclipse.jface.wizard.WizardDialog;
13
14 import com.bull.eclipse.jonas.actions.JonasFileAbstractActionDelegate;
15 import com.bull.eclipse.jonas.wizard.AddEjbMethodWizard;
16
17 // Referenced classes of package com.objectlearn.jdt.j2ee.ui.actions:
18
// J2EEAction
19

20 public class AddEjbMethodActionDelegate extends JonasFileAbstractActionDelegate
21 {
22
23     public AddEjbMethodActionDelegate()
24     {
25     }
26
27     protected boolean isEnabled()
28         throws Exception JavaDoc
29     {
30         int i = 0;
31         
32         i = 5;
33         return true;
34     }
35
36     public boolean doActionOn(ICompilationUnit unit) throws Exception JavaDoc {
37         //ICompilationUnit je = (ICompilationUnit)JavaCore.create(file);
38
if(unit == null)
39             return false;
40         org.eclipse.jdt.core.IType ejb = unit.getAllTypes()[0];
41         AddEjbMethodWizard wizard = new AddEjbMethodWizard();
42         wizard.init(JavaPlugin.getDefault().getWorkbench(), ejb);
43         WizardDialog dialog = new WizardDialog(JavaPlugin.getActiveWorkbenchShell(), wizard);
44         dialog.open();
45
46         return false;
47     }
48
49
50 }
51
Popular Tags