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 75580 Details for
Bug 199149
Manifest highlighting needed in other PDE refactoring areas
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
patch199149.txt (text/plain), 13.36 KB, created by
Adam Archer
on 2007-08-07 15:50:22 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Adam Archer
Created:
2007-08-07 15:50:22 EDT
Size:
13.36 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 CreateHeaderChangeOperation.java >--- src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java 1 May 2007 01:01:56 -0000 1.2 >+++ src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java 7 Aug 2007 19:40:37 -0000 >@@ -33,6 +33,7 @@ > import org.eclipse.pde.internal.core.text.bundle.PackageFriend; > import org.eclipse.pde.internal.core.text.bundle.RequireBundleHeader; > import org.eclipse.pde.internal.core.text.bundle.RequireBundleObject; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.text.edits.MalformedTreeException; > import org.eclipse.text.edits.MultiTextEdit; > import org.eclipse.text.edits.TextEdit; >@@ -132,6 +133,7 @@ > edit.addChildren(edits); > TextFileChange change = new TextFileChange("", manifest); //$NON-NLS-1$ > change.setEdit(edit); >+ PDEModelUtility.setChangeTextType(change, manifest); > return change; > } > } >Index: src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java,v >retrieving revision 1.5 >diff -u -r1.5 ContainerRenameParticipant.java >--- src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java 27 Apr 2007 17:56:50 -0000 1.5 >+++ src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java 7 Aug 2007 19:40:37 -0000 >@@ -34,6 +34,7 @@ > import org.eclipse.pde.internal.core.text.bundle.BundleTextChangeListener; > import org.eclipse.pde.internal.core.util.IdUtil; > import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.text.edits.MalformedTreeException; > import org.eclipse.text.edits.MultiTextEdit; > import org.osgi.framework.Constants; >@@ -100,6 +101,7 @@ > MultiTextEdit edit = new MultiTextEdit(); > edit.addChildren(listener.getTextOperations()); > change.setEdit(edit); >+ PDEModelUtility.setChangeTextType(change, manifest); > result.add(change); > > // find all the references to the changing Bundle-SymbolicName and update all references to it >Index: src/org/eclipse/pde/internal/ui/refactoring/PluginManifestChange.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PluginManifestChange.java,v >retrieving revision 1.13 >diff -u -r1.13 PluginManifestChange.java >--- src/org/eclipse/pde/internal/ui/refactoring/PluginManifestChange.java 13 Nov 2006 20:24:44 -0000 1.13 >+++ src/org/eclipse/pde/internal/ui/refactoring/PluginManifestChange.java 7 Aug 2007 19:40:37 -0000 >@@ -13,6 +13,7 @@ > import org.eclipse.core.filebuffers.FileBuffers; > import org.eclipse.core.filebuffers.ITextFileBuffer; > import org.eclipse.core.filebuffers.ITextFileBufferManager; >+import org.eclipse.core.filebuffers.LocationKind; > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; >@@ -42,6 +43,7 @@ > import org.eclipse.pde.internal.core.text.plugin.PluginModel; > import org.eclipse.pde.internal.core.text.plugin.PluginModelBase; > import org.eclipse.pde.internal.core.text.plugin.PluginNode; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.text.edits.MultiTextEdit; > import org.eclipse.text.edits.ReplaceEdit; > import org.eclipse.text.edits.TextEdit; >@@ -52,8 +54,8 @@ > throws CoreException { > ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); > try { >- manager.connect(file.getFullPath(), monitor); >- ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath()); >+ manager.connect(file.getFullPath(), LocationKind.NORMALIZE, monitor); >+ ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.NORMALIZE); > > MultiTextEdit multiEdit = new MultiTextEdit(); > >@@ -101,6 +103,7 @@ > } > TextFileChange change = new TextFileChange("", file); //$NON-NLS-1$ > change.setEdit(multiEdit); >+ PDEModelUtility.setChangeTextType(change, file); > return change; > } > } catch (CoreException e) { >@@ -108,7 +111,7 @@ > } > return null; > } finally { >- manager.disconnect(file.getFullPath(), monitor); >+ manager.disconnect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > } > } > >Index: src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java,v >retrieving revision 1.17 >diff -u -r1.17 BundleManifestChange.java >--- src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java 27 Feb 2007 21:27:19 -0000 1.17 >+++ src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java 7 Aug 2007 19:40:37 -0000 >@@ -14,6 +14,7 @@ > > import org.eclipse.core.filebuffers.FileBuffers; > import org.eclipse.core.filebuffers.ITextFileBufferManager; >+import org.eclipse.core.filebuffers.LocationKind; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -37,6 +38,7 @@ > import org.eclipse.pde.internal.core.text.bundle.ExportPackageObject; > import org.eclipse.pde.internal.core.text.bundle.PDEManifestElement; > import org.eclipse.pde.internal.core.text.bundle.PackageObject; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.text.edits.MalformedTreeException; > import org.eclipse.text.edits.MultiTextEdit; > import org.eclipse.text.edits.TextEdit; >@@ -59,7 +61,7 @@ > } catch (MalformedTreeException e) { > } catch (BadLocationException e) { > } finally { >- FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), monitor); >+ FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > } > return null; > } >@@ -91,6 +93,7 @@ > MultiTextEdit edit = new MultiTextEdit(); > edit.addChildren(operations); > change.setEdit(edit); >+ PDEModelUtility.setChangeTextType(change, file); > if (list.size() > 0) > change.setMovedElements((PDEManifestElement[])list.toArray(new PDEManifestElement[list.size()])); > return change; >@@ -99,7 +102,7 @@ > } catch (MalformedTreeException e) { > } catch (BadLocationException e) { > } finally { >- FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), monitor); >+ FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > } > return null; > } >@@ -153,7 +156,7 @@ > } catch (MalformedTreeException e) { > } catch (BadLocationException e) { > } finally { >- FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), monitor); >+ FileBuffers.getTextFileBufferManager().disconnect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > } > return null; > } >@@ -165,6 +168,7 @@ > MultiTextEdit edit = new MultiTextEdit(); > edit.addChildren(operations); > change.setEdit(edit); >+ PDEModelUtility.setChangeTextType(change, file); > return change; > } > return null; >@@ -234,9 +238,9 @@ > > public static Bundle getBundle(IFile file, IProgressMonitor monitor) throws CoreException, MalformedTreeException, BadLocationException { > ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); >- manager.connect(file.getFullPath(), monitor); >+ manager.connect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > >- IDocument document = manager.getTextFileBuffer(file.getFullPath()).getDocument(); >+ IDocument document = manager.getTextFileBuffer(file.getFullPath(), LocationKind.NORMALIZE).getDocument(); > BundleModel model = new BundleModel(document, false); > model.load(); > return model.isLoaded() ? (Bundle)model.getBundle() : null; >Index: src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java,v >retrieving revision 1.3 >diff -u -r1.3 BuildPropertiesChange.java >--- src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java 13 Nov 2006 21:10:51 -0000 1.3 >+++ src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java 7 Aug 2007 19:40:37 -0000 >@@ -13,6 +13,7 @@ > import org.eclipse.core.filebuffers.FileBuffers; > import org.eclipse.core.filebuffers.ITextFileBuffer; > import org.eclipse.core.filebuffers.ITextFileBufferManager; >+import org.eclipse.core.filebuffers.LocationKind; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -27,6 +28,7 @@ > import org.eclipse.pde.core.build.IBuildEntry; > import org.eclipse.pde.internal.core.text.build.BuildModel; > import org.eclipse.pde.internal.core.text.build.PropertiesTextChangeListener; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.text.edits.MultiTextEdit; > import org.eclipse.text.edits.TextEdit; > >@@ -36,8 +38,8 @@ > throws CoreException { > ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); > try { >- manager.connect(file.getFullPath(), monitor); >- ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath()); >+ manager.connect(file.getFullPath(), LocationKind.NORMALIZE, monitor); >+ ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.NORMALIZE); > > IDocument document = buffer.getDocument(); > >@@ -69,6 +71,7 @@ > MultiTextEdit edit = new MultiTextEdit(); > edit.addChildren(operations); > change.setEdit(edit); >+ PDEModelUtility.setChangeTextType(change, file); > return change; > } > } catch (CoreException e) { >@@ -76,7 +79,7 @@ > } > return null; > } finally { >- manager.disconnect(file.getFullPath(), monitor); >+ manager.disconnect(file.getFullPath(), LocationKind.NORMALIZE, monitor); > } > } > >Index: src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java,v >retrieving revision 1.12 >diff -u -r1.12 PDEModelUtility.java >--- src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java 3 Aug 2007 02:20:12 -0000 1.12 >+++ src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java 7 Aug 2007 19:40:37 -0000 >@@ -344,9 +344,9 @@ > for (int i = 0; i < files.length; i++) { > if (files[i] == null || !files[i].exists()) > continue; >- manager.connect(files[i].getFullPath(), LocationKind.IFILE, monitor); >+ manager.connect(files[i].getFullPath(), LocationKind.NORMALIZE, monitor); > sc++; >- buffers[i] = manager.getTextFileBuffer(files[i].getFullPath(), LocationKind.IFILE); >+ buffers[i] = manager.getTextFileBuffer(files[i].getFullPath(), LocationKind.NORMALIZE); > if (performEdits && buffers[i].isDirty()) > buffers[i].commit(monitor, true); > documents[i] = buffers[i].getDocument(); >@@ -384,12 +384,7 @@ > } > // save the file after the change applied > change.setSaveMode(TextFileChange.FORCE_SAVE); >- // mark a plugin.xml or a fragment.xml as PLUGIN2 type so they will be compared >- // with the PluginContentMergeViewer >- String textType = files[i].getName().equals("plugin.xml") || //$NON-NLS-1$ >- files[i].getName().equals("fragment.xml") ? //$NON-NLS-1$ >- "PLUGIN2" : files[i].getFileExtension(); //$NON-NLS-1$ >- change.setTextType(textType); >+ setChangeTextType(change, files[i]); > edits.add(change); > } > } >@@ -407,7 +402,7 @@ > if (files[i] == null || !files[i].exists()) > continue; > try { >- manager.disconnect(files[i].getFullPath(), LocationKind.IFILE, monitor); >+ manager.disconnect(files[i].getFullPath(), LocationKind.NORMALIZE, monitor); > dc++; > } catch (CoreException e) { > PDEPlugin.log(e); >@@ -417,6 +412,20 @@ > return (TextFileChange[])edits.toArray(new TextFileChange[edits.size()]); > } > >+ public static void setChangeTextType (TextFileChange change, IFile file) { >+ // null guard in case a folder gets passed for whatever reason >+ String name = file.getName(); >+ if (name == null) >+ return; >+ // mark a plugin.xml or a fragment.xml as PLUGIN2 type so they will be compared >+ // with the PluginContentMergeViewer >+ String textType = name.equals("plugin.xml") || //$NON-NLS-1$ >+ name.equals("fragment.xml") ? //$NON-NLS-1$ >+ "PLUGIN2" : file.getFileExtension(); //$NON-NLS-1$ >+ // if the file extension is null, the setTextType method will use type "txt", so no null guard needed >+ change.setTextType(textType); >+ } >+ > private static void modifyEditorModel( > final ModelModification mod, > final PDEFormEditor editor,
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 199149
: 75580