Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-12-08 13:31:44 -0500
committerLars Vogel2016-12-08 13:33:05 -0500
commit7bc0f2b7e258f7855e4260f20fe07f2e8265e75b (patch)
tree21daac28d7ccd924201868772c573b2ebed41edd
parentc98b91a62b388046c27ce91943eba202c56f662a (diff)
downloadeclipse.platform.team-7bc0f2b7e258f7855e4260f20fe07f2e8265e75b.tar.gz
eclipse.platform.team-7bc0f2b7e258f7855e4260f20fe07f2e8265e75b.tar.xz
eclipse.platform.team-7bc0f2b7e258f7855e4260f20fe07f2e8265e75b.zip
Bug 508941 - Add @Override and @Deprecated to org.eclipse.compare
This change was done via Cleanup actions. Change-Id: I89fe3a04dbe1ec6fba009d770b8827c0b458efb8 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/BufferedContent.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java18
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/Splitter.java13
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TokenComparator.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AdapterFactory.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BaseCompareAction.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewerCreator.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangePropertyAction.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java11
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorInputNavigator.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorSelectionProvider.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferenceInitializer.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java31
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ContentChangeNotifier.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerCreator.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java58
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java16
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NavigationEndDialog.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NullViewer.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OutlineViewerCreator.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java33
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/SimpleTextViewer.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TabFolderLayout.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextMergeViewerCreator.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextViewerCreator.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/WorkerJob.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DecoratorOverlayIcon.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DiffViewerComparator.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/HunkDiffNode.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java11
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchDiffNode.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchProjectDiffNode.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java25
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/IFilePatch.java4
79 files changed, 536 insertions, 16 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/BufferedContent.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/BufferedContent.java
index 79922a0d9..32ab6cfab 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/BufferedContent.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/BufferedContent.java
@@ -46,6 +46,7 @@ public abstract class BufferedContent implements IContentChangeNotifier, IStream
/* (non-Javadoc)
* see IStreamContentAccessor.getContents
*/
+ @Override
public InputStream getContents() throws CoreException {
if (fContent != null)
return new ByteArrayInputStream(fContent);
@@ -101,6 +102,7 @@ public abstract class BufferedContent implements IContentChangeNotifier, IStream
/* (non-Javadoc)
* see IContentChangeNotifier.addChangeListener
*/
+ @Override
public void addContentChangeListener(IContentChangeListener listener) {
if (fChangeNotifier == null)
fChangeNotifier= new ContentChangeNotifier(this);
@@ -110,6 +112,7 @@ public abstract class BufferedContent implements IContentChangeNotifier, IStream
/* (non-Javadoc)
* see IContentChangeNotifier.removeChangeListener
*/
+ @Override
public void removeContentChangeListener(IContentChangeListener listener) {
if (fChangeNotifier != null) {
fChangeNotifier.removeContentChangeListener(listener);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
index fb90e0ace..f5e5087ba 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareUI.java
@@ -275,6 +275,7 @@ public final class CompareUI {
* @deprecated Clients should obtain an <code>org.eclipse.team.core.mapping.IStorageMerger</code> from the
* <code>org.eclipse.team.core.Team#createMerger(IContentType)</code> method.
*/
+ @Deprecated
public static IStreamMerger createStreamMerger(IContentType type) {
return CompareUIPlugin.getDefault().createStreamMerger(type);
}
@@ -289,6 +290,7 @@ public final class CompareUI {
* @deprecated Clients should obtain an <code>org.eclipse.team.core.mapping.IStorageMerger</code> from the
* <code>org.eclipse.team.core.Team#createMerger(String)</code> method.
*/
+ @Deprecated
public static IStreamMerger createStreamMerger(String type) {
return CompareUIPlugin.getDefault().createStreamMerger(type);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
index 7d87b3e93..952b75336 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/EditionSelectionDialog.java
@@ -102,6 +102,7 @@ import org.eclipse.compare.structuremergeviewer.IStructureCreator;
* For sub-file elements, a <code>org.eclipse.team.ui.history.ElementLocalHistoryPageSource</code> can be used.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class EditionSelectionDialog extends ResizableDialog {
/**
@@ -157,6 +158,7 @@ public class EditionSelectionDialog extends ResizableDialog {
return fContent;
}
+ @Override
public boolean equals(Object other) {
if (other != null && other.getClass() == getClass()) {
if (getContent().equals(((Pair)other).getContent()))
@@ -165,6 +167,7 @@ public class EditionSelectionDialog extends ResizableDialog {
return super.equals(other);
}
+ @Override
public int hashCode() {
return getContent().hashCode();
}
@@ -251,6 +254,7 @@ public class EditionSelectionDialog extends ResizableDialog {
fCompareConfiguration.setLeftEditable(false);
fCompareConfiguration.setRightEditable(false);
fCompareConfiguration.setContainer(new CompareContainer() {
+ @Override
public void setStatusMessage(String message) {
if (statusLabel != null && !statusLabel.isDisposed()) {
if (message == null) {
@@ -271,6 +275,7 @@ public class EditionSelectionDialog extends ResizableDialog {
* @param contextId the help context id.
* @since 3.2
*/
+ @Override
public void setHelpContextId(String contextId) {
super.setHelpContextId(contextId);
}
@@ -425,6 +430,7 @@ public class EditionSelectionDialog extends ResizableDialog {
// construct the comparer thread
// and perform the background extract
fThread= new Thread() {
+ @Override
public void run() {
// from front (newest) to back (oldest)
@@ -474,6 +480,7 @@ public class EditionSelectionDialog extends ResizableDialog {
// construct the comparer thread
// and perform the background extract
fThread= new Thread() {
+ @Override
public void run() {
// from front (newest) to back (oldest)
@@ -740,6 +747,7 @@ public class EditionSelectionDialog extends ResizableDialog {
/* (non Javadoc)
* Creates SWT control tree.
*/
+ @Override
protected synchronized Control createDialogArea(Composite parent2) {
Composite parent= (Composite) super.createDialogArea(parent2);
@@ -752,6 +760,7 @@ public class EditionSelectionDialog extends ResizableDialog {
vsplitter.addDisposeListener(
new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fCompareConfiguration != null) {
fCompareConfiguration.dispose();
@@ -782,6 +791,7 @@ public class EditionSelectionDialog extends ResizableDialog {
fMemberTable= new Table(fMemberPane, flags);
fMemberTable.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (e.detail == SWT.CHECK) {
if (e.item instanceof TableItem) {
@@ -813,6 +823,7 @@ public class EditionSelectionDialog extends ResizableDialog {
fEditionPane= new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT);
fStructuredComparePane= new CompareViewerSwitchingPane(hsplitter, SWT.BORDER | SWT.FLAT, true) {
+ @Override
protected Viewer getViewer(Viewer oldViewer, Object input) {
if (input instanceof ICompareInput)
return CompareUI.findStructureViewer(oldViewer, (ICompareInput)input, this, getCompareConfiguration());
@@ -821,6 +832,7 @@ public class EditionSelectionDialog extends ResizableDialog {
};
fStructuredComparePane.addSelectionChangedListener(
new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent e) {
feedInput2(e.getSelection());
}
@@ -845,6 +857,7 @@ public class EditionSelectionDialog extends ResizableDialog {
// public void widgetDefaultSelected(SelectionEvent e) {
// handleDefaultSelected();
// }
+ @Override
public void widgetSelected(SelectionEvent e) {
feedInput(e.item);
}
@@ -859,6 +872,7 @@ public class EditionSelectionDialog extends ResizableDialog {
}
fContentPane= new CompareViewerSwitchingPane(vsplitter, SWT.BORDER | SWT.FLAT) {
+ @Override
protected Viewer getViewer(Viewer oldViewer, Object input) {
return CompareUI.findContentViewer(oldViewer, input, this, getCompareConfiguration());
}
@@ -875,6 +889,7 @@ public class EditionSelectionDialog extends ResizableDialog {
/* (non-Javadoc)
* Method declared on Dialog.
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
String buttonLabel= Utilities.getString(fBundle, "buttonLabel", IDialogConstants.OK_LABEL); //$NON-NLS-1$
if (fCompareMode) {
@@ -892,6 +907,7 @@ public class EditionSelectionDialog extends ResizableDialog {
* Overidden to disable dismiss on double click in compare mode.
* @since 2.0
*/
+ @Override
protected void okPressed() {
if (fCompareMode) {
// don't dismiss dialog
@@ -909,6 +925,7 @@ public class EditionSelectionDialog extends ResizableDialog {
Display display= fEditionTree.getDisplay();
display.asyncExec(
new Runnable() {
+ @Override
public void run() {
addMemberEdition(pair);
}
@@ -919,6 +936,7 @@ public class EditionSelectionDialog extends ResizableDialog {
private static void internalSort(IModificationDate[] keys) {
Arrays.sort(keys, new Comparator() {
+ @Override
public int compare(Object o1, Object o2) {
IModificationDate d1= (IModificationDate) o1;
IModificationDate d2= (IModificationDate) o2;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
index 71bf31e97..e6cf0f1b1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
@@ -54,6 +54,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* see ITypedElement.getName
*/
+ @Override
public String getName() {
return fBase.getName();
}
@@ -61,6 +62,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* see ITypedElement.getImage
*/
+ @Override
public Image getImage() {
return fBase.getImage();
}
@@ -68,6 +70,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* see ITypedElement.getType
*/
+ @Override
public String getType() {
return fBase.getType();
}
@@ -75,6 +78,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* see IModificationDate.getModificationDate
*/
+ @Override
public long getModificationDate() {
return fFileState.getModificationTime();
}
@@ -82,6 +86,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* see IStreamContentAccessor.getContents
*/
+ @Override
public InputStream getContents() throws CoreException {
return new BufferedInputStream(fFileState.getContents());
}
@@ -89,6 +94,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* @see org.eclipse.compare.IEncodedStreamContentAccessor#getCharset()
*/
+ @Override
public String getCharset() throws CoreException {
String charset= fFileState.getCharset();
if (charset == null) {
@@ -102,6 +108,7 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
/* (non-Javadoc)
* @see org.eclipse.compare.internal.IResourceProvider#getResource()
*/
+ @Override
public IResource getResource() {
IPath fullPath= fFileState.getFullPath();
return ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java
index aaa6eb4c0..ef5c32175 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/IStreamMerger.java
@@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IStatus;
* @deprecated Clients should use <code>org.eclipse.team.core.mapping.IStorageMerger</code> instead.
* @since 3.0
*/
+@Deprecated
public interface IStreamMerger {
/**
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
index a1e2983ff..357975c92 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/NavigationAction.java
@@ -57,6 +57,7 @@ public class NavigationAction extends Action {
fNext= next;
}
+ @Override
public void run() {
if (fCompareEditorInput != null) {
Object adapter= fCompareEditorInput.getAdapter(ICompareNavigator.class);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
index f0badb491..2c81d63aa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
@@ -52,6 +52,7 @@ public class ResourceNode extends BufferedContent
*
* @return the corresponding resource
*/
+ @Override
public IResource getResource() {
return fResource;
}
@@ -59,6 +60,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see IStreamContentAccessor.getContents
*/
+ @Override
public InputStream getContents() throws CoreException {
if (fResource instanceof IStorage)
return super.getContents();
@@ -68,6 +70,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see IModificationDate.getModificationDate
*/
+ @Override
public long getModificationDate() {
return fResource.getLocalTimeStamp();
}
@@ -75,6 +78,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see ITypedElement.getName
*/
+ @Override
public String getName() {
if (fResource != null)
return fResource.getName();
@@ -84,6 +88,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see ITypedElement.getType
*/
+ @Override
public String getType() {
if (fResource instanceof IContainer)
return ITypedElement.FOLDER_TYPE;
@@ -98,6 +103,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see ITypedElement.getImage
*/
+ @Override
public Image getImage() {
return CompareUI.getImage(fResource);
}
@@ -106,6 +112,7 @@ public class ResourceNode extends BufferedContent
* Returns <code>true</code> if the other object is of type <code>ITypedElement</code>
* and their names are identical. The content is not considered.
*/
+ @Override
public boolean equals(Object other) {
if (other instanceof ITypedElement) {
String otherName= ((ITypedElement)other).getName();
@@ -118,6 +125,7 @@ public class ResourceNode extends BufferedContent
* Returns the hash code of the name.
* @return a hash code value for this object.
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
@@ -125,6 +133,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see IStructureComparator.getChildren
*/
+ @Override
public Object[] getChildren() {
if (fChildren == null) {
fChildren= new ArrayList();
@@ -165,6 +174,7 @@ public class ResourceNode extends BufferedContent
* @return a buffered input stream containing the contents of this storage
* @exception CoreException if the contents of this storage could not be accessed
*/
+ @Override
protected InputStream createStream() throws CoreException {
if (fResource instanceof IStorage) {
InputStream is= null;
@@ -187,6 +197,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see IEditableContent.isEditable
*/
+ @Override
public boolean isEditable() {
return true;
}
@@ -194,6 +205,7 @@ public class ResourceNode extends BufferedContent
/* (non Javadoc)
* see IEditableContent.replace
*/
+ @Override
public ITypedElement replace(ITypedElement child, ITypedElement other) {
return child;
}
@@ -201,6 +213,7 @@ public class ResourceNode extends BufferedContent
/* (non-Javadoc)
* @see org.eclipse.compare.IEncodedStreamContentAccessor#getCharset()
*/
+ @Override
public String getCharset() {
return Utilities.getCharset(fResource);
}
@@ -208,6 +221,7 @@ public class ResourceNode extends BufferedContent
/* (non-Javadoc)
* @see org.eclipse.compare.IEditableContentExtension#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
if (fResource.getType() == IResource.FILE) {
ResourceAttributes attrs = fResource.getResourceAttributes();
@@ -221,6 +235,7 @@ public class ResourceNode extends BufferedContent
/* (non-Javadoc)
* @see org.eclipse.compare.IEditableContentExtension#validateEdit(org.eclipse.swt.widgets.Shell)
*/
+ @Override
public IStatus validateEdit(Shell shell) {
if (isReadOnly())
return ResourcesPlugin.getWorkspace().validateEdit(new IFile[] { (IFile)fResource}, shell);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/Splitter.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/Splitter.java
index 57988e425..62d6d497a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/Splitter.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/Splitter.java
@@ -11,8 +11,10 @@
*******************************************************************************/
package org.eclipse.compare;
-import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Sash;
/**
* The Splitter adds support for nesting to a SashForm.
@@ -90,6 +92,7 @@ public class Splitter extends SashForm {
* Recursively calls setMaximizedControl for all direct parents that are
* itself Splitters.
*/
+ @Override
public void setMaximizedControl(Control control) {
if (control == null || control == getMaximizedControl())
super.setMaximizedControl(null);
@@ -100,8 +103,8 @@ public class Splitter extends SashForm {
Composite parent= getParent();
if (parent instanceof Splitter)
((Splitter) parent).setMaximizedControl(this);
- else
- layout(true);
+
+ layout(true);
}
/* (non-Javadoc)
@@ -109,8 +112,8 @@ public class Splitter extends SashForm {
*/
private boolean isEmpty() {
Control[] controls= getChildren();
- for (int i= 0; i < controls.length; i++)
- if (isVisible(controls[i]))
+ for (Control control : controls)
+ if (isVisible(control))
return false;
return true;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
index 8319535b1..260ba9952 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
@@ -50,10 +50,12 @@ public class ZipFileStructureCreator implements IStructureCreator {
fName= name;
}
+ @Override
public String getName() {
return fName;
}
+ @Override
public Image getImage() {
return CompareUI.getImage(getType());
}
@@ -62,12 +64,14 @@ public class ZipFileStructureCreator implements IStructureCreator {
* Returns true if other is ITypedElement and names are equal.
* @see IComparator#equals
*/
+ @Override
public boolean equals(Object other) {
if (other instanceof ITypedElement)
return fName.equals(((ITypedElement) other).getName());
return super.equals(other);
}
+ @Override
public int hashCode() {
return fName.hashCode();
}
@@ -81,10 +85,12 @@ public class ZipFileStructureCreator implements IStructureCreator {
super(name);
}
+ @Override
public String getType() {
return ITypedElement.FOLDER_TYPE;
}
+ @Override
public Object[] getChildren() {
Object[] children= new Object[fChildren.size()];
Iterator iter= fChildren.values().iterator();
@@ -136,6 +142,7 @@ public class ZipFileStructureCreator implements IStructureCreator {
super(name);
}
+ @Override
public String getType() {
String s= this.getName();
int pos= s.lastIndexOf('.');
@@ -144,10 +151,12 @@ public class ZipFileStructureCreator implements IStructureCreator {
return ITypedElement.UNKNOWN_TYPE;
}
+ @Override
public Object[] getChildren() {
return null;
}
+ @Override
public InputStream getContents() {
if (fContents == null)
fContents= new byte[0];
@@ -194,10 +203,12 @@ public class ZipFileStructureCreator implements IStructureCreator {
fTitle= title;
}
+ @Override
public String getName() {
return fTitle;
}
+ @Override
public IStructureComparator getStructure(Object input) {
InputStream is= null;
@@ -264,6 +275,7 @@ public class ZipFileStructureCreator implements IStructureCreator {
return root;
}
+ @Override
public String getContents(Object o, boolean ignoreWhitespace) {
if (o instanceof ZipFile) {
byte[] bytes= ((ZipFile)o).getBytes();
@@ -290,10 +302,12 @@ public class ZipFileStructureCreator implements IStructureCreator {
* @param structure the node for which to save the new content
* @param input the object from which the structure tree was created in <code>getStructure</code>
*/
+ @Override
public void save(IStructureComparator structure, Object input) {
Assert.isTrue(false); // Cannot update zip archive
}
+ @Override
public IStructureComparator locate(Object path, Object source) {
return null;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TokenComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TokenComparator.java
index 1ceed1234..dc5aab797 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TokenComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TokenComparator.java
@@ -71,6 +71,7 @@ public class TokenComparator implements ITokenComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#getRangeCount()
*/
+ @Override
public int getRangeCount() {
return fCount;
}
@@ -78,6 +79,7 @@ public class TokenComparator implements ITokenComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.contentmergeviewer.ITokenComparator#getTokenStart(int)
*/
+ @Override
public int getTokenStart(int index) {
if (index < fCount)
return fStarts[index];
@@ -87,6 +89,7 @@ public class TokenComparator implements ITokenComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.contentmergeviewer.ITokenComparator#getTokenLength(int)
*/
+ @Override
public int getTokenLength(int index) {
if (index < fCount)
return fLengths[index];
@@ -96,6 +99,7 @@ public class TokenComparator implements ITokenComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#rangesEqual(int, org.eclipse.compare.rangedifferencer.IRangeComparator, int)
*/
+ @Override
public boolean rangesEqual(int thisIndex, IRangeComparator other, int otherIndex) {
if (other != null && getClass() == other.getClass()) {
TokenComparator tc= (TokenComparator) other;
@@ -110,6 +114,7 @@ public class TokenComparator implements ITokenComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#skipRangeComparison(int, int, org.eclipse.compare.rangedifferencer.IRangeComparator)
*/
+ @Override
public boolean skipRangeComparison(int length, int max, IRangeComparator other) {
if (getRangeCount() < 50 || other.getRangeCount() < 50)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
index 24f7ea9df..0e38354a9 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
@@ -18,22 +18,27 @@ import org.eclipse.jface.viewers.Viewer;
public abstract class AbstractViewer extends Viewer {
+ @Override
public void setInput(Object input) {
// empty default implementation
}
+ @Override
public Object getInput() {
return null;
}
+ @Override
public ISelection getSelection() {
return StructuredSelection.EMPTY;
}
+ @Override
public void setSelection(ISelection s, boolean reveal) {
// empty default implementation
}
+ @Override
public void refresh() {
// empty default implementation
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AdapterFactory.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AdapterFactory.java
index 18ab4fd3a..76b93723a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AdapterFactory.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AdapterFactory.java
@@ -20,10 +20,12 @@ import org.eclipse.ui.IFileEditorInput;
public class AdapterFactory implements IAdapterFactory {
+ @Override
public Object getAdapter(final Object adaptableObject, Class adapterType) {
if (IContributorResourceAdapter.class.equals(adapterType)
&& adaptableObject instanceof CompareEditorInput) {
return new IContributorResourceAdapter() {
+ @Override
public IResource getAdaptedResource(IAdaptable adaptable) {
Object ei = ((CompareEditorInput) adaptableObject)
.getAdapter(IEditorInput.class);
@@ -37,6 +39,7 @@ public class AdapterFactory implements IAdapterFactory {
return null;
}
+ @Override
public Class[] getAdapterList() {
return new Class[] { IContributorResourceAdapter.class };
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
index 3215be92f..1e96f9e42 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
@@ -32,10 +32,12 @@ public class AddFromHistoryAction extends BaseCompareAction {
// empty default implementation
}
+ @Override
protected boolean isEnabled(ISelection selection) {
return Utilities.getResources(selection).length == 1;
}
+ @Override
protected void run(ISelection selection) {
ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
@@ -113,6 +115,7 @@ public class AddFromHistoryAction extends BaseCompareAction {
throws InvocationTargetException, InterruptedException {
WorkspaceModifyOperation operation= new WorkspaceModifyOperation() {
+ @Override
public void execute(IProgressMonitor pm) throws InvocationTargetException {
try {
String taskName= Utilities.getString(bundle, "taskName"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
index 05715989c..dc6a7b984 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
@@ -45,9 +45,11 @@ public class AddFromHistoryDialog extends ResizableDialog {
fFile= file;
fFileState= fileState;
}
+ @Override
public InputStream getContents() throws CoreException {
return new BufferedInputStream(fFileState.getContents());
}
+ @Override
public String getCharset() {
String charset= null;
try {
@@ -59,15 +61,19 @@ public class AddFromHistoryDialog extends ResizableDialog {
charset= Utilities.getCharset(fFile);
return charset;
}
+ @Override
public String getName() {
return fFile.getName();
}
+ @Override
public String getType() {
return fFile.getFileExtension();
}
+ @Override
public Image getImage() {
return CompareUI.getImage(fFile);
}
+ @Override
public long getModificationDate() {
return fFileState.getModificationTime();
}
@@ -201,6 +207,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
return selected;
}
+ @Override
protected synchronized Control createDialogArea(Composite parent2) {
Composite parent= (Composite) super.createDialogArea(parent2);
@@ -213,6 +220,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
vsplitter.addDisposeListener(
new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fDateImage != null)
fDateImage.dispose();
@@ -241,6 +249,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
fMemberTable= new Table(fMemberPane, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL);
fMemberTable.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (e.detail == SWT.CHECK) {
if (e.item instanceof TableItem) {
@@ -278,6 +287,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
fEditionTree= new Tree(fEditionPane, SWT.H_SCROLL | SWT.V_SCROLL);
fEditionTree.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
feedContent(e.item);
}
@@ -287,6 +297,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
applyDialogFont(parent); // to avoid applying font to compare viewer
fContentPane= new CompareViewerSwitchingPane(vsplitter, SWT.BORDER | SWT.FLAT) {
+ @Override
protected Viewer getViewer(Viewer oldViewer, Object input) {
return CompareUI.findContentViewer(oldViewer, input, this, fCompareConfiguration);
}
@@ -427,6 +438,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
/* (non-Javadoc)
* Method declared on Dialog.
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
String buttonLabel= Utilities.getString(fBundle, "buttonLabel", IDialogConstants.OK_LABEL); //$NON-NLS-1$
// a 'Cancel' and a 'Add' button
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BaseCompareAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BaseCompareAction.java
index beaff9d30..cc222640e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BaseCompareAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BaseCompareAction.java
@@ -22,6 +22,7 @@ public abstract class BaseCompareAction implements IActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
final public void run(IAction action) {
run(fSelection);
}
@@ -29,6 +30,7 @@ public abstract class BaseCompareAction implements IActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
final public void selectionChanged(IAction action, ISelection selection) {
fSelection= selection;
if (action != null)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewerCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewerCreator.java
index 45538ba29..59eb8faba 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewerCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BinaryCompareViewerCreator.java
@@ -23,6 +23,7 @@ import org.eclipse.compare.*;
*/
public class BinaryCompareViewerCreator implements IViewerCreator {
+ @Override
public Viewer createViewer(Composite parent, CompareConfiguration mp) {
return new BinaryCompareViewer(parent, mp);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
index aea48782b..2af3acd31 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
@@ -31,6 +31,7 @@ public abstract class BufferedCanvas extends Canvas {
addPaintListener(
new PaintListener() {
+ @Override
public void paintControl(PaintEvent event) {
doubleBufferPaint(event.gc);
}
@@ -39,6 +40,7 @@ public abstract class BufferedCanvas extends Canvas {
addDisposeListener(
new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fBuffer != null) {
fBuffer.dispose();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
index 582aa099d..39f320f3a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
@@ -41,10 +41,12 @@ public class BufferedResourceNode extends ResourceNode {
return fDirty;
}
+ @Override
protected IStructureComparator createChild(IResource child) {
return new BufferedResourceNode(child);
}
+ @Override
public void setContent(byte[] contents) {
fDirty= true;
super.setContent(contents);
@@ -85,6 +87,7 @@ public class BufferedResourceNode extends ResourceNode {
}
}
+ @Override
public ITypedElement replace(ITypedElement child, ITypedElement other) {
if (child == null) { // add resource
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
index 609353517..8d1222f15 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangeCompareFilterPropertyAction.java
@@ -83,12 +83,14 @@ public class ChangeCompareFilterPropertyAction extends Action implements
return filters.containsKey(fCompareFilterDescriptor.getFilterId());
}
+ @Override
public void run() {
boolean b = !getProperty();
setChecked(b);
setProperty(b);
}
+ @Override
public void setChecked(boolean state) {
super.setChecked(state);
Utilities.initToggleAction(this, fBundle, fPrefix, state);
@@ -103,6 +105,7 @@ public class ChangeCompareFilterPropertyAction extends Action implements
setChecked(getProperty());
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(COMPARE_FILTERS)
&& event.getNewValue() instanceof Map) {
@@ -116,6 +119,7 @@ public class ChangeCompareFilterPropertyAction extends Action implements
fCompareConfiguration.removePropertyChangeListener(this);
}
+ @Override
public void widgetDisposed(DisposeEvent e) {
dispose();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangePropertyAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangePropertyAction.java
index bdea732b0..8a8b872c6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangePropertyAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ChangePropertyAction.java
@@ -45,6 +45,7 @@ public class ChangePropertyAction extends Action implements IPropertyChangeListe
setCompareConfiguration(cc);
}
+ @Override
public void run() {
boolean b= !Utilities.getBoolean(fCompareConfiguration, fPropertyKey, false);
setChecked(b);
@@ -52,6 +53,7 @@ public class ChangePropertyAction extends Action implements IPropertyChangeListe
fCompareConfiguration.setProperty(fPropertyKey, Boolean.valueOf(b));
}
+ @Override
public void setChecked(boolean state) {
super.setChecked(state);
Utilities.initToggleAction(this, fBundle, fPrefix, state);
@@ -66,6 +68,7 @@ public class ChangePropertyAction extends Action implements IPropertyChangeListe
setChecked(Utilities.getBoolean(fCompareConfiguration, fPropertyKey, false));
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(fPropertyKey)) {
setChecked(Utilities.getBoolean(fCompareConfiguration, fPropertyKey, false));
@@ -77,6 +80,7 @@ public class ChangePropertyAction extends Action implements IPropertyChangeListe
fCompareConfiguration.removePropertyChangeListener(this);
}
+ @Override
public void widgetDisposed(DisposeEvent e) {
dispose();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java
index 54c30e356..7759ff513 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java
@@ -31,6 +31,7 @@ public class CompareAction extends BaseCompareAction implements IObjectActionDel
protected IWorkbenchPage fWorkbenchPage;
protected boolean showSelectAncestorDialog = true;
+ @Override
public void run(ISelection selection) {
if (fInput != null) {
// Pass the shell so setSelection can prompt the user for which
@@ -44,6 +45,7 @@ public class CompareAction extends BaseCompareAction implements IObjectActionDel
}
}
+ @Override
protected boolean isEnabled(ISelection selection) {
if (fInput == null) {
CompareConfiguration cc= new CompareConfiguration();
@@ -59,6 +61,7 @@ public class CompareAction extends BaseCompareAction implements IObjectActionDel
return fInput.isEnabled(selection);
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
fWorkbenchPage= targetPart.getSite().getPage();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
index 59c19608d..fbd0708d5 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareContainer.java
@@ -29,6 +29,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#setStatusMessage(java.lang.String)
*/
+ @Override
public void setStatusMessage(String message) {
// Do nothing, by default
}
@@ -36,6 +37,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#addCompareInputChangeListener(org.eclipse.compare.structuremergeviewer.ICompareInput, org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener)
*/
+ @Override
public void addCompareInputChangeListener(ICompareInput input,
ICompareInputChangeListener listener) {
input.addCompareInputChangeListener(listener);
@@ -44,6 +46,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#removeCompareInputChangeListener(org.eclipse.compare.structuremergeviewer.ICompareInput, org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener)
*/
+ @Override
public void removeCompareInputChangeListener(ICompareInput input,
ICompareInputChangeListener listener) {
input.removeCompareInputChangeListener(listener);
@@ -52,6 +55,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#registerContextMenu(org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider)
*/
+ @Override
public void registerContextMenu(MenuManager menu,
ISelectionProvider selectionProvider) {
// Nothing to do
@@ -60,6 +64,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#getServiceLocator()
*/
+ @Override
public IServiceLocator getServiceLocator() {
return null;
}
@@ -67,6 +72,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#getActionBars()
*/
+ @Override
public IActionBars getActionBars() {
return null;
}
@@ -74,6 +80,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
*/
+ @Override
public void run(boolean fork, boolean cancelable,
IRunnableWithProgress runnable)
throws InvocationTargetException, InterruptedException {
@@ -83,6 +90,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#getNavigator()
*/
+ @Override
public ICompareNavigator getNavigator() {
return null;
}
@@ -90,6 +98,7 @@ public class CompareContainer implements ICompareContainer {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#runAsynchronously(org.eclipse.jface.operation.IRunnableWithProgress)
*/
+ @Override
public synchronized void runAsynchronously(IRunnableWithProgress runnable) {
if (worker == null)
worker = createWorkerJob();
@@ -105,6 +114,7 @@ public class CompareContainer implements ICompareContainer {
return CompareMessages.CompareContainer_0;
}
+ @Override
public IWorkbenchPart getWorkbenchPart() {
return null;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
index aff33c041..445a14318 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java
@@ -52,6 +52,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
*/
+ @Override
public void run(boolean fork, boolean cancelable,
IRunnableWithProgress runnable) throws InvocationTargetException,
InterruptedException {
@@ -62,6 +63,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareContainer#setStatusMessage(java.lang.String)
*/
+ @Override
public void setStatusMessage(String message) {
if (statusLabel != null && !statusLabel.isDisposed()) {
if (message == null) {
@@ -88,6 +90,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.compare.internal.ResizableDialog#close()
*/
+ @Override
public boolean close() {
if (super.close()) {
if (fCompareEditorInput != null)
@@ -100,6 +103,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
fCommitButton= createButton(parent, IDialogConstants.OK_ID, getOKButtonLabel(), true);
fCommitButton.setEnabled(isOKEnabled());
@@ -141,6 +145,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(CompareEditorInput.DIRTY_STATE)
|| event.getProperty().equals(CompareEditorInput.PROP_SELECTED_EDITION)) {
@@ -168,6 +173,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent2) {
Composite parent= (Composite) super.createDialogArea(parent2);
@@ -188,6 +194,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#open()
*/
+ @Override
public int open() {
// Before opening, set the container of the input and listen
// for changes to the input
@@ -199,6 +206,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == OK) {
if (!fCompareEditorInput.okPressed())
@@ -212,6 +220,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings compareSettings = CompareUIPlugin.getDefault().getDialogSettings();
String sectionName = this.getClass().getName();
@@ -226,6 +235,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.compare.internal.ResizableDialog#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
if (getHelpContextId() != null)
@@ -245,6 +255,7 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
*/
+ @Override
protected Point getInitialSize() {
Point initialSize = super.getInitialSize();
if (hasSettings) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index 2c8fe0ede..609296e12 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -71,6 +71,7 @@ public class CompareEditorContributor extends EditorActionBarContributor {
/*
* @see EditorActionBarContributor#contributeToToolBar(IToolBarManager)
*/
+ @Override
public void contributeToToolBar(IToolBarManager tbm) {
tbm.add(new Separator(FILTER_SEPARATOR));
tbm.add(new Separator(BUILTIN_SEPARATOR));
@@ -82,10 +83,12 @@ public class CompareEditorContributor extends EditorActionBarContributor {
/*
* @see EditorActionBarContributor#contributeToMenu(IMenuManager)
*/
+ @Override
public void contributeToMenu(IMenuManager menuManager) {
// empty implementation
}
+ @Override
public void setActiveEditor(IEditorPart targetEditor) {
if (fActiveEditorPart == targetEditor)
@@ -182,6 +185,7 @@ public class CompareEditorContributor extends EditorActionBarContributor {
}
}
+ @Override
public void dispose() {
setActiveEditor(null);
super.dispose();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorInputNavigator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorInputNavigator.java
index 07c8c9e3f..8127c1498 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorInputNavigator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorInputNavigator.java
@@ -44,6 +44,7 @@ public class CompareEditorInputNavigator extends CompareNavigator {
return fPanes;
}
+ @Override
protected INavigatable[] getNavigatables() {
List result = new ArrayList();
Object[] panes = getPanes();
@@ -59,6 +60,7 @@ public class CompareEditorInputNavigator extends CompareNavigator {
/* (non-Javadoc)
* @see org.eclipse.compare.ICompareNavigator#selectChange(boolean)
*/
+ @Override
public boolean selectChange(boolean next) {
// Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
if (next && fNextFirstTime && mustOpen()) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorSelectionProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorSelectionProvider.java
index 1d71169d7..fc8702d28 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorSelectionProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorSelectionProvider.java
@@ -43,6 +43,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see ISelectionChangedListener#selectionChanged
*/
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
doSelectionChanged(event);
}
@@ -50,7 +51,8 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see FocusListener#focusGained
*/
- public void focusGained(FocusEvent e) {
+ @Override
+ public void focusGained(FocusEvent e) {
// expecting a StyledText widget here
doFocusChanged(e.widget);
}
@@ -58,13 +60,15 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see FocusListener#focusLost
*/
- public void focusLost(FocusEvent e) {
+ @Override
+ public void focusLost(FocusEvent e) {
// do not reset due to focus behavior on GTK
//fViewerInFocus= null;
}
}
private class InternalPostSelectionListener implements ISelectionChangedListener {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
doPostSelectionChanged(event);
}
@@ -160,6 +164,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see ISelectionProvider#addSelectionChangedListener
*/
+ @Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.add(listener);
}
@@ -167,6 +172,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see ISelectionProvider#removeSelectionChangedListener
*/
+ @Override
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.remove(listener);
}
@@ -174,6 +180,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IPostSelectionProvider#addPostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
*/
+ @Override
public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
fPostSelectionChangedListeners.add(listener);
}
@@ -182,6 +189,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IPostSelectionProvider#removePostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
*/
+ @Override
public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
fPostSelectionChangedListeners.remove(listener);
}
@@ -189,6 +197,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see ISelectionProvider#getSelection
*/
+ @Override
public ISelection getSelection() {
if (fViewerInFocus != null) {
return fViewerInFocus.getSelection();
@@ -199,6 +208,7 @@ public class CompareEditorSelectionProvider implements IPostSelectionProvider {
/*
* @see ISelectionProvider#setSelection
*/
+ @Override
public void setSelection(ISelection selection) {
setSelection(selection, true);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
index bfddb2e80..aaefb69b3 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilterDescriptor.java
@@ -47,10 +47,12 @@ public class CompareFilterDescriptor {
this.keySet = configuration.getAttributeNames();
}
+ @Override
public boolean hasMoreElements() {
return cursor >= keySet.length;
}
+ @Override
public Object nextElement() {
return keySet[cursor++];
}
@@ -60,10 +62,12 @@ public class CompareFilterDescriptor {
public CompareFilterDescriptor(IConfigurationElement config) {
fConfiguration = config;
fResourceBundle = new ResourceBundle() {
+ @Override
protected Object handleGetObject(String key) {
return fConfiguration.getAttribute(key);
}
+ @Override
public Enumeration getKeys() {
return new ConfigurationKeysEnumeration(fConfiguration);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferenceInitializer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferenceInitializer.java
index 4c23792ed..700b03967 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferenceInitializer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferenceInitializer.java
@@ -19,6 +19,7 @@ public class ComparePreferenceInitializer extends AbstractPreferenceInitializer
// Nothing to do
}
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
ComparePreferencePage.initDefaults(store);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index ec37c74c3..3c0d74e2b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -68,18 +68,23 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
FakeInput(String name) {
fContent= loadPreviewContentFromFile(name);
}
+ @Override
public Image getImage() {
return null;
}
+ @Override
public String getName() {
return "no name"; //$NON-NLS-1$
}
+ @Override
public String getType() {
return "no type"; //$NON-NLS-1$
}
+ @Override
public InputStream getContents() {
return new ByteArrayInputStream(Utilities.getBytes(fContent, UTF_16));
}
+ @Override
public String getCharset() {
return UTF_16;
}
@@ -170,6 +175,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
fOverlayStore= new OverlayPreferenceStore(getPreferenceStore(), fKeys);
fPreferenceChangeListener= new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String key= event.getProperty();
if (key.equals(INITIALLY_SHOW_ANCESTOR_PANE)) {
@@ -186,6 +192,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
/*
* @see IWorkbenchPreferencePage#init()
*/
+ @Override
public void init(IWorkbench workbench) {
// empty
}
@@ -193,6 +200,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
/*
* @see PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
fOverlayStore.setValue(ADDED_LINES_REGEX, addedLinesRegex.getText());
fOverlayStore.setValue(REMOVED_LINES_REGEX, removedLinesRegex.getText());
@@ -209,6 +217,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
/*
* @see PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
fOverlayStore.loadDefaults();
@@ -220,6 +229,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
/*
* @see DialogPage#dispose()
*/
+ @Override
public void dispose() {
if (fOverlayStore != null) {
@@ -247,6 +257,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
/*
* @see PreferencePage#createContents(Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICompareContextIds.COMPARE_PREFERENCE_PAGE);
@@ -333,6 +344,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
fFilters.setText(fOverlayStore.getString(PATH_FILTER));
fFilters.addModifyListener(
new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
String filters= fFilters.getText();
String message= CompareResourceFilter.validateResourceFilters(filters);
@@ -427,6 +439,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
Control c= fPreviewViewer.getControl();
c.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fCompareConfiguration != null)
fCompareConfiguration.dispose();
@@ -470,6 +483,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
if (fCheckBoxListener == null) {
fCheckBoxListener= new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Button button= (Button) e.widget;
fOverlayStore.setValue(fCheckBoxes.get(button), button.getSelection());
@@ -498,6 +512,7 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
return buffer.toString();
}
+ @Override
public void applyData(Object data) {
if (ComparePreferencePage.CAPPING_DISABLED.equals(data)) {
fTextCompareTab.getParent().setSelection(fTextCompareTab);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
index eb4fbe73e..1e1656b0f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java
@@ -61,6 +61,7 @@ public class CompareStructureViewerSwitchingPane extends
return fCompareEditorInput.getCompareConfiguration();
}
+ @Override
protected Viewer getViewer(Viewer oldViewer, Object input) {
if (input instanceof ICompareInput) {
if (fSelectedViewerDescriptor != null) {
@@ -89,8 +90,10 @@ public class CompareStructureViewerSwitchingPane extends
return null;
}
+ @Override
protected Control createTopLeft(Composite p) {
final Composite composite = new Composite(p, SWT.NONE) {
+ @Override
public Point computeSize(int wHint, int hHint, boolean changed) {
return super.computeSize(wHint, Math.max(24, hHint), changed);
}
@@ -111,11 +114,13 @@ public class CompareStructureViewerSwitchingPane extends
toolItem
.setToolTipText(CompareMessages.CompareStructureViewerSwitchingPane_switchButtonTooltip);
toolItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
showMenu();
}
});
toolBar.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
showMenu();
}
@@ -123,11 +128,13 @@ public class CompareStructureViewerSwitchingPane extends
return composite;
}
+ @Override
protected boolean inputChanged(Object input) {
return getInput() != input
|| fCompareEditorInput.getStructureViewerDescriptor() != fSelectedViewerDescriptor;
}
+ @Override
public void setInput(Object input) {
super.setInput(input);
if (getViewer() == null || !Utilities.okToUse(getViewer().getControl()))
@@ -187,8 +194,10 @@ public class CompareStructureViewerSwitchingPane extends
// 3. dispose on close
menu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuHidden(MenuEvent e) {
e.display.asyncExec(new Runnable() {
+ @Override
public void run() {
menu.dispose();
}
@@ -199,6 +208,7 @@ public class CompareStructureViewerSwitchingPane extends
private SelectionListener createSelectionListener(final ViewerDescriptor vd) {
return new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
MenuItem mi = (MenuItem) e.widget;
if (mi.getSelection()) {
@@ -209,12 +219,14 @@ public class CompareStructureViewerSwitchingPane extends
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
// nothing to do
}
};
}
+ @Override
public void setText(String label) {
Composite c = (Composite) getTopLeft();
Control[] children = c.getChildren();
@@ -230,6 +242,7 @@ public class CompareStructureViewerSwitchingPane extends
}
}
+ @Override
public void setImage(Image image) {
Composite c = (Composite) getTopLeft();
Control[] children = c.getChildren();
@@ -243,6 +256,7 @@ public class CompareStructureViewerSwitchingPane extends
}
}
+ @Override
public void addMouseListener(MouseListener listener) {
Composite c = (Composite) getTopLeft();
Control[] children = c.getChildren();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java
index fb20ee888..d99a0b8fb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java
@@ -20,8 +20,10 @@ import org.eclipse.jface.viewers.IStructuredSelection;
* @deprecated Temporarily replaced by CompareWithOtherResourceHandler. See bug
* 264498.
*/
+@Deprecated
public class CompareWithOtherResourceAction extends CompareAction {
+ @Override
public void run(ISelection selection) {
// Show CompareWithOtherResourceDialog which return resources to compare
// and ancestor if specified. Don't need to display the other dialog
@@ -29,6 +31,7 @@ public class CompareWithOtherResourceAction extends CompareAction {
super.run(selection);
}
+ @Override
protected boolean isEnabled(ISelection selection) {
int selectionSize = 0;
if (selection instanceof IStructuredSelection) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
index 533ada409..b2d279da0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java
@@ -82,14 +82,17 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
this.element = element;
}
+ @Override
public void dragFinished(DragSourceEvent event) {
element.setText(""); //$NON-NLS-1$
}
+ @Override
public void dragSetData(DragSourceEvent event) {
event.data = element.getText();
}
+ @Override
public void dragStart(DragSourceEvent event) {
if (element.getText() == null)
event.doit = false;
@@ -108,6 +111,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
textTransfer = TextTransfer.getInstance();
}
+ @Override
public void dragEnter(DropTargetEvent event) {
if (event.detail == DND.DROP_DEFAULT) {
@@ -128,10 +132,12 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
}
}
+ @Override
public void dragLeave(DropTargetEvent event) {
// intentionally empty
}
+ @Override
public void dragOperationChanged(DropTargetEvent event) {
if (event.detail == DND.DROP_DEFAULT) {
@@ -145,10 +151,12 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
}
}
+ @Override
public void dragOver(DropTargetEvent event) {
// intentionally empty
}
+ @Override
public void drop(DropTargetEvent event) {
if (textTransfer.isSupportedType(event.currentDataType)) {
@@ -164,6 +172,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
}
+ @Override
public void dropAccept(DropTargetEvent event) {
// intentionally empty
}
@@ -247,6 +256,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
super(parent, CompareMessages.CompareWithOtherResourceDialog_workspaceRadioButton, section);
}
+ @Override
protected void createMainButton(Composite parent) {
super.createMainButton(parent);
mainButton.setText(CompareMessages.CompareWithOtherResourceDialog_workspaceMainButton);
@@ -254,12 +264,14 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
mainButton.setVisible(false);
}
+ @Override
protected void createText(Composite parent) {
super.createText(parent);
text.setEditable(true);
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
section.setResource(text.getText());
updateErrorInfo();
@@ -267,9 +279,11 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
});
text.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
+ @Override
public void widgetSelected(SelectionEvent e) {
section.setResource(text.getText());
updateErrorInfo();
@@ -280,6 +294,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
initDrop();
}
+ @Override
protected void setResource(IResource resource) {
super.setResource(resource);
text.setText(resource.getFullPath().toOSString());
@@ -311,13 +326,16 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
super(parent, CompareMessages.CompareWithOtherResourceDialog_externalFileRadioButton, section);
}
+ @Override
protected void createMainButton(Composite parent) {
super.createMainButton(parent);
mainButton.setText(CompareMessages.CompareWithOtherResourceDialog_externalFileMainButton);
mainButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
+ @Override
public void widgetSelected(SelectionEvent e) {
IResource r = tmpProject.getExternalFile();
if (r == null)
@@ -327,6 +345,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
});
}
+ @Override
protected void setResource(IResource resource) {
super.setResource(resource);
text.setText(resource.getLocation().toOSString());
@@ -340,13 +359,16 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
super(parent, CompareMessages.CompareWithOtherResourceDialog_externalFolderRadioButton, section);
}
+ @Override
protected void createMainButton(Composite parent) {
super.createMainButton(parent);
mainButton.setText(CompareMessages.CompareWithOtherResourceDialog_externalFolderMainButton);
mainButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
+ @Override
public void widgetSelected(SelectionEvent e) {
IResource r = tmpProject.getExternalFolder();
if (r == null)
@@ -356,6 +378,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
});
}
+ @Override
protected void setResource(IResource resource) {
super.setResource(resource);
text.setText(resource.getLocation().toOSString());
@@ -399,6 +422,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
externalFileContent, externalFolderContent };
for (int i = 0; i < elements.length; i++) {
elements[i].getRadioButton().addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
for (int j = 0; j < elements.length; j++) {
if (event.widget != elements[j].getRadioButton())
@@ -484,6 +508,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
createContents(parent);
}
+ @Override
protected void createContents(Composite parent) {
final Composite p = parent;
expandable = new ExpandableComposite(parent, SWT.NONE,
@@ -492,6 +517,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
createClearButton(group);
expandable.setClient(group);
expandable.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
p.layout();
adjustSize(e.getState());
@@ -503,9 +529,11 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
clearButton = new Button(parent, SWT.PUSH);
clearButton.setText(CompareMessages.CompareWithOtherResourceDialog_clear);
clearButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
+ @Override
public void widgetSelected(SelectionEvent e) {
clearResource();
}
@@ -694,6 +722,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
* org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
* .Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainPanel = new Composite(parent, SWT.NULL);
@@ -735,6 +764,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
* org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse
* .swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
okButton = getButton(IDialogConstants.OK_ID);
@@ -825,6 +855,7 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog {
/*
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
String sectionName = getClass().getName() + "_dialogBounds"; //$NON-NLS-1$
IDialogSettings settings = CompareUIPlugin.getDefault()
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
index 35508b697..227b2af71 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
public class CompareWithOtherResourceHandler extends AbstractHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IWorkbenchPage workbenchPage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ContentChangeNotifier.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ContentChangeNotifier.java
index bfcb297f8..155e50f45 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ContentChangeNotifier.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ContentChangeNotifier.java
@@ -32,6 +32,7 @@ public class ContentChangeNotifier implements IContentChangeNotifier {
/* (non-Javadoc)
* see IContentChangeNotifier.addChangeListener
*/
+ @Override
public void addContentChangeListener(IContentChangeListener listener) {
if (fListenerList == null)
fListenerList= new ListenerList();
@@ -41,6 +42,7 @@ public class ContentChangeNotifier implements IContentChangeNotifier {
/* (non-Javadoc)
* see IContentChangeNotifier.removeChangeListener
*/
+ @Override
public void removeContentChangeListener(IContentChangeListener listener) {
if (fListenerList != null) {
fListenerList.remove(listener);
@@ -58,14 +60,17 @@ public class ContentChangeNotifier implements IContentChangeNotifier {
}
// Legacy listeners may expect to be notified in the UI thread.
Runnable runnable = new Runnable() {
+ @Override
public void run() {
Object[] listeners= fListenerList.getListeners();
for (int i= 0; i < listeners.length; i++) {
final IContentChangeListener contentChangeListener = (IContentChangeListener)listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
contentChangeListener.contentChanged(element);
}
+ @Override
public void handleException(Throwable exception) {
// Logged by safe runner
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
index 3f21ad964..9292d0a75 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DiffImageDescriptor.java
@@ -68,6 +68,7 @@ public class DiffImageDescriptor extends CompositeImageDescriptor {
/* (non-Javadoc)
* @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize()
*/
+ @Override
protected Point getSize() {
return new Point(fWidth, HEIGHT);
}
@@ -75,6 +76,7 @@ public class DiffImageDescriptor extends CompositeImageDescriptor {
/* (non-Javadoc)
* @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
*/
+ @Override
protected void drawCompositeImage(int width, int height) {
if (fLeft) {
if (fBaseImageData != null) {
@@ -104,6 +106,7 @@ public class DiffImageDescriptor extends CompositeImageDescriptor {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return hashCode;
}
@@ -111,6 +114,7 @@ public class DiffImageDescriptor extends CompositeImageDescriptor {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj == this)
return true;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
index 1ceaf7444..f76b8887e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
@@ -123,6 +123,7 @@ public class DocLineComparator implements ITokenComparator {
*
* @return number of lines
*/
+ @Override
public int getRangeCount() {
return fLineCount;
}
@@ -130,6 +131,7 @@ public class DocLineComparator implements ITokenComparator {
/* (non Javadoc)
* see ITokenComparator.getTokenStart
*/
+ @Override
public int getTokenStart(int line) {
try {
IRegion r= fDocument.getLineInformation(fLineOffset + line);
@@ -143,6 +145,7 @@ public class DocLineComparator implements ITokenComparator {
* Returns the length of the given line.
* see ITokenComparator.getTokenLength
*/
+ @Override
public int getTokenLength(int line) {
return getTokenStart(line+1) - getTokenStart(line);
}
@@ -156,6 +159,7 @@ public class DocLineComparator implements ITokenComparator {
* @param otherIndex the number of the line within the other comparator
* @return <code>true</code> if the lines are equal
*/
+ @Override
public boolean rangesEqual(int thisIndex, IRangeComparator otherComparator, int otherIndex) {
if (otherComparator != null && otherComparator.getClass() == getClass()) {
@@ -189,6 +193,7 @@ public class DocLineComparator implements ITokenComparator {
* @param other the other <code>IRangeComparator</code> to compare with
* @return <code>true</code> to avoid a too lengthy range comparison
*/
+ @Override
public boolean skipRangeComparison(int length, int maxLength, IRangeComparator other) {
return false;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
index fd91e95e9..7e97f598b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/EditionAction.java
@@ -54,22 +54,27 @@ public class EditionAction extends BaseCompareAction {
fFile= file;
}
+ @Override
public String getName() {
return fFile.getName();
}
+ @Override
public String getType() {
return fFile.getFileExtension();
}
+ @Override
public Image getImage() {
return null;
}
+ @Override
public InputStream getContents() {
return new ByteArrayInputStream(Utilities.getBytes(fDocument.get(), UTF_16));
}
+ @Override
public String getCharset() {
return UTF_16;
}
@@ -85,10 +90,12 @@ public class EditionAction extends BaseCompareAction {
fBundleName= bundleName;
}
+ @Override
protected boolean isEnabled(ISelection selection) {
return Utilities.getFiles(selection).length == 1; // we don't support multiple selection for now
}
+ @Override
protected void run(ISelection selection) {
IFile[] files= Utilities.getFiles(selection);
for (int i= 0; i < files.length; i++)
@@ -174,6 +181,7 @@ public class EditionAction extends BaseCompareAction {
final IStreamContentAccessor sa, final IFile file)
throws InvocationTargetException, InterruptedException {
WorkspaceModifyOperation operation= new WorkspaceModifyOperation() {
+ @Override
public void execute(IProgressMonitor pm) throws InvocationTargetException {
try {
String taskName= Utilities.getString(bundle, "taskName"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
index 872b5ecba..a18b609a0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
@@ -33,6 +33,7 @@ class ImageCanvas extends Canvas {
ScrollBar sb= getHorizontalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
repaint();
}
@@ -41,18 +42,21 @@ class ImageCanvas extends Canvas {
sb= getVerticalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
repaint();
}
});
addListener(SWT.Resize, new Listener() {
+ @Override
public void handleEvent(Event e) {
updateScrollbars();
}
});
addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event event) {
paint(event.gc);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
index e05912347..9ee4117ee 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
@@ -49,6 +49,7 @@ public class ImageMergeViewer extends ContentMergeViewer {
getControl().setData(CompareUI.COMPARE_VIEWER_TITLE, title);
}
+ @Override
protected void updateContent(Object ancestor, Object left, Object right) {
setInput(fAncestor, ancestor);
@@ -63,10 +64,12 @@ public class ImageMergeViewer extends ContentMergeViewer {
/*
* We can't modify the contents of either side we just return null.
*/
+ @Override
protected byte[] getContents(boolean left) {
return null;
}
+ @Override
public void createControls(Composite composite) {
fAncestor= new ImageCanvas(composite, SWT.NO_FOCUS);
fLeft= new ImageCanvas(composite, SWT.NO_FOCUS);
@@ -115,6 +118,7 @@ public class ImageMergeViewer extends ContentMergeViewer {
}
}
+ @Override
protected void handleResizeAncestor(int x, int y, int width, int height) {
if (width > 0) {
fAncestor.setVisible(true);
@@ -124,11 +128,13 @@ public class ImageMergeViewer extends ContentMergeViewer {
}
}
+ @Override
protected void handleResizeLeftRight(int x, int y, int width1, int centerWidth, int width2, int height) {
fLeft.setBounds(x, y, width1, height);
fRight.setBounds(x+width1+centerWidth, y, width2, height);
}
+ @Override
protected void copy(boolean leftToRight) {
if (leftToRight) {
fRightImage= fLeftImage;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerCreator.java
index 7a4e1c6e6..7e7266cfa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewerCreator.java
@@ -24,6 +24,7 @@ import org.eclipse.jface.viewers.Viewer;
*/
public class ImageMergeViewerCreator implements IViewerCreator {
+ @Override
public Viewer createViewer(Composite parent, CompareConfiguration mp) {
return new ImageMergeViewer(parent, SWT.NULL, mp);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
index 7ffc504f9..2d1a121ca 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
@@ -25,12 +25,14 @@ public class ListContentProvider implements IStructuredContentProvider {
// nothing to do
}
+ @Override
public Object[] getElements(Object input) {
if (fContents != null && fContents == input)
return fContents.toArray();
return new Object[0];
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput instanceof List)
fContents= (List)newInput;
@@ -39,6 +41,7 @@ public class ListContentProvider implements IStructuredContentProvider {
// we use a fixed set.
}
+ @Override
public void dispose() {
// empty default implementation
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
index d923936e0..9de69fd18 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
@@ -133,15 +133,18 @@ public class MergeSourceViewer implements ISelectionChangedListener,
update();
}
+ @Override
public void run() {
if (isEnabled())
getSourceViewer().doOperation(fOperationCode);
}
+ @Override
public boolean isEnabled() {
return fOperationCode != -1 && getSourceViewer().canDoOperation(fOperationCode);
}
+ @Override
public void update() {
setEnabled(isEnabled());
}
@@ -154,86 +157,105 @@ public class MergeSourceViewer implements ISelectionChangedListener,
*/
class TextEditorAdapter implements ITextEditor {
+ @Override
public void close(boolean save) {
// defining interface method
}
+ @Override
public void doRevertToSaved() {
// defining interface method
}
+ @Override
public IAction getAction(String actionId) {
// defining interface method
return null;
}
+ @Override
public IDocumentProvider getDocumentProvider() {
return new IDocumentProvider(){
+ @Override
public void aboutToChange(Object element) {
// defining interface method
}
+ @Override
public void addElementStateListener(
IElementStateListener listener) {
// defining interface method
}
+ @Override
public boolean canSaveDocument(Object element) {
// defining interface method
return false;
}
+ @Override
public void changed(Object element) {
// defining interface method
}
+ @Override
public void connect(Object element) throws CoreException {
// defining interface method
}
+ @Override
public void disconnect(Object element) {
// defining interface method
}
+ @Override
public IAnnotationModel getAnnotationModel(Object element) {
// defining interface method
return null;
}
+ @Override
public IDocument getDocument(Object element) {
return MergeSourceViewer.this.getSourceViewer().getDocument();
}
+ @Override
public long getModificationStamp(Object element) {
// defining interface method
return 0;
}
+ @Override
public long getSynchronizationStamp(Object element) {
// defining interface method
return 0;
}
+ @Override
public boolean isDeleted(Object element) {
// defining interface method
return false;
}
+ @Override
public boolean mustSaveDocument(Object element) {
// defining interface method
return false;
}
+ @Override
public void removeElementStateListener(
IElementStateListener listener) {
// defining interface method
}
+ @Override
public void resetDocument(Object element) throws CoreException {
// defining interface method
}
+ @Override
public void saveDocument(IProgressMonitor monitor,
Object element, IDocument document, boolean overwrite)
throws CoreException {
@@ -241,28 +263,34 @@ public class MergeSourceViewer implements ISelectionChangedListener,
}};
}
+ @Override
public IRegion getHighlightRange() {
// defining interface method
return null;
}
+ @Override
public ISelectionProvider getSelectionProvider() {
return MergeSourceViewer.this.getSourceViewer().getSelectionProvider();
}
+ @Override
public boolean isEditable() {
// defining interface method
return false;
}
+ @Override
public void removeActionActivationCode(String actionId) {
// defining interface method
}
+ @Override
public void resetHighlightRange() {
// defining interface method
}
+ @Override
public void selectAndReveal(int start, int length) {
selectAndReveal(start, length, start, length);
}
@@ -324,107 +352,130 @@ public class MergeSourceViewer implements ISelectionChangedListener,
return viewer.overlapsWithVisibleRegion(offset, length);
}
+ @Override
public void setAction(String actionID, IAction action) {
// defining interface method
}
+ @Override
public void setActionActivationCode(String actionId,
char activationCharacter, int activationKeyCode,
int activationStateMask) {
// defining interface method
}
+ @Override
public void setHighlightRange(int offset, int length, boolean moveCursor) {
// defining interface method
}
+ @Override
public void showHighlightRangeOnly(boolean showHighlightRangeOnly) {
// defining interface method
}
+ @Override
public boolean showsHighlightRangeOnly() {
// defining interface method
return false;
}
+ @Override
public IEditorInput getEditorInput() {
if (MergeSourceViewer.this.fContainer.getWorkbenchPart() instanceof IEditorPart)
return ((IEditorPart) MergeSourceViewer.this.fContainer.getWorkbenchPart()).getEditorInput();
return null;
}
+ @Override
public IEditorSite getEditorSite() {
// defining interface method
return null;
}
+ @Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
// defining interface method
}
+ @Override
public void addPropertyListener(IPropertyListener listener) {
// defining interface method
}
+ @Override
public void createPartControl(Composite parent) {
// defining interface method
}
+ @Override
public void dispose() {
// defining interface method
}
+ @Override
public IWorkbenchPartSite getSite() {
return MergeSourceViewer.this.fContainer.getWorkbenchPart().getSite();
}
+ @Override
public String getTitle() {
// defining interface method
return null;
}
+ @Override
public Image getTitleImage() {
// defining interface method
return null;
}
+ @Override
public String getTitleToolTip() {
// defining interface method
return null;
}
+ @Override
public void removePropertyListener(IPropertyListener listener) {
// defining interface method
}
+ @Override
public void setFocus() {
// defining interface method
}
+ @Override
public Object getAdapter(Class adapter) {
// defining interface method
return null;
}
+ @Override
public void doSave(IProgressMonitor monitor) {
// defining interface method
}
+ @Override
public void doSaveAs() {
// defining interface method
}
+ @Override
public boolean isDirty() {
// defining interface method
return false;
}
+ @Override
public boolean isSaveAsAllowed() {
// defining interface method
return false;
}
+ @Override
public boolean isSaveOnCloseNeeded() {
// defining interface method
return false;
@@ -464,6 +515,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
// for listening to editor show/hide line number preference value
fPreferenceChangeListener= new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
MergeSourceViewer.this.handlePropertyChangeEvent(event);
}
@@ -764,6 +816,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
return null;
}
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
Iterator e= fActions.values().iterator();
while (e.hasNext()) {
@@ -776,6 +829,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
}
}
+ @Override
public void textChanged(TextEvent event) {
updateContentDependantActions();
}
@@ -795,6 +849,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
/*
* Allows the viewer to add menus and/or tools to the context menu.
*/
+ @Override
public void menuAboutToShow(IMenuManager menu) {
menu.add(new Separator("undo")); //$NON-NLS-1$
@@ -1015,12 +1070,14 @@ public class MergeSourceViewer implements ISelectionChangedListener,
.getOperationHistory();
}
+ @Override
public void historyNotification(OperationHistoryEvent event) {
// This method updates the enablement of all content operations
// when the undo history changes. It could be localized to UNDO and REDO.
IUndoContext context = getUndoContext();
if (context != null && event.getOperation().hasContext(context)) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
updateContentDependantActions();
}
@@ -1042,6 +1099,7 @@ public class MergeSourceViewer implements ISelectionChangedListener,
return fSourceViewer;
}
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == ITextEditor.class) {
return new TextEditorAdapter();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
index 99f9c8410..e0c77cc06 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
@@ -38,6 +38,7 @@ public abstract class MergeViewerAction extends Action implements IUpdate {
return fMutable;
}
+ @Override
public void update() {
// empty default implementation
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
index 4a90f1906..006b99f56 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
@@ -39,10 +39,12 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
return fAncestorError != null || fLeftError != null || fRightError != null;
}
+ @Override
public void dispose() {
// empty default implementation
}
+ @Override
public void inputChanged(Viewer v, Object o1, Object o2) {
// we are not interested since we have no state
}
@@ -53,24 +55,28 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
fAncestorError= errorMessage;
}
+ @Override
public String getAncestorLabel(Object element) {
if (fAncestorError != null)
return fAncestorError;
return fCompareConfiguration.getAncestorLabel(element);
}
+ @Override
public Image getAncestorImage(Object element) {
if (fAncestorError != null)
return null;
return fCompareConfiguration.getAncestorImage(element);
}
+ @Override
public Object getAncestorContent(Object element) {
if (element instanceof ICompareInput)
return ((ICompareInput) element).getAncestor();
return null;
}
+ @Override
public boolean showAncestor(Object element) {
if (element instanceof ICompareInput)
return true; // fix for #45239: Show ancestor for incoming and outgoing changes
@@ -84,24 +90,28 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
fLeftError= errorMessage;
}
+ @Override
public String getLeftLabel(Object element) {
if (fLeftError != null)
return fLeftError;
return fCompareConfiguration.getLeftLabel(element);
}
+ @Override
public Image getLeftImage(Object element) {
if (fLeftError != null)
return null;
return fCompareConfiguration.getLeftImage(element);
}
+ @Override
public Object getLeftContent(Object element) {
if (element instanceof ICompareInput)
return ((ICompareInput) element).getLeft();
return null;
}
+ @Override
public boolean isLeftEditable(Object element) {
if (hasError())
return false;
@@ -118,6 +128,7 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
return false;
}
+ @Override
public void saveLeftContent(Object element, byte[] bytes) {
if (element instanceof ICompareInput) {
ICompareInput node= (ICompareInput) element;
@@ -144,24 +155,28 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
fRightError= errorMessage;
}
+ @Override
public String getRightLabel(Object element) {
if (fRightError != null)
return fRightError;
return fCompareConfiguration.getRightLabel(element);
}
+ @Override
public Image getRightImage(Object element) {
if (fRightError != null)
return null;
return fCompareConfiguration.getRightImage(element);
}
+ @Override
public Object getRightContent(Object element) {
if (element instanceof ICompareInput)
return ((ICompareInput) element).getRight();
return null;
}
+ @Override
public boolean isRightEditable(Object element) {
if (hasError())
return false;
@@ -178,6 +193,7 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
return false;
}
+ @Override
public void saveRightContent(Object element, byte[] bytes) {
if (element instanceof ICompareInput) {
ICompareInput node= (ICompareInput) element;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NavigationEndDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NavigationEndDialog.java
index 0cb023fad..5626fcc22 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NavigationEndDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NavigationEndDialog.java
@@ -28,6 +28,7 @@ public class NavigationEndDialog extends MessageDialogWithToggle {
this.labelsAndValues = labelsAndValues;
}
+ @Override
protected Control createCustomArea(Composite parent) {
editor = new RadioGroupFieldEditor(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, CompareMessages.NavigationEndDialog_1, 1,
labelsAndValues,
@@ -38,6 +39,7 @@ public class NavigationEndDialog extends MessageDialogWithToggle {
return parent;
}
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
editor.store();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NullViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NullViewer.java
index b334b1aa8..aa098eeec 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NullViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/NullViewer.java
@@ -29,6 +29,7 @@ public class NullViewer extends AbstractViewer {
CompareViewerPane.clearToolBar(parent);
}
+ @Override
public Control getControl() {
return fDummy;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OutlineViewerCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OutlineViewerCreator.java
index a81ef156a..78686a560 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OutlineViewerCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OutlineViewerCreator.java
@@ -58,9 +58,11 @@ public abstract class OutlineViewerCreator {
for (int i = 0; i < list.length; i++) {
final IPropertyChangeListener listener = (IPropertyChangeListener)list[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
listener.propertyChange(event);
}
+ @Override
public void handleException(Throwable exception) {
// Logged by SafeRunner
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
index afc30e194..8aa3a6f04 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
@@ -50,6 +50,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
OverlayKey key= findOverlayKey(event.getProperty());
if (key != null)
@@ -216,6 +217,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#addPropertyChangeListener(IPropertyChangeListener)
*/
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
fStore.addPropertyChangeListener(listener);
}
@@ -223,6 +225,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#removePropertyChangeListener(IPropertyChangeListener)
*/
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
fStore.removePropertyChangeListener(listener);
}
@@ -230,6 +233,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#firePropertyChangeEvent(String, Object, Object)
*/
+ @Override
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
fStore.firePropertyChangeEvent(name, oldValue, newValue);
}
@@ -237,6 +241,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#contains(String)
*/
+ @Override
public boolean contains(String name) {
return fStore.contains(name);
}
@@ -244,6 +249,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getBoolean(String)
*/
+ @Override
public boolean getBoolean(String name) {
return fStore.getBoolean(name);
}
@@ -251,6 +257,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultBoolean(String)
*/
+ @Override
public boolean getDefaultBoolean(String name) {
return fStore.getDefaultBoolean(name);
}
@@ -258,6 +265,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultDouble(String)
*/
+ @Override
public double getDefaultDouble(String name) {
return fStore.getDefaultDouble(name);
}
@@ -265,6 +273,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultFloat(String)
*/
+ @Override
public float getDefaultFloat(String name) {
return fStore.getDefaultFloat(name);
}
@@ -272,6 +281,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultInt(String)
*/
+ @Override
public int getDefaultInt(String name) {
return fStore.getDefaultInt(name);
}
@@ -279,6 +289,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultLong(String)
*/
+ @Override
public long getDefaultLong(String name) {
return fStore.getDefaultLong(name);
}
@@ -286,6 +297,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDefaultString(String)
*/
+ @Override
public String getDefaultString(String name) {
return fStore.getDefaultString(name);
}
@@ -293,6 +305,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getDouble(String)
*/
+ @Override
public double getDouble(String name) {
return fStore.getDouble(name);
}
@@ -300,6 +313,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getFloat(String)
*/
+ @Override
public float getFloat(String name) {
return fStore.getFloat(name);
}
@@ -307,6 +321,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getInt(String)
*/
+ @Override
public int getInt(String name) {
return fStore.getInt(name);
}
@@ -314,6 +329,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getLong(String)
*/
+ @Override
public long getLong(String name) {
return fStore.getLong(name);
}
@@ -321,6 +337,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#getString(String)
*/
+ @Override
public String getString(String name) {
return fStore.getString(name);
}
@@ -328,6 +345,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#isDefault(String)
*/
+ @Override
public boolean isDefault(String name) {
return fStore.isDefault(name);
}
@@ -335,6 +353,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#needsSaving()
*/
+ @Override
public boolean needsSaving() {
return fStore.needsSaving();
}
@@ -342,6 +361,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#putValue(String, String)
*/
+ @Override
public void putValue(String name, String value) {
if (covers(name))
fStore.putValue(name, value);
@@ -350,6 +370,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, double)
*/
+ @Override
public void setDefault(String name, double value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -358,6 +379,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, float)
*/
+ @Override
public void setDefault(String name, float value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -366,6 +388,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, int)
*/
+ @Override
public void setDefault(String name, int value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -374,6 +397,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, long)
*/
+ @Override
public void setDefault(String name, long value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -382,6 +406,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, String)
*/
+ @Override
public void setDefault(String name, String value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -390,6 +415,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setDefault(String, boolean)
*/
+ @Override
public void setDefault(String name, boolean value) {
if (covers(name))
fStore.setDefault(name, value);
@@ -398,6 +424,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setToDefault(String)
*/
+ @Override
public void setToDefault(String name) {
fStore.setToDefault(name);
}
@@ -405,6 +432,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, double)
*/
+ @Override
public void setValue(String name, double value) {
if (covers(name))
fStore.setValue(name, value);
@@ -413,6 +441,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, float)
*/
+ @Override
public void setValue(String name, float value) {
if (covers(name))
fStore.setValue(name, value);
@@ -421,6 +450,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, int)
*/
+ @Override
public void setValue(String name, int value) {
if (covers(name))
fStore.setValue(name, value);
@@ -429,6 +459,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, long)
*/
+ @Override
public void setValue(String name, long value) {
if (covers(name))
fStore.setValue(name, value);
@@ -437,6 +468,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, String)
*/
+ @Override
public void setValue(String name, String value) {
if (covers(name))
fStore.setValue(name, value);
@@ -445,6 +477,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
/*
* @see IPreferenceStore#setValue(String, boolean)
*/
+ @Override
public void setValue(String name, boolean value) {
if (covers(name))
fStore.setValue(name, value);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
index f5dfa9f9a..277136935 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
@@ -56,12 +56,14 @@ public abstract class ResizableDialog extends Dialog {
/*
* @see org.eclipse.jface.window.Window#configureShell(Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
if (fContextId != null)
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, fContextId);
}
+ @Override
protected Point getInitialSize() {
int width= 0;
@@ -71,9 +73,11 @@ public abstract class ResizableDialog extends Dialog {
if (s != null) {
s.addControlListener(
new ControlListener() {
+ @Override
public void controlMoved(ControlEvent arg0) {
fNewBounds= s.getBounds();
}
+ @Override
public void controlResized(ControlEvent arg0) {
fNewBounds= s.getBounds();
}
@@ -122,6 +126,7 @@ public abstract class ResizableDialog extends Dialog {
return new Point(width, height);
}
+ @Override
protected Point getInitialLocation(Point initialSize) {
Point loc= super.getInitialLocation(initialSize);
@@ -141,6 +146,7 @@ public abstract class ResizableDialog extends Dialog {
return loc;
}
+ @Override
public boolean close() {
boolean closed= super.close();
if (closed && fNewBounds != null)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
index c6ebbf8b4..caa32774a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
@@ -84,6 +84,7 @@ class ResourceCompareInput extends CompareEditorInput {
public MyDiffNode(IDiffContainer parent, int description, ITypedElement ancestor, ITypedElement left, ITypedElement right) {
super(parent, description, ancestor, left, right);
}
+ @Override
public void fireChange() {
super.fireChange();
setDirty(true);
@@ -94,6 +95,7 @@ class ResourceCompareInput extends CompareEditorInput {
void clearDirty() {
fDirty= false;
}
+ @Override
public String getName() {
if (fLastName == null)
fLastName= super.getName();
@@ -102,6 +104,7 @@ class ResourceCompareInput extends CompareEditorInput {
return fLastName;
}
+ @Override
public ITypedElement getId() {
ITypedElement id= super.getId();
if (id == null)
@@ -115,6 +118,7 @@ class ResourceCompareInput extends CompareEditorInput {
FilteredBufferedResourceNode(IResource resource) {
super(resource);
}
+ @Override
protected IStructureComparator createChild(IResource child) {
String name= child.getName();
if (CompareUIPlugin.getDefault().filter(name, child instanceof IContainer, false))
@@ -130,12 +134,15 @@ class ResourceCompareInput extends CompareEditorInput {
super(config);
}
+ @Override
public Viewer createDiffViewer(Composite parent) {
fDiffViewer= new DiffTreeViewer(parent, getCompareConfiguration()) {
+ @Override
protected void fillContextMenu(IMenuManager manager) {
if (fOpenAction == null) {
fOpenAction= new Action() {
+ @Override
public void run() {
handleOpen(null);
}
@@ -184,6 +191,7 @@ class ResourceCompareInput extends CompareEditorInput {
this.theResources = theResources;
}
+ @Override
protected Control createCustomArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
@@ -208,6 +216,7 @@ class ResourceCompareInput extends CompareEditorInput {
}
private SelectionListener selectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Button selectedButton = (Button) e.widget;
if (!selectedButton.getSelection())
@@ -377,6 +386,7 @@ class ResourceCompareInput extends CompareEditorInput {
/*
* Performs a two-way or three-way diff on the current selection.
*/
+ @Override
public Object prepareInput(IProgressMonitor pm) throws InvocationTargetException {
try {
@@ -404,6 +414,7 @@ class ResourceCompareInput extends CompareEditorInput {
setTitle(title);
Differencer d= new Differencer() {
+ @Override
protected Object visit(Object parent, int description, Object ancestor, Object left, Object right) {
return new MyDiffNode((IDiffContainer) parent, description, (ITypedElement)ancestor, (ITypedElement)left, (ITypedElement)right);
}
@@ -419,6 +430,7 @@ class ResourceCompareInput extends CompareEditorInput {
}
}
+ @Override
public String getToolTipText() {
if (fLeftResource != null && fRightResource != null) {
String leftLabel= fLeftResource.getFullPath().makeRelative().toString();
@@ -445,6 +457,7 @@ class ResourceCompareInput extends CompareEditorInput {
return n;
}
+ @Override
public void saveChanges(IProgressMonitor pm) throws CoreException {
super.saveChanges(pm);
if (fRoot instanceof DiffNode) {
@@ -487,6 +500,7 @@ class ResourceCompareInput extends CompareEditorInput {
/* (non Javadoc)
* see IAdaptable.getAdapter
*/
+ @Override
public Object getAdapter(Class adapter) {
if (IFile.class.equals(adapter)) {
IProgressMonitor pm= new NullProgressMonitor();
@@ -546,6 +560,7 @@ class ResourceCompareInput extends CompareEditorInput {
return s;
}
+ @Override
public boolean canRunAsJob() {
return true;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
index ff56bd8e5..0767de353 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
@@ -63,6 +63,7 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
* (non-Javadoc)
* @see org.eclipse.compare.internal.TextEditorPropertyAction#synchronizeWithPreference()
*/
+ @Override
protected void synchronizeWithPreference() {
boolean checked = false;
if (fStore != null) {
@@ -93,6 +94,7 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
* (non-Javadoc)
* @see org.eclipse.compare.internal.TextEditorPropertyAction#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(getPreferenceKey()) || AbstractTextEditor.PREFERENCE_SHOW_LEADING_SPACES.equals(property) || AbstractTextEditor.PREFERENCE_SHOW_ENCLOSED_SPACES.equals(property)
@@ -105,6 +107,7 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
}
}
+ @Override
protected boolean toggleState(boolean checked) {
if (fNeedsPainters == null)
return false; // Not initialized yet
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/SimpleTextViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/SimpleTextViewer.java
index 64d4c6da7..ba0e162f0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/SimpleTextViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/SimpleTextViewer.java
@@ -33,10 +33,12 @@ public class SimpleTextViewer extends AbstractViewer {
fSourceViewer.setEditable(false);
}
+ @Override
public Control getControl() {
return fSourceViewer.getTextWidget();
}
+ @Override
public void setInput(Object input) {
if (input instanceof IStreamContentAccessor) {
fSourceViewer.setDocument(new Document(getString(input)));
@@ -47,6 +49,7 @@ public class SimpleTextViewer extends AbstractViewer {
}
}
+ @Override
public Object getInput() {
return fInput;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TabFolderLayout.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TabFolderLayout.java
index 166621276..7384ac918 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TabFolderLayout.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TabFolderLayout.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.Layout;
public class TabFolderLayout extends Layout {
+ @Override
protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
return new Point(wHint, hHint);
@@ -42,6 +43,7 @@ public class TabFolderLayout extends Layout {
}
+ @Override
protected void layout (Composite composite, boolean flushCache) {
Rectangle rect= composite.getClientArea();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java
index 2d4b97189..2ae3c4127 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java
@@ -45,6 +45,7 @@ public class TextEditorPropertyAction extends Action implements IPropertyChangeL
return viewers;
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(getPreferenceKey())) {
synchronizeWithPreference();
@@ -66,6 +67,7 @@ public class TextEditorPropertyAction extends Action implements IPropertyChangeL
return preferenceKey;
}
+ @Override
public void run() {
toggleState(isChecked());
if (store != null)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextMergeViewerCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextMergeViewerCreator.java
index 796cad6b3..5df49d6dd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextMergeViewerCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextMergeViewerCreator.java
@@ -25,6 +25,7 @@ import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
*/
public class TextMergeViewerCreator implements IViewerCreator {
+ @Override
public Viewer createViewer(Composite parent, CompareConfiguration mp) {
return new TextMergeViewer(parent, mp);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextViewerCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextViewerCreator.java
index 5daa1d437..515361d11 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextViewerCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextViewerCreator.java
@@ -26,6 +26,7 @@ import org.eclipse.compare.IViewerCreator;
*/
public class TextViewerCreator implements IViewerCreator {
+ @Override
public Viewer createViewer(Composite parent, CompareConfiguration mp) {
return new SimpleTextViewer(parent);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/WorkerJob.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/WorkerJob.java
index d25e52e7a..2ba246b51 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/WorkerJob.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/WorkerJob.java
@@ -26,6 +26,7 @@ public class WorkerJob extends Job {
worker = new Worker(name);
}
+ @Override
protected IStatus run(IProgressMonitor monitor) {
worker.run(monitor);
// reschedule to ensure we don't miss a task
@@ -48,6 +49,7 @@ public class WorkerJob extends Job {
return new MultiStatus(CompareUIPlugin.PLUGIN_ID, 0, (IStatus[]) statii.toArray(new IStatus[statii.size()]), CompareMessages.WorkerJob_0, null);
}
+ @Override
public boolean shouldRun() {
return worker.hasWork();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
index 40c0fc6e7..d16424ca6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/DocumentMerger.java
@@ -404,6 +404,7 @@ public class DocumentMerger {
final Object[] result= new Object[1];
final DocLineComparator sa= sancestor, sl= sleft, sr= sright;
IRunnableWithProgress runnable= new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
monitor.beginTask(CompareMessages.DocumentMerger_0, maxWork(sa, sl, sr));
try {
@@ -569,6 +570,7 @@ public class DocumentMerger {
final Object[] result= new Object[1];
final DocLineComparator sa= sancestor, sl= sleft, sr= sright;
IRunnableWithProgress runnable= new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
monitor.beginTask(CompareMessages.DocumentMerger_2, maxWork(sa, sl, sr));
try {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
index c5fd8ba24..e39d9b4c6 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
@@ -40,14 +40,16 @@ class LineComparator implements IRangeComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#getRangeCount()
*/
- public int getRangeCount() {
+ @Override
+ public int getRangeCount() {
return fLines.length;
}
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#rangesEqual(int, org.eclipse.compare.rangedifferencer.IRangeComparator, int)
*/
- public boolean rangesEqual(int thisIndex, IRangeComparator other,
+ @Override
+ public boolean rangesEqual(int thisIndex, IRangeComparator other,
int otherIndex) {
String s1 = fLines[thisIndex];
String s2 = ((LineComparator) other).fLines[otherIndex];
@@ -57,7 +59,8 @@ class LineComparator implements IRangeComparator {
/* (non-Javadoc)
* @see org.eclipse.compare.rangedifferencer.IRangeComparator#skipRangeComparison(int, int, org.eclipse.compare.rangedifferencer.IRangeComparator)
*/
- public boolean skipRangeComparison(int length, int maxLength, IRangeComparator other) {
+ @Override
+ public boolean skipRangeComparison(int length, int maxLength, IRangeComparator other) {
return false;
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
index 0616aaef4..7d83df189 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
@@ -36,6 +36,7 @@ public class TextStreamMerger implements IStreamMerger {
* org.eclipse.core.resources.IEncodedStorage,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IStatus merge(OutputStream output, String outputEncoding, InputStream ancestor, String ancestorEncoding, InputStream target, String targetEncoding, InputStream other, String otherEncoding, IProgressMonitor monitor) {
LineComparator a, t, o;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DecoratorOverlayIcon.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DecoratorOverlayIcon.java
index 75cfe7582..8001d7058 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DecoratorOverlayIcon.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DecoratorOverlayIcon.java
@@ -81,7 +81,8 @@ class DecoratorOverlayIcon extends CompositeImageDescriptor {
}
}
- public boolean equals(Object o) {
+ @Override
+ public boolean equals(Object o) {
if (!(o instanceof DecoratorOverlayIcon)) {
return false;
}
@@ -90,7 +91,8 @@ class DecoratorOverlayIcon extends CompositeImageDescriptor {
&& Arrays.equals(overlays, other.overlays);
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
int code = base.hashCode();
for (int i = 0; i < overlays.length; i++) {
if (overlays[i] != null) {
@@ -100,7 +102,8 @@ class DecoratorOverlayIcon extends CompositeImageDescriptor {
return code;
}
- protected void drawCompositeImage(int width, int height) {
+ @Override
+ protected void drawCompositeImage(int width, int height) {
ImageDescriptor underlay = overlays[IDecoration.UNDERLAY];
if (underlay != null) {
drawImage(underlay.getImageData(), 0, 0);
@@ -109,14 +112,16 @@ class DecoratorOverlayIcon extends CompositeImageDescriptor {
drawOverlays(overlays);
}
- protected Point getSize() {
+ @Override
+ protected Point getSize() {
return size;
}
/* (non-Javadoc)
* @see org.eclipse.jface.resource.CompositeImageDescriptor#getTransparentPixel()
*/
- protected int getTransparentPixel() {
+ @Override
+ protected int getTransparentPixel() {
return base.getImageData().transparentPixel;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DiffViewerComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DiffViewerComparator.java
index 78b611b33..cd76bfca0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DiffViewerComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/DiffViewerComparator.java
@@ -24,6 +24,7 @@ public class DiffViewerComparator extends ViewerSorter {
return false;
}
+ @Override
public int category(Object node) {
if (node instanceof DiffNode) {
Object o= ((DiffNode) node).getId();
@@ -33,8 +34,10 @@ public class DiffViewerComparator extends ViewerSorter {
return 0;
}
+ @Override
protected Comparator getComparator() {
return new Comparator() {
+ @Override
public int compare(Object arg0, Object arg1) {
String label0 = arg0 == null ? "" : arg0.toString(); //$NON-NLS-1$
String label1 = arg1 == null ? "" : arg1.toString(); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java
index e8e873a10..ff117b988 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java
@@ -33,12 +33,14 @@ public class FilePatch extends FilePatch2 implements IFilePatch {
* .IStorage, org.eclipse.compare.patch.PatchConfiguration,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IFilePatchResult apply(IStorage content,
PatchConfiguration configuration, IProgressMonitor monitor) {
return apply(content != null ? Utilities.getReaderCreator(content)
: null, configuration, monitor);
}
+ @Override
protected FilePatch2 create(IPath oldPath, long oldDate, IPath newPath,
long newDate) {
return new FilePatch(oldPath, oldDate, newPath, newDate);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/HunkDiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/HunkDiffNode.java
index 805306116..0590d96aa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/HunkDiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/HunkDiffNode.java
@@ -60,6 +60,7 @@ public class HunkDiffNode extends PatchDiffNode {
return result;
}
+ @Override
protected PatchConfiguration getConfiguration() {
return result.getDiffResult().getConfiguration();
}
@@ -102,6 +103,7 @@ public class HunkDiffNode extends PatchDiffNode {
return false;
}
+ @Override
public IResource getResource() {
return ((PatchFileDiffNode)getParent()).getResource();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index f3d822485..3f45f8210 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -121,6 +121,7 @@ public class InputPatchPage extends WizardPage {
private TreeViewer fTreeViewer;
class ActivationListener extends ShellAdapter {
+ @Override
public void shellActivated(ShellEvent e) {
// allow error messages if the selected input actually has something selected in it
fShowError=true;
@@ -159,6 +160,7 @@ public class InputPatchPage extends WizardPage {
return getPatchFilePath();
}
+ @Override
public void createControl(Composite parent) {
Composite composite= new Composite(parent, SWT.NULL);
@@ -197,6 +199,7 @@ public class InputPatchPage extends WizardPage {
* allows the user to specify where to root the patch
* @return PreviewPatchPage if multi-project patch, PatchTargetPage if single project patch
*/
+ @Override
public IWizardPage getNextPage() {
if (!checkPageComplete())
return this;
@@ -340,6 +343,7 @@ public class InputPatchPage extends WizardPage {
/* (non-JavaDoc)
* Method declared in IWizardPage.
*/
+ @Override
public boolean canFlipToNextPage() {
// we can't call getNextPage to determine if flipping is allowed since computing
// the next page is quite expensive. So we say yes if the page is complete.
@@ -414,6 +418,7 @@ public class InputPatchPage extends WizardPage {
// Add listeners
fUseClipboardButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (!fUseClipboardButton.getSelection())
return;
@@ -430,6 +435,7 @@ public class InputPatchPage extends WizardPage {
});
fUsePatchFileButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (!fUsePatchFileButton.getSelection())
return;
@@ -445,11 +451,13 @@ public class InputPatchPage extends WizardPage {
}
});
fPatchFileNameField.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateWidgetEnablements();
}
});
fPatchFileNameField.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
clearErrorMessage();
fShowError= true;
@@ -458,6 +466,7 @@ public class InputPatchPage extends WizardPage {
}
});
fPatchFileBrowseButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
clearErrorMessage();
fShowError= true;
@@ -466,6 +475,7 @@ public class InputPatchPage extends WizardPage {
}
});
fUseURLButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
clearErrorMessage();
fShowError= (fPatchURLField.getText() != ""); //$NON-NLS-1$
@@ -477,6 +487,7 @@ public class InputPatchPage extends WizardPage {
}
});
fPatchURLField.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
clearErrorMessage();
fShowError = true;
@@ -485,6 +496,7 @@ public class InputPatchPage extends WizardPage {
}
});
fUseWorkspaceButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (!fUseWorkspaceButton.getSelection())
return;
@@ -501,6 +513,7 @@ public class InputPatchPage extends WizardPage {
});
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
clearErrorMessage();
updateWidgetEnablements();
@@ -508,6 +521,7 @@ public class InputPatchPage extends WizardPage {
});
fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
ISelection selection= event.getSelection();
if (selection instanceof TreeSelection) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
index 4ce115d03..c5bfbdccb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
@@ -77,6 +77,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
wrappedProvider = labelProvider;
}
+ @Override
public String getText(Object element) {
String text = wrappedProvider.getText(element);
if (element instanceof PatchDiffNode){
@@ -120,6 +121,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
return text;
}
+ @Override
public Image getImage(Object element) {
Image image = wrappedProvider.getImage(element);
if (element instanceof PatchDiffNode){
@@ -157,6 +159,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
Assert.isNotNull(patcher);
this.patcher = patcher;
root = new DiffNode(Differencer.NO_CHANGE) {
+ @Override
public boolean hasChildren() {
return true;
}
@@ -174,6 +177,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
return imageCache;
}
+ @Override
protected void handleDispose() {
super.handleDispose();
getImageCache(getPatcher().getConfiguration()).dispose();
@@ -187,6 +191,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
return cache;
}
+ @Override
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
initLabels();
return root;
@@ -268,6 +273,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
if (left instanceof UnmatchedHunkTypedElement) {
UnmatchedHunkTypedElement element = (UnmatchedHunkTypedElement) left;
element.addContentChangeListener(new IContentChangeListener() {
+ @Override
public void contentChanged(IContentChangeNotifier source) {
if (getViewer() == null || getViewer().getControl().isDisposed())
return;
@@ -284,8 +290,10 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
/* (non-Javadoc)
* @see org.eclipse.compare.CompareEditorInput#createDiffViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Viewer createDiffViewer(Composite parent) {
viewer = new DiffTreeViewer(parent, getCompareConfiguration()){
+ @Override
protected void fillContextMenu(IMenuManager manager) {
PatchCompareEditorInput.this.fillContextMenu(manager);
}
@@ -294,6 +302,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
viewer.setLabelProvider(new PatcherCompareEditorLabelProvider((ILabelProvider)viewer.getLabelProvider()));
viewer.getTree().setData(CompareUI.COMPARE_VIEWER_TITLE, PatchMessages.PatcherCompareEditorInput_PatchContents);
viewer.addOpenListener(new IOpenListener() {
+ @Override
public void open(OpenEvent event) {
IStructuredSelection sel= (IStructuredSelection) event.getSelection();
Object obj= sel.getFirstElement();
@@ -319,6 +328,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
private ViewerFilter[] getFilters() {
return new ViewerFilter[] { new ViewerFilter() {
+ @Override
public boolean select(Viewer v, Object parentElement, Object element) {
if (element instanceof PatchDiffNode) {
PatchDiffNode node = (PatchDiffNode) element;
@@ -425,6 +435,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
protected abstract void fillContextMenu(IMenuManager manager);
+ @Override
public Viewer findStructureViewer(Viewer oldViewer, ICompareInput input,
Composite parent) {
if (org.eclipse.compare.internal.Utilities.isHunk(input))
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchDiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchDiffNode.java
index 76722c7b8..1b9aaf535 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchDiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchDiffNode.java
@@ -50,6 +50,7 @@ public abstract class PatchDiffNode extends DiffNode implements IResourceProvide
protected abstract PatchConfiguration getConfiguration();
+ @Override
public boolean equals(Object other) {
if (other instanceof PatchDiffNode) {
PatchDiffNode node = (PatchDiffNode) other;
@@ -58,10 +59,12 @@ public abstract class PatchDiffNode extends DiffNode implements IResourceProvide
return super.equals(other);
}
+ @Override
public int hashCode() {
return getPatchElement().hashCode();
}
+ @Override
public IResource getResource() {
return null;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
index 0705d804c..b438e6479 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
@@ -79,6 +79,7 @@ public class PatchFileDiffNode extends PatchDiffNode implements IContentChangeLi
return result;
}
+ @Override
protected PatchConfiguration getConfiguration() {
return result.getConfiguration();
}
@@ -86,6 +87,7 @@ public class PatchFileDiffNode extends PatchDiffNode implements IContentChangeLi
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffContainer#add(org.eclipse.compare.structuremergeviewer.IDiffElement)
*/
+ @Override
public void add(IDiffElement diff) {
super.add(diff);
// Listen for content changes in unmatched children so we can fire an input change
@@ -102,10 +104,12 @@ public class PatchFileDiffNode extends PatchDiffNode implements IContentChangeLi
/* (non-Javadoc)
* @see org.eclipse.compare.IContentChangeListener#contentChanged(org.eclipse.compare.IContentChangeNotifier)
*/
+ @Override
public void contentChanged(IContentChangeNotifier source) {
fireChange();
}
+ @Override
public int getKind() {
int kind = super.getKind();
if (kind == Differencer.NO_CHANGE && getPatcher().hasCachedContents(getDiffResult().getDiff())) {
@@ -119,6 +123,7 @@ public class PatchFileDiffNode extends PatchDiffNode implements IContentChangeLi
return file != null && file.isAccessible();
}
+ @Override
public IResource getResource() {
return ((WorkspaceFileDiffResult)getDiffResult()).getTargetFile();
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchProjectDiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchProjectDiffNode.java
index e2f56404c..873e3b2bc 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchProjectDiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchProjectDiffNode.java
@@ -36,6 +36,7 @@ public class PatchProjectDiffNode extends PatchDiffNode {
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffNode#getName()
*/
+ @Override
public String getName() {
return project.getName();
}
@@ -43,6 +44,7 @@ public class PatchProjectDiffNode extends PatchDiffNode {
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffNode#getImage()
*/
+ @Override
public Image getImage() {
Image image = CompareUI.getImage(Utilities.getProject(project));
if (containsProblems()) {
@@ -68,10 +70,12 @@ public class PatchProjectDiffNode extends PatchDiffNode {
/* (non-Javadoc)
* @see org.eclipse.compare.structuremergeviewer.DiffNode#getType()
*/
+ @Override
public String getType() {
return ITypedElement.FOLDER_TYPE;
}
+ @Override
protected PatchConfiguration getConfiguration() {
return configuration;
}
@@ -80,6 +84,7 @@ public class PatchProjectDiffNode extends PatchDiffNode {
return project;
}
+ @Override
public IResource getResource() {
return ResourcesPlugin.getWorkspace().getRoot().getProject(getDiffProject().getName());
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
index 78a50f9da..954013e82 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchTargetPage.java
@@ -75,6 +75,7 @@ public class PatchTargetPage extends WizardPage {
return (new Path(textField.getText())).makeAbsolute();
}
+ @Override
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
@@ -93,7 +94,8 @@ public class PatchTargetPage extends WizardPage {
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE);
useWorkspaceAsTarget.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
+ @Override
+ public void handleEvent(Event event) {
fShowError = true;
if (useWorkspaceAsTarget.getSelection()) {
fPatchTargets.getTree().setEnabled(false);
@@ -128,6 +130,7 @@ public class PatchTargetPage extends WizardPage {
/* (non-JavaDoc)
* Method declared in IWizardPage.
*/
+ @Override
public IWizardPage getNextPage() {
// if selected target is file ensure that patch file
@@ -160,6 +163,7 @@ public class PatchTargetPage extends WizardPage {
/* (non-JavaDoc)
* Method declared in IWizardPage.
*/
+ @Override
public boolean canFlipToNextPage() {
// we can't call getNextPage to determine if flipping is allowed since computing
// the next page is quite expensive. So we say yes if the page is complete.
@@ -186,6 +190,7 @@ public class PatchTargetPage extends WizardPage {
// register listeners
fPatchTargets.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
fShowError = true;
fPatcher.setTarget(Utilities.getFirstResource(event.getSelection()));
@@ -194,6 +199,7 @@ public class PatchTargetPage extends WizardPage {
});
fPatchTargets.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
((PatchWizard)getWizard()).showPage(getNextPage());
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
index 31efd3795..4945b0026 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
@@ -105,6 +105,7 @@ public class PatchWizard extends Wizard {
/* (non-Javadoc)
* Method declared on IWizard.
*/
+ @Override
public void addPages() {
if (patch == null)
addPage(fPatchWizardPage = new InputPatchPage(this));
@@ -119,6 +120,7 @@ public class PatchWizard extends Wizard {
/* (non-Javadoc)
* Method declared on IWizard.
*/
+ @Override
public boolean performFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
@@ -168,9 +170,11 @@ public class PatchWizard extends Wizard {
}
WorkspaceModifyOperation op = new WorkspaceModifyOperation(scheduleRule) {
+ @Override
protected void execute(IProgressMonitor monitor) throws InvocationTargetException {
try {
fPatcher.applyAll(monitor, new Patcher.IFileValidator() {
+ @Override
public boolean validateResources(IFile[] resoures) {
return Utilities.validateResources(resoures, getShell(), PatchMessages.PatchWizard_title);
}
@@ -207,6 +211,7 @@ public class PatchWizard extends Wizard {
getContainer().showPage(page);
}
+ @Override
public IWizardPage getNextPage(IWizardPage page) {
//no patch has been read in yet, input patch page
if (!patchReadIn)
@@ -235,6 +240,7 @@ public class PatchWizard extends Wizard {
return fConfiguration;
}
+ @Override
public boolean canFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
if (currentPage.getName().equals(PreviewPatchPage2.PREVIEWPATCHPAGE_NAME)){
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
index 8273a1c43..af2535421 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java
@@ -27,6 +27,7 @@ public class PatchWizardDialog extends WizardDialog {
setMinimumPageSize(700, 500);
}
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = CompareUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(PATCH_WIZARD_SETTINGS_SECTION);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
index 3028911d0..6eda0af90 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
@@ -106,6 +106,7 @@ public class PreviewPatchPage2 extends WizardPage {
this.fPatcher = patcher;
this.fConfiguration = configuration;
this.fConfiguration.addPropertyChangeListener(new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(CompareConfiguration.IGNORE_WHITESPACE)){
rebuildTree();
@@ -114,6 +115,7 @@ public class PreviewPatchPage2 extends WizardPage {
});
}
+ @Override
public void createControl(Composite parent) {
fToolkit = new FormToolkit(parent.getDisplay());
fToolkit.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
@@ -125,6 +127,7 @@ public class PreviewPatchPage2 extends WizardPage {
initializeDialogUnits(parent);
fInput = new PatchCompareEditorInput(getPatcher(), getCompareConfiguration()) {
+ @Override
protected void fillContextMenu(IMenuManager manager) {
if (isShowAll()) {
manager.add(fIncludeAction);
@@ -150,6 +153,7 @@ public class PreviewPatchPage2 extends WizardPage {
initializeActions();
fInput.contributeDiffViewerToolbarItems(getContributedActions(), getPatcher().isWorkspacePatch());
fInput.getViewer().addSelectionChangedListener(new ISelectionChangedListener(){
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection s = event.getSelection();
if (s != null && !s.isEmpty()) {
@@ -206,6 +210,7 @@ public class PreviewPatchPage2 extends WizardPage {
private void initializeActions() {
fMoveAction = new Action(PatchMessages.PreviewPatchPage2_RetargetAction, null) {
+ @Override
public void run() {
Shell shell = getShell();
ISelection selection = fInput.getViewer().getSelection();
@@ -229,6 +234,7 @@ public class PreviewPatchPage2 extends WizardPage {
fMoveAction .setToolTipText(PatchMessages.PreviewPatchPage2_RetargetTooltip);
fMoveAction.setEnabled(true);
fInput.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel= (IStructuredSelection) event.getSelection();
Object obj= sel.getFirstElement();
@@ -246,6 +252,7 @@ public class PreviewPatchPage2 extends WizardPage {
});
fExcludeAction = new Action(PatchMessages.PreviewPatchPage2_0) {
+ @Override
public void run() {
ISelection selection = fInput.getViewer().getSelection();
if (selection instanceof TreeSelection){
@@ -267,6 +274,7 @@ public class PreviewPatchPage2 extends WizardPage {
fExcludeAction.setEnabled(true);
fIncludeAction = new Action(PatchMessages.PreviewPatchPage2_1) {
+ @Override
public void run() {
ISelection selection = fInput.getViewer().getSelection();
if (selection instanceof TreeSelection){
@@ -288,9 +296,11 @@ public class PreviewPatchPage2 extends WizardPage {
fIncludeAction.setEnabled(true);
fIgnoreWhiteSpace = new Action(PatchMessages.PreviewPatchPage2_IgnoreWSAction, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_ENABLED)){
+ @Override
public void run(){
try {
getContainer().run(false, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(PatchMessages.PreviewPatchPage2_IgnoreWhitespace, IProgressMonitor.UNKNOWN);
if (isChecked() != getPatcher().isIgnoreWhitespace()) {
@@ -315,9 +325,11 @@ public class PreviewPatchPage2 extends WizardPage {
fIgnoreWhiteSpace.setDisabledImageDescriptor(CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_DISABLED));
fReversePatch = new Action(PatchMessages.PreviewPatchPage_ReversePatch_text){
+ @Override
public void run(){
try {
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(PatchMessages.PreviewPatchPage2_CalculateReverse, IProgressMonitor.UNKNOWN);
if (isChecked() != getPatcher().isReversed()) {
@@ -343,6 +355,7 @@ public class PreviewPatchPage2 extends WizardPage {
fReversePatch.setToolTipText(PatchMessages.PreviewPatchPage_ReversePatch_text);
}
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
//Need to handle input and rebuild tree only when becoming visible
@@ -369,6 +382,7 @@ public class PreviewPatchPage2 extends WizardPage {
final boolean[] result = new boolean[] { false };
if (ctrl != null && !ctrl.isDisposed()){
Runnable runnable = new Runnable() {
+ @Override
public void run() {
if (!ctrl.isDisposed()) {
// flush any viewers before prompting
@@ -393,6 +407,7 @@ public class PreviewPatchPage2 extends WizardPage {
final Control ctrl = getControl();
if (ctrl != null && !ctrl.isDisposed()){
Runnable runnable = new Runnable() {
+ @Override
public void run() {
if (!ctrl.isDisposed()) {
fInput.buildTree();
@@ -440,6 +455,7 @@ public class PreviewPatchPage2 extends WizardPage {
patchOptions.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
patchOptions.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
patchOptions.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
form.layout();
}
@@ -467,6 +483,7 @@ public class PreviewPatchPage2 extends WizardPage {
if (fStripPrefixSegments!=null)
fStripPrefixSegments.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (patcher.getStripPrefixSegments() != getStripPrefixSegments()) {
if (promptToRebuild(PatchMessages.PreviewPatchPage2_4)) {
@@ -481,6 +498,7 @@ public class PreviewPatchPage2 extends WizardPage {
fFuzzField.addModifyListener(
new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (patcher.getFuzz() != getFuzzFactor()) {
if (promptToRebuild(PatchMessages.PreviewPatchPage2_5)) {
@@ -517,6 +535,7 @@ public class PreviewPatchPage2 extends WizardPage {
Button b= new Button(pair, SWT.PUSH);
b.setText(PatchMessages.PreviewPatchPage_GuessFuzz_text);
b.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (promptToRebuild(PatchMessages.PreviewPatchPage2_6)) {
// Reset the fuzz. We don't use HunkResult.MAXIMUM_FUZZ_FACTOR on purpose here,
@@ -544,6 +563,7 @@ public class PreviewPatchPage2 extends WizardPage {
| GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.GRAB_HORIZONTAL);
generateRejects.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
getPatcher().setGenerateRejectFile(
generateRejects.getSelection());
@@ -560,6 +580,7 @@ public class PreviewPatchPage2 extends WizardPage {
| GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.GRAB_HORIZONTAL);
showRemoved.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fInput.setShowAll(showRemoved.getSelection());
fInput.updateTree();
@@ -576,6 +597,7 @@ public class PreviewPatchPage2 extends WizardPage {
| GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.GRAB_HORIZONTAL);
reversePatch.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fReversePatch != null) {
fReversePatch.setChecked(reversePatch.getSelection());
@@ -620,6 +642,7 @@ public class PreviewPatchPage2 extends WizardPage {
| GridData.HORIZONTAL_ALIGN_BEGINNING
| GridData.GRAB_HORIZONTAL);
showMatched.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fInput.setShowMatched(showMatched.getSelection());
rebuildTree();
@@ -660,6 +683,7 @@ public class PreviewPatchPage2 extends WizardPage {
try {
PlatformUI.getWorkbench().getProgressService().run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) {
result[0]= patcher.guessFuzzFactor(monitor);
}
@@ -752,6 +776,7 @@ public class PreviewPatchPage2 extends WizardPage {
new String[] { added + "", removed + "" }); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Override
public void dispose() {
fToolkit.dispose();
super.dispose();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
index 425aa0b2e..f98808ea0 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
@@ -37,6 +37,7 @@ class RetargetPatchElementDialog extends Dialog {
public RetargetPatchContentProvider(PatchDiffNode node) {
this.node = node;
}
+ @Override
public Object[] getChildren(Object element) {
if (element instanceof IWorkspaceRoot) {
// Don't show closed projects
@@ -71,6 +72,7 @@ class RetargetPatchElementDialog extends Dialog {
fSelectedNode= node;
}
+ @Override
protected Control createButtonBar(Composite parent) {
Control control = super.createButtonBar(parent);
Button okButton = this.getButton(IDialogConstants.OK_ID);
@@ -78,6 +80,7 @@ class RetargetPatchElementDialog extends Dialog {
return control;
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);
@@ -158,6 +161,7 @@ class RetargetPatchElementDialog extends Dialog {
return ""; //$NON-NLS-1$
}
+ @Override
protected void okPressed() {
if (fSelectedResource != null){
if (fSelectedNode instanceof PatchProjectDiffNode && fSelectedResource instanceof IProject) {
@@ -179,6 +183,7 @@ class RetargetPatchElementDialog extends Dialog {
void setupListeners() {
fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection s= (IStructuredSelection) event.getSelection();
Object obj= s.getFirstElement();
@@ -201,6 +206,7 @@ class RetargetPatchElementDialog extends Dialog {
});
fViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
ISelection s= event.getSelection();
if (s instanceof IStructuredSelection) {
@@ -215,6 +221,7 @@ class RetargetPatchElementDialog extends Dialog {
}
+ @Override
protected Point getInitialSize() {
final Point size= super.getInitialSize();
size.x= convertWidthInCharsToPixels(75);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
index 6efb9f35d..c3d6a8b75 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
@@ -39,6 +39,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.IContentChangeNotifier#addContentChangeListener(org.eclipse.compare.IContentChangeListener)
*/
+ @Override
public synchronized void addContentChangeListener(IContentChangeListener listener) {
if (changeNotifier == null)
changeNotifier = new ContentChangeNotifier(this);
@@ -48,6 +49,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.IContentChangeNotifier#removeContentChangeListener(org.eclipse.compare.IContentChangeListener)
*/
+ @Override
public synchronized void removeContentChangeListener(IContentChangeListener listener) {
if (changeNotifier != null)
changeNotifier.removeContentChangeListener(listener);
@@ -56,6 +58,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.IEditableContent#isEditable()
*/
+ @Override
public boolean isEditable() {
IFile file = ((WorkspaceFileDiffResult)getHunkResult().getDiffResult()).getTargetFile();
return file != null && file.isAccessible();
@@ -64,6 +67,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.IEditableContent#replace(org.eclipse.compare.ITypedElement, org.eclipse.compare.ITypedElement)
*/
+ @Override
public ITypedElement replace(ITypedElement dest, ITypedElement src) {
// Not supported
return null;
@@ -72,6 +76,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.IEditableContent#setContent(byte[])
*/
+ @Override
public void setContent(byte[] newContent) {
getPatcher().setManuallyMerged(getHunkResult().getHunk(), true);
getPatcher().cacheContents(getDiff(), newContent);
@@ -90,6 +95,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
/* (non-Javadoc)
* @see org.eclipse.compare.internal.patch.HunkTypedElement#getContents()
*/
+ @Override
public InputStream getContents() throws CoreException {
// If there are cached contents, use them
if (getPatcher().hasCachedContents(getDiff()))
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
index 659e8b833..0ff61096f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
@@ -56,6 +56,7 @@ public class WorkspaceFileDiffResult extends FileDiffResult {
refresh(Utilities.getReaderCreator(getTargetFile()), null);
}
+ @Override
public String getCharset() {
IFile file = getTargetFile();
try {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
index 611a7aaa6..c1aac5067 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
@@ -59,6 +59,7 @@ public class WorkspacePatcher extends Patcher {
setTarget(target);
}
+ @Override
protected void patchParsed(PatchReader patchReader) {
super.patchParsed(patchReader);
fDiffProjects = patchReader.getDiffProjects();
@@ -80,6 +81,7 @@ public class WorkspacePatcher extends Patcher {
//---- parsing patch files
+ @Override
public void applyAll(IProgressMonitor pm, IFileValidator validator) throws CoreException {
if (pm == null)
pm = new NullProgressMonitor();
@@ -195,6 +197,7 @@ public class WorkspacePatcher extends Patcher {
return (IFile[]) files.toArray(new IFile[files.size()]);
}
+ @Override
public IFile getTargetFile(FilePatch2 diff) {
IPath path = diff.getStrippedPath(getStripPrefixSegments(), isReversed());
DiffProject project = getProject(diff);
@@ -246,6 +249,7 @@ public class WorkspacePatcher extends Patcher {
fDiffProjects = temp;
}
+ @Override
protected Object getElementParent(Object element) {
if (element instanceof FilePatch2 && fDiffProjects != null) {
FilePatch2 diff = (FilePatch2) element;
@@ -381,6 +385,7 @@ public class WorkspacePatcher extends Patcher {
return null;
}
+ @Override
public int getStripPrefixSegments() {
// Segments are never stripped from a workspace patch
if (isWorkspacePatch())
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
index 3d7bf3751..9ea0db9fa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
@@ -195,6 +195,7 @@ public class ApplyPatchOperation implements Runnable {
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
+ @Override
public void run() {
openWizard();
}
@@ -204,6 +205,7 @@ public class ApplyPatchOperation implements Runnable {
BufferedReader reader = Utilities.createReader(storage);
try {
PatchReader patchReader = new PatchReader() {
+ @Override
protected FilePatch2 createFileDiff(IPath oldPath, long oldDate,
IPath newPath, long newDate) {
return new FilePatch(oldPath, oldDate, newPath,
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/IFilePatch.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/IFilePatch.java
index e2f8b8964..9d05ae903 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/IFilePatch.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/patch/IFilePatch.java
@@ -42,6 +42,7 @@ public interface IFilePatch extends IFilePatch2 {
* @return the target path for this patch
* @see PatchConfiguration#isReversed()
*/
+ @Override
public IPath getTargetPath(PatchConfiguration configuration);
/**
@@ -64,6 +65,7 @@ public interface IFilePatch extends IFilePatch2 {
* @return the header information of the patch or
* <code>null</code>
*/
+ @Override
public String getHeader();
/**
@@ -73,6 +75,7 @@ public interface IFilePatch extends IFilePatch2 {
* @return milliseconds time value of the before date from the patch
* @since 3.4
*/
+ @Override
public long getBeforeDate();
/**
@@ -82,5 +85,6 @@ public interface IFilePatch extends IFilePatch2 {
* @return milliseconds time value of the after date from the patch
* @since 3.4
*/
+ @Override
public long getAfterDate();
}

Back to the top