View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  package pl.edu.agh.cast.ui.wizards;
12  
13  import org.eclipse.jface.wizard.WizardPage;
14  import org.eclipse.swt.SWT;
15  import org.eclipse.swt.layout.GridData;
16  import org.eclipse.swt.layout.GridLayout;
17  import org.eclipse.swt.widgets.Button;
18  import org.eclipse.swt.widgets.Composite;
19  import org.eclipse.swt.widgets.Label;
20  import org.eclipse.swt.widgets.Text;
21  
22  import pl.edu.agh.cast.util.Messages;
23  
24  /**
25   * @author
26   */
27  
28  public class SelectRootNumbersWizardPage extends WizardPage {
29  
30  	private Text _nodesNumber;
31  
32  	private Text _connectionsNumber;
33  
34  	private Button minButton;
35  
36  	private Button sumButton;
37  
38  	public SelectRootNumbersWizardPage(String pageName) {
39  		super(pageName);
40  		setTitle(pageName);
41  		setDescription(Messages.SelectRootNumbersWizardPage_0);
42  	}
43  
44  	public void createControl(Composite parent) {
45  		Composite container = new Composite(parent, SWT.NULL);
46  		GridLayout layout = new GridLayout(2, false);
47  		container.setLayout(layout);
48  
49  		Label label = new Label(container, SWT.NULL);
50  		label.setText(Messages.SelectRootNumbersWizardPage_1);
51  
52  		_nodesNumber = new Text(container, SWT.BORDER);
53  		_nodesNumber.setEditable(true);
54  		GridData gd = new GridData();
55  
56  		gd.grabExcessHorizontalSpace = true;
57  		gd.horizontalAlignment = SWT.FILL;
58  		gd.minimumWidth = 100;
59  		_nodesNumber.setLayoutData(gd);
60  		_nodesNumber.setText("2"); //$NON-NLS-1$
61  
62  		Label label2 = new Label(container, SWT.NULL);
63  		label2.setText(Messages.SelectRootNumbersWizardPage_3);
64  
65  		_connectionsNumber = new Text(container, SWT.BORDER);
66  		_connectionsNumber.setEditable(true);
67  		GridData gd2 = new GridData();
68  
69  		gd2.grabExcessHorizontalSpace = true;
70  		gd2.horizontalAlignment = SWT.FILL;
71  		gd2.minimumWidth = 100;
72  		_connectionsNumber.setLayoutData(gd2);
73  		_connectionsNumber.setText("2"); //$NON-NLS-1$
74  
75  		Label label7 = new Label(container, SWT.NULL);
76  		label7.setText(" "); //$NON-NLS-1$
77  
78  		Label label8 = new Label(container, SWT.NULL);
79  		label8.setText(" "); //$NON-NLS-1$
80  
81  		Label label9 = new Label(container, SWT.NULL);
82  		label9.setText(" "); //$NON-NLS-1$
83  
84  		Label label10 = new Label(container, SWT.NULL);
85  		label10.setText(" "); //$NON-NLS-1$
86  
87  		Label label3 = new Label(container, SWT.NULL);
88  		label3.setText(Messages.SelectRootNumbersWizardPage_4);
89  
90  		Label label4 = new Label(container, SWT.NULL);
91  		label4.setText(" "); //$NON-NLS-1$
92  
93  		minButton = new Button(container, SWT.RADIO);
94  		minButton.setText(Messages.SelectRootNumbersWizardPage_5);
95  
96  		Label label5 = new Label(container, SWT.NULL);
97  		label5.setText(" "); //$NON-NLS-1$
98  
99  		sumButton = new Button(container, SWT.RADIO);
100 		sumButton.setText(Messages.SelectRootNumbersWizardPage_6);
101 
102 		setControl(container);
103 	}
104 
105 	public String getNodesNumber() {
106 		return _nodesNumber.getText();
107 	}
108 
109 	public String getConnectionsNumber() {
110 		return _connectionsNumber.getText();
111 	}
112 
113 	public Boolean isEachModeSelected() {
114 		return minButton.getSelection();
115 	}
116 }