|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.s60tools.appdep.ui.wizards; |
|
20 |
|
21 import org.eclipse.jface.wizard.IWizardPage; |
|
22 import org.eclipse.jface.wizard.WizardDialog; |
|
23 import org.eclipse.swt.widgets.Shell; |
|
24 |
|
25 /** |
|
26 * Wizard dialog for extension specific wizards. |
|
27 */ |
|
28 public class AppDepWizardDialog extends WizardDialog { |
|
29 |
|
30 /** |
|
31 * Used AppDep Wizard. |
|
32 */ |
|
33 private ISelectSDKWizard wizard = null; |
|
34 |
|
35 /** |
|
36 * Creates a new wizard dialog for the given wizard. |
|
37 * Just calls the super constructor. |
|
38 * @param parentShell the parent shell |
|
39 * @param newWizard The AppDep wizard this dialog is working on. |
|
40 */ |
|
41 public AppDepWizardDialog(Shell parentShell, ISelectSDKWizard newWizard){ |
|
42 super(parentShell, newWizard); |
|
43 this.wizard = newWizard; |
|
44 } |
|
45 |
|
46 /* (non-Javadoc) |
|
47 * @see org.eclipse.jface.wizard.WizardDialog#finishPressed() |
|
48 */ |
|
49 protected void finishPressed() { |
|
50 int exitStatus = wizard.getExitStatus(); |
|
51 super.finishPressed(); |
|
52 setReturnCode(exitStatus); |
|
53 } |
|
54 |
|
55 /* (non-Javadoc) |
|
56 * @see org.eclipse.jface.dialogs.Dialog#cancelPressed() |
|
57 */ |
|
58 protected void cancelPressed() { |
|
59 super.cancelPressed(); |
|
60 setReturnCode(ISelectSDKWizard.CANCEL); |
|
61 } |
|
62 |
|
63 /* (non-Javadoc) |
|
64 * @see org.eclipse.jface.wizard.WizardDialog#backPressed() |
|
65 */ |
|
66 @Override |
|
67 protected void backPressed() { |
|
68 // Getting current wizard page |
|
69 IWizardPage currentPage = getCurrentPage(); |
|
70 if(currentPage instanceof SelectComponentWizardPage){ |
|
71 SelectComponentWizardPage scwp = (SelectComponentWizardPage)currentPage; |
|
72 scwp.setShowDuplicateComponentInfo(true); |
|
73 } |
|
74 super.backPressed(); |
|
75 } |
|
76 |
|
77 /* (non-Javadoc) |
|
78 * @see org.eclipse.jface.wizard.WizardDialog#nextPressed() |
|
79 */ |
|
80 @Override |
|
81 protected void nextPressed() { |
|
82 // Getting current wizard page |
|
83 IWizardPage currentPage = getCurrentPage(); |
|
84 |
|
85 // Refreshing data on next page |
|
86 IRefreshable nextPage = (IRefreshable) wizard.getNextPage(currentPage); |
|
87 nextPage.refresh(); |
|
88 |
|
89 super.nextPressed(); |
|
90 } |
|
91 |
|
92 } |