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

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java (-2 / +6 lines)
Lines 37-42 Link Here
37
	private ICVSRemoteResource resource;
37
	private ICVSRemoteResource resource;
38
	private ResourceEditionNode[] children;
38
	private ResourceEditionNode[] children;
39
	private ISharedDocumentAdapter sharedDocumentAdapter;
39
	private ISharedDocumentAdapter sharedDocumentAdapter;
40
	private IEditorInput editorInput;
40
41
41
	/**
42
	/**
42
	 * Creates a new ResourceEditionNode on the given resource edition.
43
	 * Creates a new ResourceEditionNode on the given resource edition.
Lines 208-215 Link Here
208
	private IEditorInput getDocumentKey(Object element) {
209
	private IEditorInput getDocumentKey(Object element) {
209
		try {
210
		try {
210
			if (element == this && getStorage() != null) {
211
			if (element == this && getStorage() != null) {
211
				return new FileRevisionEditorInput(resource
212
				if (editorInput == null) {
212
						.getAdapter(IFileRevision.class), getStorage());
213
				editorInput = new FileRevisionEditorInput(resource
214
							.getAdapter(IFileRevision.class), getStorage());
215
				}
216
				return editorInput;
213
			}
217
			}
214
		} catch (TeamException e) {
218
		} catch (TeamException e) {
215
			TeamUIPlugin.log(e);
219
			TeamUIPlugin.log(e);
(-)compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java (-2 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 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 631-638 Link Here
631
	 */
631
	 */
632
	protected void propertyChange(PropertyChangeEvent event) {
632
	protected void propertyChange(PropertyChangeEvent event) {
633
		String key= event.getProperty();
633
		String key= event.getProperty();
634
		if (key.equals(CompareConfiguration.IGNORE_WHITESPACE))
634
		if (key.equals(CompareConfiguration.IGNORE_WHITESPACE)) {
635
			diff();
635
			diff();
636
		} else if (key.equals("ANCESTOR_ENCODING")) { //$NON-NLS-1$
637
			fAncestorStructure.refresh(new NullProgressMonitor());
638
			diff();
639
		} else if (key.equals("LEFT_ENCODING")) { //$NON-NLS-1$
640
			fLeftStructure.refresh(new NullProgressMonitor());
641
			diff();
642
		} else if (key.equals("RIGHT_ENCODING")) { //$NON-NLS-1$
643
			fRightStructure.refresh(new NullProgressMonitor());
644
			diff();
645
		}
636
		else
646
		else
637
			super.propertyChange(event);
647
			super.propertyChange(event);
638
	}
648
	}
(-)compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java (-3 / +46 lines)
Lines 536-541 Link Here
536
			}
536
			}
537
		}
537
		}
538
538
539
		/* (non-Javadoc)
540
		 * @see org.eclipse.ui.editors.text.IEncodingSupport#setEncoding(java.lang.String)
541
		 */
539
		public void setEncoding(String encoding) {
542
		public void setEncoding(String encoding) {
540
			if (fDocumentKey == null || fDocumentProvider == null) {
543
			if (fDocumentKey == null || fDocumentProvider == null) {
541
				return;
544
				return;
Lines 553-565 Link Here
553
						} catch (CoreException e) {
556
						} catch (CoreException e) {
554
							CompareUIPlugin.log(e);
557
							CompareUIPlugin.log(e);
555
						} finally {
558
						} finally {
556
							update(true);
559
							encodingChanged(fLeg);
557
						}
560
						}
558
					}
561
					}
559
				}
562
				}
560
			}
563
			}
561
		}
564
		}
562
565
566
		/* (non-Javadoc)
567
		 * @see org.eclipse.ui.editors.text.IEncodingSupport#getEncoding()
568
		 */
563
		public String getEncoding() {
569
		public String getEncoding() {
564
			if (fDocumentProvider != null && fDocumentKey != null
570
			if (fDocumentProvider != null && fDocumentKey != null
565
					&& fDocumentProvider instanceof IStorageDocumentProvider) {
571
					&& fDocumentProvider instanceof IStorageDocumentProvider) {
Lines 569-574 Link Here
569
			return null;
575
			return null;
570
		}
576
		}
571
577
578
		/* (non-Javadoc)
579
		 * @see org.eclipse.ui.editors.text.IEncodingSupport#getDefaultEncoding()
580
		 */
572
		public String getDefaultEncoding() {
581
		public String getDefaultEncoding() {
573
			if (fDocumentProvider != null && fDocumentKey != null
582
			if (fDocumentProvider != null && fDocumentKey != null
574
					&& fDocumentProvider instanceof IStorageDocumentProvider) {
583
					&& fDocumentProvider instanceof IStorageDocumentProvider) {
Lines 579-584 Link Here
579
		}
588
		}
580
589
581
		private String internalGetEncoding() {
590
		private String internalGetEncoding() {
591
			if (fElement instanceof IEncodedStreamContentAccessor) {
592
				try {
593
					fEncoding = ((IEncodedStreamContentAccessor) fElement)
594
							.getCharset();
595
				} catch (CoreException e) {
596
					// silently ignored
597
				}
598
			}
582
			if (fEncoding != null) {
599
			if (fEncoding != null) {
583
				return fEncoding;
600
				return fEncoding;
584
			}
601
			}
Lines 1007-1013 Link Here
1007
				// recalculate diffs and update controls
1024
				// recalculate diffs and update controls
1008
				new UIJob(CompareMessages.DocumentMerger_0) {
1025
				new UIJob(CompareMessages.DocumentMerger_0) {
1009
					public IStatus runInUIThread(IProgressMonitor monitor) {
1026
					public IStatus runInUIThread(IProgressMonitor monitor) {
1010
						update(true);
1027
						encodingChanged(fLeg);
1011
						return Status.OK_STATUS;
1028
						return Status.OK_STATUS;
1012
					}
1029
					}
1013
				}.schedule();
1030
				}.schedule();
Lines 4972-4979 Link Here
4972
		return false;
4989
		return false;
4973
	}
4990
	}
4974
4991
4992
	/**
4993
	 * This method returns {@link ITextEditor} used in the
4994
	 * {@link ChangeEncodingAction}. It provides implementation of methods that
4995
	 * are used by the action by delegating them to {@link ContributorInfo} that
4996
	 * corresponds to the side that has focus.
4997
	 * 
4998
	 * @return
4999
	 */
4975
	private ITextEditor getTextEditorAdapter() {
5000
	private ITextEditor getTextEditorAdapter() {
4976
		return new ITextEditor () {
5001
		return new ITextEditor() {
4977
			public void close(boolean save) {
5002
			public void close(boolean save) {
4978
				// Implementing interface method
5003
				// Implementing interface method
4979
			}
5004
			}
Lines 5176-5179 Link Here
5176
			}
5201
			}
5177
		};
5202
		};
5178
	}
5203
	}
5204
5205
	private void encodingChanged(char leg) {
5206
		update(true);
5207
		String key = null;
5208
		switch (leg) {
5209
		case ANCESTOR_CONTRIBUTOR:
5210
			key = "ANCESTOR_ENCODING"; //$NON-NLS-1$
5211
			break;
5212
		case LEFT_CONTRIBUTOR:
5213
			key = "LEFT_ENCODING"; //$NON-NLS-1$
5214
			break;
5215
		case RIGHT_CONTRIBUTOR:
5216
			key = "RIGHT_ENCODING"; //$NON-NLS-1$
5217
			break;
5218
		}
5219
		getCompareConfiguration().setProperty(key, null);
5220
	}
5221
5179
}
5222
}

Return to bug 261025