Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 90684 Details for
Bug 219513
[validation] delete empty and useless plugin.xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
org.eclipse.pde.patch
clipboard.txt (text/plain), 31.99 KB, created by
Chris Aniszczyk
on 2008-02-25 15:40:25 EST
(
hide
)
Description:
org.eclipse.pde.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2008-02-25 15:40:25 EST
Size:
31.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java,v >retrieving revision 1.19 >diff -u -r1.19 OrganizeManifest.java >--- src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java 24 Jan 2008 21:14:22 -0000 1.19 >+++ src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java 25 Feb 2008 20:39:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513 > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.tools; > >@@ -18,7 +19,9 @@ > import org.eclipse.core.runtime.*; > import org.eclipse.jdt.core.*; > import org.eclipse.jface.text.IDocument; >+import org.eclipse.ltk.core.refactoring.Change; > import org.eclipse.ltk.core.refactoring.TextFileChange; >+import org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange; > import org.eclipse.osgi.service.resolver.*; > import org.eclipse.pde.core.IBaseModel; > import org.eclipse.pde.core.build.*; >@@ -174,7 +177,19 @@ > ((SingleManifestHeader) lazy).setMainComponent(null); > } > } >+ >+ } >+ >+ public static Change deleteUselessPluginFile(IProject project, IPluginModelBase modelBase) { >+ if (modelBase == null) >+ return null; > >+ IExtensions ext = modelBase.getExtensions(); >+ if (ext.getExtensionPoints().length > 0 || ext.getExtensions().length > 0) >+ return null; >+ String name = (modelBase instanceof IBundleFragmentModel) ? ICoreConstants.FRAGMENT_FILENAME_DESCRIPTOR : ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR; >+ IFile pluginFile = project.getFile(name); >+ return new DeleteResourceChange(pluginFile.getFullPath(), true); > } > > public static TextFileChange[] removeUnusedKeys(final IProject project, final IBundle bundle, final IPluginModelBase modelBase) { >Index: src/org/eclipse/pde/internal/ui/wizards/tools/IOrganizeManifestsSettings.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/IOrganizeManifestsSettings.java,v >retrieving revision 1.9 >diff -u -r1.9 IOrganizeManifestsSettings.java >--- src/org/eclipse/pde/internal/ui/wizards/tools/IOrganizeManifestsSettings.java 2 Oct 2007 22:03:04 -0000 1.9 >+++ src/org/eclipse/pde/internal/ui/wizards/tools/IOrganizeManifestsSettings.java 25 Feb 2008 20:39:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -23,6 +23,7 @@ > public static final String PROP_UNUSED_DEPENDENCIES = "OrganizeManifests.RequireImport.findRemoveUnused"; //$NON-NLS-1$ > public static final String PROP_ADD_DEPENDENCIES = "OrganizeManifests.AddDependencies"; //$NON-NLS-1$ > public static final String PROP_REMOVE_LAZY = "OrganizeManifests.General.cleanup"; //$NON-NLS-1$ >+ public static final String PROP_REMOVE_USELESSFILES = "OrganizeManifests.General.cleanup.removeUselessFiles"; //$NON-NLS-1$ > public static final String PROP_NLS_PATH = "OrganizeManifests.Translation.nls"; //$NON-NLS-1$ > public static final String PROP_UNUSED_KEYS = "OrganizeManifests.Translation.unusedKeys"; //$NON-NLS-1$ > } >\ No newline at end of file >Index: src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java,v >retrieving revision 1.8 >diff -u -r1.8 OrganizeManifestsWizard.java >--- src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java 16 Jan 2008 17:08:24 -0000 1.8 >+++ src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java 25 Feb 2008 20:39:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -27,7 +27,7 @@ > } > > public boolean performFinish() { >- fMainPage.preformOk(); >+ fMainPage.performOk(); > return super.performFinish(); > } > >Index: src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java,v >retrieving revision 1.8 >diff -u -r1.8 OrganizeManifestsWizardPage.java >--- src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java 16 Jan 2008 17:08:24 -0000 1.8 >+++ src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java 25 Feb 2008 20:39:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513 > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.tools; > >@@ -39,6 +40,7 @@ > private Button fFixIconNLSPaths; > private Button fRemovedUnusedKeys; > private Button fRemoveLazy; >+ private Button fRemoveUselessFiles; > > private Button[] fTopLevelButtons; // used for setting page complete state > >@@ -139,6 +141,10 @@ > > fRemoveLazy = new Button(group, SWT.CHECK); > fRemoveLazy.setText(PDEUIMessages.OrganizeManifestsWizardPage_lazyStart); >+ >+ fRemoveUselessFiles = new Button(group, SWT.CHECK); >+ fRemoveUselessFiles.setText(PDEUIMessages.OrganizeManifestsWizardPage_uselessPluginFile); >+ > } > > private void createNLSGroup(Composite container) { >@@ -208,6 +214,10 @@ > fRemoveLazy.setSelection(selection); > fProcessor.setRemoveLazy(selection); > >+ selection = !settings.getBoolean(PROP_REMOVE_USELESSFILES); >+ fRemoveUselessFiles.setSelection(selection); >+ fProcessor.setRemoveUselessFiles(selection); >+ > selection = settings.getBoolean(PROP_NLS_PATH); > fFixIconNLSPaths.setSelection(selection); > fProcessor.setPrefixIconNL(selection); >@@ -220,7 +230,7 @@ > setPageComplete(); > } > >- protected void preformOk() { >+ protected void performOk() { > IDialogSettings settings = getDialogSettings(); > > settings.put(PROP_ADD_MISSING, !fAddMissing.getSelection()); >@@ -235,6 +245,7 @@ > settings.put(PROP_ADD_DEPENDENCIES, fAdditonalDependencies.getSelection()); > > settings.put(PROP_REMOVE_LAZY, !fRemoveLazy.getSelection()); >+ settings.put(PROP_REMOVE_USELESSFILES, !fRemoveUselessFiles.getSelection()); > > settings.put(PROP_NLS_PATH, fFixIconNLSPaths.getSelection()); > settings.put(PROP_UNUSED_KEYS, fRemovedUnusedKeys.getSelection()); >@@ -252,7 +263,7 @@ > } > > private void setButtonArrays() { >- fTopLevelButtons = new Button[] {fRemoveUnresolved, fAddMissing, fModifyDependencies, fMarkInternal, fUnusedDependencies, fAdditonalDependencies, fFixIconNLSPaths, fRemovedUnusedKeys, fRemoveLazy, fCalculateUses}; >+ fTopLevelButtons = new Button[] {fRemoveUnresolved, fAddMissing, fModifyDependencies, fMarkInternal, fUnusedDependencies, fAdditonalDependencies, fFixIconNLSPaths, fRemovedUnusedKeys, fRemoveLazy, fRemoveUselessFiles, fCalculateUses}; > } > > private void setPageComplete() { >@@ -311,6 +322,8 @@ > fProcessor.setAddDependencies(fAdditonalDependencies.getSelection()); > else if (fRemoveLazy.equals(source)) > fProcessor.setRemoveLazy(fRemoveLazy.getSelection()); >+ else if (fRemoveUselessFiles.equals(source)) >+ fProcessor.setRemoveUselessFiles(fRemoveUselessFiles.getSelection()); > else if (fFixIconNLSPaths.equals(source)) > fProcessor.setPrefixIconNL(fFixIconNLSPaths.getSelection()); > else if (fRemovedUnusedKeys.equals(source)) >Index: src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java,v >retrieving revision 1.3 >diff -u -r1.3 OrganizeManifestsProcessor.java >--- src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java 16 Jan 2008 17:08:24 -0000 1.3 >+++ src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java 25 Feb 2008 20:39:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513 > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.tools; > >@@ -41,6 +42,7 @@ > protected boolean fRemoveDependencies = true; // if true: remove, else mark optional > protected boolean fUnusedDependencies = false; // find/remove unused dependencies - long running op > protected boolean fRemoveLazy = true; // remove lazy/auto start if no activator >+ protected boolean fRemoveUselessFiles = false; // remove fragment/plugin.xml if no extension/extension point defined > protected boolean fPrefixIconNL = false; // prefix icon paths with $nl$ > protected boolean fUnusedKeys = false; // remove unused <bundle-localization>.properties keys > protected boolean fAddDependencies = false; >@@ -82,7 +84,7 @@ > CompositeChange change = new CompositeChange(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()})); > monitor.beginTask(NLS.bind(PDEUIMessages.OrganizeManifestsProcessor_rootMessage, new String[] {fCurrentProject.getName()}), getTotalTicksPerProject()); > >- final TextFileChange[] result = {null}; >+ final Change[] result = {null, null}; > final Exception[] ee = new Exception[1]; > ModelModification modification = new ModelModification(fCurrentProject) { > protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { >@@ -96,17 +98,19 @@ > } > } > }; >- TextFileChange[] changes = PDEModelUtility.changesForModelModication(modification, monitor); >+ Change[] changes = PDEModelUtility.changesForModelModication(modification, monitor); > for (int i = 0; i < changes.length; i++) > change.add(changes[i]); > if (result[0] != null) > change.add(result[0]); >+ if (result[1] != null) >+ change.add(result[1]); > if (ee[0] != null) > PDEPlugin.log(ee[0]); > return change; > } > >- private void runCleanup(IProgressMonitor monitor, IBundlePluginModelBase modelBase, TextFileChange[] result) throws InvocationTargetException, InterruptedException { >+ private void runCleanup(IProgressMonitor monitor, IBundlePluginModelBase modelBase, Change[] result) throws InvocationTargetException, InterruptedException { > > IBundle currentBundle = modelBase.getBundleModel().getBundle(); > ISharedExtensionsModel sharedExtensionsModel = modelBase.getExtensionsModel(); >@@ -179,6 +183,14 @@ > monitor.worked(1); > } > >+ if (fRemoveUselessFiles) { >+ monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_uselessPluginFile, fCurrentProject.getName())); >+ if (!monitor.isCanceled()) { >+ result[1] = OrganizeManifest.deleteUselessPluginFile(fCurrentProject, currentExtensionsModel); >+ } >+ monitor.worked(1); >+ } >+ > if (fPrefixIconNL) { > monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_nlIconPath, projectName)); > if (!monitor.isCanceled()) >@@ -189,7 +201,7 @@ > if (fUnusedKeys) { > monitor.subTask(NLS.bind(PDEUIMessages.OrganizeManifestsOperation_unusedKeys, projectName)); > if (!monitor.isCanceled()) { >- TextFileChange[] results = OrganizeManifest.removeUnusedKeys(fCurrentProject, currentBundle, currentExtensionsModel); >+ Change[] results = OrganizeManifest.removeUnusedKeys(fCurrentProject, currentBundle, currentExtensionsModel); > if (results.length > 0) > result[0] = results[0]; > } >@@ -235,6 +247,8 @@ > ticks += 4; > if (fRemoveLazy) > ticks += 1; >+ if (fRemoveUselessFiles) >+ ticks += 1; > if (fPrefixIconNL) > ticks += 1; > if (fUnusedKeys) >@@ -278,6 +292,10 @@ > fRemoveLazy = removeLazy; > } > >+ public void setRemoveUselessFiles(boolean removeUselessFiles) { >+ fRemoveUselessFiles = removeUselessFiles; >+ } >+ > public void setPrefixIconNL(boolean prefixIconNL) { > fPrefixIconNL = prefixIconNL; > } >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.359 >diff -u -r1.359 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 19 Feb 2008 00:00:39 -0000 1.359 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 25 Feb 2008 20:39:28 -0000 >@@ -2499,8 +2499,10 @@ > public static String PointSelectionPage_noDescAvailable; > > public static String RemoveRequireBundleResolution_description; >- > public static String RemoveRequireBundleResolution_label; >+ public static String RemoveUselessPluginFile_description; >+ public static String AddNewExtensionResolution_description; >+ public static String AddNewExtensionPointResolution_description; > > public static String OptionalRequireBundleResolution_description; > >@@ -2968,6 +2970,8 @@ > > public static String OrganizeManifestsOperation_lazyStart; > >+ public static String OrganizeManifestsOperation_uselessPluginFile; >+ > public static String OrganizeManifestsOperation_nlIconPath; > > public static String OrganizeManifestsOperation_unusedKeys; >@@ -3002,6 +3006,8 @@ > > public static String OrganizeManifestsWizardPage_lazyStart; > >+ public static String OrganizeManifestsWizardPage_uselessPluginFile; >+ > public static String OrganizeManifestsWizardPage_internationalizationGroup; > > public static String OrganizeManifestsWizardPage_prefixNL; >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.969 >diff -u -r1.969 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 20 Feb 2008 14:12:40 -0000 1.969 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 25 Feb 2008 20:39:29 -0000 >@@ -2056,6 +2056,9 @@ > RemoveNodeXMLResolution_label=Remove the {0} element. > RemoveNodeXMLResolution_attrLabel=Remove the {0} attribute. > >+RemoveUselessPluginFile_description=Delete file >+AddNewExtensionResolution_description = Add an extension >+AddNewExtensionPointResolution_description = Add an extension point > RemoveRequireBundleResolution_label=Remove bundle ''{0}'' from the list > RemoveUnknownExecEnvironments_label=Remove all unknown Execution Environments > AddDefaultExecutionEnvironment_label=Add ''{0}'' as a required execution environment >@@ -2090,6 +2093,7 @@ > OrganizeManifestsOperation_export=organizing export packages... {0} > OrganizeManifestsOperation_unusedDeps=removing unused dependencies... {0} > OrganizeManifestsOperation_lazyStart=checking for unnecessary lazy activation header... {0} >+OrganizeManifestsOperation_uselessPluginFile=deleting unnecessary plugin.xml or fragment.xml file... {0} > OrganizeManifestsWizardPage_errorMsg=This function works only on plug-ins containing a MANIFEST.MF > OrganizeManifestsWizardPage_prefixNL=&Prefix icon paths in plug-in extensions with an $nl$ segment > OrganizeManifestsOperation_nlIconPath=checking icon paths for missing $nl$ segments... {0} >@@ -2097,6 +2101,7 @@ > OrganizeManifestsWizardPage_addMissing=&Ensure that all packages appear in the MANIFEST.MF > OrganizeManifestsProcessor_rootMessage=Organize Manifest for {0} > OrganizeManifestsWizardPage_lazyStart=Remove unnecessary lazy activation headers >+OrganizeManifestsWizardPage_uselessPluginFile=Delete unnecessary plugin/fragment.xml files > OrganizeRequireBundleResolution_Description=Organize Require Bundle Header > OrganizeImportPackageResolution_Description=Organize Import Package Header > OrganizeExportPackageResolution_Description=Organize Export Package Header >Index: src/org/eclipse/pde/internal/ui/launcher/LauncherUtils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LauncherUtils.java,v >retrieving revision 1.109 >diff -u -r1.109 LauncherUtils.java >--- src/org/eclipse/pde/internal/ui/launcher/LauncherUtils.java 8 Feb 2008 23:13:43 -0000 1.109 >+++ src/org/eclipse/pde/internal/ui/launcher/LauncherUtils.java 25 Feb 2008 20:39:29 -0000 >@@ -217,6 +217,7 @@ > processor.setRemoveUnresolved(false); > processor.setModifyDep(false); > processor.setRemoveLazy(false); >+ processor.setRemoveUselessFiles(false); > processor.setAddDependencies(true); > processor.setCalculateUses(false); > processor.setMarkInternal(false); >Index: src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java,v >retrieving revision 1.35 >diff -u -r1.35 ResolutionGenerator.java >--- src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 24 Jan 2008 21:17:11 -0000 1.35 >+++ src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java 25 Feb 2008 20:39:29 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Gary Duprex <Gary.Duprex@aspectstools.com> - bug 150225 > * Bartosz Michalik <bartosz.michalik@gmail.com> - bug 214156 >+ * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513 > *******************************************************************************/ > package org.eclipse.pde.internal.ui.correction; > >@@ -87,6 +88,8 @@ > return new IMarkerResolution[] {new ExternalizeResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker), new ExternalizeStringsResolution(AbstractPDEMarkerResolution.RENAME_TYPE)}; > case PDEMarkerFactory.P_UNKNOWN_CLASS : > return new IMarkerResolution[] {new CreateClassXMLResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker), new ChooseClassXMLResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)}; >+ case PDEMarkerFactory.P_USELESS_FILE : >+ return new IMarkerResolution[] {new DeletePluginBaseResolution(AbstractPDEMarkerResolution.REMOVE_TYPE), new AddNewExtensionResolution(AbstractPDEMarkerResolution.CREATE_TYPE), new AddNewExtensionPointResolution(AbstractPDEMarkerResolution.CREATE_TYPE)}; > case PDEMarkerFactory.M_DEPRECATED_PROVIDE_PACKAGE : > return new IMarkerResolution[] {new RenameProvidePackageResolution(AbstractPDEMarkerResolution.RENAME_TYPE)}; > case PDEMarkerFactory.M_EXECUTION_ENVIRONMENT_NOT_SET : >Index: src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java >diff -N src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.correction; >+ >+import org.eclipse.jface.wizard.WizardDialog; >+import org.eclipse.pde.core.IBaseModel; >+import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor; >+import org.eclipse.pde.internal.ui.util.SWTUtil; >+import org.eclipse.pde.internal.ui.wizards.extension.NewExtensionWizard; >+import org.eclipse.ui.IEditorPart; >+ >+public class AddNewExtensionResolution extends AbstractPDEMarkerResolution { >+ >+ public AddNewExtensionResolution(int type) { >+ super(type); >+ } >+ >+ public String getLabel() { >+ return PDEUIMessages.AddNewExtensionResolution_description; >+ } >+ >+ protected void createChange(IBaseModel model) { >+ IEditorPart part = PDEPlugin.getActivePage().getActiveEditor(); >+ if (part instanceof ManifestEditor) { >+ ManifestEditor editor = (ManifestEditor) part; >+ IBaseModel base = editor.getAggregateModel(); >+ if (base instanceof IBundlePluginModelBase) { >+ IBundlePluginModelBase pluginModel = (IBundlePluginModelBase) base; >+ NewExtensionWizard wizard = new NewExtensionWizard(pluginModel.getUnderlyingResource().getProject(), pluginModel, editor) { >+ public boolean performFinish() { >+ return super.performFinish(); >+ } >+ }; >+ WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); >+ dialog.create(); >+ SWTUtil.setDialogSize(dialog, 500, 500); >+ dialog.open(); >+ } >+ } >+ } >+ >+} >Index: src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java >diff -N src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,52 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.correction; >+ >+import org.eclipse.jface.wizard.WizardDialog; >+import org.eclipse.pde.core.IBaseModel; >+import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor; >+import org.eclipse.pde.internal.ui.util.SWTUtil; >+import org.eclipse.pde.internal.ui.wizards.extension.NewExtensionPointWizard; >+import org.eclipse.ui.IEditorPart; >+ >+public class AddNewExtensionPointResolution extends AbstractPDEMarkerResolution { >+ >+ public AddNewExtensionPointResolution(int type) { >+ super(type); >+ } >+ >+ public String getLabel() { >+ return PDEUIMessages.AddNewExtensionPointResolution_description; >+ } >+ >+ protected void createChange(IBaseModel model) { >+ IEditorPart part = PDEPlugin.getActivePage().getActiveEditor(); >+ if (part instanceof ManifestEditor) { >+ ManifestEditor editor = (ManifestEditor) part; >+ IBaseModel base = editor.getAggregateModel(); >+ if (base instanceof IBundlePluginModelBase) { >+ IBundlePluginModelBase pluginModel = (IBundlePluginModelBase) base; >+ NewExtensionPointWizard wizard = new NewExtensionPointWizard(pluginModel.getUnderlyingResource().getProject(), pluginModel, editor) { >+ public boolean performFinish() { >+ return super.performFinish(); >+ } >+ }; >+ WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); >+ dialog.create(); >+ SWTUtil.setDialogSize(dialog, 400, 450); >+ dialog.open(); >+ } >+ } >+ } >+} >Index: src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java >diff -N src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 219513 >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.correction; >+ >+import org.eclipse.core.resources.IMarker; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.pde.core.IBaseModel; >+import org.eclipse.pde.internal.core.builders.PDEMarkerFactory; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+ >+public class DeletePluginBaseResolution extends AbstractPDEMarkerResolution { >+ >+ public DeletePluginBaseResolution(int type) { >+ super(type); >+ } >+ >+ public String getLabel() { >+ return PDEUIMessages.RemoveUselessPluginFile_description; >+ } >+ >+ public void run(final IMarker marker) { >+ try { >+ marker.delete(); >+ marker.getResource().deleteMarkers(PDEMarkerFactory.MARKER_ID, false, IResource.DEPTH_ZERO); >+ marker.getResource().delete(true, new NullProgressMonitor()); >+ } catch (CoreException e) { >+ } >+ } >+ >+ protected void createChange(IBaseModel model) { >+ // handled by run >+ } >+ >+} >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/builders/ExtensionsErrorReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/ExtensionsErrorReporter.java,v >retrieving revision 1.24 >diff -u -r1.24 ExtensionsErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/ExtensionsErrorReporter.java 19 Feb 2008 02:01:55 -0000 1.24 >+++ src/org/eclipse/pde/internal/core/builders/ExtensionsErrorReporter.java 25 Feb 2008 20:39:31 -0000 >@@ -12,8 +12,7 @@ > > import java.io.File; > import java.util.*; >-import org.eclipse.core.resources.IFile; >-import org.eclipse.core.resources.IResource; >+import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.JavaCore; >@@ -86,6 +85,10 @@ > } > } > } >+ >+ IExtensions extensions = fModel.getExtensions(); >+ if (extensions != null && extensions.getExtensions().length == 0 && extensions.getExtensionPoints().length == 0) >+ report(PDECoreMessages.Builders_Manifest_useless_file, -1, IMarker.SEVERITY_WARNING, PDEMarkerFactory.P_USELESS_FILE, PDEMarkerFactory.CAT_OTHER); > } > } > >Index: src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java,v >retrieving revision 1.21 >diff -u -r1.21 PDEMarkerFactory.java >--- src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 3 Jan 2008 03:40:15 -0000 1.21 >+++ src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java 25 Feb 2008 20:39:31 -0000 >@@ -58,6 +58,7 @@ > public static final int P_ILLEGAL_XML_NODE = 0x3001; > public static final int P_UNTRANSLATED_NODE = 0x3002; > public static final int P_UNKNOWN_CLASS = 0x3003; >+ public static final int P_USELESS_FILE = 0x3004; > > // marker attribute keys > public static final String BK_BUILD_ENTRY = "buildEntry.key"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/core/PDECoreMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java,v >retrieving revision 1.50 >diff -u -r1.50 PDECoreMessages.java >--- src/org/eclipse/pde/internal/core/PDECoreMessages.java 19 Feb 2008 00:00:41 -0000 1.50 >+++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 25 Feb 2008 20:39:30 -0000 >@@ -141,6 +141,7 @@ > public static String Builders_Manifest_resource; > public static String Builders_Manifest_deprecated_3_0; > public static String Builders_Manifest_key_not_found; >+ public static String Builders_Manifest_useless_file; > > public static String Builders_Convert_missingAttribute; > public static String Builders_Convert_illegalValue; >Index: src/org/eclipse/pde/internal/core/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v >retrieving revision 1.88 >diff -u -r1.88 pderesources.properties >--- src/org/eclipse/pde/internal/core/pderesources.properties 19 Feb 2008 00:00:41 -0000 1.88 >+++ src/org/eclipse/pde/internal/core/pderesources.properties 25 Feb 2008 20:39:30 -0000 >@@ -92,7 +92,8 @@ > BuildErrorReporter_sourceMissing=The plug-in's classpath library '.' does not have a corresponding source build entry > BuildErrorReporter_cannotFindJar={0} cannot be resolved > BuildErrorReporter_cannotFindBundle=Bundle {0} cannot be resolved >-Builders_Manifest_key_not_found = Key ''{0}'' is not found in the plugin''s properties file >+Builders_Manifest_key_not_found = Key ''{0}'' is not found in the plugin's properties file >+Builders_Manifest_useless_file = A plugin.xml must contain at least one extension or extension point > BuildErrorReporter_missingEntry=An "{0}" build entry is missing > > Builders_Convert_missingAttribute = ''{0}'' attribute is missing
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 219513
:
90646
| 90684 |
90685
|
90686