1 package net.sf.panoptes.view.wizard;
2
3 import net.sf.panoptes.controller.MBeanConnectionController;
4 import net.sf.panoptes.model.component.jmx.MBeanServerComponent;
5
6 import org.eclipse.jface.viewers.IStructuredSelection;
7 import org.eclipse.jface.wizard.Wizard;
8 import org.eclipse.ui.INewWizard;
9 import org.eclipse.ui.IWorkbench;
10
11 /***
12 * Wizard class
13 */
14 public class NewNodeWizard extends Wizard implements INewWizard {
15
16 private MBeanConnectionController controller;
17
18 NodeConnectionPage nodeConnectionPage;
19 MBeanServerComponent connection = null;
20 boolean connectImmediately = false;
21
22 protected IStructuredSelection selection;
23
24 protected IWorkbench workbench;
25
26 public NewNodeWizard(MBeanConnectionController controller) {
27 super();
28 this.controller = controller;
29 setNeedsProgressMonitor(true);
30
31 }
32
33 public void addPages() {
34 nodeConnectionPage = new NodeConnectionPage(null, null);
35 addPage(nodeConnectionPage);
36
37 }
38
39 public boolean canFinish() {
40 if (this.getContainer().getCurrentPage() == nodeConnectionPage
41 && this.getContainer().getCurrentPage().isPageComplete())
42 return true;
43 else
44 return false;
45 }
46
47 /***
48 * @see org.eclipse.jface.wizard.IWizard#performFinish()
49 */
50 public boolean performFinish() {
51 controller.addMBeanServerConnection(
52 nodeConnectionPage.getHostName(),
53 nodeConnectionPage.getHostUrl(),
54 nodeConnectionPage.getRmiPort(),
55 nodeConnectionPage.connectImmediately());
56 return true;
57 }
58
59 public MBeanServerComponent getConnection() {
60 return connection;
61 }
62
63 public boolean connectImmediately() {
64 return connectImmediately;
65 }
66
67 /***
68 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
69 */
70 public void init(IWorkbench workbench, IStructuredSelection selection) {
71 }
72
73 }
This page was automatically generated by Maven