Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 254970
Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ds/ui/wizards/DSNewWizard.java (-1 / +7 lines)
Lines 14-24 Link Here
14
14
15
import java.lang.reflect.InvocationTargetException;
15
import java.lang.reflect.InvocationTargetException;
16
16
17
import org.eclipse.jface.dialogs.IDialogSettings;
17
import org.eclipse.jface.operation.IRunnableWithProgress;
18
import org.eclipse.jface.operation.IRunnableWithProgress;
18
import org.eclipse.jface.viewers.IStructuredSelection;
19
import org.eclipse.jface.viewers.IStructuredSelection;
19
import org.eclipse.jface.wizard.Wizard;
20
import org.eclipse.jface.wizard.Wizard;
20
import org.eclipse.pde.internal.ds.ui.Activator;
21
import org.eclipse.pde.internal.ds.ui.Activator;
21
import org.eclipse.pde.internal.ds.ui.Messages;
22
import org.eclipse.pde.internal.ds.ui.Messages;
23
import org.eclipse.pde.internal.ui.PDEPlugin;
22
import org.eclipse.ui.INewWizard;
24
import org.eclipse.ui.INewWizard;
23
import org.eclipse.ui.IWorkbench;
25
import org.eclipse.ui.IWorkbench;
24
26
Lines 40-45 Link Here
40
	
42
	
41
	public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
43
	public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
42
		setWindowTitle(Messages.DSNewWizard_title);
44
		setWindowTitle(Messages.DSNewWizard_title);
45
		setDialogSettings(PDEPlugin.getDefault().getDialogSettings());
43
		fMainPage = new DSFileWizardPage(currentSelection);
46
		fMainPage = new DSFileWizardPage(currentSelection);
44
	}
47
	}
45
48
Lines 50-56 Link Here
50
	 */
53
	 */
51
	public boolean performFinish() {
54
	public boolean performFinish() {
52
		try {
55
		try {
53
56
			IDialogSettings settings = getDialogSettings();
57
			if (settings != null) {
58
				fMainPage.saveSettings(settings);
59
			}
54
			IRunnableWithProgress op = new DSCreationOperation(fMainPage
60
			IRunnableWithProgress op = new DSCreationOperation(fMainPage
55
					.createNewFile(), fMainPage.getDSComponentNameValue(),
61
					.createNewFile(), fMainPage.getDSComponentNameValue(),
56
					fMainPage.getDSImplementationClassValue());
62
					fMainPage.getDSImplementationClassValue());
(-)src/org/eclipse/pde/internal/ds/ui/wizards/DSFileWizardPage.java (-2 / +22 lines)
Lines 27-32 Link Here
27
import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
27
import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
28
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
28
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
29
import org.eclipse.jdt.ui.JavaUI;
29
import org.eclipse.jdt.ui.JavaUI;
30
import org.eclipse.jface.dialogs.IDialogSettings;
30
import org.eclipse.jface.viewers.IStructuredSelection;
31
import org.eclipse.jface.viewers.IStructuredSelection;
31
import org.eclipse.jface.window.Window;
32
import org.eclipse.jface.window.Window;
32
import org.eclipse.jface.wizard.WizardDialog;
33
import org.eclipse.jface.wizard.WizardDialog;
Lines 64-70 Link Here
64
65
65
	private static final String F_FILE_EXTENSION = "xml"; //$NON-NLS-1$
66
	private static final String F_FILE_EXTENSION = "xml"; //$NON-NLS-1$
66
67
67
	private static final String F_COMPONENT_NAME = "component.xml"; //$NON-NLS-1$
68
	private static final String F_DEFAULT_COMPONENT_NAME = "component.xml"; //$NON-NLS-1$
69
70
	private static final String S_COMPONENT_NAME = "component"; //$NON-NLS-1$
68
71
69
	private Group fGroup;
72
	private Group fGroup;
70
73
Lines 93-99 Link Here
93
		setDescription(Messages.DSFileWizardPage_description);
96
		setDescription(Messages.DSFileWizardPage_description);
94
		// Force the file extension to be 'xml'
97
		// Force the file extension to be 'xml'
95
		setFileExtension(F_FILE_EXTENSION);
98
		setFileExtension(F_FILE_EXTENSION);
96
		setFileName(F_COMPONENT_NAME);
97
	}
99
	}
98
100
99
	private void setComponentName() {
101
	private void setComponentName() {
Lines 134-139 Link Here
134
	}
136
	}
135
137
136
	protected void createAdvancedControls(Composite parent) {
138
	protected void createAdvancedControls(Composite parent) {
139
		IDialogSettings settings = getDialogSettings();
140
		if (settings != null) {
141
			String component = settings.get(S_COMPONENT_NAME);
142
			if (component != null && !component.equals("")) {
143
				setFileName(component);
144
			} else {
145
				setFileName(F_DEFAULT_COMPONENT_NAME);
146
			}
147
		} else {
148
			setFileName(F_DEFAULT_COMPONENT_NAME);
149
		}
137
150
138
		// Controls Group
151
		// Controls Group
139
		fGroup = new Group(parent, SWT.NONE);
152
		fGroup = new Group(parent, SWT.NONE);
Lines 312-315 Link Here
312
		return checkPageComplete();
325
		return checkPageComplete();
313
	}
326
	}
314
327
328
	public void saveSettings(IDialogSettings settings) {
329
		settings.put(S_COMPONENT_NAME, getFileName());
330
331
	}
332
	
333
	
334
315
}
335
}

Return to bug 254970