Lines 12-17
Link Here
|
12 |
package org.eclipse.pde.internal.ui.wizards.plugin; |
12 |
package org.eclipse.pde.internal.ui.wizards.plugin; |
13 |
|
13 |
|
14 |
import org.eclipse.core.runtime.IStatus; |
14 |
import org.eclipse.core.runtime.IStatus; |
|
|
15 |
import org.eclipse.jface.dialogs.IDialogSettings; |
15 |
import org.eclipse.jface.wizard.IWizardPage; |
16 |
import org.eclipse.jface.wizard.IWizardPage; |
16 |
import org.eclipse.jface.wizard.WizardPage; |
17 |
import org.eclipse.jface.wizard.WizardPage; |
17 |
import org.eclipse.pde.internal.core.PDECoreMessages; |
18 |
import org.eclipse.pde.internal.core.PDECoreMessages; |
Lines 19-32
Link Here
|
19 |
import org.eclipse.pde.internal.core.util.VersionUtil; |
20 |
import org.eclipse.pde.internal.core.util.VersionUtil; |
20 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
21 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
21 |
import org.eclipse.pde.internal.ui.util.PDELabelUtility; |
22 |
import org.eclipse.pde.internal.ui.util.PDELabelUtility; |
|
|
23 |
import org.eclipse.pde.internal.ui.wizards.BundleProviderUtil; |
22 |
import org.eclipse.pde.internal.ui.wizards.IProjectProvider; |
24 |
import org.eclipse.pde.internal.ui.wizards.IProjectProvider; |
23 |
import org.eclipse.pde.ui.IFieldData; |
25 |
import org.eclipse.pde.ui.IFieldData; |
24 |
import org.eclipse.swt.SWT; |
26 |
import org.eclipse.swt.SWT; |
25 |
import org.eclipse.swt.events.ModifyEvent; |
27 |
import org.eclipse.swt.events.ModifyEvent; |
26 |
import org.eclipse.swt.events.ModifyListener; |
28 |
import org.eclipse.swt.events.ModifyListener; |
27 |
import org.eclipse.swt.layout.GridData; |
29 |
import org.eclipse.swt.layout.GridData; |
28 |
import org.eclipse.swt.widgets.Composite; |
30 |
import org.eclipse.swt.widgets.*; |
29 |
import org.eclipse.swt.widgets.Text; |
|
|
30 |
|
31 |
|
31 |
public abstract class ContentPage extends WizardPage { |
32 |
public abstract class ContentPage extends WizardPage { |
32 |
|
33 |
|
Lines 34-40
Link Here
|
34 |
protected Text fIdText; |
35 |
protected Text fIdText; |
35 |
protected Text fVersionText; |
36 |
protected Text fVersionText; |
36 |
protected Text fNameText; |
37 |
protected Text fNameText; |
37 |
protected Text fProviderText; |
38 |
protected Combo fProviderCombo; |
38 |
|
39 |
|
39 |
protected NewProjectCreationPage fMainPage; |
40 |
protected NewProjectCreationPage fMainPage; |
40 |
protected AbstractFieldData fData; |
41 |
protected AbstractFieldData fData; |
Lines 75-80
Link Here
|
75 |
return text; |
76 |
return text; |
76 |
} |
77 |
} |
77 |
|
78 |
|
|
|
79 |
protected Combo createProviderCombo(Composite parent, ModifyListener listener, int horizSpan) { |
80 |
Combo combo = new Combo(parent, SWT.BORDER | SWT.DROP_DOWN); |
81 |
GridData data = new GridData(GridData.FILL_HORIZONTAL); |
82 |
data.horizontalSpan = horizSpan; |
83 |
combo.setLayoutData(data); |
84 |
BundleProviderUtil.loadHistory(combo, getDialogSettings()); |
85 |
// Add listener only now, otherwise combo.select(0) would trigger it |
86 |
// and cause a NPE during validation. |
87 |
combo.addModifyListener(listener); |
88 |
return combo; |
89 |
} |
90 |
|
78 |
protected abstract void validatePage(); |
91 |
protected abstract void validatePage(); |
79 |
|
92 |
|
80 |
protected String validateProperties() { |
93 |
protected String validateProperties() { |
Lines 167-173
Link Here
|
167 |
fIdText.setText(id); |
180 |
fIdText.setText(id); |
168 |
fVersionText.setText("1.0.0"); //$NON-NLS-1$ |
181 |
fVersionText.setText("1.0.0"); //$NON-NLS-1$ |
169 |
fNameText.setText(IdUtil.getValidName(id)); |
182 |
fNameText.setText(IdUtil.getValidName(id)); |
170 |
fProviderText.setText(IdUtil.getValidProvider(id)); |
183 |
if (0 == fProviderCombo.getText().length()) { |
|
|
184 |
fProviderCombo.setText(IdUtil.getValidProvider(id)); |
185 |
} |
171 |
fChangedGroups = oldfChanged; |
186 |
fChangedGroups = oldfChanged; |
172 |
} |
187 |
} |
173 |
if (fInitialized) |
188 |
if (fInitialized) |
Lines 182-192
Link Here
|
182 |
return IdUtil.getValidId(fProjectProvider.getProjectName()); |
197 |
return IdUtil.getValidId(fProjectProvider.getProjectName()); |
183 |
} |
198 |
} |
184 |
|
199 |
|
|
|
200 |
public void saveSettings(IDialogSettings settings) { |
201 |
BundleProviderUtil.saveHistory(fProviderCombo, settings); |
202 |
} |
203 |
|
185 |
public void updateData() { |
204 |
public void updateData() { |
186 |
fData.setId(fIdText.getText().trim()); |
205 |
fData.setId(fIdText.getText().trim()); |
187 |
fData.setVersion(fVersionText.getText().trim()); |
206 |
fData.setVersion(fVersionText.getText().trim()); |
188 |
fData.setName(fNameText.getText().trim()); |
207 |
fData.setName(fNameText.getText().trim()); |
189 |
fData.setProvider(fProviderText.getText().trim()); |
208 |
fData.setProvider(fProviderCombo.getText().trim()); |
190 |
} |
209 |
} |
191 |
|
210 |
|
192 |
public IFieldData getData() { |
211 |
public IFieldData getData() { |