1 package oic.simulator.serviceprovider.view.dialogs;
3 import oic.simulator.serviceprovider.utils.Constants;
5 import org.eclipse.jface.wizard.IWizardPage;
6 import org.eclipse.jface.wizard.WizardPage;
7 import org.eclipse.swt.SWT;
8 import org.eclipse.swt.events.SelectionAdapter;
9 import org.eclipse.swt.events.SelectionEvent;
10 import org.eclipse.swt.layout.GridData;
11 import org.eclipse.swt.layout.GridLayout;
12 import org.eclipse.swt.widgets.Button;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Label;
15 import org.eclipse.swt.widgets.Text;
17 public class StartStopResourcePage extends WizardPage {
19 private Button startButton;
21 private boolean start;
23 protected StartStopResourcePage() {
24 super("Start/Stop Resource");
29 public void createControl(Composite parent) {
30 setPageComplete(false);
31 setTitle(Constants.START_STOP_PAGE_TITLE);
32 setMessage(Constants.START_STOP_PAGE_MESSAGE);
33 Composite compContent = new Composite(parent, SWT.NONE);
34 GridLayout gridLayout = new GridLayout();
35 compContent.setLayout(gridLayout);
36 GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
37 compContent.setLayoutData(gd);
39 startButton = new Button(compContent, SWT.CHECK);
40 startButton.setText("Start Resource(s)");
41 startButton.setSelection(true);
43 gd.verticalIndent = 10;
44 startButton.setLayoutData(gd);
46 Label descLbl = new Label(compContent, SWT.NONE);
47 descLbl.setText("Description:");
49 gd.verticalIndent = 50;
50 descLbl.setLayoutData(gd);
52 final Text text = new Text(compContent, SWT.MULTI | SWT.READ_ONLY
53 | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
54 text.setText("Starting the resource will register it with the platform and makes it visible on the network.\n"
55 + "Resources can be started or stopped later from 'Resource Manager' view.");
57 gd.horizontalAlignment = SWT.FILL;
58 gd.grabExcessHorizontalSpace = true;
60 gd.verticalAlignment = SWT.BOTTOM;
61 text.setLayoutData(gd);
65 setControl(compContent);
68 private void addUIListeners() {
69 startButton.addSelectionListener(new SelectionAdapter() {
71 public void widgetSelected(SelectionEvent e) {
72 setStart(startButton.getSelection());
77 public boolean isStart() {
81 public void setStart(boolean start) {
86 public IWizardPage getNextPage() {
87 System.out.println(this.getClass().getName() + ": getNextPage");