Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c83842cb12ae5861daa58e9a3ae08b8503be8f78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*******************************************************************************
 * Copyright (c) 2009, 2010 Wind River Systems, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tm.internal.tcf.debug.ui.launch.setup;

import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class WizardFirstPage extends WizardPage implements Listener {

    private final SetupWizardDialog wizard;

    private Button button_props;
    private Button button_local;
    private Button button_login;

    WizardFirstPage(SetupWizardDialog wizard) {
        super("FirstPage");
        this.wizard = wizard;
        setTitle("Select a task");
        setDescription("Select an option that describes the task you want the wizard to perform");
    }

    public void createControl(Composite parent) {
        Composite composite =  new Composite(parent, SWT.NULL);
        GridLayout gl = new GridLayout();
        gl.numColumns = 1;
        composite.setLayout(gl);

        button_props = new Button(composite, SWT.RADIO | SWT.WRAP | SWT.MULTI);
        button_props.addListener(SWT.Selection, this);
        button_props.setText("Manual setup of TCF connection properties.");

        button_local = new Button(composite, SWT.RADIO | SWT.WRAP | SWT.MULTI);
        button_local.addListener(SWT.Selection, this);
        button_local.setText("Setup TCF agent on local host.");

        button_login = new Button(composite, SWT.RADIO | SWT.WRAP | SWT.MULTI);
        button_login.addListener(SWT.Selection, this);
        button_login.setText("Setup TCF agent on remote host over Telnet or SSH.");

        setControl(composite);
    }

    public void handleEvent(Event event) {
        getContainer().updateButtons();
    }

    @Override
    public IWizardPage getNextPage() {
        if (button_props.getSelection()) return wizard.getPage("PropsPage");
        if (button_local.getSelection()) return wizard.getPage("LocalPage");
        if (button_login.getSelection()) return wizard.getPage("LoginPage");
        return null;
    }
}

Back to the top