Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: da0a889bd0e281492299e57c4597b9475cb9b1c2 (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
/*******************************************************************************
 * 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.tcf.internal.debug.ui.launch.setup;

import java.util.Map;

import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tcf.internal.debug.ui.ImageCache;

public class SetupWizardDialog extends Wizard {

    private final Map<String,String> peer_attrs;

    public SetupWizardDialog(Map<String,String> peer_attrs) {
        this.peer_attrs = peer_attrs;
        setWindowTitle("TCF Debug Target Setup");
    }

    @Override
    public void addPages() {
        addPage(new WizardFirstPage(this));
        addPage(new WizardLoginPage(this));
        addPage(new WizardLogPage(this));
        addPage(new WizardLocalPage(this));
        addPage(new WizardPropsPage(this, peer_attrs));
    }

    @Override
    public Image getDefaultPageImage() {
        return ImageCache.getImage(ImageCache.IMG_TARGET_WIZARD);
    }

    @Override
    public boolean canFinish() {
        IWizardPage page = getContainer().getCurrentPage();
        if (page instanceof WizardLogPage) return ((WizardLogPage)page).canFinish();
        if (page instanceof WizardPropsPage) return ((WizardPropsPage)page).canFinish();
        return false;
    }

    @Override
    public boolean performFinish() {
        if (!canFinish()) return false;
        IWizardPage page = getContainer().getCurrentPage();
        if (page instanceof WizardPropsPage) {
            if (!((WizardPropsPage)page).performFinish()) return false;;
        }
        return true;
    }
}

Back to the top