View | Details | Raw Unified | Return to bug 219513 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/pderesources.properties (-1 / +2 lines)
Lines 92-98 Link Here
92
BuildErrorReporter_sourceMissing=The plug-in's classpath library '.' does not have a corresponding source build entry
92
BuildErrorReporter_sourceMissing=The plug-in's classpath library '.' does not have a corresponding source build entry
93
BuildErrorReporter_cannotFindJar={0} cannot be resolved
93
BuildErrorReporter_cannotFindJar={0} cannot be resolved
94
BuildErrorReporter_cannotFindBundle=Bundle {0} cannot be resolved
94
BuildErrorReporter_cannotFindBundle=Bundle {0} cannot be resolved
95
Builders_Manifest_key_not_found = Key ''{0}'' is not found in the plugin''s properties file
95
Builders_Manifest_key_not_found = Key ''{0}'' is not found in the plugin's properties file
96
Builders_Manifest_useless_file = File possibly useless: it doesn't define any extension or extension point
96
BuildErrorReporter_missingEntry=An "{0}" build entry is missing
97
BuildErrorReporter_missingEntry=An "{0}" build entry is missing
97
98
98
Builders_Convert_missingAttribute = ''{0}'' attribute is missing
99
Builders_Convert_missingAttribute = ''{0}'' attribute is missing
(-)src/org/eclipse/pde/internal/core/PDECoreMessages.java (+1 lines)
Lines 141-146 Link Here
141
	public static String Builders_Manifest_resource;
141
	public static String Builders_Manifest_resource;
142
	public static String Builders_Manifest_deprecated_3_0;
142
	public static String Builders_Manifest_deprecated_3_0;
143
	public static String Builders_Manifest_key_not_found;
143
	public static String Builders_Manifest_key_not_found;
144
	public static String Builders_Manifest_useless_file;
144
145
145
	public static String Builders_Convert_missingAttribute;
146
	public static String Builders_Convert_missingAttribute;
146
	public static String Builders_Convert_illegalValue;
147
	public static String Builders_Convert_illegalValue;
(-)src/org/eclipse/pde/internal/core/builders/ExtensionsErrorReporter.java (-2 / +5 lines)
Lines 12-19 Link Here
12
12
13
import java.io.File;
13
import java.io.File;
14
import java.util.*;
14
import java.util.*;
15
import org.eclipse.core.resources.IFile;
15
import org.eclipse.core.resources.*;
16
import org.eclipse.core.resources.IResource;
17
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.*;
18
import org.eclipse.jdt.core.IJavaProject;
17
import org.eclipse.jdt.core.IJavaProject;
19
import org.eclipse.jdt.core.JavaCore;
18
import org.eclipse.jdt.core.JavaCore;
Lines 86-91 Link Here
86
					}
85
					}
87
				}
86
				}
88
			}
87
			}
88
89
			IExtensions extensions = fModel.getExtensions();
90
			if (extensions.getExtensions().length == 0 && extensions.getExtensionPoints().length == 0)
91
				report(PDECoreMessages.Builders_Manifest_useless_file, -1, IMarker.SEVERITY_WARNING, PDEMarkerFactory.P_USELESS_FILE, PDEMarkerFactory.CAT_OTHER);
89
		}
92
		}
90
	}
93
	}
91
94
(-)src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java (+1 lines)
Lines 58-63 Link Here
58
	public static final int P_ILLEGAL_XML_NODE = 0x3001;
58
	public static final int P_ILLEGAL_XML_NODE = 0x3001;
59
	public static final int P_UNTRANSLATED_NODE = 0x3002;
59
	public static final int P_UNTRANSLATED_NODE = 0x3002;
60
	public static final int P_UNKNOWN_CLASS = 0x3003;
60
	public static final int P_UNKNOWN_CLASS = 0x3003;
61
	public static final int P_USELESS_FILE = 0x3004;
61
62
62
	// marker attribute keys
63
	// marker attribute keys
63
	public static final String BK_BUILD_ENTRY = "buildEntry.key"; //$NON-NLS-1$
64
	public static final String BK_BUILD_ENTRY = "buildEntry.key"; //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 27-33 Link Here
27
	}
27
	}
28
28
29
	public boolean performFinish() {
29
	public boolean performFinish() {
30
		fMainPage.preformOk();
30
		fMainPage.performOk();
31
		return super.performFinish();
31
		return super.performFinish();
32
	}
32
	}
33
33
(-)src/org/eclipse/pde/internal/ui/wizards/tools/IOrganizeManifestsSettings.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 23-28 Link Here
23
	public static final String PROP_UNUSED_DEPENDENCIES = "OrganizeManifests.RequireImport.findRemoveUnused"; //$NON-NLS-1$
23
	public static final String PROP_UNUSED_DEPENDENCIES = "OrganizeManifests.RequireImport.findRemoveUnused"; //$NON-NLS-1$
24
	public static final String PROP_ADD_DEPENDENCIES = "OrganizeManifests.AddDependencies"; //$NON-NLS-1$
24
	public static final String PROP_ADD_DEPENDENCIES = "OrganizeManifests.AddDependencies"; //$NON-NLS-1$
25
	public static final String PROP_REMOVE_LAZY = "OrganizeManifests.General.cleanup"; //$NON-NLS-1$
25
	public static final String PROP_REMOVE_LAZY = "OrganizeManifests.General.cleanup"; //$NON-NLS-1$
26
	public static final String PROP_REMOVE_USELESSFILES = "OrganizeManifests.General.cleanup.removeUselessFiles"; //$NON-NLS-1$
26
	public static final String PROP_NLS_PATH = "OrganizeManifests.Translation.nls"; //$NON-NLS-1$
27
	public static final String PROP_NLS_PATH = "OrganizeManifests.Translation.nls"; //$NON-NLS-1$
27
	public static final String PROP_UNUSED_KEYS = "OrganizeManifests.Translation.unusedKeys"; //$NON-NLS-1$
28
	public static final String PROP_UNUSED_KEYS = "OrganizeManifests.Translation.unusedKeys"; //$NON-NLS-1$
28
}
29
}
(-)src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java (-1 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.wizards.tools;
12
package org.eclipse.pde.internal.ui.wizards.tools;
12
13
Lines 18-24 Link Here
18
import org.eclipse.core.runtime.*;
19
import org.eclipse.core.runtime.*;
19
import org.eclipse.jdt.core.*;
20
import org.eclipse.jdt.core.*;
20
import org.eclipse.jface.text.IDocument;
21
import org.eclipse.jface.text.IDocument;
22
import org.eclipse.ltk.core.refactoring.Change;
21
import org.eclipse.ltk.core.refactoring.TextFileChange;
23
import org.eclipse.ltk.core.refactoring.TextFileChange;
24
import org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange;
22
import org.eclipse.osgi.service.resolver.*;
25
import org.eclipse.osgi.service.resolver.*;
23
import org.eclipse.pde.core.IBaseModel;
26
import org.eclipse.pde.core.IBaseModel;
24
import org.eclipse.pde.core.build.*;
27
import org.eclipse.pde.core.build.*;
Lines 174-180 Link Here
174
					((SingleManifestHeader) lazy).setMainComponent(null);
177
					((SingleManifestHeader) lazy).setMainComponent(null);
175
			}
178
			}
176
		}
179
		}
180
		
181
	}
182
183
	public static Change deleteUselessPluginFile(IProject project, IPluginModelBase modelBase) {
184
		if (modelBase == null)
185
			return null;
177
186
187
		IExtensions ext = modelBase.getExtensions();
188
		if (ext.getExtensionPoints().length > 0 || ext.getExtensions().length > 0)
189
			return null;
190
		String name = (modelBase instanceof IBundleFragmentModel) ? ICoreConstants.FRAGMENT_FILENAME_DESCRIPTOR : ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR;
191
		IFile pluginFile = project.getFile(name);
192
		return new DeleteResourceChange(pluginFile.getFullPath(), true);
178
	}
193
	}
179
194
180
	public static TextFileChange[] removeUnusedKeys(final IProject project, final IBundle bundle, final IPluginModelBase modelBase) {
195
	public static TextFileChange[] removeUnusedKeys(final IProject project, final IBundle bundle, final IPluginModelBase modelBase) {
(-)src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java (-3 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.wizards.tools;
12
package org.eclipse.pde.internal.ui.wizards.tools;
12
13
Lines 39-44 Link Here
39
	private Button fFixIconNLSPaths;
40
	private Button fFixIconNLSPaths;
40
	private Button fRemovedUnusedKeys;
41
	private Button fRemovedUnusedKeys;
41
	private Button fRemoveLazy;
42
	private Button fRemoveLazy;
43
	private Button fRemoveUselessFiles;
42
44
43
	private Button[] fTopLevelButtons; // used for setting page complete state
45
	private Button[] fTopLevelButtons; // used for setting page complete state
44
46
Lines 139-144 Link Here
139
141
140
		fRemoveLazy = new Button(group, SWT.CHECK);
142
		fRemoveLazy = new Button(group, SWT.CHECK);
141
		fRemoveLazy.setText(PDEUIMessages.OrganizeManifestsWizardPage_lazyStart);
143
		fRemoveLazy.setText(PDEUIMessages.OrganizeManifestsWizardPage_lazyStart);
144
145
		fRemoveUselessFiles = new Button(group, SWT.CHECK);
146
		fRemoveUselessFiles.setText(PDEUIMessages.OrganizeManifestsWizardPage_uselessPluginFile);
147
142
	}
148
	}
143
149
144
	private void createNLSGroup(Composite container) {
150
	private void createNLSGroup(Composite container) {
Lines 208-213 Link Here
208
		fRemoveLazy.setSelection(selection);
214
		fRemoveLazy.setSelection(selection);
209
		fProcessor.setRemoveLazy(selection);
215
		fProcessor.setRemoveLazy(selection);
210
216
217
		selection = !settings.getBoolean(PROP_REMOVE_USELESSFILES);
218
		fRemoveUselessFiles.setSelection(selection);
219
		fProcessor.setRemoveUselessFiles(selection);
220
211
		selection = settings.getBoolean(PROP_NLS_PATH);
221
		selection = settings.getBoolean(PROP_NLS_PATH);
212
		fFixIconNLSPaths.setSelection(selection);
222
		fFixIconNLSPaths.setSelection(selection);
213
		fProcessor.setPrefixIconNL(selection);
223
		fProcessor.setPrefixIconNL(selection);
Lines 220-226 Link Here
220
		setPageComplete();
230
		setPageComplete();
221
	}
231
	}
222
232
223
	protected void preformOk() {
233
	protected void performOk() {
224
		IDialogSettings settings = getDialogSettings();
234
		IDialogSettings settings = getDialogSettings();
225
235
226
		settings.put(PROP_ADD_MISSING, !fAddMissing.getSelection());
236
		settings.put(PROP_ADD_MISSING, !fAddMissing.getSelection());
Lines 235-240 Link Here
235
		settings.put(PROP_ADD_DEPENDENCIES, fAdditonalDependencies.getSelection());
245
		settings.put(PROP_ADD_DEPENDENCIES, fAdditonalDependencies.getSelection());
236
246
237
		settings.put(PROP_REMOVE_LAZY, !fRemoveLazy.getSelection());
247
		settings.put(PROP_REMOVE_LAZY, !fRemoveLazy.getSelection());
248
		settings.put(PROP_REMOVE_USELESSFILES, !fRemoveUselessFiles.getSelection());
238
249
239
		settings.put(PROP_NLS_PATH, fFixIconNLSPaths.getSelection());
250
		settings.put(PROP_NLS_PATH, fFixIconNLSPaths.getSelection());
240
		settings.put(PROP_UNUSED_KEYS, fRemovedUnusedKeys.getSelection());
251
		settings.put(PROP_UNUSED_KEYS, fRemovedUnusedKeys.getSelection());
Lines 252-258 Link Here
252
	}
263
	}
253
264
254
	private void setButtonArrays() {
265
	private void setButtonArrays() {
255
		fTopLevelButtons = new Button[] {fRemoveUnresolved, fAddMissing, fModifyDependencies, fMarkInternal, fUnusedDependencies, fAdditonalDependencies, fFixIconNLSPaths, fRemovedUnusedKeys, fRemoveLazy, fCalculateUses};
266
		fTopLevelButtons = new Button[] {fRemoveUnresolved, fAddMissing, fModifyDependencies, fMarkInternal, fUnusedDependencies, fAdditonalDependencies, fFixIconNLSPaths, fRemovedUnusedKeys, fRemoveLazy, fRemoveUselessFiles, fCalculateUses};
256
	}
267
	}
257
268
258
	private void setPageComplete() {
269
	private void setPageComplete() {
Lines 311-316 Link Here
311
			fProcessor.setAddDependencies(fAdditonalDependencies.getSelection());
322
			fProcessor.setAddDependencies(fAdditonalDependencies.getSelection());
312
		else if (fRemoveLazy.equals(source))
323
		else if (fRemoveLazy.equals(source))
313
			fProcessor.setRemoveLazy(fRemoveLazy.getSelection());
324
			fProcessor.setRemoveLazy(fRemoveLazy.getSelection());
325
		else if (fRemoveUselessFiles.equals(source))
326
			fProcessor.setRemoveUselessFiles(fRemoveUselessFiles.getSelection());
314
		else if (fFixIconNLSPaths.equals(source))
327
		else if (fFixIconNLSPaths.equals(source))
315
			fProcessor.setPrefixIconNL(fFixIconNLSPaths.getSelection());
328
			fProcessor.setPrefixIconNL(fFixIconNLSPaths.getSelection());
316
		else if (fRemovedUnusedKeys.equals(source))
329
		else if (fRemovedUnusedKeys.equals(source))
(-)src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java (-5 / +23 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.wizards.tools;
12
package org.eclipse.pde.internal.ui.wizards.tools;
12
13
Lines 41-46 Link Here
41
	protected boolean fRemoveDependencies = true; // if true: remove, else mark optional
42
	protected boolean fRemoveDependencies = true; // if true: remove, else mark optional
42
	protected boolean fUnusedDependencies = false; // find/remove unused dependencies - long running op
43
	protected boolean fUnusedDependencies = false; // find/remove unused dependencies - long running op
43
	protected boolean fRemoveLazy = true; // remove lazy/auto start if no activator
44
	protected boolean fRemoveLazy = true; // remove lazy/auto start if no activator
45
	protected boolean fRemoveUselessFiles = false; // remove fragment/plugin.xml if no extension/extension point defined
44
	protected boolean fPrefixIconNL = false; // prefix icon paths with $nl$
46
	protected boolean fPrefixIconNL = false; // prefix icon paths with $nl$
45
	protected boolean fUnusedKeys = false; // remove unused <bundle-localization>.properties keys
47
	protected boolean fUnusedKeys = false; // remove unused <bundle-localization>.properties keys
46
	protected boolean fAddDependencies = false;
48
	protected boolean fAddDependencies = false;
Lines 82-88 Link Here
82
		CompositeChange change = new CompositeChange(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()}));
84
		CompositeChange change = new CompositeChange(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()}));
83
		monitor.beginTask(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()}), getTotalTicksPerProject());
85
		monitor.beginTask(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()}), getTotalTicksPerProject());
84
86
85
		final TextFileChange[] result = {null};
87
		final Change[] result = {null, null};
86
		final Exception[] ee = new Exception[1];
88
		final Exception[] ee = new Exception[1];
87
		ModelModification modification = new ModelModification(fCurrentProject) {
89
		ModelModification modification = new ModelModification(fCurrentProject) {
88
			protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException {
90
			protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException {
Lines 96-112 Link Here
96
					}
98
					}
97
			}
99
			}
98
		};
100
		};
99
		TextFileChange[] changes = PDEModelUtility.changesForModelModication(modification, monitor);
101
		Change[] changes = PDEModelUtility.changesForModelModication(modification, monitor);
100
		for (int i = 0; i < changes.length; i++)
102
		for (int i = 0; i < changes.length; i++)
101
			change.add(changes[i]);
103
			change.add(changes[i]);
102
		if (result[0] != null)
104
		if (result[0] != null)
103
			change.add(result[0]);
105
			change.add(result[0]);
106
		if (result[1] != null)
107
			change.add(result[1]);
104
		if (ee[0] != null)
108
		if (ee[0] != null)
105
			PDEPlugin.log(ee[0]);
109
			PDEPlugin.log(ee[0]);
106
		return change;
110
		return change;
107
	}
111
	}
108
112
109
	private void runCleanup(IProgressMonitor monitor, IBundlePluginModelBase modelBase, TextFileChange[] result) throws InvocationTargetException, InterruptedException {
113
	private void runCleanup(IProgressMonitor monitor, IBundlePluginModelBase modelBase, Change[] result) throws InvocationTargetException, InterruptedException {
110
114
111
		IBundle currentBundle = modelBase.getBundleModel().getBundle();
115
		IBundle currentBundle = modelBase.getBundleModel().getBundle();
112
		ISharedExtensionsModel sharedExtensionsModel = modelBase.getExtensionsModel();
116
		ISharedExtensionsModel sharedExtensionsModel = modelBase.getExtensionsModel();
Lines 179-184 Link Here
179
			monitor.worked(1);
183
			monitor.worked(1);
180
		}
184
		}
181
185
186
		if (fRemoveUselessFiles) {
187
			monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_uselessPluginFile, fCurrentProject.getName()));
188
			if (!monitor.isCanceled()) {
189
				result[1] = OrganizeManifest.deleteUselessPluginFile(fCurrentProject, currentExtensionsModel);
190
			}
191
			monitor.worked(1);
192
		}
193
182
		if (fPrefixIconNL) {
194
		if (fPrefixIconNL) {
183
			monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_nlIconPath, projectName));
195
			monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_nlIconPath, projectName));
184
			if (!monitor.isCanceled())
196
			if (!monitor.isCanceled())
Lines 189-195 Link Here
189
		if (fUnusedKeys) {
201
		if (fUnusedKeys) {
190
			monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_unusedKeys, projectName));
202
			monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_unusedKeys, projectName));
191
			if (!monitor.isCanceled()) {
203
			if (!monitor.isCanceled()) {
192
				TextFileChange[] results = OrganizeManifest.removeUnusedKeys(fCurrentProject, currentBundle, currentExtensionsModel);
204
				Change[] results = OrganizeManifest.removeUnusedKeys(fCurrentProject, currentBundle, currentExtensionsModel);
193
				if (results.length > 0)
205
				if (results.length > 0)
194
					result[0] = results[0];
206
					result[0] = results[0];
195
			}
207
			}
Lines 235-240 Link Here
235
			ticks += 4;
247
			ticks += 4;
236
		if (fRemoveLazy)
248
		if (fRemoveLazy)
237
			ticks += 1;
249
			ticks += 1;
250
		if (fRemoveUselessFiles)
251
			ticks += 1;
238
		if (fPrefixIconNL)
252
		if (fPrefixIconNL)
239
			ticks += 1;
253
			ticks += 1;
240
		if (fUnusedKeys)
254
		if (fUnusedKeys)
Lines 278-283 Link Here
278
		fRemoveLazy = removeLazy;
292
		fRemoveLazy = removeLazy;
279
	}
293
	}
280
294
295
	public void setRemoveUselessFiles(boolean removeUselessFiles) {
296
		fRemoveUselessFiles = removeUselessFiles;
297
	}
298
281
	public void setPrefixIconNL(boolean prefixIconNL) {
299
	public void setPrefixIconNL(boolean prefixIconNL) {
282
		fPrefixIconNL = prefixIconNL;
300
		fPrefixIconNL = prefixIconNL;
283
	}
301
	}
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (+3 lines)
Lines 2056-2061 Link Here
2056
RemoveNodeXMLResolution_label=Remove the {0} element.
2056
RemoveNodeXMLResolution_label=Remove the {0} element.
2057
RemoveNodeXMLResolution_attrLabel=Remove the {0} attribute.
2057
RemoveNodeXMLResolution_attrLabel=Remove the {0} attribute.
2058
2058
2059
RemoveUselessPluginFile_description=Delete file
2059
RemoveRequireBundleResolution_label=Remove bundle ''{0}'' from the list
2060
RemoveRequireBundleResolution_label=Remove bundle ''{0}'' from the list
2060
RemoveUnknownExecEnvironments_label=Remove all unknown Execution Environments
2061
RemoveUnknownExecEnvironments_label=Remove all unknown Execution Environments
2061
AddDefaultExecutionEnvironment_label=Add ''{0}'' as a required execution environment
2062
AddDefaultExecutionEnvironment_label=Add ''{0}'' as a required execution environment
Lines 2090-2095 Link Here
2090
OrganizeManifestsOperation_export=organizing export packages... {0}
2091
OrganizeManifestsOperation_export=organizing export packages... {0}
2091
OrganizeManifestsOperation_unusedDeps=removing unused dependencies... {0}
2092
OrganizeManifestsOperation_unusedDeps=removing unused dependencies... {0}
2092
OrganizeManifestsOperation_lazyStart=checking for unnecessary lazy activation header... {0}
2093
OrganizeManifestsOperation_lazyStart=checking for unnecessary lazy activation header... {0}
2094
OrganizeManifestsOperation_uselessPluginFile=deleting unnecessary plugin.xml or fragment.xml file... {0}
2093
OrganizeManifestsWizardPage_errorMsg=This function works only on plug-ins containing a MANIFEST.MF
2095
OrganizeManifestsWizardPage_errorMsg=This function works only on plug-ins containing a MANIFEST.MF
2094
OrganizeManifestsWizardPage_prefixNL=&Prefix icon paths in plug-in extensions with an $nl$ segment
2096
OrganizeManifestsWizardPage_prefixNL=&Prefix icon paths in plug-in extensions with an $nl$ segment
2095
OrganizeManifestsOperation_nlIconPath=checking icon paths for missing $nl$ segments... {0}
2097
OrganizeManifestsOperation_nlIconPath=checking icon paths for missing $nl$ segments... {0}
Lines 2097-2102 Link Here
2097
OrganizeManifestsWizardPage_addMissing=&Ensure that all packages appear in the MANIFEST.MF
2099
OrganizeManifestsWizardPage_addMissing=&Ensure that all packages appear in the MANIFEST.MF
2098
OrganizeManifestsProcessor_rootMessage=Organize Manifest for {0}
2100
OrganizeManifestsProcessor_rootMessage=Organize Manifest for {0}
2099
OrganizeManifestsWizardPage_lazyStart=Remove unnecessary lazy activation headers
2101
OrganizeManifestsWizardPage_lazyStart=Remove unnecessary lazy activation headers
2102
OrganizeManifestsWizardPage_uselessPluginFile=Delete unnecessary plugin/fragment.xml files
2100
OrganizeRequireBundleResolution_Description=Organize Require Bundle Header
2103
OrganizeRequireBundleResolution_Description=Organize Require Bundle Header
2101
OrganizeImportPackageResolution_Description=Organize Import Package Header
2104
OrganizeImportPackageResolution_Description=Organize Import Package Header
2102
OrganizeExportPackageResolution_Description=Organize Export Package Header
2105
OrganizeExportPackageResolution_Description=Organize Export Package Header
(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+6 lines)
Lines 2502-2507 Link Here
2502
2502
2503
	public static String RemoveRequireBundleResolution_label;
2503
	public static String RemoveRequireBundleResolution_label;
2504
2504
2505
	public static String RemoveUselessPluginFile_description;
2506
2505
	public static String OptionalRequireBundleResolution_description;
2507
	public static String OptionalRequireBundleResolution_description;
2506
2508
2507
	public static String OptionalRequireBundleResolution_label;
2509
	public static String OptionalRequireBundleResolution_label;
Lines 2968-2973 Link Here
2968
2970
2969
	public static String OrganizeManifestsOperation_lazyStart;
2971
	public static String OrganizeManifestsOperation_lazyStart;
2970
2972
2973
	public static String OrganizeManifestsOperation_uselessPluginFile;
2974
2971
	public static String OrganizeManifestsOperation_nlIconPath;
2975
	public static String OrganizeManifestsOperation_nlIconPath;
2972
2976
2973
	public static String OrganizeManifestsOperation_unusedKeys;
2977
	public static String OrganizeManifestsOperation_unusedKeys;
Lines 3002-3007 Link Here
3002
3006
3003
	public static String OrganizeManifestsWizardPage_lazyStart;
3007
	public static String OrganizeManifestsWizardPage_lazyStart;
3004
3008
3009
	public static String OrganizeManifestsWizardPage_uselessPluginFile;
3010
3005
	public static String OrganizeManifestsWizardPage_internationalizationGroup;
3011
	public static String OrganizeManifestsWizardPage_internationalizationGroup;
3006
3012
3007
	public static String OrganizeManifestsWizardPage_prefixNL;
3013
	public static String OrganizeManifestsWizardPage_prefixNL;
(-)src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java (+3 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Gary Duprex <Gary.Duprex@aspectstools.com> - bug 150225
10
 *     Gary Duprex <Gary.Duprex@aspectstools.com> - bug 150225
11
 *     Bartosz Michalik <bartosz.michalik@gmail.com> - bug 214156
11
 *     Bartosz Michalik <bartosz.michalik@gmail.com> - bug 214156
12
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.pde.internal.ui.correction;
14
package org.eclipse.pde.internal.ui.correction;
14
15
Lines 87-92 Link Here
87
				return new IMarkerResolution[] {new ExternalizeResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker), new ExternalizeStringsResolution(AbstractPDEMarkerResolution.RENAME_TYPE)};
88
				return new IMarkerResolution[] {new ExternalizeResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker), new ExternalizeStringsResolution(AbstractPDEMarkerResolution.RENAME_TYPE)};
88
			case PDEMarkerFactory.P_UNKNOWN_CLASS :
89
			case PDEMarkerFactory.P_UNKNOWN_CLASS :
89
				return new IMarkerResolution[] {new CreateClassXMLResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker), new ChooseClassXMLResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
90
				return new IMarkerResolution[] {new CreateClassXMLResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker), new ChooseClassXMLResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
91
			case PDEMarkerFactory.P_USELESS_FILE :
92
				return new IMarkerResolution[] {new DeletePluginBaseResolution(AbstractPDEMarkerResolution.REMOVE_TYPE)};
90
			case PDEMarkerFactory.M_DEPRECATED_PROVIDE_PACKAGE :
93
			case PDEMarkerFactory.M_DEPRECATED_PROVIDE_PACKAGE :
91
				return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)};
94
				return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)};
92
			case PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET :
95
			case PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET :
(-)src/org/eclipse/pde/internal/ui/launcher/LauncherUtils.java (+1 lines)
Lines 217-222 Link Here
217
		processor.setRemoveUnresolved(false);
217
		processor.setRemoveUnresolved(false);
218
		processor.setModifyDep(false);
218
		processor.setModifyDep(false);
219
		processor.setRemoveLazy(false);
219
		processor.setRemoveLazy(false);
220
		processor.setRemoveUselessFiles(false);
220
		processor.setAddDependencies(true);
221
		processor.setAddDependencies(true);
221
		processor.setCalculateUses(false);
222
		processor.setCalculateUses(false);
222
		processor.setMarkInternal(false);
223
		processor.setMarkInternal(false);
(-)src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java (+42 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513
11
 *******************************************************************************/
12
package org.eclipse.pde.internal.ui.correction;
13
14
import org.eclipse.core.resources.IMarker;
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.NullProgressMonitor;
17
import org.eclipse.pde.core.IBaseModel;
18
import org.eclipse.pde.internal.ui.PDEUIMessages;
19
20
public class DeletePluginBaseResolution extends AbstractPDEMarkerResolution {
21
22
	public DeletePluginBaseResolution(int type) {
23
		super(type);
24
	}
25
26
	public String getLabel() {
27
		return PDEUIMessages.RemoveUselessPluginFile_description;
28
	}
29
30
	public void run(final IMarker marker) {
31
		try {
32
			marker.delete();
33
			marker.getResource().delete(true, new NullProgressMonitor());
34
		} catch (CoreException e) {
35
		}
36
	}
37
38
	protected void createChange(IBaseModel model) {
39
		// handled by run
40
	}
41
42
}

Return to bug 219513