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 175199 Details for
Bug 320869
Undo/Redo operations not working for Import Packages Section
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
20100726.txt (text/plain), 6.85 KB, created by
Ankur Sharma
on 2010-07-26 03:24:26 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ankur Sharma
Created:
2010-07-26 03:24:26 EDT
Size:
6.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java,v >retrieving revision 1.8 >diff -u -r1.8 ImportPackageObject.java >--- text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java 27 May 2009 20:25:15 -0000 1.8 >+++ text/org/eclipse/pde/internal/core/text/bundle/ImportPackageObject.java 26 Jul 2010 07:15:02 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 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 >@@ -84,4 +84,12 @@ > writer.write(write()); > } > >+ public void restoreProperty(String propertyName, Object oldValue, Object newValue) { >+ if (Constants.RESOLUTION_DIRECTIVE.equalsIgnoreCase(propertyName)) { >+ setOptional(new Boolean(newValue.toString()).booleanValue()); >+ } else if (fVersionAttribute != null && fVersionAttribute.equalsIgnoreCase(propertyName)) { >+ setVersion(newValue.toString()); >+ } >+ } >+ > } >Index: text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java,v >retrieving revision 1.10 >diff -u -r1.10 PackageObject.java >--- text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java 27 May 2009 20:25:15 -0000 1.10 >+++ text/org/eclipse/pde/internal/core/text/bundle/PackageObject.java 26 Jul 2010 07:15:02 -0000 >@@ -17,7 +17,7 @@ > > private static final long serialVersionUID = 1L; > >- private transient String fVersionAttribute; >+ protected transient String fVersionAttribute; > > public PackageObject(ManifestHeader header, ManifestElement element, String versionAttribute) { > super(header, element); >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java,v >retrieving revision 1.15 >diff -u -r1.15 PluginUndoManager.java >--- src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java 27 May 2009 20:38:14 -0000 1.15 >+++ src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java 26 Jul 2010 07:15:04 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -17,12 +17,17 @@ > import org.eclipse.pde.core.plugin.*; > import org.eclipse.pde.internal.core.build.BuildObject; > import org.eclipse.pde.internal.core.build.IBuildObject; >+import org.eclipse.pde.internal.core.bundle.BundleObject; >+import org.eclipse.pde.internal.core.ibundle.IBundleModel; >+import org.eclipse.pde.internal.core.ibundle.IManifestHeader; > import org.eclipse.pde.internal.core.plugin.*; > import org.eclipse.pde.internal.core.plugin.PluginAttribute; >+import org.eclipse.pde.internal.core.text.bundle.*; > import org.eclipse.pde.internal.core.text.plugin.*; > import org.eclipse.pde.internal.ui.PDEPlugin; > import org.eclipse.pde.internal.ui.editor.ModelUndoManager; > import org.eclipse.pde.internal.ui.editor.PDEFormEditor; >+import org.osgi.framework.Constants; > > public class PluginUndoManager extends ModelUndoManager { > >@@ -79,10 +84,14 @@ > private void executeAdd(IModelChangeProvider model, Object[] elements) { > IPluginBase pluginBase = null; > IBuild build = null; >- if (model instanceof IPluginModelBase) >+ IBundleModel bundleModel = null; >+ if (model instanceof IPluginModelBase) { > pluginBase = ((IPluginModelBase) model).getPluginBase(); >- if (model instanceof IBuildModel) >+ } else if (model instanceof IBuildModel) { > build = ((IBuildModel) model).getBuild(); >+ } else if (model instanceof IBundleModel) { >+ bundleModel = (IBundleModel) model; >+ } > > try { > for (int i = 0; i < elements.length; i++) { >@@ -107,6 +116,13 @@ > } else if (element instanceof IBuildEntry) { > IBuildEntry e = (IBuildEntry) element; > build.add(e); >+ } else if (element instanceof BundleObject) { >+ if (element instanceof ImportPackageObject) { >+ IManifestHeader header = bundleModel.getBundle().getManifestHeader(Constants.IMPORT_PACKAGE); >+ if (header != null && header instanceof ImportPackageHeader) { >+ ((ImportPackageHeader) header).addPackage((PackageObject) element); >+ } >+ } > } > } > } catch (CoreException e) { >@@ -117,10 +133,14 @@ > private void executeRemove(IModelChangeProvider model, Object[] elements) { > IPluginBase pluginBase = null; > IBuild build = null; >- if (model instanceof IPluginModelBase) >+ IBundleModel bundleModel = null; >+ if (model instanceof IPluginModelBase) { > pluginBase = ((IPluginModelBase) model).getPluginBase(); >- if (model instanceof IBuildModel) >+ } else if (model instanceof IBuildModel) { > build = ((IBuildModel) model).getBuild(); >+ } else if (model instanceof IBundleModel) { >+ bundleModel = (IBundleModel) model; >+ } > > try { > for (int i = 0; i < elements.length; i++) { >@@ -145,6 +165,13 @@ > } else if (element instanceof IBuildEntry) { > IBuildEntry e = (IBuildEntry) element; > build.remove(e); >+ } else if (element instanceof BundleObject) { >+ if (element instanceof ImportPackageObject) { >+ IManifestHeader header = bundleModel.getBundle().getManifestHeader(Constants.IMPORT_PACKAGE); >+ if (header != null && header instanceof ImportPackageHeader) { >+ ((ImportPackageHeader) header).removePackage((PackageObject) element); >+ } >+ } > } > } > } catch (CoreException e) { >@@ -186,6 +213,11 @@ > PluginObjectNode node = (PluginObjectNode) element; > String newString = newValue != null ? newValue.toString() : null; > node.setXMLAttribute(propertyName, newString); >+ } else if (element instanceof BundleObject) { >+ if (element instanceof ImportPackageObject) { >+ ImportPackageObject ipObj = (ImportPackageObject) element; >+ ipObj.restoreProperty(propertyName, oldValue, newValue); >+ } > } > } >
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 320869
: 175199