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 122787 Details for
Bug 261025
[Viewers] Changing encoding in compare editor doesn't trigger structured differences recalculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch_v03
261025_v03.txt (text/plain), 6.27 KB, created by
Pawel Pogorzelski
on 2009-01-16 06:23:17 EST
(
hide
)
Description:
Patch_v03
Filename:
MIME Type:
Creator:
Pawel Pogorzelski
Created:
2009-01-16 06:23:17 EST
Size:
6.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java,v >retrieving revision 1.19 >diff -u -r1.19 ResourceEditionNode.java >--- src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java 6 Jan 2009 16:49:54 -0000 1.19 >+++ src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java 16 Jan 2009 11:20:55 -0000 >@@ -37,6 +37,7 @@ > private ICVSRemoteResource resource; > private ResourceEditionNode[] children; > private ISharedDocumentAdapter sharedDocumentAdapter; >+ private IEditorInput editorInput; > > /** > * Creates a new ResourceEditionNode on the given resource edition. >@@ -208,8 +209,11 @@ > private IEditorInput getDocumentKey(Object element) { > try { > if (element == this && getStorage() != null) { >- return new FileRevisionEditorInput(resource >- .getAdapter(IFileRevision.class), getStorage()); >+ if (editorInput == null) { >+ editorInput = new FileRevisionEditorInput(resource >+ .getAdapter(IFileRevision.class), getStorage()); >+ } >+ return editorInput; > } > } catch (TeamException e) { > TeamUIPlugin.log(e); >#P org.eclipse.compare >Index: compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java,v >retrieving revision 1.48 >diff -u -r1.48 StructureDiffViewer.java >--- compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java 3 Jun 2008 13:35:49 -0000 1.48 >+++ compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java 16 Jan 2009 11:21:00 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 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 >@@ -631,8 +631,18 @@ > */ > protected void propertyChange(PropertyChangeEvent event) { > String key= event.getProperty(); >- if (key.equals(CompareConfiguration.IGNORE_WHITESPACE)) >+ if (key.equals(CompareConfiguration.IGNORE_WHITESPACE)) { > diff(); >+ } else if (key.equals("ANCESTOR_ENCODING")) { //$NON-NLS-1$ >+ fAncestorStructure.refresh(new NullProgressMonitor()); >+ diff(); >+ } else if (key.equals("LEFT_ENCODING")) { //$NON-NLS-1$ >+ fLeftStructure.refresh(new NullProgressMonitor()); >+ diff(); >+ } else if (key.equals("RIGHT_ENCODING")) { //$NON-NLS-1$ >+ fRightStructure.refresh(new NullProgressMonitor()); >+ diff(); >+ } > else > super.propertyChange(event); > } >Index: compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java,v >retrieving revision 1.241 >diff -u -r1.241 TextMergeViewer.java >--- compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java 12 Jan 2009 12:33:00 -0000 1.241 >+++ compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java 16 Jan 2009 11:21:00 -0000 >@@ -536,6 +536,9 @@ > } > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.editors.text.IEncodingSupport#setEncoding(java.lang.String) >+ */ > public void setEncoding(String encoding) { > if (fDocumentKey == null || fDocumentProvider == null) { > return; >@@ -553,13 +556,16 @@ > } catch (CoreException e) { > CompareUIPlugin.log(e); > } finally { >- update(true); >+ encodingChanged(fLeg); > } > } > } > } > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.editors.text.IEncodingSupport#getEncoding() >+ */ > public String getEncoding() { > if (fDocumentProvider != null && fDocumentKey != null > && fDocumentProvider instanceof IStorageDocumentProvider) { >@@ -569,6 +575,9 @@ > return null; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.editors.text.IEncodingSupport#getDefaultEncoding() >+ */ > public String getDefaultEncoding() { > if (fDocumentProvider != null && fDocumentKey != null > && fDocumentProvider instanceof IStorageDocumentProvider) { >@@ -579,6 +588,14 @@ > } > > private String internalGetEncoding() { >+ if (fElement instanceof IEncodedStreamContentAccessor) { >+ try { >+ fEncoding = ((IEncodedStreamContentAccessor) fElement) >+ .getCharset(); >+ } catch (CoreException e) { >+ // silently ignored >+ } >+ } > if (fEncoding != null) { > return fEncoding; > } >@@ -1007,7 +1024,7 @@ > // recalculate diffs and update controls > new UIJob(CompareMessages.DocumentMerger_0) { > public IStatus runInUIThread(IProgressMonitor monitor) { >- update(true); >+ encodingChanged(fLeg); > return Status.OK_STATUS; > } > }.schedule(); >@@ -4972,8 +4989,16 @@ > return false; > } > >+ /** >+ * This method returns {@link ITextEditor} used in the >+ * {@link ChangeEncodingAction}. It provides implementation of methods that >+ * are used by the action by delegating them to {@link ContributorInfo} that >+ * corresponds to the side that has focus. >+ * >+ * @return >+ */ > private ITextEditor getTextEditorAdapter() { >- return new ITextEditor () { >+ return new ITextEditor() { > public void close(boolean save) { > // Implementing interface method > } >@@ -5176,4 +5201,22 @@ > } > }; > } >+ >+ private void encodingChanged(char leg) { >+ update(true); >+ String key = null; >+ switch (leg) { >+ case ANCESTOR_CONTRIBUTOR: >+ key = "ANCESTOR_ENCODING"; //$NON-NLS-1$ >+ break; >+ case LEFT_CONTRIBUTOR: >+ key = "LEFT_ENCODING"; //$NON-NLS-1$ >+ break; >+ case RIGHT_CONTRIBUTOR: >+ key = "RIGHT_ENCODING"; //$NON-NLS-1$ >+ break; >+ } >+ getCompareConfiguration().setProperty(key, null); >+ } >+ > }
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
Flags:
pawel.pogorzelski1
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 261025
:
122539
|
122678
| 122787