46 * |
46 * |
47 */ |
47 */ |
48 public abstract class AbstractLaunchWizardSection implements IWizardSection { |
48 public abstract class AbstractLaunchWizardSection implements IWizardSection { |
49 |
49 |
50 private static final String CHANGE_LABEL = Messages.getString("AbstractLaunchWizardSection.ChangeLabel"); //$NON-NLS-1$ |
50 private static final String CHANGE_LABEL = Messages.getString("AbstractLaunchWizardSection.ChangeLabel"); //$NON-NLS-1$ |
51 protected final LaunchWizardData data; |
51 protected final IWizardData data; |
52 private String sectionName; |
52 private String sectionName; |
53 |
53 |
54 protected IStatus status; |
54 protected IStatus status; |
55 protected Label descriptionLabel; |
55 protected Label descriptionLabel; |
56 protected Button changeButton; |
56 protected Button changeButton; |
57 protected Composite control; |
57 protected Composite control; |
58 private ISectionChangeListener changeListener; |
58 private ISectionChangeListener changeListener; |
59 protected final AbstractUnifiedLaunchOptionsPage launchOptionsPage; |
59 protected final AbstractUnifiedLaunchOptionsPage launchOptionsPage; |
60 |
60 |
61 |
61 |
62 public AbstractLaunchWizardSection(LaunchWizardData data, String sectionName, AbstractUnifiedLaunchOptionsPage launchOptionsPage) { |
62 public AbstractLaunchWizardSection(IWizardData data, String sectionName, AbstractUnifiedLaunchOptionsPage launchOptionsPage) { |
63 this.data = data; |
63 this.data = data; |
64 this.sectionName = sectionName; |
64 this.sectionName = sectionName; |
65 this.launchOptionsPage = launchOptionsPage; |
65 this.launchOptionsPage = launchOptionsPage; |
66 status = Status.OK_STATUS; |
66 status = Status.OK_STATUS; |
67 } |
67 } |
83 |
83 |
84 /** Create the UI for this section. */ |
84 /** Create the UI for this section. */ |
85 public abstract void createControl(Composite parent); |
85 public abstract void createControl(Composite parent); |
86 |
86 |
87 /** Create the dialog for the Change... button. */ |
87 /** Create the dialog for the Change... button. */ |
88 protected abstract AbstractLaunchSettingsDialog createChangeSettingsDialog(Shell shell, LaunchWizardData dialogData); |
88 protected abstract AbstractLaunchSettingsDialog createChangeSettingsDialog(Shell shell, IWizardData dialogData); |
89 /** Refresh the section after the Change... dialog has been closed. */ |
89 /** Refresh the section after the Change... dialog has been closed. */ |
90 protected abstract void refresh(); |
90 protected abstract void refresh(); |
91 |
91 |
92 public Control getControl() { |
92 public Control getControl() { |
93 return control; |
93 return control; |
162 |
162 |
163 /* (non-Javadoc) |
163 /* (non-Javadoc) |
164 * @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#doChange() |
164 * @see com.nokia.cdt.internal.debug.launch.wizard2.AbstractLaunchWizardSection#doChange() |
165 */ |
165 */ |
166 protected void doChange() { |
166 protected void doChange() { |
167 LaunchWizardData dialogData = data.copy(); |
167 IWizardData dialogData = data.copy(); |
168 AbstractLaunchSettingsDialog dialog = createChangeSettingsDialog(getControl().getShell(), dialogData); |
168 AbstractLaunchSettingsDialog dialog = createChangeSettingsDialog(getControl().getShell(), dialogData); |
169 if (dialog.open() == Window.OK) { |
169 if (dialog.open() == Window.OK) { |
170 data.apply(dialogData); |
170 data.apply(dialogData); |
171 refresh(); |
171 refresh(); |
172 } |
172 } |