956
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 the License "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 |
package com.nokia.cdt.internal.debug.launch.newwizard;
|
|
19 |
|
|
20 |
import org.eclipse.core.runtime.Status;
|
|
21 |
import org.eclipse.swt.widgets.Composite;
|
|
22 |
import org.eclipse.swt.widgets.Shell;
|
|
23 |
|
2163
|
24 |
import com.nokia.cdt.internal.debug.launch.newwizard.IOtherSettingsWizardData.EBuildBeforeLaunchOption;
|
956
|
25 |
|
|
26 |
/**
|
|
27 |
* Present the "Build before debug" section with a short description.
|
|
28 |
*/
|
|
29 |
public class OtherSettingsSection extends AbstractLaunchWizardSection {
|
|
30 |
|
2163
|
31 |
private IOtherSettingsWizardData otherSettingsWizardData;
|
|
32 |
|
956
|
33 |
/**
|
|
34 |
*
|
|
35 |
*/
|
2163
|
36 |
public OtherSettingsSection(IWizardData data, AbstractUnifiedLaunchOptionsPage launchOptionsPage) {
|
969
|
37 |
super(data, Messages.getString("OtherSettingsSection.Title"), launchOptionsPage); //$NON-NLS-1$
|
2163
|
38 |
otherSettingsWizardData = (IOtherSettingsWizardData) data;
|
956
|
39 |
}
|
|
40 |
|
|
41 |
/* (non-Javadoc)
|
|
42 |
* @see com.nokia.cdt.internal.debug.launch.wizard2.IWizardSection#createComposite(org.eclipse.swt.widgets.Composite)
|
|
43 |
*/
|
|
44 |
public void createControl(Composite parent) {
|
|
45 |
createSection(parent, 2);
|
|
46 |
}
|
|
47 |
|
|
48 |
/* (non-Javadoc)
|
|
49 |
* @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#dispose()
|
|
50 |
*/
|
|
51 |
@Override
|
|
52 |
protected void dispose() {
|
|
53 |
}
|
|
54 |
|
|
55 |
public void initializeSettings() {
|
2163
|
56 |
otherSettingsWizardData.setBuildBeforeLaunchOption(EBuildBeforeLaunchOption.USE_WORKSPACE_SETTING);
|
956
|
57 |
}
|
|
58 |
|
|
59 |
/* (non-Javadoc)
|
|
60 |
* @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#validate()
|
|
61 |
*/
|
|
62 |
@Override
|
|
63 |
protected void validate() {
|
|
64 |
status = Status.OK_STATUS;
|
|
65 |
}
|
|
66 |
|
|
67 |
/* (non-Javadoc)
|
|
68 |
* @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#updateUI()
|
|
69 |
*/
|
|
70 |
@Override
|
|
71 |
protected void updateUI() {
|
|
72 |
String msg;
|
|
73 |
|
969
|
74 |
String ifWorkspace = ""; //$NON-NLS-1$
|
2163
|
75 |
if (otherSettingsWizardData.getBuildBeforeLaunch() == EBuildBeforeLaunchOption.USE_WORKSPACE_SETTING)
|
969
|
76 |
ifWorkspace = Messages.getString("OtherSettingsSection.WorkspaceLabel"); //$NON-NLS-1$
|
956
|
77 |
|
2163
|
78 |
if (otherSettingsWizardData.isCurrentBuildBeforeLaunch())
|
969
|
79 |
msg = Messages.getString("OtherSettingsSection.BuildBeforeLabel"); //$NON-NLS-1$
|
956
|
80 |
else
|
969
|
81 |
msg = Messages.getString("OtherSettingsSection.NoBuildBeforeLabel"); //$NON-NLS-1$
|
956
|
82 |
|
969
|
83 |
descriptionLabel.setText(msg + ifWorkspace + "."); //$NON-NLS-1$
|
956
|
84 |
}
|
|
85 |
|
|
86 |
/* (non-Javadoc)
|
|
87 |
* @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#createChangeSettingsDialog(org.eclipse.swt.widgets.Shell, com.nokia.cdt.internal.debug.launch.wizard2.LaunchOptionsData)
|
|
88 |
*/
|
|
89 |
@Override
|
|
90 |
protected AbstractLaunchSettingsDialog createChangeSettingsDialog(
|
2163
|
91 |
Shell shell, IWizardData dialogData) {
|
956
|
92 |
return new OtherSettingsDialog(shell, dialogData);
|
|
93 |
}
|
|
94 |
|
|
95 |
protected void refresh() {
|
|
96 |
validate();
|
|
97 |
updateUI();
|
|
98 |
}
|
|
99 |
}
|