Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2015-05-04 20:14:30 +0000
committerMatthias Sohn2015-05-04 20:14:44 +0000
commit8f5a2665bb41db2226ed32f49ddf67fc58074cab (patch)
treed7121d1e0a940a3e5b114b849e6d69055f31e8ff
parent68cf77a93f5b82d80141bfd7456b49421480d6a5 (diff)
parent274817ca5ed97a4ce20255ceb8b0056809063f5c (diff)
downloadegit-8f5a2665bb41db2226ed32f49ddf67fc58074cab.tar.gz
egit-8f5a2665bb41db2226ed32f49ddf67fc58074cab.tar.xz
egit-8f5a2665bb41db2226ed32f49ddf67fc58074cab.zip
Merge branch 'master' into stable-4.0
Change-Id: I8677905bb875756b204d7bfecacbcaccdcad18ea Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java14
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntryTest.java15
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProviderTest.java194
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java357
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/ResourceVariantTest.java301
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProviderTest.java98
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/VariantsTestCase.java101
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/storage/GitBlobStorageTest.java (renamed from org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/storage/BlobStorageTest.java)15
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java9
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java39
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java5
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java16
-rw-r--r--org.eclipse.egit.core/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java8
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/NetUtil.java83
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/CoreText.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties1
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java101
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProvider.java129
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitCachedResourceVariantTree.java67
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantCache.java91
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantFileRevision.java60
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeProvider.java64
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriber.java164
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitSyncInfoToDiffConverter.java191
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java167
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/AbstractGitResourceVariant.java112
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitBlobStorage.java8
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexBlobStorage.java8
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexResourceVariant.java53
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/TreeParserResourceVariant.java57
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java74
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java13
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java37
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java (renamed from org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java)78
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponentTest.java65
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java3
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java13
-rw-r--r--org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/GitRepositoriesPerspectiveFactory.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java64
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ConfigurationChecker.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabelProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/RepositorySaveableFilter.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java28
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ValidationUtils.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/WorkbenchStyledLabelProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AddToIndexActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AssumeUnchangedActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BooleanPrefAction.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithCommitActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithHeadActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRefActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigureFetchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigurePushActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CreatePatchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DeleteBranchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DisconnectActionHandler.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/FetchActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeToolActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushTagsActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseAction.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RenameBranchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithOursTheirsMenu.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimpleFetchActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimplePushActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashCreateHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashToolbarAction.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashesMenu.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWithMenu.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagActionHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameRevision.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java12
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java15
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectRepositoryPage.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectWizardPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/ProjectUtils.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationContentProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationLabelProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ConfigureDebugTraceCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/FetchChangeFromGerritCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/PushHeadToGerritCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java15
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInput.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInputFactory.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java14
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NoteDetailsPage.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NotesBlock.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OpenCommitAction.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommit.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommitNote.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CheckoutHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateBranchHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateTagHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/EditHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RewordHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/ShowInHistoryHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/SquashHandler.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashApplyHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashDropHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java52
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/ClickableCellEditor.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/FilteredCheckboxTree.java17
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentAssistProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java15
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java14
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/EGitCredentialsProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceMapping.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecorationResult.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitQuickDiffProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BasicConfigurationDialog.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java12
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CheckoutConflictDialog.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java45
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageArea.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java36
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitSelectDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeContentProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NonDeletedFilesTree.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RebaseTargetSelectionDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RenameBranchDialog.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RevertFailureDialog.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java24
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java15
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultTable.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/TrackingRefUpdateContentProvider.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/gerrit/GerritConfigurationPage.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffLabelProvider.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbarThread.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FormatJob.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java40
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPageSource.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphContentProvider.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/LocationPage.java18
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RenameTracker.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTCommitList.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/AbstractRebaseHistoryCommandHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CheckoutCommitHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CherryPickHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsInTreeHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareWithWorkingTreeHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateBranchOnCommitHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreatePatchHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateTagOnCommitHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteBranchOnCommitHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteTagOnCommitHandler.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/EditHandler.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/MergeHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/OpenInCommitViewerHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/OpenInTextEditorHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/PushCommitHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/RebaseInteractiveCurrentHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/RenameBranchOnCommitHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ResetQuickdiffBaselineHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/RevertHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/RewordHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/SetQuickdiffBaselineHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ShowBlameHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/ShowVersionsHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/SquashHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/importing/GitScmUrlImportWizardPage.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/merge/MergeResultDialog.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/operations/GitScopeUtil.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/AddConfigEntryDialog.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommittingPreferencePage.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java20
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DialogsPreferencePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitDecoratorPreferencePage.java55
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GlobalConfigurationPreferencePage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/HistoryPreferencePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ProjectsPreferencePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/StorageSizeFieldEditor.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/SynchronizePreferencePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/WindowCachePreferencePage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/PullOperationUI.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/AddRemotePage.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/ConfirmationPage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushBranchPage.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java71
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushTagsWizard.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushWizard.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefSpecDialog.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateContentProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/RefUpdateElement.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/SimpleConfigurePushDialog.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/CommitMessageEditorDialog.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveDragSourceListener.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveDropTargetListener.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractivePlanContentProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveStepActionToolBarProvider.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveView.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebasePlanIndexer.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseResultDialog.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/RefSelectionDialog.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogViewContentProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/command/CheckoutHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/command/CopyHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/command/OpenInCommitViewerHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/command/ResetHandler.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/BranchPropertySource.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateRepositoryPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/NewRepositoryWizard.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java17
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewStyledCellLabelProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryDragAssistant.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertyPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySourceProvider.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryRemotePropertySource.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchWizard.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryStatisticsPage.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/SelectResetTypePage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/LinkHelper.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoriesViewPropertyTester.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/AddToIndexCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ChangeCredentialsCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CheckoutCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ClearCredentialsCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CloneCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ConfigureBranchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ConfigureFetchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ConfigureGerritRemoteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ConfigurePushCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ConfigureRemoteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CopyPathCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateBranchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteBranchCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteFetchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteFileCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeletePushCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteTagCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/FetchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/FetchConfiguredRemoteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/GarbageCollectCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportChangedProjectsCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportProjectsCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/LinkWithSelectionCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/MergeCommand.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/OpenCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/OpenInEditorCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PushConfiguredRemoteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RefreshCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveOrDeleteRepositoryCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveRemoteCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameBranchCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ResetCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashApplyCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/StashDropCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleAddCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleSyncCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SubmoduleUpdateCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/SynchronizeCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ToggleBranchCommitCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ToggleBranchHierarchyCommand.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/EditableRevision.java16
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java27
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionTypedElement.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/GitCompareFileRevisionEditorInput.java14
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/LocalFileRevision.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/LocationEditableRevision.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/StorageTypedElement.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitMatch.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitResultLabelProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchPage.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchQuery.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResult.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/RepositoryMatch.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionPropertyTester.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/ExistingOrNewPage.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/MoveProjectsLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/RepoComboContentProvider.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/RepoComboLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/sharing/SharingWizard.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingEntry.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingEntryAdapterFactory.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingFolderEntry.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java56
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewContentProvider.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingViewLabelProvider.java23
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/submodule/AddSubmoduleWizard.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/submodule/SubmodulePathWizardPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronize.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizardPage.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SynchronizeFetchJob.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/ExpandAllModelAction.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/GitOpenInCompareAction.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/OpenWorkingFileAction.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/PullAction.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/PushAction.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/GitCacheCompareInput.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/GitCompareInput.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/LocalNonWorkspaceTypedElement.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetLabelProvider.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitModelWorkbenchAdapter.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelBlob.java12
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCommit.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRepository.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/trace/GitTraceLocation.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/variables/GitVariableResolver.java2
-rw-r--r--pom.xml11
424 files changed, 4513 insertions, 233 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
index b163a05182..389d0476f0 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/GitMoveDeleteHookTest.java
@@ -146,8 +146,9 @@ public class GitMoveDeleteHookTest {
"some text");
testUtils.addFileToProject(project.getProject(), "file2.txt",
"some more text");
+ IFile file = project.getProject().getFile("file.txt");
AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
- new IResource[] { project.getProject().getFile("file.txt"),
+ new IResource[] { file,
project.getProject().getFile("file2.txt") });
addToIndexOperation.execute(null);
@@ -158,9 +159,12 @@ public class GitMoveDeleteHookTest {
assertNotNull(dirCache.getEntry("file.txt"));
assertNotNull(dirCache.getEntry("file2.txt"));
// Modify the content before the move
- testUtils.changeContentOfFile(project.getProject(), project
- .getProject().getFile("file.txt"), "other text");
- project.getProject().getFile("file.txt").delete(true, null);
+ testUtils.changeContentOfFile(project.getProject(), file, "other text");
+ testUtils.waitForJobs(10000, 1000, JobFamilies.INDEX_DIFF_CACHE_UPDATE);
+
+ file.delete(true, null);
+
+ testUtils.waitForJobs(10000, 1000, JobFamilies.INDEX_DIFF_CACHE_UPDATE);
// Check index for the deleted file
dirCache.read();
@@ -168,7 +172,7 @@ public class GitMoveDeleteHookTest {
assertNull(dirCache.getEntry("file.txt"));
assertNotNull(dirCache.getEntry("file2.txt"));
// Actual file is deleted
- assertFalse(project.getProject().getFile("file.txt").exists());
+ assertFalse(file.exists());
// But a non-affected file remains
assertTrue(project.getProject().getFile("file2.txt").exists());
}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntryTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntryTest.java
index 650abf5d0e..0bc4156052 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntryTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/indexdiff/IndexDiffCacheEntryTest.java
@@ -20,8 +20,6 @@ import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.JobFamilies;
import org.eclipse.egit.core.test.GitTestCase;
@@ -177,18 +175,7 @@ public class IndexDiffCacheEntryTest extends GitTestCase {
*/
private void waitForJobs(long maxWaitTime, Object family)
throws InterruptedException {
- Thread.sleep(50);
- long start = System.currentTimeMillis();
- IJobManager jobManager = Job.getJobManager();
-
- Job[] jobs = jobManager.find(family);
- while (jobs.length > 0) {
- Thread.sleep(100);
- jobs = jobManager.find(family);
- if (System.currentTimeMillis() - start > maxWaitTime) {
- return;
- }
- }
+ testUtils.waitForJobs(maxWaitTime, family);
}
private void cleanEntryFlags() {
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProviderTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProviderTest.java
new file mode 100644
index 0000000000..37929acd17
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProviderTest.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Obeo and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.egit.core.op.MergeOperation;
+import org.junit.Test;
+
+public class DirCacheResourceVariantTreeProviderTest extends VariantsTestCase {
+ @Test
+ public void testDirCacheAddToIndex() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ testRepo.appendFileContent(file1, INITIAL_CONTENT_1);
+
+ // untracked file : not part of the index
+ DirCacheResourceVariantTreeProvider treeProvider = new DirCacheResourceVariantTreeProvider(
+ repo);
+ assertTrue(treeProvider.getKnownResources().isEmpty());
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getSourceTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getRemoteTree().hasResourceVariant(iFile1));
+
+ testRepo.addToIndex(iFile1);
+
+ // We now have a stage 0, but this isn't represented in the resource
+ // variant tree provider
+ treeProvider = new DirCacheResourceVariantTreeProvider(repo);
+ assertTrue(treeProvider.getKnownResources().isEmpty());
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getSourceTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getRemoteTree().hasResourceVariant(iFile1));
+ }
+
+ @Test
+ public void testDirCacheTreesNoConflict() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2,
+ "second file - initial commit");
+
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+ IFile iFile2 = testRepo.getIFile(iProject, file2);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ final String branchChanges = "branch changes\n";
+ setContentsAndCommit(testRepo, iFile2, branchChanges
+ + INITIAL_CONTENT_2, "branch commit");
+
+ testRepo.checkoutBranch(MASTER);
+
+ final String masterChanges = "\nsome changes";
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + masterChanges, "master commit");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ // end setup
+
+ // try and merge the branch into master
+ new MergeOperation(repo, BRANCH).execute(null);
+
+ // no conflict on either file : nothing in the trees
+ DirCacheResourceVariantTreeProvider treeProvider = new DirCacheResourceVariantTreeProvider(
+ repo);
+ assertTrue(treeProvider.getKnownResources().isEmpty());
+
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile2));
+
+ assertFalse(treeProvider.getSourceTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getSourceTree().hasResourceVariant(iFile2));
+
+ assertFalse(treeProvider.getRemoteTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getRemoteTree().hasResourceVariant(iFile2));
+ }
+
+ @Test
+ public void testDirCacheTreesConflictOnOne() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2,
+ "second file - initial commit");
+
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+ IFile iFile2 = testRepo.getIFile(iProject, file2);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ final String branchChanges = "branch changes\n";
+ setContentsAndCommit(testRepo, iFile1, branchChanges
+ + INITIAL_CONTENT_1, "branch commit");
+ setContentsAndCommit(testRepo, iFile2, branchChanges
+ + INITIAL_CONTENT_2, "branch commit");
+
+ testRepo.checkoutBranch(MASTER);
+
+ final String masterChanges = "\nsome changes";
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + masterChanges, "master commit");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ // end setup
+
+ // try and merge the branch into master
+ new MergeOperation(repo, BRANCH).execute(null);
+
+ // conflict on file 1 : present in all three trees
+ // no conflict on file 2 : not present in any tree
+ DirCacheResourceVariantTreeProvider treeProvider = new DirCacheResourceVariantTreeProvider(
+ repo);
+ assertTrue(treeProvider.getKnownResources().contains(iFile1));
+ assertFalse(treeProvider.getKnownResources().contains(iFile2));
+
+ assertTrue(treeProvider.getBaseTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile2));
+
+ assertTrue(treeProvider.getSourceTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getSourceTree().hasResourceVariant(iFile2));
+
+ assertTrue(treeProvider.getRemoteTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getRemoteTree().hasResourceVariant(iFile2));
+ }
+
+ @Test
+ public void testDirCacheTreesConflict() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ final String branchChanges = "branch changes\n";
+ setContentsAndCommit(testRepo, iFile1, branchChanges
+ + INITIAL_CONTENT_1, "branch commit");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2
+ + "branch", "second file - initial commit - branch");
+
+ testRepo.checkoutBranch(MASTER);
+
+ final String masterChanges = "some changes\n";
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + masterChanges, "master commit - file1");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2
+ + "master", "second file - initial commit - master");
+ IFile iFile2 = testRepo.getIFile(iProject, file2);
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ // end setup
+
+ // try and merge the branch into master
+ new MergeOperation(repo, BRANCH).execute(null);
+
+ // conflict on file 1 : file 1 has three stages.
+ // conflict on file 2, but was not in the base : only stage 2 and 3
+ DirCacheResourceVariantTreeProvider treeProvider = new DirCacheResourceVariantTreeProvider(
+ repo);
+ assertTrue(treeProvider.getKnownResources().contains(iFile1));
+ assertTrue(treeProvider.getKnownResources().contains(iFile2));
+
+ assertTrue(treeProvider.getBaseTree().hasResourceVariant(iFile1));
+ assertFalse(treeProvider.getBaseTree().hasResourceVariant(iFile2));
+
+ assertTrue(treeProvider.getSourceTree().hasResourceVariant(iFile1));
+ assertTrue(treeProvider.getSourceTree().hasResourceVariant(iFile2));
+
+ assertTrue(treeProvider.getRemoteTree().hasResourceVariant(iFile1));
+ assertTrue(treeProvider.getRemoteTree().hasResourceVariant(iFile2));
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java
new file mode 100644
index 0000000000..11046f2985
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriberTest.java
@@ -0,0 +1,357 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Obeo and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jgit.revwalk.RevTree;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.treewalk.NameConflictTreeWalk;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.team.core.diff.IDiff;
+import org.eclipse.team.core.diff.IThreeWayDiff;
+import org.eclipse.team.core.history.IFileRevision;
+import org.eclipse.team.core.mapping.provider.ResourceDiff;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.junit.Before;
+import org.junit.Test;
+
+public class GitResourceVariantTreeSubscriberTest extends VariantsTestCase {
+ private static final String BRANCH_CHANGES = "branch changes\n";
+
+ private static final String MASTER_CHANGES = "\nsome changes";
+
+ private static final String BASE = "base";
+
+ private File file1;
+
+ private File file2;
+
+ private IFile iFile1;
+
+ private IFile iFile2;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+
+ file1 = testRepo.createFile(iProject, "file1");
+ file2 = testRepo.createFile(iProject, "file2");
+
+ iFile1 = testRepo.getIFile(iProject, file1);
+ iFile2 = testRepo.getIFile(iProject, file2);
+ }
+
+ @Test
+ public void testSubscriber() throws Exception {
+ GitResourceVariantTreeProvider provider = createTreeProvider();
+ GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
+ provider);
+
+ assertTrue(subscriber.isSupervised(iProject));
+ assertTrue(subscriber.isSupervised(iFile1));
+ assertTrue(subscriber.isSupervised(iFile2));
+
+ assertSame(provider.getBaseTree(), subscriber.getBaseTree());
+ assertSame(provider.getRemoteTree(), subscriber.getRemoteTree());
+ assertSame(provider.getSourceTree(), subscriber.getSourceTree());
+
+ assertNotNull(subscriber.getDiff(iProject));
+ assertNotNull(subscriber.getDiff(iFile1));
+ assertNotNull(subscriber.getDiff(iFile2));
+
+ assertNotNull(subscriber.getSyncInfo(iProject));
+ assertNotNull(subscriber.getSyncInfo(iFile1));
+ assertNotNull(subscriber.getSyncInfo(iFile2));
+
+ }
+
+ @Test
+ public void testSyncInfo() throws Exception {
+ GitResourceVariantTreeProvider provider = createTreeProvider();
+ GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
+ provider);
+
+ final SyncInfo projectInfo = subscriber.getSyncInfo(iProject);
+ assertNotNull(projectInfo);
+ assertEquals(SyncInfo.CONFLICTING | SyncInfo.CHANGE,
+ projectInfo.getKind());
+
+ final SyncInfo syncInfo1 = subscriber.getSyncInfo(iFile1);
+ assertNotNull(syncInfo1);
+ assertEquals(SyncInfo.OUTGOING | SyncInfo.CHANGE, syncInfo1.getKind());
+ IResourceVariant baseVariant1 = syncInfo1.getBase();
+ IResourceVariant remoteVariant1 = syncInfo1.getRemote();
+ assertContentEquals(baseVariant1, INITIAL_CONTENT_1);
+ assertContentEquals(remoteVariant1, INITIAL_CONTENT_1);
+
+ final SyncInfo syncInfo2 = subscriber.getSyncInfo(iFile2);
+ assertNotNull(syncInfo2);
+ assertEquals(SyncInfo.INCOMING | SyncInfo.CHANGE, syncInfo2.getKind());
+ IResourceVariant baseVariant2 = syncInfo2.getBase();
+ IResourceVariant remoteVariant2 = syncInfo2.getRemote();
+ assertContentEquals(baseVariant2, INITIAL_CONTENT_2);
+ assertContentEquals(remoteVariant2, BRANCH_CHANGES + INITIAL_CONTENT_2);
+ }
+
+ @Test
+ public void testDiff() throws Exception {
+ GitResourceVariantTreeProvider provider = createTreeProvider();
+ GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
+ provider);
+
+ final IDiff diff1 = subscriber.getDiff(iFile1);
+ assertTrue(diff1 instanceof IThreeWayDiff);
+ assertEquals(IDiff.CHANGE, diff1.getKind());
+ assertEquals(IThreeWayDiff.OUTGOING,
+ ((IThreeWayDiff) diff1).getDirection());
+ final IDiff localDiff1 = ((IThreeWayDiff) diff1).getLocalChange();
+ final IDiff remoteDiff1 = ((IThreeWayDiff) diff1).getRemoteChange();
+ assertNull(remoteDiff1);
+ assertTrue(localDiff1 instanceof ResourceDiff);
+ final IFileRevision localState1 = ((ResourceDiff) localDiff1)
+ .getAfterState();
+ final IFileRevision baseState1 = ((ResourceDiff) localDiff1)
+ .getBeforeState();
+ assertNotNull(localState1);
+ assertNotNull(baseState1);
+ assertTrue(iFile1.getName().equals(localState1.getName()));
+ assertTrue(iFile1.getName().equals(baseState1.getName()));
+ final IStorage localStorage1 = localState1
+ .getStorage(new NullProgressMonitor());
+ final IStorage baseStorage1 = baseState1
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(localStorage1, INITIAL_CONTENT_1 + MASTER_CHANGES);
+ assertContentEquals(baseStorage1, INITIAL_CONTENT_1);
+
+ final IDiff diff2 = subscriber.getDiff(iFile2);
+ assertTrue(diff2 instanceof IThreeWayDiff);
+ assertEquals(IDiff.CHANGE, diff2.getKind());
+ assertEquals(IThreeWayDiff.INCOMING,
+ ((IThreeWayDiff) diff2).getDirection());
+ final IDiff localDiff2 = ((IThreeWayDiff) diff2).getLocalChange();
+ final IDiff remoteDiff2 = ((IThreeWayDiff) diff2).getRemoteChange();
+ assertTrue(remoteDiff2 instanceof ResourceDiff);
+ assertNull(localDiff2);
+ final IFileRevision remoteState2 = ((ResourceDiff) remoteDiff2)
+ .getAfterState();
+ final IFileRevision ancestorState2 = ((ResourceDiff) remoteDiff2)
+ .getBeforeState();
+ assertTrue(iFile2.getName().equals(ancestorState2.getName()));
+ assertTrue(iFile2.getName().equals(remoteState2.getName()));
+ final IStorage ancestorStorage2 = ancestorState2
+ .getStorage(new NullProgressMonitor());
+ final IStorage remoteStorage2 = remoteState2
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(ancestorStorage2, INITIAL_CONTENT_2);
+ assertContentEquals(remoteStorage2, BRANCH_CHANGES + INITIAL_CONTENT_2);
+ }
+
+ @Test
+ public void testAddLocalAndRemote() throws Exception {
+ GitResourceVariantTreeProvider provider = createTreeProviderWithAdditions();
+ GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
+ provider);
+
+ final IDiff diff1 = subscriber.getDiff(iFile1);
+ assertTrue(diff1 instanceof IThreeWayDiff);
+ assertEquals(IDiff.ADD, diff1.getKind());
+ assertEquals(IThreeWayDiff.OUTGOING,
+ ((IThreeWayDiff) diff1).getDirection());
+ final IDiff localDiff1 = ((IThreeWayDiff) diff1).getLocalChange();
+ final IDiff remoteDiff1 = ((IThreeWayDiff) diff1).getRemoteChange();
+ assertTrue(localDiff1 instanceof ResourceDiff);
+ assertNull(remoteDiff1);
+ final IFileRevision ancestorState1 = ((ResourceDiff) localDiff1)
+ .getBeforeState();
+ final IFileRevision localState1 = ((ResourceDiff) localDiff1)
+ .getAfterState();
+ assertTrue(iFile1.getName().equals(localState1.getName()));
+ assertNull(ancestorState1);
+ final IStorage localStorage1 = localState1
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(localStorage1, INITIAL_CONTENT_1);
+
+ final IDiff diff2 = subscriber.getDiff(iFile2);
+ assertTrue(diff2 instanceof IThreeWayDiff);
+ assertEquals(IDiff.ADD, diff2.getKind());
+ assertEquals(IThreeWayDiff.INCOMING,
+ ((IThreeWayDiff) diff2).getDirection());
+ final IDiff localDiff2 = ((IThreeWayDiff) diff2).getLocalChange();
+ final IDiff remoteDiff2 = ((IThreeWayDiff) diff2).getRemoteChange();
+ assertTrue(remoteDiff2 instanceof ResourceDiff);
+ assertNull(localDiff2);
+ final IFileRevision ancestorState2 = ((ResourceDiff) remoteDiff2)
+ .getBeforeState();
+ final IFileRevision remoteState2 = ((ResourceDiff) remoteDiff2)
+ .getAfterState();
+ assertNull(ancestorState2);
+ assertTrue(iFile2.getName().equals(remoteState2.getName()));
+ final IStorage remoteStorage2 = remoteState2
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(remoteStorage2, INITIAL_CONTENT_2);
+ }
+
+ @Test
+ public void testRemoveLocalAndRemote() throws Exception {
+ GitResourceVariantTreeProvider provider = createTreeProviderWithDeletions();
+ GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
+ provider);
+
+ // file1 has been removed locally
+ final IDiff diff1 = subscriber.getDiff(iFile1);
+ assertTrue(diff1 instanceof IThreeWayDiff);
+ assertEquals(IDiff.REMOVE, diff1.getKind());
+ assertEquals(IThreeWayDiff.OUTGOING,
+ ((IThreeWayDiff) diff1).getDirection());
+ final IDiff localDiff1 = ((IThreeWayDiff) diff1).getLocalChange();
+ final IDiff remoteDiff1 = ((IThreeWayDiff) diff1).getRemoteChange();
+ assertTrue(localDiff1 instanceof ResourceDiff);
+ assertNull(remoteDiff1);
+ final IFileRevision ancestorState1 = ((ResourceDiff) localDiff1)
+ .getBeforeState();
+ final IFileRevision localState1 = ((ResourceDiff) localDiff1)
+ .getAfterState();
+ assertTrue(iFile1.getName().equals(ancestorState1.getName()));
+ assertNull(localState1);
+ final IStorage ancestorStorage1 = ancestorState1
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(ancestorStorage1, INITIAL_CONTENT_1);
+
+ // file2 has been removed remotely
+ final IDiff diff2 = subscriber.getDiff(iFile2);
+ assertTrue(diff2 instanceof IThreeWayDiff);
+ assertEquals(IDiff.REMOVE, diff2.getKind());
+ assertEquals(IThreeWayDiff.INCOMING,
+ ((IThreeWayDiff) diff2).getDirection());
+ final IDiff localDiff2 = ((IThreeWayDiff) diff2).getLocalChange();
+ final IDiff remoteDiff2 = ((IThreeWayDiff) diff2).getRemoteChange();
+ assertTrue(remoteDiff2 instanceof ResourceDiff);
+ assertNull(localDiff2);
+ final IFileRevision ancestorState2 = ((ResourceDiff) remoteDiff2)
+ .getBeforeState();
+ final IFileRevision remoteState2 = ((ResourceDiff) remoteDiff2)
+ .getAfterState();
+ assertTrue(iFile2.getName().equals(ancestorState2.getName()));
+ assertNull(remoteState2);
+ final IStorage rancestorStorage2 = ancestorState2
+ .getStorage(new NullProgressMonitor());
+ assertContentEquals(rancestorStorage2, INITIAL_CONTENT_2);
+ }
+
+ private GitResourceVariantTreeProvider createTreeProvider()
+ throws Exception {
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+ testRepo.appendContentAndCommit(iProject, file2,
+ INITIAL_CONTENT_2, "second file - initial commit");
+ testRepo.createBranch(MASTER, BASE);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ setContentsAndCommit(testRepo, iFile2, BRANCH_CHANGES
+ + INITIAL_CONTENT_2, "branch commit");
+
+ testRepo.checkoutBranch(MASTER);
+
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + MASTER_CHANGES, "master commit");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+
+ // as if we tried to merge branch into master
+ try (RevWalk walk = new RevWalk(repo)) {
+ RevTree baseTree = walk.parseTree(repo.resolve(BASE));
+ RevTree sourceTree = walk.parseTree(repo.resolve(MASTER));
+ RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH));
+ TreeWalk treeWalk = new NameConflictTreeWalk(repo);
+ treeWalk.addTree(baseTree);
+ treeWalk.addTree(sourceTree);
+ treeWalk.addTree(remoteTree);
+ return new TreeWalkResourceVariantTreeProvider(repo, treeWalk, 0,
+ 1, 2);
+ }
+ }
+
+ private GitResourceVariantTreeProvider createTreeProviderWithAdditions()
+ throws Exception {
+ testRepo.createBranch(MASTER, BASE);
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+ file2 = testRepo.createFile(iProject, "file2");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2,
+ "Creation of file2 in branch2.");
+
+ testRepo.checkoutBranch(MASTER);
+ file1 = testRepo.createFile(iProject, "file1");
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "Creation of file1 in branch1.");
+
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+
+ // as if we tried to merge branch3 into branch2
+ try (RevWalk walk = new RevWalk(repo)) {
+ RevTree baseTree = walk.parseTree(repo.resolve(BASE));
+ RevTree sourceTree = walk.parseTree(repo.resolve(MASTER));
+ RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH));
+ TreeWalk treeWalk = new NameConflictTreeWalk(repo);
+ treeWalk.addTree(baseTree);
+ treeWalk.addTree(sourceTree);
+ treeWalk.addTree(remoteTree);
+ return new TreeWalkResourceVariantTreeProvider(repo, treeWalk, 0,
+ 1, 2);
+ }
+ }
+
+ private GitResourceVariantTreeProvider createTreeProviderWithDeletions()
+ throws Exception {
+ file1 = testRepo.createFile(iProject, "file1");
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "Creation of file1 in branch1.");
+ file2 = testRepo.createFile(iProject, "file2");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2,
+ "Creation of file2 in branch2.");
+ testRepo.createBranch(MASTER, BASE);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+ testRepo.untrack(file2);
+ testRepo.commit("Removed file2 in branch.");
+
+ testRepo.checkoutBranch(MASTER);
+ testRepo.untrack(file1);
+ testRepo.commit("Removed file1 in master.");
+
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+
+ // as if we tried to merge branch3 into branch2
+ try (RevWalk walk = new RevWalk(repo)) {
+ RevTree baseTree = walk.parseTree(repo.resolve(BASE));
+ RevTree sourceTree = walk.parseTree(repo.resolve(MASTER));
+ RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH));
+ TreeWalk treeWalk = new NameConflictTreeWalk(repo);
+ treeWalk.addTree(baseTree);
+ treeWalk.addTree(sourceTree);
+ treeWalk.addTree(remoteTree);
+ return new TreeWalkResourceVariantTreeProvider(repo, treeWalk, 0,
+ 1, 2);
+ }
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/ResourceVariantTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/ResourceVariantTest.java
new file mode 100644
index 0000000000..ede07fa3d3
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/ResourceVariantTest.java
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Obeo and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.egit.core.internal.storage.AbstractGitResourceVariant;
+import org.eclipse.egit.core.internal.storage.IndexResourceVariant;
+import org.eclipse.egit.core.internal.storage.TreeParserResourceVariant;
+import org.eclipse.egit.core.op.MergeOperation;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.treewalk.CanonicalTreeParser;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.junit.Test;
+
+public class ResourceVariantTest extends VariantsTestCase {
+ private final static String BASE_BRANCH = "base";
+
+ private final static String BRANCH_CHANGE = "branch changes\n";
+
+ private final static String MASTER_CHANGE = "master changes\n";
+
+ @Test
+ public void testIndexVariants() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+ IFile iFile2 = testRepo.getIFile(iProject, file2);
+
+ setupUnconflictingBranches();
+
+ List<String> possibleNames = Arrays.asList(iFile1.getName(),
+ iFile2.getName());
+ DirCache cache = repo.readDirCache();
+ for (int i = 0; i < cache.getEntryCount(); i++) {
+ final DirCacheEntry entry = cache.getEntry(i);
+
+ AbstractGitResourceVariant variant = IndexResourceVariant.create(
+ repo, entry);
+
+ assertEquals(entry.getObjectId().getName(),
+ variant.getContentIdentifier());
+ assertTrue(possibleNames.contains(variant.getName()));
+ assertEquals(entry.getObjectId(), variant.getObjectId());
+ assertEquals(entry.getRawMode(), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ assertContentEquals(variant, INITIAL_CONTENT_1 + MASTER_CHANGE);
+ } else {
+ assertContentEquals(variant, INITIAL_CONTENT_2 + MASTER_CHANGE);
+ }
+ }
+
+ testRepo.checkoutBranch(BRANCH);
+
+ cache = repo.readDirCache();
+ for (int i = 0; i < cache.getEntryCount(); i++) {
+ final DirCacheEntry entry = cache.getEntry(i);
+
+ AbstractGitResourceVariant variant = IndexResourceVariant.create(
+ repo, entry);
+ assertEquals(entry.getObjectId().getName(),
+ variant.getContentIdentifier());
+ assertTrue(possibleNames.contains(variant.getName()));
+ assertEquals(entry.getObjectId(), variant.getObjectId());
+ assertEquals(entry.getRawMode(), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ assertContentEquals(variant, BRANCH_CHANGE + INITIAL_CONTENT_1);
+ } else {
+ assertContentEquals(variant, BRANCH_CHANGE + INITIAL_CONTENT_2);
+ }
+ }
+ }
+
+ @Test
+ public void testIndexVariantsConflict() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ setupConflictingBranches();
+ // end setup
+
+ // create a conflict to force multiple stages
+ new MergeOperation(repo, BRANCH).execute(null);
+
+ DirCache cache = repo.readDirCache();
+ // 3 stages for file 1, 2 stages for file 2
+ assertEquals(5, cache.getEntryCount());
+ for (int i = 0; i < cache.getEntryCount(); i++) {
+ final DirCacheEntry entry = cache.getEntry(i);
+
+ AbstractGitResourceVariant variant = IndexResourceVariant.create(
+ repo, entry);
+ assertEquals(entry.getObjectId().getName(),
+ variant.getContentIdentifier());
+ assertEquals(entry.getObjectId(), variant.getObjectId());
+ assertEquals(entry.getRawMode(), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ switch (entry.getStage()) {
+ case DirCacheEntry.STAGE_1:
+ assertContentEquals(variant, INITIAL_CONTENT_1);
+ break;
+ case DirCacheEntry.STAGE_2:
+ assertContentEquals(variant, INITIAL_CONTENT_1
+ + MASTER_CHANGE);
+ break;
+ case DirCacheEntry.STAGE_3:
+ assertContentEquals(variant, BRANCH_CHANGE
+ + INITIAL_CONTENT_1);
+ break;
+ case DirCacheEntry.STAGE_0:
+ default:
+ fail("Unexpected entry stage " + entry.getStage()
+ + " in the index for file " + entry.getPathString());
+ break;
+ }
+ } else {
+ switch (entry.getStage()) {
+ case DirCacheEntry.STAGE_2:
+ assertContentEquals(variant, INITIAL_CONTENT_2
+ + MASTER_CHANGE);
+ break;
+ case DirCacheEntry.STAGE_3:
+ assertContentEquals(variant, BRANCH_CHANGE
+ + INITIAL_CONTENT_2);
+ break;
+ case DirCacheEntry.STAGE_0:
+ case DirCacheEntry.STAGE_1:
+ default:
+ fail("Unexpected entry stage " + entry.getStage()
+ + " in the index for file " + entry.getPathString());
+ break;
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testTreeWalkBranchVariants() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ setupUnconflictingBranches();
+
+ ObjectId baseId = repo.resolve(BRANCH);
+ RevWalk walk = new RevWalk(repo);
+ TreeWalk tw = new TreeWalk(repo);
+ tw.addTree(walk.parseTree(baseId));
+
+ while (tw.next()) {
+ AbstractGitResourceVariant variant = TreeParserResourceVariant
+ .create(repo, tw.getTree(0, CanonicalTreeParser.class));
+
+ assertEquals(tw.getObjectId(0).getName(),
+ variant.getContentIdentifier());
+ assertEquals(tw.getObjectId(0), variant.getObjectId());
+ assertEquals(tw.getRawMode(0), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ assertContentEquals(variant, BRANCH_CHANGE + INITIAL_CONTENT_1);
+ } else if (!tw.isSubtree()) {
+ assertContentEquals(variant, BRANCH_CHANGE + INITIAL_CONTENT_2);
+ }
+
+ if (tw.isSubtree()) {
+ tw.enterSubtree();
+ }
+ }
+ }
+
+ @Test
+ public void testTreeWalkMasterVariants() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ setupUnconflictingBranches();
+
+ ObjectId baseId = repo.resolve(MASTER);
+ RevWalk walk = new RevWalk(repo);
+ TreeWalk tw = new TreeWalk(repo);
+ tw.addTree(walk.parseTree(baseId));
+
+ while (tw.next()) {
+ AbstractGitResourceVariant variant = TreeParserResourceVariant
+ .create(repo, tw.getTree(0, CanonicalTreeParser.class));
+
+ assertEquals(tw.getObjectId(0).getName(),
+ variant.getContentIdentifier());
+ assertEquals(tw.getObjectId(0), variant.getObjectId());
+ assertEquals(tw.getRawMode(0), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ assertContentEquals(variant, INITIAL_CONTENT_1 + MASTER_CHANGE);
+ } else if (!tw.isSubtree()) {
+ assertContentEquals(variant, INITIAL_CONTENT_2 + MASTER_CHANGE);
+ }
+
+ if (tw.isSubtree()) {
+ tw.enterSubtree();
+ }
+ }
+ }
+
+ @Test
+ public void testTreeWalkBaseVariants() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ setupUnconflictingBranches();
+
+ ObjectId baseId = repo.resolve(BASE_BRANCH);
+ RevWalk walk = new RevWalk(repo);
+ TreeWalk tw = new TreeWalk(repo);
+ tw.addTree(walk.parseTree(baseId));
+
+ while (tw.next()) {
+ AbstractGitResourceVariant variant = TreeParserResourceVariant
+ .create(repo, tw.getTree(0, CanonicalTreeParser.class));
+
+ assertEquals(tw.getObjectId(0).getName(),
+ variant.getContentIdentifier());
+ assertEquals(tw.getObjectId(0), variant.getObjectId());
+ assertEquals(tw.getRawMode(0), variant.getRawMode());
+ if (iFile1.getName().equals(variant.getName())) {
+ assertContentEquals(variant, INITIAL_CONTENT_1);
+ } else if (!tw.isSubtree()) {
+ fail("file2 shouldn't exist in our base.");
+ }
+
+ if (tw.isSubtree()) {
+ tw.enterSubtree();
+ }
+ }
+ }
+
+ private void setupUnconflictingBranches() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+
+ testRepo.createBranch(MASTER, BASE_BRANCH);
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ setContentsAndCommit(testRepo, iFile1, BRANCH_CHANGE
+ + INITIAL_CONTENT_1, "branch commit");
+ testRepo.appendContentAndCommit(iProject, file2, BRANCH_CHANGE
+ + INITIAL_CONTENT_2, "second file - initial commit - branch");
+
+ testRepo.checkoutBranch(MASTER);
+
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + MASTER_CHANGE, "master commit - file1");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2
+ + MASTER_CHANGE, "second file - initial commit - master");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ }
+
+ private void setupConflictingBranches() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ setContentsAndCommit(testRepo, iFile1, BRANCH_CHANGE
+ + INITIAL_CONTENT_1, "branch commit");
+ testRepo.appendContentAndCommit(iProject, file2, BRANCH_CHANGE
+ + INITIAL_CONTENT_2, "second file - initial commit - branch");
+
+ testRepo.checkoutBranch(MASTER);
+
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + MASTER_CHANGE, "master commit - file1");
+ testRepo.appendContentAndCommit(iProject, file2, INITIAL_CONTENT_2
+ + MASTER_CHANGE, "second file - initial commit - master");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProviderTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProviderTest.java
new file mode 100644
index 0000000000..d1508c728a
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProviderTest.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Obeo and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevTree;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.treewalk.NameConflictTreeWalk;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.junit.Test;
+
+public class TreeWalkResourceVariantTreeProviderTest extends VariantsTestCase {
+ @Test
+ public void testTreeWalkTrees() throws Exception {
+ File file1 = testRepo.createFile(iProject, "file1");
+ File file2 = testRepo.createFile(iProject, "file2");
+
+ testRepo.appendContentAndCommit(iProject, file1, INITIAL_CONTENT_1,
+ "first file - initial commit");
+ RevCommit baseCommit = testRepo.appendContentAndCommit(iProject, file2,
+ INITIAL_CONTENT_2, "second file - initial commit");
+
+ IFile iFile1 = testRepo.getIFile(iProject, file1);
+ IFile iFile2 = testRepo.getIFile(iProject, file2);
+
+ testRepo.createAndCheckoutBranch(MASTER, BRANCH);
+
+ final String branchChanges = "branch changes\n";
+ setContentsAndCommit(testRepo, iFile2, branchChanges
+ + INITIAL_CONTENT_2, "branch commit");
+
+ testRepo.checkoutBranch(MASTER);
+
+ final String masterChanges = "\nsome changes";
+ setContentsAndCommit(testRepo, iFile1, INITIAL_CONTENT_1
+ + masterChanges, "master commit");
+ iProject.refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
+ // end setup
+
+ // as if we tried to merge branch into master
+ try (RevWalk walk = new RevWalk(repo)) {
+ RevTree baseTree = walk.parseTree(baseCommit.getId());
+ RevTree sourceTree = walk.parseTree(repo.resolve(MASTER));
+ RevTree remoteTree = walk.parseTree(repo.resolve(BRANCH));
+ TreeWalk treeWalk = new NameConflictTreeWalk(repo);
+ treeWalk.addTree(baseTree);
+ treeWalk.addTree(sourceTree);
+ treeWalk.addTree(remoteTree);
+ TreeWalkResourceVariantTreeProvider treeProvider = new TreeWalkResourceVariantTreeProvider(
+ repo, treeWalk, 0, 1, 2);
+
+ assertEquals(1, treeProvider.getRoots().size());
+ assertTrue(treeProvider.getRoots().contains(iProject));
+
+ assertTrue(treeProvider.getKnownResources().contains(iFile1));
+ assertTrue(treeProvider.getKnownResources().contains(iFile2));
+
+ IResourceVariant file1BaseVariant = treeProvider.getBaseTree()
+ .getResourceVariant(iFile1);
+ IResourceVariant file2BaseVariant = treeProvider.getBaseTree()
+ .getResourceVariant(iFile2);
+ assertContentEquals(file1BaseVariant, INITIAL_CONTENT_1);
+ assertContentEquals(file2BaseVariant, INITIAL_CONTENT_2);
+
+ IResourceVariant file1TheirsVariant = treeProvider.getRemoteTree()
+ .getResourceVariant(iFile1);
+ IResourceVariant file2TheirsVariant = treeProvider.getRemoteTree()
+ .getResourceVariant(iFile2);
+ assertContentEquals(file1TheirsVariant, INITIAL_CONTENT_1);
+ assertContentEquals(file2TheirsVariant, branchChanges
+ + INITIAL_CONTENT_2);
+
+ IResourceVariant file1OursVariant = treeProvider.getSourceTree()
+ .getResourceVariant(iFile1);
+ IResourceVariant file2OursVariant = treeProvider.getSourceTree()
+ .getResourceVariant(iFile2);
+ assertContentEquals(file1OursVariant, INITIAL_CONTENT_1
+ + masterChanges);
+ assertContentEquals(file2OursVariant, INITIAL_CONTENT_2);
+ }
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/VariantsTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/VariantsTestCase.java
new file mode 100644
index 0000000000..2e2a9e7cb8
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/merge/VariantsTestCase.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (C) 2015 Obeo and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.util.Scanner;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.egit.core.test.GitTestCase;
+import org.eclipse.egit.core.test.TestRepository;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.junit.After;
+import org.junit.Before;
+
+public abstract class VariantsTestCase extends GitTestCase {
+ protected final String INITIAL_CONTENT_1 = "some content for the first file";
+
+ protected final String INITIAL_CONTENT_2 = "some content for the second file";
+
+ protected static final String MASTER = Constants.R_HEADS + Constants.MASTER;
+
+ protected static final String BRANCH = Constants.R_HEADS + "branch";
+
+ protected Repository repo;
+
+ protected IProject iProject;
+
+ protected TestRepository testRepo;
+
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ iProject = project.project;
+ testRepo = new TestRepository(gitDir);
+ testRepo.connect(iProject);
+ repo = RepositoryMapping.getMapping(iProject).getRepository();
+
+ // make initial commit
+ try (Git git = new Git(repo)) {
+ git.commit().setAuthor("JUnit", "junit@jgit.org")
+ .setMessage("Initial commit").call();
+ }
+ }
+
+ @After
+ @Override
+ public void tearDown() throws Exception {
+ testRepo.disconnect(iProject);
+ testRepo.dispose();
+ repo = null;
+
+ super.tearDown();
+ }
+
+ protected RevCommit setContentsAndCommit(TestRepository testRepository,
+ IFile targetFile, String newContents, String commitMessage)
+ throws Exception {
+ targetFile.setContents(
+ new ByteArrayInputStream(newContents.getBytes()),
+ IResource.FORCE, new NullProgressMonitor());
+ testRepository.addToIndex(targetFile);
+ return testRepository.commit(commitMessage);
+ }
+
+ protected void assertContentEquals(IResourceVariant variant,
+ String expectedContents) throws Exception {
+ assertContentEquals(variant.getStorage(new NullProgressMonitor()),
+ expectedContents);
+ }
+
+ protected void assertContentEquals(IStorage storage, String expectedContents)
+ throws Exception {
+ try (Scanner scanner = new Scanner(storage.getContents())) {
+ scanner.useDelimiter("\\A");
+ String fileContent = "";
+ if (scanner.hasNext()) {
+ fileContent = scanner.next();
+ }
+ assertEquals(expectedContents, fileContent);
+ }
+ }
+}
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/storage/BlobStorageTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/storage/GitBlobStorageTest.java
index d9346e0a0e..640e37dcc0 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/storage/BlobStorageTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/storage/GitBlobStorageTest.java
@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.egit.core.internal.storage;
+package org.eclipse.egit.core.storage;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.internal.storage.GitFileHistoryProvider;
import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.core.op.DisconnectProviderOperation;
import org.eclipse.egit.core.test.GitTestCase;
@@ -39,7 +40,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-public class BlobStorageTest extends GitTestCase {
+public class GitBlobStorageTest extends GitTestCase {
Repository repository;
@@ -59,7 +60,7 @@ public class BlobStorageTest extends GitTestCase {
@Test
public void testOk() throws Exception {
ObjectId id = createFile(repository, project.getProject(), "file", "data");
- BlobStorage blobStorage = new BlobStorage(repository, "p/file", id);
+ GitBlobStorage blobStorage = new GitBlobStorage(repository, "p/file", id);
assertEquals("file", blobStorage.getName());
assertEquals("data", testUtils.slurpAndClose(blobStorage.getContents()));
assertEquals(Path.fromPortableString("p/file").toOSString(), blobStorage.getFullPath().toOSString());
@@ -108,7 +109,7 @@ public class BlobStorageTest extends GitTestCase {
@Test
public void testFailNotFound() throws Exception {
- BlobStorage blobStorage = new BlobStorage(repository, "file", ObjectId.fromString("0123456789012345678901234567890123456789"));
+ GitBlobStorage blobStorage = new GitBlobStorage(repository, "file", ObjectId.fromString("0123456789012345678901234567890123456789"));
assertEquals("file", blobStorage.getName());
try {
blobStorage.getContents();
@@ -120,7 +121,7 @@ public class BlobStorageTest extends GitTestCase {
@Test
public void testFailWrongType() throws Exception {
- BlobStorage blobStorage = new BlobStorage(repository, "file", ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
+ GitBlobStorage blobStorage = new GitBlobStorage(repository, "file", ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
assertEquals("file", blobStorage.getName());
try {
blobStorage.getContents();
@@ -134,7 +135,7 @@ public class BlobStorageTest extends GitTestCase {
public void testFailCorrupt() throws Exception {
try {
createFileCorruptShort(repository, project.getProject(), "file", "data");
- BlobStorage blobStorage = new BlobStorage(repository, "file", ObjectId.fromString("6320cd248dd8aeaab759d5871f8781b5c0505172"));
+ GitBlobStorage blobStorage = new GitBlobStorage(repository, "file", ObjectId.fromString("6320cd248dd8aeaab759d5871f8781b5c0505172"));
assertEquals("file", blobStorage.getName());
blobStorage.getContents();
fail("We should not be able to read this blob");
@@ -147,7 +148,7 @@ public class BlobStorageTest extends GitTestCase {
public void testFailCorrupt2() throws Exception {
try {
createFileCorruptShort(repository, project.getProject(), "file", "datjhjhjhjhjhjhjjkujioedfughjuop986rdfghjhiu7867586redtfguy675r6tfguhyo76r7tfa");
- BlobStorage blobStorage = new BlobStorage(repository, "file", ObjectId.fromString("526ef34fc76ab0c35ccee343bda1a626efbd4134"));
+ GitBlobStorage blobStorage = new GitBlobStorage(repository, "file", ObjectId.fromString("526ef34fc76ab0c35ccee343bda1a626efbd4134"));
assertEquals("file", blobStorage.getName());
blobStorage.getContents();
fail("We should not be able to read this blob");
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java
index 24e2eccd8b..aa713e2131 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java
@@ -130,16 +130,17 @@ public class LinkedResourcesTest {
.getLocation(), 0, null);
// Make sure linked folder is refreshed
folder.refreshLocal(IResource.DEPTH_INFINITE, null);
+ project2.getFile("project2folder1/project2folder1file1.txt")
+ .touch(null);
// Links are written to the .project file
resourceDeltaTestHelper1
.assertChangedResources(new String[] { "/project1/.project" });
+
+
// Changes to linked resources are reported against their repository
resourceDeltaTestHelper2.assertChangedResources(new String[] {
- "/project1/link2project2/project2folder1",
- "/project1/link2project2/.project",
- "/project1/link2project2/project2folder1/project2folder1file1.txt",
- "/project1/link2project2" });
+ "/project2/project2folder1/project2folder1file1.txt" });
}
@Test
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
index c3c19cb5b6..22272de74d 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
@@ -33,6 +33,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.treewalk.TreeWalk;
@@ -300,6 +302,43 @@ public class TestUtils {
}
}
+ /**
+ * Waits at least 50 milliseconds until no jobs of given family are running
+ *
+ * @param maxWaitTime
+ * @param family
+ * @throws InterruptedException
+ */
+ public void waitForJobs(long maxWaitTime, Object family)
+ throws InterruptedException {
+ waitForJobs(maxWaitTime, 50, family);
+ }
+
+ /**
+ * Waits at least <code>minWaitTime</code> milliseconds until no jobs of
+ * given family are running
+ *
+ * @param maxWaitTime
+ * @param minWaitTime
+ * @param family
+ * @throws InterruptedException
+ */
+ public void waitForJobs(long maxWaitTime, long minWaitTime, Object family)
+ throws InterruptedException {
+ Thread.sleep(minWaitTime);
+ long start = System.currentTimeMillis();
+ IJobManager jobManager = Job.getJobManager();
+
+ Job[] jobs = jobManager.find(family);
+ while (jobs.length > 0) {
+ Thread.sleep(100);
+ jobs = jobManager.find(family);
+ if (System.currentTimeMillis() - start > maxWaitTime) {
+ return;
+ }
+ }
+ }
+
private static HashMap<String, String> mkmap(String... args) {
if ((args.length % 2) > 0)
throw new IllegalArgumentException("needs to be pairs");
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
index e326f49566..1ce3603abf 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
@@ -30,6 +30,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.core.op.MergeOperation;
import org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber;
import org.eclipse.egit.core.synchronize.GitSubscriberMergeContext;
@@ -44,7 +45,6 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.team.core.mapping.IMergeContext;
import org.eclipse.team.core.mapping.IResourceMappingMerger;
-import org.eclipse.team.core.mapping.ResourceMappingMerger;
import org.eclipse.team.core.subscribers.SubscriberScopeManager;
import org.junit.Before;
@@ -105,8 +105,7 @@ public abstract class ModelTestCase extends GitTestCase {
.getModelProviderDescriptor(
SampleModelProvider.SAMPLE_PROVIDER_ID)
.getModelProvider();
- return (ResourceMappingMerger) Platform.getAdapterManager().getAdapter(
- provider, IResourceMappingMerger.class);
+ return Utils.getAdapter(provider, IResourceMappingMerger.class);
}
protected IMergeContext prepareContext(Repository repository,
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
index 0f662e8cae..02c4989eef 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
@@ -94,17 +94,18 @@ public class AddOperationTest extends GitTestCase {
testRepository.commit("first commit");
- assertEquals(file1.getLocalTimeStamp(),
- testRepository.lastModifiedInIndex(file1.getLocation()
- .toPortableString()));
+ assertEquals(file1.getLocalTimeStamp() / 1000,
+ testRepository.lastModifiedInIndex(
+ file1.getLocation().toPortableString()) / 1000);
Thread.sleep(1000);
file1.setContents(
new ByteArrayInputStream("other text".getBytes(project.project
.getDefaultCharset())), 0, null);
- assertFalse(file1.getLocalTimeStamp() == testRepository
- .lastModifiedInIndex(file1.getLocation().toPortableString()));
+ assertFalse(file1.getLocalTimeStamp() / 1000 == testRepository
+ .lastModifiedInIndex(file1.getLocation().toPortableString())
+ / 1000);
new AddToIndexOperation(resources).execute(null);
@@ -113,8 +114,9 @@ public class AddOperationTest extends GitTestCase {
// does not work yet due to the racy git problem: DirCache.writeTo
// smudges the
// timestamp of an added file
- assertEquals(file1.getLocalTimeStamp() / 10,
- testRepository.lastModifiedInIndex(file1.getLocation().toPortableString()) / 10);
+ assertEquals(file1.getLocalTimeStamp() / 1000,
+ testRepository.lastModifiedInIndex(
+ file1.getLocation().toPortableString()) / 1000);
}
@Test
diff --git a/org.eclipse.egit.core/META-INF/MANIFEST.MF b/org.eclipse.egit.core/META-INF/MANIFEST.MF
index 4d61e52018..74ee97f449 100644
--- a/org.eclipse.egit.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.core/META-INF/MANIFEST.MF
@@ -23,6 +23,7 @@ Export-Package: org.eclipse.egit.core;version="4.0.0";x-friends:="org.eclipse.eg
org.eclipse.egit.core.op;version="4.0.0";x-friends:="org.eclipse.egit.ui.test,org.eclipse.egit.ui",
org.eclipse.egit.core.project;version="4.0.0";x-friends:="org.eclipse.egit.ui,org.eclipse.egit.ui.test",
org.eclipse.egit.core.securestorage;version="4.0.0";x-friends:="org.eclipse.egit.ui",
+ org.eclipse.egit.core.storage;version="4.0.0",
org.eclipse.egit.core.synchronize;version="4.0.0";x-friends:="org.eclipse.egit.ui,org.eclipse.egit.ui.test",
org.eclipse.egit.core.synchronize.dto;version="4.0.0";x-friends:="org.eclipse.egit.ui"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
index 34da167cc7..5d457adfe5 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java
@@ -192,12 +192,14 @@ public class Activator extends Plugin implements DebugOptionsListener {
if (resource instanceof IProject) {
IProject project = (IProject) resource;
if (project.isAccessible()) {
- if (RepositoryProvider.getProvider(project) instanceof GitProvider) {
+ if (RepositoryProvider.getProvider(project,
+ GitProvider.ID) != null) {
IResource dotGit = project
.findMember(Constants.DOT_GIT);
- if (dotGit != null
- && dotGit.getType() == IResource.FOLDER)
+ if (dotGit != null && dotGit
+ .getType() == IResource.FOLDER) {
GitProjectData.reconfigureWindowCache();
+ }
}
} else {
// bug 419706: project is closed - use java.io API
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/NetUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/NetUtil.java
new file mode 100644
index 0000000000..e2e0406dc7
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/NetUtil.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Christian Halstrick <christian.halstrick@sap.com>
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.eclipse.jgit.lib.Repository;
+
+/**
+ * Networking utilities
+ */
+public class NetUtil {
+
+ private static TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ // no check
+ }
+
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ // no check
+ }
+ } };
+
+ private static HostnameVerifier trustAllHostNames = new HostnameVerifier() {
+ public boolean verify(String hostname, SSLSession session) {
+ // always accept
+ return true;
+ }
+ };
+
+ /**
+ * Configures a {@link HttpURLConnection} according to the value of the
+ * repositories configuration parameter "http.sslVerify". When this value is
+ * false and when the URL is for the "https" protocol then all hostnames are
+ * accepted and certificates are also accepted when they can't be validated
+ *
+ * @param repo
+ * the repository to be asked for the configuration parameter
+ * http.sslVerify
+ * @param conn
+ * the connection to be configured
+ * @throws IOException
+ */
+ public static void setSslVerification(Repository repo,
+ HttpURLConnection conn) throws IOException {
+ if ("https".equals(conn.getURL().getProtocol())) { //$NON-NLS-1$
+ HttpsURLConnection httpsConn = (HttpsURLConnection) conn;
+ if (!repo.getConfig().getBoolean("http", "sslVerify", true)) { //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ SSLContext ctx = SSLContext.getInstance("TLS"); //$NON-NLS-1$
+ ctx.init(null, trustAllCerts, null);
+ httpsConn.setSSLSocketFactory(ctx.getSocketFactory());
+ httpsConn.setHostnameVerifier(trustAllHostNames);
+ } catch (KeyManagementException e) {
+ throw new IOException(e.getMessage());
+ } catch (NoSuchAlgorithmException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/CoreText.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/CoreText.java
index e92b70be61..297a43729c 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/CoreText.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/CoreText.java
@@ -5,6 +5,7 @@
* Copyright (C) 2012, Markus Duft <markus.duft@salomon.at>
* Copyright (C) 2013, Matthias Sohn <matthias.sohn@sap.com>
* Copyright (C) 2013, Daniel Megert <daniel_megert@ch.ibm.com>
+ * Copyright (C) 2015, Obeo.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -391,6 +392,9 @@ public class CoreText extends NLS {
public static String GitProjectData_UnmappingGoneResourceFailed;
/** */
+ public static String GitResourceVariantTreeSubscriber_name;
+
+ /** */
public static String GitResourceVariantTreeSubscriber_fetchTaskName;
/** */
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties
index 003a867d02..0ce50d79e9 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties
@@ -156,6 +156,7 @@ GitProjectData_repositoryChangedTaskName=Git repository changed
GitProjectData_UnmapJobName=Disconnecting project {0} from Git repository
GitProjectData_UnmappingGoneResourceFailed=Unmapping gone mapped resource {0} failed
+GitResourceVariantTreeSubscriber_name = Git Resource Variant Tree Subscriber
GitResourceVariantTreeSubscriber_fetchTaskName=Fetching data from git repositories
GitResourceVariantTreeSubscriber_CouldNotFindSourceVariant=Could not find source variant for resource: {0}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
index a5a2efc90e..0dabffea4f 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/indexdiff/GitResourceDeltaVisitor.java
@@ -18,7 +18,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
@@ -68,29 +68,44 @@ public class GitResourceDeltaVisitor implements IResourceDeltaVisitor {
public boolean visit(IResourceDelta delta) throws CoreException {
final IResource resource = delta.getResource();
- // If the resource is not part of a project under
- // Git revision control
- final RepositoryMapping mapping = RepositoryMapping
- .getMapping(resource);
- if (mapping == null || mapping.getRepository() != repository)
- // Ignore the change
+ if (resource.getType() == IResource.ROOT) {
return true;
+ }
- IndexDiffCache cache = Activator.getDefault().getIndexDiffCache();
- IndexDiffCacheEntry entry = null;
-
- if (cache != null)
- entry = cache.getIndexDiffCacheEntry(mapping.getRepository());
-
- if (resource instanceof IFolder
- && delta.getKind() == IResourceDelta.ADDED) {
- String path = mapping.getRepoRelativePath(resource) + "/"; //$NON-NLS-1$
+ if (resource.getType() == IResource.PROJECT) {
+ // If the resource is not part of a project under
+ // Git revision control or from a different repository
+ final RepositoryMapping mapping = RepositoryMapping
+ .getMapping((IProject) resource);
+ if (mapping == null || mapping.getRepository() != repository) {
+ // Ignore the change for project and its children
+ return false;
+ }
+
+ // continue with children
+ return true;
+ }
- if (isIgnoredInOldIndex(entry, path))
- return true; // keep going to catch .gitignore files.
+ if (resource.isLinked()) {
+ // Ignore linked files, folders and their children
+ return false;
+ }
- filesToUpdate.add(path);
- resourcesToUpdate.add(resource);
+ if (resource.getType() == IResource.FOLDER) {
+ if (delta.getKind() == IResourceDelta.ADDED) {
+ String repoRelativePath = getRepoRelativePath(resource);
+ if (repoRelativePath == null) {
+ return false;
+ }
+ String path = repoRelativePath + "/"; //$NON-NLS-1$
+ if (isIgnoredInOldIndex(path)) {
+ return true; // keep going to catch .gitignore files.
+ }
+ filesToUpdate.add(path);
+ resourcesToUpdate.add(resource);
+ }
+
+ // continue with children
return true;
}
@@ -98,58 +113,72 @@ public class GitResourceDeltaVisitor implements IResourceDeltaVisitor {
// care about (e.g. marker changes to files) then
// ignore
if (delta.getKind() == IResourceDelta.CHANGED
- && (delta.getFlags() & INTERESTING_CHANGES) == 0)
- return true;
-
- // skip any non-FILE resources
- if (resource.getType() != IResource.FILE)
- return true;
+ && (delta.getFlags() & INTERESTING_CHANGES) == 0) {
+ return false;
+ }
if (resource.getName().equals(GITIGNORE_NAME)) {
gitIgnoreChanged = true;
return false;
}
- String repoRelativePath = mapping.getRepoRelativePath(resource);
+ String repoRelativePath = getRepoRelativePath(resource);
if (repoRelativePath == null) {
resourcesToUpdate.add(resource);
return true;
}
- if (isIgnoredInOldIndex(entry, repoRelativePath)) {
+ if (isIgnoredInOldIndex(repoRelativePath)) {
// This file is ignored in the old index, and ignore rules did not
// change: ignore the delta to avoid unnecessary index updates
return false;
}
+
filesToUpdate.add(repoRelativePath);
resourcesToUpdate.add(resource);
-
return true;
}
+ private static String getRepoRelativePath(IResource resource) {
+ final RepositoryMapping mapping = RepositoryMapping
+ .getMapping(resource.getProject());
+ if (mapping == null) {
+ return null;
+ }
+ return mapping.getRepoRelativePath(resource);
+ }
+
/**
- * @param entry
- * the {@link IndexDiffCacheEntry} for the repository containing
- * the path.
* @param path
* the repository relative path of the resource to check
* @return whether the given path is ignored by the given
* {@link IndexDiffCacheEntry}
*/
- private boolean isIgnoredInOldIndex(IndexDiffCacheEntry entry, String path) {
+ private boolean isIgnoredInOldIndex(String path) {
+ if (gitIgnoreChanged) {
+ return false;
+ }
+ IndexDiffCacheEntry entry = null;
+ IndexDiffCache cache = Activator.getDefault().getIndexDiffCache();
+ if (cache != null) {
+ entry = cache.getIndexDiffCacheEntry(repository);
+ }
// fall back to processing all changes as long as there is no old index.
- if (entry == null || gitIgnoreChanged)
+ if (entry == null) {
return false;
+ }
IndexDiffData indexDiff = entry.getIndexDiff();
- if (indexDiff == null)
+ if (indexDiff == null) {
return false;
+ }
String p = path;
Set<String> ignored = indexDiff.getIgnoredNotInIndex();
while (p != null) {
- if (ignored.contains(p))
+ if (ignored.contains(p)) {
return true;
+ }
p = skipLastSegment(p);
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProvider.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProvider.java
new file mode 100644
index 0000000000..95bb42a719
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/DirCacheResourceVariantTreeProvider.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.io.IOException;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.internal.storage.IndexResourceVariant;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.team.core.variants.IResourceVariantTree;
+
+/**
+ * This will populate its three {@link IResourceVariantTree} by looking up
+ * information within the repository's DirCache.
+ * <p>
+ * Files that are not located within the workspace will be ignored and thus will
+ * not be accessible through the trees created by this provider.
+ * </p>
+ */
+public class DirCacheResourceVariantTreeProvider implements
+ GitResourceVariantTreeProvider {
+ private final IResourceVariantTree baseTree;
+
+ private final IResourceVariantTree sourceTree;
+
+ private final IResourceVariantTree remoteTree;
+
+ private final Set<IResource> roots;
+
+ private final Set<IResource> knownResources;
+
+ /**
+ * Constructs the resource variant trees by iterating over the given
+ * repository's DirCache entries.
+ *
+ * @param repository
+ * The repository which DirCache info we need to cache as
+ * IResourceVariantTrees.
+ * @throws IOException
+ * if we somehow cannot read the DirCache.
+ */
+ public DirCacheResourceVariantTreeProvider(Repository repository)
+ throws IOException {
+ final DirCache cache = repository.readDirCache();
+ final GitResourceVariantCache baseCache = new GitResourceVariantCache();
+ final GitResourceVariantCache sourceCache = new GitResourceVariantCache();
+ final GitResourceVariantCache remoteCache = new GitResourceVariantCache();
+
+ for (int i = 0; i < cache.getEntryCount(); i++) {
+ final DirCacheEntry entry = cache.getEntry(i);
+ final IPath path = new Path(entry.getPathString());
+ final IResource resource = ResourceUtil
+ .getResourceHandleForLocation(path);
+ // Resource variants only make sense for IResources. Do not consider
+ // files outside of the workspace or otherwise non accessible.
+ if (resource == null || resource.getProject() == null
+ || !resource.getProject().isAccessible()) {
+ continue;
+ }
+ switch (entry.getStage()) {
+ case DirCacheEntry.STAGE_0:
+ // Skipped on purpose (no conflict)
+ break;
+ case DirCacheEntry.STAGE_1:
+ baseCache.setVariant(resource,
+ IndexResourceVariant.create(repository, entry));
+ break;
+ case DirCacheEntry.STAGE_2:
+ sourceCache.setVariant(resource,
+ IndexResourceVariant.create(repository, entry));
+ break;
+ case DirCacheEntry.STAGE_3:
+ remoteCache.setVariant(resource,
+ IndexResourceVariant.create(repository, entry));
+ break;
+ default:
+ throw new IllegalStateException(
+ "Invalid stage: " + entry.getStage()); //$NON-NLS-1$
+ }
+ }
+
+ baseTree = new GitCachedResourceVariantTree(baseCache);
+ sourceTree = new GitCachedResourceVariantTree(sourceCache);
+ remoteTree = new GitCachedResourceVariantTree(remoteCache);
+
+ roots = new LinkedHashSet<IResource>();
+ roots.addAll(baseCache.getRoots());
+ roots.addAll(sourceCache.getRoots());
+ roots.addAll(remoteCache.getRoots());
+
+ knownResources = new LinkedHashSet<IResource>();
+ knownResources.addAll(baseCache.getKnownResources());
+ knownResources.addAll(sourceCache.getKnownResources());
+ knownResources.addAll(remoteCache.getKnownResources());
+ }
+
+ public IResourceVariantTree getBaseTree() {
+ return baseTree;
+ }
+
+ public IResourceVariantTree getRemoteTree() {
+ return remoteTree;
+ }
+
+ public IResourceVariantTree getSourceTree() {
+ return sourceTree;
+ }
+
+ public Set<IResource> getKnownResources() {
+ return knownResources;
+ }
+
+ public Set<IResource> getRoots() {
+ return roots;
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitCachedResourceVariantTree.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitCachedResourceVariantTree.java
new file mode 100644
index 0000000000..3a0110c05e
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitCachedResourceVariantTree.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.eclipse.team.core.variants.IResourceVariantTree;
+
+/**
+ * An immutable resource variant tree backed by a
+ * {@link GitResourceVariantCache}. This will never contact the server.
+ * <p>
+ * This will not react to refreshing calls and shouldn't be used for
+ * synchronization purposes.
+ * </p>
+ */
+/*
+ * Illegal implementation of IResourceVariantTree : we could also extend the
+ * AbstractResourceVariantTree... but since we don't react to refreshing calls
+ * anyway, we do not need the extra logic it provides.
+ */
+class GitCachedResourceVariantTree implements IResourceVariantTree {
+ private final GitResourceVariantCache cache;
+
+ public GitCachedResourceVariantTree(GitResourceVariantCache cache) {
+ this.cache = cache;
+ }
+
+ public IResource[] roots() {
+ final Set<IResource> roots = cache.getRoots();
+ return roots.toArray(new IResource[roots.size()]);
+ }
+
+ public IResource[] members(IResource resource) throws TeamException {
+ return cache.members(resource);
+ }
+
+ public IResourceVariant getResourceVariant(IResource resource)
+ throws TeamException {
+ return cache.getVariant(resource);
+ }
+
+ public boolean hasResourceVariant(IResource resource) throws TeamException {
+ return cache.getVariant(resource) != null;
+ }
+
+ public IResource[] refresh(IResource[] resources, int depth,
+ IProgressMonitor monitor) throws TeamException {
+ // This does not react to refresh calls
+ return new IResource[0];
+ }
+
+ public void flushVariants(IResource resource, int depth)
+ throws TeamException {
+ // Empty implementation
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantCache.java
new file mode 100644
index 0000000000..523f0d195a
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantCache.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.team.core.variants.IResourceVariant;
+
+/**
+ * Caches the resource variants corresponding to local IResources.
+ */
+class GitResourceVariantCache {
+ private final Map<IResource, IResourceVariant> cache = new LinkedHashMap<IResource, IResourceVariant>();
+
+ private final Map<IResource, Set<IResource>> members = new LinkedHashMap<IResource, Set<IResource>>();
+
+ private final Set<IResource> roots = new LinkedHashSet<IResource>();
+
+ /**
+ * Sets the variant associated with the given resource in this cache.
+ *
+ * @param resource
+ * The resource for which we need to cache a variant.
+ * @param variant
+ * Variant for the resource.
+ */
+ public void setVariant(IResource resource, IResourceVariant variant) {
+ cache.put(resource, variant);
+
+ IProject project = resource.getProject();
+ roots.add(project);
+
+ members.put(resource, new LinkedHashSet<IResource>());
+
+ final IResource parent = resource.getParent();
+ Set<IResource> parentMembers = members.get(parent);
+ if (parentMembers == null) {
+ parentMembers = new LinkedHashSet<IResource>();
+ members.put(parent, parentMembers);
+ }
+ parentMembers.add(resource);
+ }
+
+ /**
+ * @param resource
+ * The resource which variant we need.
+ * @return The variant associated with this resource in this cache.
+ */
+ public IResourceVariant getVariant(IResource resource) {
+ return cache.get(resource);
+ }
+
+ /**
+ * @return The known roots of the tree we were populated from.
+ */
+ public Set<IResource> getRoots() {
+ return Collections.unmodifiableSet(roots);
+ }
+
+ /**
+ * @return All resources for which this cache holds variants.
+ */
+ public Set<IResource> getKnownResources() {
+ return Collections.unmodifiableSet(cache.keySet());
+ }
+
+ /**
+ * Returns all members of the given resource for which we hold variants.
+ *
+ * @param resource
+ * The resource which members we need.
+ * @return All members of the given resource for which we hold variants; an
+ * empty array if none.
+ */
+ public IResource[] members(IResource resource) {
+ final Set<IResource> children = members.get(resource);
+ return children.toArray(new IResource[children.size()]);
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantFileRevision.java
new file mode 100644
index 0000000000..5c2b815b66
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantFileRevision.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import org.eclipse.egit.core.synchronize.GitRemoteResource;
+import org.eclipse.jgit.lib.PersonIdent;
+import org.eclipse.team.internal.core.mapping.ResourceVariantFileRevision;
+
+/**
+ * The default implementation of ResourceVariantFileRevision has no author,
+ * comment, timestamp... or any information that could be provided by the Git
+ * resource variant. This implementation uses the variant's information.
+ */
+class GitResourceVariantFileRevision extends ResourceVariantFileRevision {
+
+ public GitResourceVariantFileRevision(GitRemoteResource variant) {
+ super(variant);
+ }
+
+ @Override
+ public GitRemoteResource getVariant() {
+ return (GitRemoteResource) super.getVariant();
+ }
+
+ @Override
+ public String getContentIdentifier() {
+ // Use the same ID as would CommitFileRevision
+ return getVariant().getCommitId().getId().getName();
+ }
+
+ @Override
+ public long getTimestamp() {
+ final PersonIdent author = getVariant().getCommitId().getAuthorIdent();
+ if (author != null) {
+ return author.getWhen().getTime();
+ }
+ return super.getTimestamp();
+ }
+
+ @Override
+ public String getAuthor() {
+ final PersonIdent author = getVariant().getCommitId().getAuthorIdent();
+ if (author != null) {
+ return author.getName();
+ }
+ return super.getAuthor();
+ }
+
+ @Override
+ public String getComment() {
+ return getVariant().getCommitId().getFullMessage();
+
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeProvider.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeProvider.java
new file mode 100644
index 0000000000..04e30379fc
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.team.core.variants.IResourceVariantTree;
+
+/**
+ * Resource variant trees are in charge of providing the
+ * {@link org.eclipse.team.core.subscribers.Subscriber Subscribers} with
+ * resource variants, allowing them to retrieve the content of a given file in
+ * different states (remote, local, index, workspace...).
+ */
+public interface GitResourceVariantTreeProvider {
+ /**
+ * Returns the base resource variant tree. This should provide access to the
+ * common ancestor of the "source" and "remote" resource variants.
+ *
+ * @return The base resource variant tree.
+ */
+ IResourceVariantTree getBaseTree();
+
+ /**
+ * Returns the remote resource variant tree. This is traditionally the
+ * remote data, or 'right' side of a comparison. In git terms, this is the
+ * "theirs" side.
+ *
+ * @return The remote resource variant tree.
+ */
+ IResourceVariantTree getRemoteTree();
+
+ /**
+ * Returns the source resource variant tree. This is traditionally the local
+ * data, or 'left' side of a comparison. In git terms, this is the "ours"
+ * side.
+ *
+ * @return The source resource variant tree.
+ */
+ IResourceVariantTree getSourceTree();
+
+ /**
+ * @return The list of root resources for which this provider's trees may
+ * hold variants.
+ */
+ Set<IResource> getRoots();
+
+ /**
+ * Returns the whole set of resources for which this provider's trees hold
+ * variants. The returned resources may not necessarily exist in all three
+ * underlying trees.
+ *
+ * @return The whole set of resources for which this provider's trees hold
+ * variants.
+ */
+ Set<IResource> getKnownResources();
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriber.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriber.java
new file mode 100644
index 0000000000..30368af4b6
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitResourceVariantTreeSubscriber.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.util.Arrays;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.egit.core.internal.CoreText;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.diff.IDiff;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.eclipse.team.core.variants.IResourceVariantComparator;
+import org.eclipse.team.core.variants.IResourceVariantTree;
+import org.eclipse.team.core.variants.ResourceVariantTreeSubscriber;
+import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter;
+
+/**
+ * This implementation of a {@link ResourceVariantTreeSubscriber} takes its
+ * input from a {@link GitResourceVariantTreeProvider}.
+ * <p>
+ * This allows us to hijack all calls from the default subscriber for "local"
+ * resources to our actual source tree, which could be the local working
+ * directory as well as it could be a branch.
+ * </p>
+ */
+public class GitResourceVariantTreeSubscriber extends
+ ResourceVariantTreeSubscriber {
+ private GitResourceVariantTreeProvider variantTreeProvider;
+
+ private final SyncInfoToDiffConverter syncInfoConverter;
+
+ private final IResourceVariantComparator comparator;
+
+ /**
+ * @param variantTreeProvider
+ * The instance that will provide the base, source and remote
+ * trees to this subscriber.
+ */
+ public GitResourceVariantTreeSubscriber(
+ GitResourceVariantTreeProvider variantTreeProvider) {
+ this.variantTreeProvider = variantTreeProvider;
+ syncInfoConverter = new GitSyncInfoToDiffConverter(variantTreeProvider);
+ comparator = new GitVariantComparator(
+ variantTreeProvider.getSourceTree());
+ }
+
+ @Override
+ protected IResourceVariantTree getBaseTree() {
+ return variantTreeProvider.getBaseTree();
+ }
+
+ @Override
+ protected IResourceVariantTree getRemoteTree() {
+ return variantTreeProvider.getRemoteTree();
+ }
+
+ /**
+ * @return the source resource variant tree.
+ */
+ protected IResourceVariantTree getSourceTree() {
+ return variantTreeProvider.getSourceTree();
+ }
+
+ @Override
+ public IDiff getDiff(IResource resource) throws CoreException {
+ final SyncInfo info = getSyncInfo(resource);
+ if (info == null || info.getKind() == SyncInfo.IN_SYNC)
+ return null;
+ return syncInfoConverter.getDeltaFor(info);
+ }
+
+ @Override
+ public SyncInfo getSyncInfo(IResource resource) throws TeamException {
+ // Overridden here to properly catch and re-throw the forwarded
+ // TeamException
+ try {
+ return super.getSyncInfo(resource);
+ } catch (ForwardedTeamException e) {
+ throw (TeamException) e.getCause();
+ }
+ }
+
+ @Override
+ public String getName() {
+ return CoreText.GitResourceVariantTreeSubscriber_name;
+ }
+
+ @Override
+ public boolean isSupervised(IResource resource) throws TeamException {
+ return variantTreeProvider.getKnownResources().contains(resource);
+ }
+
+ @Override
+ public IResource[] roots() {
+ final Set<IResource> roots = variantTreeProvider.getRoots();
+ return roots.toArray(new IResource[roots.size()]);
+ }
+
+ @Override
+ public IResourceVariantComparator getResourceComparator() {
+ return comparator;
+ }
+
+ /**
+ * We have a source tree whereas Team only knows about "local" files. This
+ * will always use said {@link #oursTree source tree} when comparing
+ * variants.
+ */
+ private static class GitVariantComparator implements
+ IResourceVariantComparator {
+ private final IResourceVariantTree oursTree;
+
+ public GitVariantComparator(IResourceVariantTree oursTree) {
+ this.oursTree = oursTree;
+ }
+
+ public boolean compare(IResource local, IResourceVariant remote) {
+ try {
+ final IResourceVariant oursVariant = oursTree
+ .getResourceVariant(local);
+ if (oursVariant == null)
+ return remote == null;
+ return compare(oursVariant, remote);
+ } catch (TeamException e) {
+ // We can't throw the TeamException from here, but we can't let
+ // the comparison go through either.
+ // This is only called from "getSyncInfo", we'll forward this
+ // exception and rethrow it from there.
+ throw new ForwardedTeamException(e);
+ }
+ }
+
+ public boolean compare(IResourceVariant base, IResourceVariant remote) {
+ return Arrays.equals(base.asBytes(), remote.asBytes());
+ }
+
+ public boolean isThreeWay() {
+ return true;
+ }
+ }
+
+ /**
+ * This should never be thrown outside of this class. The only purpose of
+ * this exception is to encapsulate a TeamException where it cannot be
+ * thrown.
+ */
+ private static class ForwardedTeamException extends RuntimeException {
+ /** Generated SUID. */
+ private static final long serialVersionUID = 4074010396155542178L;
+
+ public ForwardedTeamException(TeamException e) {
+ super(e);
+ }
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitSyncInfoToDiffConverter.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitSyncInfoToDiffConverter.java
new file mode 100644
index 0000000000..b82e9a7b60
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/GitSyncInfoToDiffConverter.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.internal.CoreText;
+import org.eclipse.egit.core.internal.storage.WorkspaceFileRevision;
+import org.eclipse.egit.core.synchronize.GitRemoteResource;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.diff.IDiff;
+import org.eclipse.team.core.diff.ITwoWayDiff;
+import org.eclipse.team.core.diff.provider.ThreeWayDiff;
+import org.eclipse.team.core.history.IFileRevision;
+import org.eclipse.team.core.mapping.provider.ResourceDiff;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.variants.IResourceVariant;
+import org.eclipse.team.internal.core.mapping.ResourceVariantFileRevision;
+import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter;
+
+/**
+ * The default implementation of SyncInfoToDiffConverter uses inaccurate
+ * information with regards to some of EGit features.
+ * <p>
+ * SyncInfoToDiffConverter#asFileRevision(IResourceVariant) is called when a
+ * user double-clicks a revision from the synchronize view (among others).
+ * However, the default implementation returns an IFileRevision with no comment,
+ * author or timestamp information.
+ * </p>
+ * <p>
+ * SyncInfoToDiffConverter#getDeltaFor(SyncInfo) had been originally thought by
+ * Team to be used for synchronizations that considered local changes. This is
+ * not always the case with EGit. For example, a user might try and compare two
+ * refs together from the Git repository explorer (right click > synchronize
+ * with each other). In such a case, the local files must not be taken into
+ * account.
+ * </p>
+ * <p>
+ * Most of the private methods here were copy/pasted from the super
+ * implementation.
+ * </p>
+ */
+public class GitSyncInfoToDiffConverter extends SyncInfoToDiffConverter {
+ private GitResourceVariantTreeProvider variantTreeProvider;
+
+ /**
+ * Creates our diff converter given the provider of our variant trees.
+ *
+ * @param variantTreeProvider
+ * Provides the resource variant trees that should be used to
+ * query file revisions.
+ */
+ public GitSyncInfoToDiffConverter(
+ GitResourceVariantTreeProvider variantTreeProvider) {
+ this.variantTreeProvider = variantTreeProvider;
+ }
+
+ @Override
+ public IDiff getDeltaFor(SyncInfo info) {
+ if (info.getComparator().isThreeWay()) {
+ ITwoWayDiff local = getLocalDelta(info);
+ ITwoWayDiff remote = getRemoteDelta(info);
+ return new ThreeWayDiff(local, remote);
+ } else {
+ if (info.getKind() != SyncInfo.IN_SYNC) {
+ IResourceVariant remote = info.getRemote();
+ IResource local = info.getLocal();
+
+ int kind;
+ if (remote == null) {
+ kind = IDiff.REMOVE;
+ } else if (!local.exists()) {
+ kind = IDiff.ADD;
+ } else {
+ kind = IDiff.CHANGE;
+ }
+ if (local.getType() == IResource.FILE) {
+ IFileRevision after = asFileState(remote);
+ IFileRevision before = getLocalFileRevision((IFile) local);
+ return new ResourceDiff(info.getLocal(), kind, 0, before,
+ after);
+ }
+ // For folders, we don't need file states
+ return new ResourceDiff(info.getLocal(), kind);
+ }
+ return null;
+ }
+ }
+
+ private ITwoWayDiff getLocalDelta(SyncInfo info) {
+ int direction = SyncInfo.getDirection(info.getKind());
+ if (direction == SyncInfo.OUTGOING || direction == SyncInfo.CONFLICTING) {
+ IResourceVariant ancestor = info.getBase();
+ IResource local = info.getLocal();
+
+ int kind;
+ if (ancestor == null) {
+ kind = IDiff.ADD;
+ } else if (!local.exists()) {
+ kind = IDiff.REMOVE;
+ } else {
+ kind = IDiff.CHANGE;
+ }
+ if (local.getType() == IResource.FILE) {
+ IFileRevision before = asFileState(ancestor);
+ IFileRevision after = getLocalFileRevision((IFile) local);
+ return new ResourceDiff(info.getLocal(), kind, 0, before, after);
+ }
+ // For folders, we don't need file states
+ return new ResourceDiff(info.getLocal(), kind);
+ }
+ return null;
+ }
+
+ /**
+ * Returns a file revision from the source tree for this local file.
+ *
+ * @param local
+ * The local file.
+ * @return The file revision that should be considered for the local (left)
+ * side of a delta
+ */
+ public IFileRevision getLocalFileRevision(IFile local) {
+ try {
+ return asFileState(variantTreeProvider.getSourceTree()
+ .getResourceVariant(local));
+ } catch (TeamException e) {
+ String error = NLS
+ .bind(CoreText.GitResourceVariantTreeSubscriber_CouldNotFindSourceVariant,
+ local.getName());
+ Activator.logError(error, e);
+ // fall back to the working tree version
+ return new WorkspaceFileRevision(local);
+ }
+ }
+
+ /*
+ * copied from the private implementation in SyncInfoToDiffConverter
+ */
+ private ITwoWayDiff getRemoteDelta(SyncInfo info) {
+ int direction = SyncInfo.getDirection(info.getKind());
+ if (direction == SyncInfo.INCOMING || direction == SyncInfo.CONFLICTING) {
+ IResourceVariant ancestor = info.getBase();
+ IResourceVariant remote = info.getRemote();
+
+ int kind;
+ if (ancestor == null)
+ kind = IDiff.ADD;
+ else if (remote == null)
+ kind = IDiff.REMOVE;
+ else
+ kind = IDiff.CHANGE;
+
+ // For folders, we don't need file states
+ if (info.getLocal().getType() == IResource.FILE) {
+ IFileRevision before = asFileState(ancestor);
+ IFileRevision after = asFileState(remote);
+ return new ResourceDiff(info.getLocal(), kind, 0, before, after);
+ }
+
+ return new ResourceDiff(info.getLocal(), kind);
+ }
+ return null;
+ }
+
+ /*
+ * copied from the private implementation in SyncInfoToDiffConverter
+ */
+ private IFileRevision asFileState(final IResourceVariant variant) {
+ if (variant == null)
+ return null;
+ return asFileRevision(variant);
+ }
+
+ @Override
+ protected ResourceVariantFileRevision asFileRevision(
+ IResourceVariant variant) {
+ if (variant instanceof GitRemoteResource)
+ return new GitResourceVariantFileRevision(
+ (GitRemoteResource) variant);
+ return new ResourceVariantFileRevision(variant);
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java
new file mode 100644
index 0000000000..24c1b86aa2
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/merge/TreeWalkResourceVariantTreeProvider.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.merge;
+
+import java.io.IOException;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.internal.storage.TreeParserResourceVariant;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.treewalk.AbstractTreeIterator;
+import org.eclipse.jgit.treewalk.CanonicalTreeParser;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.team.core.variants.IResourceVariantTree;
+
+/**
+ * This will populate its three {@link IResourceVariantTree} by walking over a
+ * tree walk and caching the IResources it spans.
+ * <p>
+ * Files that are not located within the workspace will be ignored and thus will
+ * not be accessible through the trees created by this provider.
+ * </p>
+ */
+public class TreeWalkResourceVariantTreeProvider implements
+ GitResourceVariantTreeProvider {
+ private final IResourceVariantTree baseTree;
+
+ private final IResourceVariantTree oursTree;
+
+ private final IResourceVariantTree theirsTree;
+
+ private final Set<IResource> roots;
+
+ private final Set<IResource> knownResources;
+
+ /**
+ * Constructs the resource variant trees by iterating over the given tree
+ * walk. This TreeWalk must contain at least three trees corresponding to
+ * the three "sides" we need.
+ * <p>
+ * The tree walk will be reset to its initial state when we are done with
+ * the iteration.
+ * </p>
+ *
+ * @param repository
+ * The repository this tree walk has been created for.
+ * @param treeWalk
+ * The tree walk to iterate over.
+ * @param baseIndex
+ * Index of the ancestor tree in the given TreeWalk (value
+ * returned by {@link TreeWalk#addTree(AbstractTreeIterator)})
+ * @param ourIndex
+ * Index of our tree in the given TreeWalk (value returned by
+ * {@link TreeWalk#addTree(AbstractTreeIterator)})
+ * @param theirIndex
+ * Index of their tree in the given TreeWalk (value returned by
+ * {@link TreeWalk#addTree(AbstractTreeIterator)})
+ * @throws IOException
+ * if we somehow cannot iterate over the treewalk.
+ */
+ public TreeWalkResourceVariantTreeProvider(Repository repository,
+ TreeWalk treeWalk, int baseIndex, int ourIndex, int theirIndex)
+ throws IOException {
+ // Record the initial state of this tree walk before iterating
+ final AbstractTreeIterator[] initialTrees = new AbstractTreeIterator[treeWalk
+ .getTreeCount()];
+ for (int i = 0; i < treeWalk.getTreeCount(); i++) {
+ initialTrees[i] = treeWalk.getTree(i, AbstractTreeIterator.class);
+ }
+
+ final GitResourceVariantCache baseCache = new GitResourceVariantCache();
+ final GitResourceVariantCache theirsCache = new GitResourceVariantCache();
+ final GitResourceVariantCache oursCache = new GitResourceVariantCache();
+
+ while (treeWalk.next()) {
+ final int modeBase = treeWalk.getRawMode(baseIndex);
+ final int modeOurs = treeWalk.getRawMode(ourIndex);
+ final int modeTheirs = treeWalk.getRawMode(theirIndex);
+ if (modeBase == 0 && modeOurs == 0 && modeTheirs == 0) {
+ // untracked
+ continue;
+ }
+
+ final CanonicalTreeParser base = treeWalk.getTree(baseIndex,
+ CanonicalTreeParser.class);
+ final CanonicalTreeParser ours = treeWalk.getTree(ourIndex,
+ CanonicalTreeParser.class);
+ final CanonicalTreeParser theirs = treeWalk.getTree(theirIndex,
+ CanonicalTreeParser.class);
+
+ final IPath path = new Path(treeWalk.getPathString());
+ final IResource resource = ResourceUtil
+ .getResourceHandleForLocation(path);
+ // Resource variants only make sense for IResources. Do not consider
+ // files outside of the workspace or otherwise non accessible.
+ if (resource != null && resource.getProject().isAccessible()) {
+ if (modeBase != 0) {
+ baseCache.setVariant(resource,
+ TreeParserResourceVariant.create(repository, base));
+ }
+ if (modeOurs != 0) {
+ oursCache.setVariant(resource,
+ TreeParserResourceVariant.create(repository, ours));
+ }
+ if (modeTheirs != 0) {
+ theirsCache.setVariant(resource,
+ TreeParserResourceVariant.create(repository, theirs));
+ }
+ }
+
+ if (treeWalk.isSubtree()) {
+ treeWalk.enterSubtree();
+ }
+ }
+
+ // TODO any better way to reset the tree walk after an iteration?
+ treeWalk.reset();
+ for (int i = 0; i < initialTrees.length; i++) {
+ initialTrees[i].reset();
+ treeWalk.addTree(initialTrees[i]);
+ }
+
+ baseTree = new GitCachedResourceVariantTree(baseCache);
+ theirsTree = new GitCachedResourceVariantTree(theirsCache);
+ oursTree = new GitCachedResourceVariantTree(oursCache);
+
+ roots = new LinkedHashSet<IResource>();
+ roots.addAll(baseCache.getRoots());
+ roots.addAll(oursCache.getRoots());
+ roots.addAll(theirsCache.getRoots());
+
+ knownResources = new LinkedHashSet<IResource>();
+ knownResources.addAll(baseCache.getKnownResources());
+ knownResources.addAll(oursCache.getKnownResources());
+ knownResources.addAll(theirsCache.getKnownResources());
+ }
+
+ public IResourceVariantTree getBaseTree() {
+ return baseTree;
+ }
+
+ public IResourceVariantTree getRemoteTree() {
+ return theirsTree;
+ }
+
+ public IResourceVariantTree getSourceTree() {
+ return oursTree;
+ }
+
+ public Set<IResource> getKnownResources() {
+ return knownResources;
+ }
+
+ public Set<IResource> getRoots() {
+ return roots;
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/AbstractGitResourceVariant.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/AbstractGitResourceVariant.java
new file mode 100644
index 0000000000..22effd8371
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/AbstractGitResourceVariant.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.storage;
+
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.team.core.variants.IResourceVariant;
+
+/**
+ * Base class of the git-related resource variants.
+ */
+public abstract class AbstractGitResourceVariant implements IResourceVariant {
+ /** Repository in which this variant's content will be accessed. */
+ protected final Repository repository;
+
+ /** Repository-relative path of this resource. */
+ protected final String path;
+
+ /**
+ * Whether this resource is a container or not in this particular variant.
+ * This may be different than the local resource's state (if there is a
+ * file/folder conflict for example).
+ */
+ protected final boolean isContainer;
+
+ /** Object id of this variant in its repository. */
+ protected final ObjectId objectId;
+
+ /** Raw mode bits of this variant. */
+ protected final int rawMode;
+
+ /**
+ * @param repository
+ * Repository in which this variant's content will be accessed.
+ * @param path
+ * Repository-relative path of this resource.
+ * @param isContainer
+ * Whether this resource is a container or not in this particular
+ * variant.
+ * @param objectId
+ * Object id of this variant in its repository.
+ * @param rawMode
+ * Raw mode bits of this variant.
+ */
+ protected AbstractGitResourceVariant(Repository repository, String path,
+ boolean isContainer, ObjectId objectId, int rawMode) {
+ this.repository = repository;
+ this.path = path;
+ this.isContainer = isContainer;
+ this.objectId = objectId;
+ this.rawMode = rawMode;
+ }
+
+ public String getName() {
+ int lastSeparator = path.lastIndexOf('/');
+ return path.substring(lastSeparator + 1);
+ }
+
+ public boolean isContainer() {
+ return isContainer;
+ }
+
+ public String getContentIdentifier() {
+ return objectId.name();
+ }
+
+ public byte[] asBytes() {
+ return objectId.name().getBytes();
+ }
+
+ /**
+ * @return the object id of this variant in its backing repository.
+ */
+ public ObjectId getObjectId() {
+ return objectId;
+ }
+
+ /**
+ * @return the raw mode of this variant.
+ */
+ public int getRawMode() {
+ return rawMode;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this)
+ return true;
+ if (obj instanceof AbstractGitResourceVariant) {
+ AbstractGitResourceVariant other = (AbstractGitResourceVariant) obj;
+ return this.path.equals(other.path)
+ && this.repository.equals(other.repository)
+ && this.objectId.equals(other.objectId);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 37;
+ hash = 37 * hash + (path != null ? path.hashCode() : 0);
+ hash = 37 * hash + (repository != null ? repository.hashCode() : 0);
+ hash = 37 * hash + (objectId != null ? objectId.hashCode() : 0);
+ return hash;
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitBlobStorage.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitBlobStorage.java
index bb173fddb4..a425a17283 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitBlobStorage.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitBlobStorage.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (C) 2010, Jens Baumgart <jens.baumgart@sap.com>
+ * Copyright (C) 2014, Obeo
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -14,7 +15,10 @@ package org.eclipse.egit.core.internal.storage;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.internal.Utils;
+import org.eclipse.egit.core.storage.GitBlobStorage;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -26,7 +30,7 @@ import org.eclipse.jgit.revwalk.RevCommit;
* issue that editors get dirty because Eclipse seems to share the document of
* the workspace file if the remote file has the same full path.
*/
-public class CommitBlobStorage extends BlobStorage {
+public class CommitBlobStorage extends GitBlobStorage {
private final RevCommit commit;
@@ -49,6 +53,8 @@ public class CommitBlobStorage extends BlobStorage {
@Override
public IPath getFullPath() {
+ final RepositoryUtil repositoryUtil = Activator.getDefault()
+ .getRepositoryUtil();
IPath repoPath = new Path(repositoryUtil.getRepositoryName(db));
String pathString = super.getFullPath().toPortableString() + " " //$NON-NLS-1$
+ Utils.getShortObjectId(commit.getId());
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexBlobStorage.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexBlobStorage.java
index 82ef15077f..9a1c0902cc 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexBlobStorage.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexBlobStorage.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (C) 2010, Jens Baumgart <jens.baumgart@sap.com>
+ * Copyright (C) 2014, Obeo
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,6 +11,9 @@ package org.eclipse.egit.core.internal.storage;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.storage.GitBlobStorage;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
@@ -20,7 +24,7 @@ import org.eclipse.jgit.lib.Repository;
* @see CommitBlobStorage
*
*/
-public class IndexBlobStorage extends BlobStorage {
+public class IndexBlobStorage extends GitBlobStorage {
IndexBlobStorage(final Repository repository, final String fileName,
final ObjectId blob) {
@@ -29,6 +33,8 @@ public class IndexBlobStorage extends BlobStorage {
@Override
public IPath getFullPath() {
+ final RepositoryUtil repositoryUtil = Activator.getDefault()
+ .getRepositoryUtil();
IPath repoPath = new Path(repositoryUtil.getRepositoryName(db));
String pathString = super.getFullPath().toPortableString() + " index"; //$NON-NLS-1$
return repoPath.append(Path.fromPortableString(pathString));
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexResourceVariant.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexResourceVariant.java
new file mode 100644
index 0000000000..14b3b0be44
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexResourceVariant.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.storage;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.team.core.TeamException;
+
+/**
+ * Implementation of a resource variant populated through a Repository's
+ * DirCache information.
+ */
+public class IndexResourceVariant extends AbstractGitResourceVariant {
+ private IndexResourceVariant(Repository repository, String path,
+ boolean isContainer, ObjectId objectId, int rawMode) {
+ super(repository, path, isContainer, objectId, rawMode);
+ }
+
+ /**
+ * Constructs a resource variant corresponding to the given DirCache entry.
+ *
+ * @param repository
+ * Repository from which this DirCacheEntry was extracted.
+ * @param entry
+ * The DirCacheEntry for which content we need an
+ * IResourceVariant.
+ * @return The created variant.
+ */
+ public static IndexResourceVariant create(Repository repository,
+ DirCacheEntry entry) {
+ final String path = entry.getPathString();
+ final boolean isContainer = FileMode.TREE.equals(entry.getFileMode());
+ final ObjectId objectId = entry.getObjectId();
+ final int rawMode = entry.getRawMode();
+
+ return new IndexResourceVariant(repository, path, isContainer,
+ objectId, rawMode);
+ }
+
+ public IStorage getStorage(IProgressMonitor monitor) throws TeamException {
+ return new IndexBlobStorage(repository, path, objectId);
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/TreeParserResourceVariant.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/TreeParserResourceVariant.java
new file mode 100644
index 0000000000..772ae80aee
--- /dev/null
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/TreeParserResourceVariant.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (C) 2015, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.core.internal.storage;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.egit.core.storage.GitBlobStorage;
+import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.treewalk.CanonicalTreeParser;
+import org.eclipse.team.core.TeamException;
+
+/**
+ * Implementation of a resource variant populated through a CanonicalTreeParser.
+ * This can provide access to local resources as well as their remote variants.
+ */
+public class TreeParserResourceVariant extends AbstractGitResourceVariant {
+ private TreeParserResourceVariant(Repository repository, String path,
+ boolean isContainer, ObjectId objectId, int rawMode) {
+ super(repository, path, isContainer, objectId, rawMode);
+ }
+
+ /**
+ * Constructs a resource variant corresponding to the current entry of the
+ * given CanonicalTreeParser.
+ *
+ * @param repository
+ * Repository from which this CanonicalTreeParser was created.
+ * @param treeParser
+ * A CanonicalTreeParser to retrieve information from. This will
+ * only read information about the current entry on which this
+ * parser is positioned and will not change its state.
+ * @return The created variant.
+ */
+ public static TreeParserResourceVariant create(Repository repository,
+ CanonicalTreeParser treeParser) {
+ final String path = treeParser.getEntryPathString();
+ final boolean isContainer = FileMode.TREE.equals(treeParser
+ .getEntryFileMode());
+ final ObjectId objectId = treeParser.getEntryObjectId();
+ final int rawMode = treeParser.getEntryRawMode();
+
+ return new TreeParserResourceVariant(repository, path, isContainer,
+ objectId, rawMode);
+ }
+
+ public IStorage getStorage(IProgressMonitor monitor) throws TeamException {
+ return new GitBlobStorage(repository, path, objectId);
+ }
+}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
index b00dc12f7f..ef0b49b965 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
@@ -1,7 +1,7 @@
/*******************************************************************************
* Copyright (C) 2011, Jens Baumgart <jens.baumgart@sap.com>
* Copyright (C) 2012, 2013 Robin Stocker <robin@nibor.org>
- * Copyright (C) 2012, 2013 Laurent Goubet <laurent.goubet@obeo.fr>
+ * Copyright (C) 2012, 2015 Laurent Goubet <laurent.goubet@obeo.fr>
* Copyright (C) 2012, Gunnar Wagenknecht <gunnar@wagenknecht.org>
*
* All rights reserved. This program and the accompanying materials
@@ -67,12 +67,11 @@ public class ResourceUtil {
* @return the resources, or null
*/
public static IResource getResourceForLocation(IPath location) {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- URI uri = URIUtil.toURI(location);
- IFile file = getFileForLocationURI(root, uri);
- if (file != null)
+ IFile file = getFileForLocation(location);
+ if (file != null) {
return file;
- return getContainerForLocationURI(root, uri);
+ }
+ return getContainerForLocation(location);
}
/**
@@ -87,11 +86,36 @@ public class ResourceUtil {
*/
public static IFile getFileForLocation(IPath location) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IFile file = root.getFileForLocation(location);
+ if (file == null) {
+ return null;
+ }
+ if (isValid(file)) {
+ return file;
+ }
URI uri = URIUtil.toURI(location);
return getFileForLocationURI(root, uri);
}
/**
+ * sort out closed, linked or not shared resources
+ *
+ * @param resource
+ * @return true if the resource is shared with git, not a link and
+ * accessible in Eclipse
+ */
+ private static boolean isValid(IResource resource) {
+ return resource.isAccessible()
+ && !resource.isLinked(IResource.CHECK_ANCESTORS)
+ && isSharedWithGit(resource);
+ }
+
+ private static boolean isSharedWithGit(IResource resource) {
+ return RepositoryProvider.getProvider(resource.getProject(),
+ GitProvider.ID) != null;
+ }
+
+ /**
* Return the corresponding container if it exists and has the Git
* repository provider.
* <p>
@@ -103,6 +127,13 @@ public class ResourceUtil {
*/
public static IContainer getContainerForLocation(IPath location) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IContainer dir = root.getContainerForLocation(location);
+ if (dir == null) {
+ return null;
+ }
+ if (isValid(dir)) {
+ return dir;
+ }
URI uri = URIUtil.toURI(location);
return getContainerForLocationURI(root, uri);
}
@@ -161,12 +192,33 @@ public class ResourceUtil {
File f = new Path(repository.getWorkTree().getAbsolutePath())
.append((repoRelativePath)).toFile();
return FS.DETECTED.isSymLink(f);
- } catch (@SuppressWarnings("unused") IOException e) {
+ } catch (IOException e) {
return false;
}
}
/**
+ * Returns a resource handle for this path in the workspace. Note that
+ * neither the resource nor the result need exist in the workspace : this
+ * may return inexistant or otherwise non-accessible IResources.
+ *
+ * @param path
+ * Path for which we need a resource handle.
+ * @return The resource handle for the given path in the workspace.
+ */
+ public static IResource getResourceHandleForLocation(IPath path) {
+ final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
+ .getRoot();
+
+ final IResource resource;
+ if (path.segmentCount() > 1)
+ resource = workspaceRoot.getFile(path);
+ else
+ resource = workspaceRoot.getProject(path.toString());
+ return resource;
+ }
+
+ /**
* The method splits the given resources by their repository. For each
* occurring repository a list is built containing the repository relative
* paths of the related resources.
@@ -259,12 +311,12 @@ public class ResourceUtil {
int shortestPathSegmentCount = Integer.MAX_VALUE;
T shortestPath = null;
for (T resource : resources) {
- if (!resource.exists())
+ if (!resource.exists()) {
continue;
- RepositoryProvider provider = RepositoryProvider.getProvider(
- resource.getProject(), GitProvider.ID);
- if (provider == null)
+ }
+ if (!isSharedWithGit(resource)) {
continue;
+ }
IPath fullPath = resource.getFullPath();
int segmentCount = fullPath.segmentCount();
if (segmentCount < shortestPathSegmentCount) {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java
index 48fc3ab6dd..0a76a58a0c 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java
@@ -19,6 +19,7 @@ import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.NetUtil;
import org.eclipse.egit.core.internal.gerrit.GerritUtil;
import org.eclipse.egit.core.op.CloneOperation.PostCloneTask;
import org.eclipse.jgit.lib.Constants;
@@ -80,7 +81,7 @@ public class ConfigureGerritAfterCloneTask implements PostCloneTask {
public void execute(Repository repository, IProgressMonitor monitor)
throws CoreException {
try {
- if (isGerrit()) {
+ if (isGerrit(repository)) {
Activator.logInfo(uri
+ " was detected to be hosted by a Gerrit server"); //$NON-NLS-1$
configureGerrit(repository);
@@ -99,12 +100,16 @@ public class ConfigureGerritAfterCloneTask implements PostCloneTask {
* /rest-api-config.html#get-version">Gerrit 2.11 Get Version REST
* endpoint</a>
*
+ * @param repo
+ * the repository to be configured
+ *
* @return {@code true} if the repository is hosted on a Gerrit server
* @throws IOException
* @throws MalformedURLException
* @throws URISyntaxException
*/
- private boolean isGerrit() throws MalformedURLException, IOException,
+ private boolean isGerrit(Repository repo) throws MalformedURLException,
+ IOException,
URISyntaxException {
URIish u = new URIish(uri);
final String s = u.getScheme();
@@ -122,7 +127,8 @@ public class ConfigureGerritAfterCloneTask implements PostCloneTask {
}
if (path != null && (HTTP.equals(s) || HTTPS.equals(s))) {
- String baseURL = uri.substring(0, uri.lastIndexOf(path));
+ String baseURL = u.setPath("/").toString(); //$NON-NLS-1$
+ baseURL = baseURL.substring(0, baseURL.length() - 1);
String tmpPath = ""; //$NON-NLS-1$
HttpURLConnection httpConnection = null;
try {
@@ -133,6 +139,7 @@ public class ConfigureGerritAfterCloneTask implements PostCloneTask {
httpConnection = (HttpURLConnection) new URL(baseURL
+ tmpPath + GERRIT_CONFIG_SERVER_VERSION_API)
.openConnection();
+ NetUtil.setSslVerification(repo, httpConnection);
httpConnection.setRequestMethod("GET"); //$NON-NLS-1$
httpConnection.setReadTimeout(1000 * timeout);
int responseCode = httpConnection.getResponseCode();
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
index 4d7bf06bd8..fcfe3d24ff 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/GitProjectData.java
@@ -201,8 +201,8 @@ public class GitProjectData {
public synchronized static GitProjectData get(final IProject p) {
try {
GitProjectData d = lookup(p);
- if (d == null
- && RepositoryProvider.getProvider(p) instanceof GitProvider) {
+ if (d == null && RepositoryProvider.getProvider(p,
+ GitProvider.ID) != null) {
d = new GitProjectData(p).load();
cache(p, d);
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
index 699a31f7fb..8813680910 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java
@@ -297,32 +297,45 @@ public class RepositoryMapping {
* GitProvider.
*/
public static RepositoryMapping getMapping(final IResource resource) {
- if (isNonWorkspace(resource))
+ if (isNonWorkspace(resource)) {
return null;
-
- if (resource.isLinked(IResource.CHECK_ANCESTORS))
+ }
+ if (resource.isLinked(IResource.CHECK_ANCESTORS)) {
return getMapping(resource.getLocation());
+ }
+ return getMapping(resource.getProject());
+ }
- IProject project = resource.getProject();
- if (project == null)
+ /**
+ * Get the repository mapping for a project.
+ *
+ * @param project
+ * @return the RepositoryMapping for this project, or null for non
+ * GitProvider.
+ */
+ public static RepositoryMapping getMapping(final IProject project) {
+ if (project == null || isNonWorkspace(project)) {
return null;
-
- final RepositoryProvider rp = RepositoryProvider.getProvider(project);
- if (!(rp instanceof GitProvider))
+ }
+ final RepositoryProvider rp = RepositoryProvider.getProvider(project,
+ GitProvider.ID);
+ if (rp == null) {
return null;
+ }
- if (((GitProvider)rp).getData() == null)
+ GitProjectData data = ((GitProvider) rp).getData();
+ if (data == null) {
return null;
+ }
- return ((GitProvider)rp).getData().getRepositoryMapping(resource);
+ return data.getRepositoryMapping(project);
}
/**
* Get the repository mapping for a path if it exists.
*
* @param path
- * @return the RepositoryMapping for this path,
- * or null for non GitProvider.
+ * @return the RepositoryMapping for this path, or null for non GitProvider.
*/
public static RepositoryMapping getMapping(IPath path) {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java
index b5262267a3..85b0ea3129 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/BlobStorage.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java
@@ -2,15 +2,17 @@
* Copyright (C) 2006, 2012 Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* Copyright (C) 2011, Dariusz Luksza <dariusz@luksza.org>
+ * Copyright (C) 2014, Obeo
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.egit.core.internal.storage;
+package org.eclipse.egit.core.storage;
import java.io.ByteArrayInputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
@@ -20,7 +22,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
-import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.internal.CoreText;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
@@ -31,24 +32,40 @@ import org.eclipse.jgit.treewalk.WorkingTreeOptions;
import org.eclipse.jgit.util.io.AutoCRLFInputStream;
import org.eclipse.osgi.util.NLS;
-/** Accesses a blob from Git. */
-class BlobStorage implements IStorage {
+/**
+ * Provides access to a git blob.
+ *
+ * @since 4.0
+ */
+public class GitBlobStorage implements IStorage {
+ /** Repository containing the object this storage provides access to. */
protected final Repository db;
- protected final RepositoryUtil repositoryUtil;
-
- private final String path;
-
- private final ObjectId blobId;
-
- BlobStorage(final Repository repository, final String fileName,
+ /** Repository-relative path of the underlying object. */
+ protected final String path;
+
+ /** Id of this object in its repository. */
+ protected final ObjectId blobId;
+
+ /**
+ * @param repository
+ * The repository containing this object.
+ * @param path
+ * Repository-relative path of the underlying object. This path
+ * is not validated by this class, i.e. it's returned as is by
+ * {@code #getAbsolutePath()} and {@code #getFullPath()} without
+ * validating if the blob is reachable using this path.
+ * @param blob
+ * Id of this object in its repository.
+ */
+ public GitBlobStorage(final Repository repository, final String path,
final ObjectId blob) {
- db = repository;
- path = fileName;
- blobId = blob;
- repositoryUtil = Activator.getDefault().getRepositoryUtil();
+ this.db = repository;
+ this.path = path;
+ this.blobId = blob;
}
+ @Override
public InputStream getContents() throws CoreException {
try {
return open();
@@ -66,36 +83,42 @@ class BlobStorage implements IStorage {
try {
WorkingTreeOptions workingTreeOptions = db.getConfig().get(WorkingTreeOptions.KEY);
+ final InputStream objectInputStream = db.open(blobId,
+ Constants.OBJ_BLOB).openStream();
switch (workingTreeOptions.getAutoCRLF()) {
case INPUT:
// When autocrlf == input the working tree could be either CRLF or LF, i.e. the comparison
// itself should ignore line endings.
case FALSE:
- return db.open(blobId, Constants.OBJ_BLOB).openStream();
+ return objectInputStream;
case TRUE:
default:
- return new AutoCRLFInputStream(db.open(blobId, Constants.OBJ_BLOB).openStream(), true);
+ return new AutoCRLFInputStream(objectInputStream, true);
}
} catch (MissingObjectException notFound) {
throw new CoreException(Activator.error(NLS.bind(
CoreText.BlobStorage_blobNotFound, blobId.name(), path),
- null));
+ notFound));
}
}
+ @Override
public IPath getFullPath() {
return Path.fromPortableString(path);
}
+ @Override
public String getName() {
final int last = path.lastIndexOf('/');
return last >= 0 ? path.substring(last + 1) : path;
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public Object getAdapter(final Class adapter) {
return null;
}
@@ -113,7 +136,7 @@ class BlobStorage implements IStorage {
return false;
if (getClass() != obj.getClass())
return false;
- BlobStorage other = (BlobStorage) obj;
+ GitBlobStorage other = (GitBlobStorage) obj;
if (blobId == null) {
if (other.blobId != null)
return false;
@@ -132,5 +155,20 @@ class BlobStorage implements IStorage {
return true;
}
-
+ /**
+ * Returns the absolute path on disk of the underlying object.
+ * <p>
+ * The returned path may not point to an existing file if the object does
+ * not exist locally.
+ * </p>
+ *
+ * @return The absolute path on disk of the underlying object.
+ */
+ public IPath getAbsolutePath() {
+ if (db.isBare()) {
+ return null;
+ }
+ return new Path(db.getWorkTree().getAbsolutePath() + File.separatorChar
+ + path);
+ }
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponentTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponentTest.java
new file mode 100644
index 0000000000..7119ab2812
--- /dev/null
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponentTest.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2015 SAP SE (Christian Georgi <christian.georgi@sap.com>)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.egit.ui.internal.dialogs;
+
+import static org.junit.Assert.assertEquals;
+
+import org.eclipse.egit.ui.internal.UIText;
+import org.junit.Test;
+
+public class CommitMessageComponentTest {
+
+ @Test
+ public void commitFormat_simple() {
+ String commitMessage = "Simple message";
+
+ String formattedMessage = CommitMessageComponent
+ .formatIssuesInCommitMessage(commitMessage);
+ assertEquals(null, formattedMessage);
+ }
+
+ @Test
+ public void commitFormat_trailingWhitespace_ok() {
+ String commitMessage = "Simple message\n\n\n";
+
+ String formattedMessage = CommitMessageComponent
+ .formatIssuesInCommitMessage(commitMessage);
+ assertEquals(null, formattedMessage);
+ }
+
+ @Test
+ public void commitFormat_MultipleLines_ok() {
+ String commitMessage = "Simple message\n\nDetails";
+
+ String formattedMessage = CommitMessageComponent
+ .formatIssuesInCommitMessage(commitMessage);
+ assertEquals(null, formattedMessage);
+ }
+
+ @Test
+ public void commitFormat_MultipleLines_notOk() {
+ String commitMessage = "Simple message\nDetails";
+
+ String formattedMessage = CommitMessageComponent
+ .formatIssuesInCommitMessage(commitMessage);
+ assertEquals(UIText.CommitMessageComponent_MessageSecondLineNotEmpty,
+ formattedMessage);
+ }
+
+ @Test
+ public void commitFormat_MultipleLines_notOk2() {
+ String commitMessage = "Simple message\n \nDetails";
+
+ String formattedMessage = CommitMessageComponent
+ .formatIssuesInCommitMessage(commitMessage);
+ assertEquals(UIText.CommitMessageComponent_MessageSecondLineNotEmpty,
+ formattedMessage);
+ }
+
+}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
index bcaed2bff9..c8907dac18 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
@@ -32,6 +32,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.JobFamilies;
+import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.internal.operations.GitScopeOperation;
import org.eclipse.egit.ui.internal.operations.GitScopeOperationFactory;
@@ -230,7 +231,7 @@ public class GitScopeUtilTest extends LocalRepositoryTestCase {
}
private ResourceMapping getMappingAdapter(IResource resource) {
- return (ResourceMapping) resource.getAdapter(ResourceMapping.class);
+ return Utils.getAdapter(resource, ResourceMapping.class);
}
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
index 5a17851b53..fc71f8fd2d 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
@@ -19,6 +19,7 @@ import java.io.File;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.internal.UIText;
@@ -77,8 +78,8 @@ public class CommitEditorTest extends LocalRepositoryTestCase {
assertNotNull(editorRef.get());
IEditorPart editor = editorRef.get();
assertTrue(editor instanceof CommitEditor);
- RepositoryCommit adaptedCommit = (RepositoryCommit) editor
- .getAdapter(RepositoryCommit.class);
+ RepositoryCommit adaptedCommit = Utils.getAdapter(editor,
+ RepositoryCommit.class);
assertNotNull(adaptedCommit);
assertEquals(commit, adaptedCommit.getRevCommit());
assertEquals(repository.getDirectory(), adaptedCommit.getRepository()
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index 310547b8ee..0d6768e569 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -28,6 +28,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
@@ -84,7 +85,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
/**
* First level should have 5 children
- *
+ *
* @throws Exception
*/
@Test
@@ -98,7 +99,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
/**
* Open (expand, file->editor, branch->checkout)
- *
+ *
* @throws Exception
*/
@Test
@@ -159,7 +160,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
/**
* Checks the first level of the working directory
- *
+ *
* @throws Exception
*/
@Test
@@ -179,7 +180,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
/**
* Checks is some context menus are available, should be replaced with real
* tests
- *
+ *
* @throws Exception
*/
@Test
@@ -381,7 +382,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
IAdaptable[] elements = workingSet.getElements();
assertEquals("Wrong number of projects in working set", 1,
elements.length);
- IProject project = (IProject) elements[0].getAdapter(IProject.class);
+ IProject project = Utils.getAdapter(elements[0], IProject.class);
assertEquals("Wrong project in working set", projectName, project
.getName());
}
@@ -440,7 +441,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
/**
* Link with editor, both ways
- *
+ *
* @throws Exception
*/
@Test
diff --git a/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
index c49ff179b6..5534361bcb 100644
--- a/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,5 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
@@ -54,13 +55,14 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
@@ -81,6 +83,7 @@ org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
@@ -95,6 +98,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
@@ -104,6 +108,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
org.eclipse.jdt.core.compiler.source=1.7
diff --git a/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css b/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
index ed640358f8..ecbee3632d 100644
--- a/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
+++ b/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
@@ -7,6 +7,7 @@
*
* Contributors:
* Andrea Guarinoni - initial API and implementation
+ * Fabio Zadrozny - Bug 465672 - EGit staging view and commit page are not properly styled
*******************************************************************************/
/* ############################## EGIT preferences ############################## */
@@ -26,3 +27,11 @@ IEclipsePreferences#org-eclipse-ui-workbench {
'org.eclipse.egit.ui.UncommittedChangeBackgroundColor=42,42,42'
'org.eclipse.egit.ui.UncommittedChangeForegroundColor=114,157,186'
}
+
+
+#org-eclipse-egit-ui-StagingView StyledText,
+Form Section LayoutComposite StyledText
+ {
+ background-color: #313538;
+ color: #dddddd;
+ }
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 7736214b1f..13ce0bccad 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -216,6 +216,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
}
+ @Override
public void start(final BundleContext context) throws Exception {
super.start(context);
@@ -272,6 +273,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
private void updateUiState() {
Display.getCurrent().asyncExec(new Runnable() {
+ @Override
public void run() {
boolean wasActive = uiIsActive;
uiIsActive = Display.getCurrent().getActiveShell() != null;
@@ -292,18 +294,22 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
});
}
+ @Override
public void windowOpened(IWorkbenchWindow window) {
updateUiState();
}
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {
updateUiState();
}
+ @Override
public void windowClosed(IWorkbenchWindow window) {
updateUiState();
}
+ @Override
public void windowActivated(IWorkbenchWindow window) {
updateUiState();
if (rcs.doReschedule)
@@ -324,6 +330,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
job.schedule();
}
+ @Override
public void optionsChanged(DebugOptions options) {
// initialize the trace stuff
debugOptions = options;
@@ -420,6 +427,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
return Status.OK_STATUS;
}
+ @Override
public void onIndexChanged(IndexChangedEvent e) {
if (Activator.getDefault().getPreferenceStore()
.getBoolean(UIPreferences.REFESH_ON_INDEX_CHANGE))
@@ -581,6 +589,7 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
}
}
+ @Override
public void stop(final BundleContext context) throws Exception {
if (refreshHandle != null) {
refreshHandle.remove();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/GitRepositoriesPerspectiveFactory.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/GitRepositoriesPerspectiveFactory.java
index 6d7e7ae5d2..07315dd0fb 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/GitRepositoriesPerspectiveFactory.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/GitRepositoriesPerspectiveFactory.java
@@ -25,6 +25,7 @@ import org.eclipse.ui.IPerspectiveFactory;
*/
public class GitRepositoriesPerspectiveFactory implements IPerspectiveFactory {
+ @Override
public void createInitialLayout(IPageLayout layout) {
// repositories on the left hand
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
index e202ab3b18..dcaeef7b47 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
@@ -36,6 +36,7 @@ public class PluginPreferenceInitializer extends AbstractPreferenceInitializer {
/**
* This method initializes the plugin preferences with default values.
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
int[] w;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
index 67579ca01e..0a8ba9858b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIUtils.java
@@ -10,10 +10,13 @@
*******************************************************************************/
package org.eclipse.egit.ui;
+import java.lang.ref.SoftReference;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -86,6 +89,8 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.ISources;
@@ -103,6 +108,12 @@ import org.eclipse.ui.services.IServiceLocator;
* Some utilities for UI code
*/
public class UIUtils {
+
+ /** Default image descriptor for files */
+ public static final ImageDescriptor DEFAULT_FILE_IMG = PlatformUI
+ .getWorkbench().getSharedImages()
+ .getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
+
/**
* these activate the content assist; alphanumeric, space plus some expected
* special chars
@@ -277,6 +288,7 @@ public class UIUtils {
IContentProposalProvider cp = new IContentProposalProvider() {
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
List<IContentProposal> resultList = new ArrayList<IContentProposal>();
@@ -322,18 +334,22 @@ public class UIUtils {
IContentProposal propsal = new IContentProposal() {
+ @Override
public String getLabel() {
return null;
}
+ @Override
public String getDescription() {
return null;
}
+ @Override
public int getCursorPosition() {
return 0;
}
+ @Override
public String getContent() {
return uriString;
}
@@ -354,6 +370,7 @@ public class UIUtils {
.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
return new IPreviousValueProposalHandler() {
+ @Override
public void updateProposals() {
String value = textField.getText();
// don't store empty values
@@ -422,6 +439,7 @@ public class UIUtils {
stroke.format()));
IContentProposalProvider cp = new IContentProposalProvider() {
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
List<IContentProposal> resultList = new ArrayList<IContentProposal>();
@@ -508,6 +526,7 @@ public class UIUtils {
widget.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
resource.dispose();
}
@@ -527,12 +546,16 @@ public class UIUtils {
widget.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
resources.dispose();
}
});
}
+ /** Key is file extension, value is the reference to the image descriptor */
+ private static Map<String, SoftReference<ImageDescriptor>> extensionToDescriptor = new HashMap<>();
+
/**
* Get editor image for path
*
@@ -540,14 +563,38 @@ public class UIUtils {
* @return image descriptor
*/
public static ImageDescriptor getEditorImage(final String path) {
- if (path != null && path.length() > 0) {
- final String name = new Path(path).lastSegment();
- if (name != null)
- return PlatformUI.getWorkbench().getEditorRegistry()
- .getImageDescriptor(name);
+ if (path == null || path.length() <= 0) {
+ return DEFAULT_FILE_IMG;
+ }
+ final String fileName = new Path(path).lastSegment();
+ if (fileName == null) {
+ return DEFAULT_FILE_IMG;
+ }
+ IEditorRegistry registry = PlatformUI.getWorkbench()
+ .getEditorRegistry();
+ IEditorDescriptor defaultEditor = registry.getDefaultEditor(fileName);
+ if (defaultEditor != null) {
+ return defaultEditor.getImageDescriptor();
+ }
+ // now we know there is no Eclipse editor for the file, and Eclipse will
+ // check Program.findProgram() and this will be slow, see bug 464891
+ int extensionIndex = fileName.lastIndexOf('.');
+ if (extensionIndex < 0) {
+ // Program.findProgram() uses extensions only
+ return DEFAULT_FILE_IMG;
+ }
+ String key = fileName.substring(extensionIndex);
+ SoftReference<ImageDescriptor> cached = extensionToDescriptor.get(key);
+ if (cached != null) {
+ ImageDescriptor descriptor = cached.get();
+ if (descriptor != null) {
+ return descriptor;
+ }
}
- return PlatformUI.getWorkbench().getSharedImages()
- .getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
+ // In worst case this calls Program.findProgram() and blocks UI
+ ImageDescriptor descriptor = registry.getImageDescriptor(fileName);
+ extensionToDescriptor.put(key, new SoftReference<>(descriptor));
+ return descriptor;
}
/**
@@ -580,6 +627,7 @@ public class UIUtils {
collapseItem.setToolTipText(UIText.UIUtils_CollapseAll);
collapseItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
viewer.collapseAll();
}
@@ -593,6 +641,7 @@ public class UIUtils {
expandItem.setToolTipText(UIText.UIUtils_ExpandAll);
expandItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
viewer.expandAll();
}
@@ -751,6 +800,7 @@ public class UIUtils {
UIText.CancelAfterSaveDialog_Title, null,
cancelConfirmationQuestion,
MessageDialog.QUESTION, buttons, 0) {
+ @Override
protected int getShellStyle() {
return (SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL
| SWT.SHEET | getDefaultOrientation());
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java
index 2b79d51d57..17b83722b1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java
@@ -50,6 +50,7 @@ public class CommonUtils {
* string1.equals(String2) returns false
*/
public static final Comparator<String> STRING_ASCENDING_COMPARATOR = new Comparator<String>() {
+ @Override
public int compare(String o1, String o2) {
if (o1.length() == 0 || o2.length() == 0)
return o1.length() - o2.length();
@@ -96,6 +97,7 @@ public class CommonUtils {
* {@link CommonUtils#STRING_ASCENDING_COMPARATOR}.
*/
public static final Comparator<Ref> REF_ASCENDING_COMPARATOR = new Comparator<Ref>() {
+ @Override
public int compare(Ref o1, Ref o2) {
return STRING_ASCENDING_COMPARATOR.compare(o1.getName(), o2.getName());
}
@@ -106,6 +108,7 @@ public class CommonUtils {
* {@link IResource#getName()}.
*/
public static final Comparator<IResource> RESOURCE_NAME_COMPARATOR = new Comparator<IResource>() {
+ @Override
public int compare(IResource r1, IResource r2) {
return Policy.getComparator().compare(r1.getName(), r2.getName());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
index af2c1c9713..3bbed82844 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
@@ -377,15 +377,18 @@ public class CompareUtils {
setChecked(CompareUtils.isReuseOpenEditor());
}
+ @Override
public void run() {
CompareUtils.setReuseOpenEditor(isChecked());
}
+ @Override
public void dispose() {
// stop listening
node.removePreferenceChangeListener(this);
}
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
setChecked(isReuseOpenEditor());
@@ -500,6 +503,7 @@ public class CompareUtils {
// safety check: make sure we open compare editor from UI thread
if (Display.getCurrent() == null) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
openCompareEditorRunnable(page, in);
}
@@ -976,6 +980,7 @@ public class CompareUtils {
final EditableRevision next = new EditableRevision(nextFile, encoding);
IContentChangeListener listener = new IContentChangeListener() {
+ @Override
public void contentChanged(IContentChangeNotifier source) {
final byte[] newContent = next.getModifiedContent();
setIndexEntryContents(repository, gitPath, newContent);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ConfigurationChecker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ConfigurationChecker.java
index 6a918bbf0e..10cfb68ddc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ConfigurationChecker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ConfigurationChecker.java
@@ -44,6 +44,7 @@ public class ConfigurationChecker {
if (PlatformUI.isWorkbenchRunning()) {
PlatformUI.getWorkbench().getDisplay()
.asyncExec(new Runnable() {
+ @Override
public void run() {
check();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
index cbd1956af0..21b8abca3f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/DecorationOverlayDescriptor.java
@@ -153,6 +153,7 @@ public class DecorationOverlayDescriptor extends CompositeImageDescriptor {
}
}
+ @Override
public boolean equals(Object o) {
if (!(o instanceof DecorationOverlayDescriptor))
return false;
@@ -161,6 +162,7 @@ public class DecorationOverlayDescriptor extends CompositeImageDescriptor {
&& Arrays.equals(overlays, other.overlays);
}
+ @Override
public int hashCode() {
int code = base.hashCode();
for (int i = 0; i < overlays.length; i++)
@@ -169,6 +171,7 @@ public class DecorationOverlayDescriptor extends CompositeImageDescriptor {
return code;
}
+ @Override
protected void drawCompositeImage(int width, int height) {
if (overlays.length > IDecoration.UNDERLAY) {
ImageDescriptor underlay = overlays[IDecoration.UNDERLAY];
@@ -190,10 +193,12 @@ public class DecorationOverlayDescriptor extends CompositeImageDescriptor {
return data != null ? data : DEFAULT_IMAGE_DATA;
}
+ @Override
protected Point getSize() {
return size;
}
+ @Override
protected int getTransparentPixel() {
return getBaseImageData().transparentPixel;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabelProvider.java
index 477ce7c5fe..5c767df4de 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabelProvider.java
@@ -84,6 +84,7 @@ public class GitLabelProvider extends LabelProvider implements
return super.getImage(element);
}
+ @Override
public StyledString getStyledText(Object element) {
return GitLabels.getStyledLabelExtendedSafe(element);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/RepositorySaveableFilter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/RepositorySaveableFilter.java
index 7f58c1c722..957dc5153b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/RepositorySaveableFilter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/RepositorySaveableFilter.java
@@ -40,6 +40,7 @@ public class RepositorySaveableFilter extends SaveFilter {
this.workDir = new Path(repository.getWorkTree().getAbsolutePath());
}
+ @Override
public boolean select(Saveable saveable, IWorkbenchPart[] containingParts) {
boolean selected = super.select(saveable, containingParts);
if (!selected)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java
index 3dee6f6f3c..47f73f8dd9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java
@@ -63,6 +63,7 @@ import org.eclipse.jgit.transport.RemoteConfig;
*/
public class ResourcePropertyTester extends PropertyTester {
+ @Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
boolean value = internalTest(receiver, property);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
index a517c0899b..e3fe319bd6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/SaveFilter.java
@@ -49,6 +49,7 @@ class SaveFilter implements ISaveableFilter {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveableFilter#select(org.eclipse.ui.Saveable, org.eclipse.ui.IWorkbenchPart[])
*/
+ @Override
public boolean select(Saveable saveable,
IWorkbenchPart[] containingParts) {
if (isDescendantOfRoots(saveable)) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 55ffae355f..e915024793 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -12,6 +12,7 @@
* Copyright (C) 2014, Marc Khouzam <marc.khouzam@ericsson.com>
* Copyright (C) 2014, Red Hat Inc.
* Copyright (C) 2014, Axel Richard <axel.richard@obeo.fr>
+ * Copyright (C) 2015, SAP SE (Christian Georgi <christian.georgi@sap.com>)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -742,30 +743,54 @@ public class UIText extends NLS {
public static String RebaseInteractiveStepActionToolBarProvider_SkipText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_SkipDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_EditText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_EditDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_FixupText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_FixupDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_MoveDownText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_MoveDownDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_MoveUpText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_MoveUpDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_PickText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_PickDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_RedoText;
/** */
public static String RebaseInteractiveStepActionToolBarProvider_RewordText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_RewordDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_SquashText;
/** */
+ public static String RebaseInteractiveStepActionToolBarProvider_SquashDesc;
+
+ /** */
public static String RebaseInteractiveStepActionToolBarProvider_UndoText;
/** */
@@ -2440,6 +2465,9 @@ public class UIText extends NLS {
public static String CommitMessageComponent_AmendingCommitInRemoteBranch;
/** */
+ public static String CommitMessageComponent_MessageSecondLineNotEmpty;
+
+ /** */
public static String CommitMessageEditorDialog_EditCommitMessageTitle;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ValidationUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ValidationUtils.java
index 068ce1f8ad..4c82bdfca8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ValidationUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ValidationUtils.java
@@ -36,6 +36,7 @@ public class ValidationUtils {
public static IInputValidator getRefNameInputValidator(
final Repository repo, final String refPrefix, final boolean errorOnEmptyName) {
return new IInputValidator() {
+ @Override
public String isValid(String newText) {
if (newText.length() == 0) {
if (errorOnEmptyName)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/WorkbenchStyledLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/WorkbenchStyledLabelProvider.java
index 6d40728a8a..7f93488658 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/WorkbenchStyledLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/WorkbenchStyledLabelProvider.java
@@ -26,26 +26,32 @@ public class WorkbenchStyledLabelProvider implements IStyledLabelProvider {
*/
protected final WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
+ @Override
public void removeListener(ILabelProviderListener listener) {
// Empty
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
+ @Override
public void dispose() {
workbenchLabelProvider.dispose();
}
+ @Override
public void addListener(ILabelProviderListener listener) {
// Empty
}
+ @Override
public StyledString getStyledText(Object element) {
return new StyledString(workbenchLabelProvider.getText(element));
}
+ @Override
public Image getImage(Object element) {
return workbenchLabelProvider.getImage(element);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AddToIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AddToIndexActionHandler.java
index 181428d559..aff158f335 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AddToIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AddToIndexActionHandler.java
@@ -31,6 +31,7 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class AddToIndexActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final IResource[] sel = getSelectedResources(event);
if (sel.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
index 9219bd59ec..54dde74a88 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ApplyPatchActionHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
public class ApplyPatchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
IResource resource = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AssumeUnchangedActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AssumeUnchangedActionHandler.java
index 7daf36c926..6df61ccba5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AssumeUnchangedActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/AssumeUnchangedActionHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.egit.ui.internal.UIText;
* @see AssumeUnchangedOperation
*/
public class AssumeUnchangedActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
if (resources.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BooleanPrefAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BooleanPrefAction.java
index 3b79cd7cfb..6bf3cf5a65 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BooleanPrefAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BooleanPrefAction.java
@@ -43,6 +43,7 @@ public abstract class BooleanPrefAction extends Action implements
setChecked(store.getBoolean(prefName));
}
+ @Override
public void run() {
store.setValue(prefName, isChecked());
if (store.needsSaving())
@@ -59,6 +60,7 @@ public abstract class BooleanPrefAction extends Action implements
*/
protected abstract void apply(boolean value);
+ @Override
public void propertyChange(final PropertyChangeEvent event) {
if (prefName.equals(event.getProperty())) {
setChecked(store.getBoolean(prefName));
@@ -66,6 +68,7 @@ public abstract class BooleanPrefAction extends Action implements
}
}
+ @Override
public void dispose() {
// stop listening
store.removePropertyChangeListener(this);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchActionHandler.java
index 9a6edb0bba..fa52208c0a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchActionHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class BranchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
index 466ac126d4..9bb148ca66 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CleanActionHandler.java
@@ -17,6 +17,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class CleanActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitActionHandler.java
index 453589a67e..56311c134e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitActionHandler.java
@@ -30,6 +30,7 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class CommitActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final Repository repo = getRepository(true, event);
if (repo == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
index 89070a5dbd..19398519f9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareIndexWithHeadActionHandler.java
@@ -47,6 +47,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
public class CompareIndexWithHeadActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
@@ -93,6 +94,7 @@ public class CompareIndexWithHeadActionHandler extends RepositoryActionHandler {
UIText.CompareIndexWithHeadActionHandler_fileNotStaged,
location.toOSString());
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openInformation(null, title, message);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithCommitActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithCommitActionHandler.java
index 3f8a95ec74..679547f058 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithCommitActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithCommitActionHandler.java
@@ -31,6 +31,7 @@ import org.eclipse.ui.PlatformUI;
*/
public class CompareWithCommitActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repo = getRepository(true, event);
if (repo == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithHeadActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithHeadActionHandler.java
index b2dedc5196..511a5512e6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithHeadActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithHeadActionHandler.java
@@ -28,6 +28,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* the HEAD commit.
*/
public class CompareWithHeadActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
// assert all resources map to the same repository
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
index e6c6c22540..7dd0dc27f3 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
@@ -33,6 +33,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* of the repository.
*/
public class CompareWithIndexActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
// assert all resources map to the same repository
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
index d2fba4def8..2c2d9496d9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
@@ -46,6 +46,7 @@ public class CompareWithPreviousActionHandler extends RepositoryActionHandler {
/**
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null) {
@@ -113,6 +114,7 @@ public class CompareWithPreviousActionHandler extends RepositoryActionHandler {
commits.add(pc.commit);
HandlerUtil.getActiveShell(event).getDisplay()
.syncExec(new Runnable() {
+ @Override
public void run() {
CommitSelectDialog dlg = new CommitSelectDialog(
HandlerUtil.getActiveShell(event), commits);
@@ -137,6 +139,7 @@ public class CompareWithPreviousActionHandler extends RepositoryActionHandler {
resource.getName());
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog
.openWarning(
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRefActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRefActionHandler.java
index 26dd6bd4a3..f48e7e8242 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRefActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithRefActionHandler.java
@@ -34,6 +34,7 @@ import org.eclipse.ui.PlatformUI;
* file as found in the working directory and the version in the selected ref.
*/
public class CompareWithRefActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repo = getRepository(true, event);
// assert all resources map to the same repository
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigureFetchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigureFetchActionHandler.java
index 06b83ffec0..06021a674a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigureFetchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigureFetchActionHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class ConfigureFetchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(true, event);
if (repository != null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigurePushActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigurePushActionHandler.java
index 587aea1018..c0ce9077a0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigurePushActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ConfigurePushActionHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class ConfigurePushActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(true, event);
if (repository != null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CreatePatchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CreatePatchActionHandler.java
index 281dcbacab..954944bb76 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CreatePatchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CreatePatchActionHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class CreatePatchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
// assert all resources map to the same repository
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DeleteBranchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DeleteBranchActionHandler.java
index 59331fd511..31a83cf04c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DeleteBranchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DeleteBranchActionHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class DeleteBranchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
index b5223b5831..165a186cbf 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java
@@ -37,6 +37,7 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class DiscardChangesActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = getPart(event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DisconnectActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DisconnectActionHandler.java
index bab644b4c2..d6b958fcdc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DisconnectActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DisconnectActionHandler.java
@@ -30,16 +30,19 @@ import org.eclipse.team.core.RepositoryProvider;
* @see DisconnectProviderOperation
*/
public class DisconnectActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IProject[] selectedProjects = getProjectsForSelectedResources();
List<IProject> projects = new ArrayList<IProject>(selectedProjects.length);
for (IProject project : selectedProjects) {
- if (project.isOpen()
- && RepositoryProvider.getProvider(project) instanceof GitProvider)
+ if (project.isOpen() && RepositoryProvider.getProvider(project,
+ GitProvider.ID) != null) {
projects.add(project);
+ }
}
- if (projects.isEmpty())
+ if (projects.isEmpty()) {
return null;
+ }
JobUtil.scheduleUserJob(new DisconnectProviderOperation(projects),
UIText.Disconnect_disconnect,
JobFamilies.DISCONNECT, new JobChangeAdapter() {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/FetchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/FetchActionHandler.java
index 664511de54..d554bb4c56 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/FetchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/FetchActionHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class FetchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
@@ -49,6 +50,7 @@ public class FetchActionHandler extends RepositoryActionHandler {
return null;
}
+ @Override
public boolean isEnabled() {
return selectionMapsToSingleRepository();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java
index 49c9b79410..15e323724f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.egit.ui.internal.operations.IgnoreOperationUI;
/** Action for ignoring files via .gitignore. */
public class IgnoreActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final IResource[] resources = getSelectedResources(event);
if (resources.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
index c7e3ddee0a..7598cf2a67 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
@@ -45,6 +45,7 @@ import org.eclipse.ui.PlatformUI;
*/
public class MergeActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
@@ -83,6 +84,7 @@ public class MergeActionHandler extends RepositoryActionHandler {
IStatus result = cevent.getJob().getResult();
if (result.getSeverity() == IStatus.CANCEL)
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
// don't use getShell(event) here since
// the active shell has changed since the
@@ -101,6 +103,7 @@ public class MergeActionHandler extends RepositoryActionHandler {
.getException(), true);
else
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeToolActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeToolActionHandler.java
index 7819b64034..c9ccf52743 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeToolActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeToolActionHandler.java
@@ -37,6 +37,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class MergeToolActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
int mergeMode = Activator.getDefault().getPreferenceStore().getInt(
UIPreferences.MERGE_MODE);
@@ -55,6 +56,7 @@ public class MergeToolActionHandler extends RepositoryActionHandler {
return null;
}
+ @Override
public boolean isEnabled() {
IPath[] paths = getSelectedLocations();
Map<Repository, Collection<String>> pathsByRepository = ResourceUtil
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java
index 74885e7d9d..db917f9c0d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java
@@ -26,6 +26,7 @@ import org.eclipse.egit.ui.internal.UIText;
* @see AssumeUnchangedOperation
*/
public class NoAssumeUnchangedActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
if (resources.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java
index 66b612be0c..cdb5b004e2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java
@@ -26,6 +26,7 @@ import org.eclipse.jgit.lib.Repository;
* Action for pulling into the currently checked-out branch.
*/
public class PullFromUpstreamActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository[] repos = getRepositories(event);
if (repos.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java
index adcbb2255e..e677231b0f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java
@@ -29,6 +29,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class PushActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java
index ac580013b8..a7a7f124b5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java
@@ -23,6 +23,7 @@ import org.eclipse.jgit.lib.Repository;
* "Push Branch..." action for repository
*/
public class PushBranchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(true, event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
index 6776863384..47602b22dc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushMenu.java
@@ -58,6 +58,7 @@ public class PushMenu extends CompoundContributionItem implements
return true;
}
+ @Override
public void initialize(IServiceLocator locator) {
this.serviceLocator = locator;
this.handlerService = CommonUtils.getService(locator, IHandlerService.class);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushTagsActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushTagsActionHandler.java
index f5c17c67cb..dcc8aec75c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushTagsActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushTagsActionHandler.java
@@ -16,6 +16,7 @@ import org.eclipse.jgit.lib.Repository;
* "Push Tags..." action for repository
*/
public class PushTagsActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(true, event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java
index 96979d9b2a..5b1e67a75b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Shell;
* Action for "Push to Upstream" or "Push Branch..." if not configured
*/
public class PushUpstreamOrBranchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseAction.java
index e92aeeab44..60dfc76d1d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseAction.java
@@ -57,6 +57,7 @@ public class RebaseAction extends RepositoryAction implements
rebaseContinue = UIIcons.REBASE_CONTINUE.createImage();
}
+ @Override
public Menu getMenu(Control parent) {
Menu menu = new Menu(parent);
Repository repo = getRepository();
@@ -135,6 +136,7 @@ public class RebaseAction extends RepositoryAction implements
this.action = action;
}
+ @Override
public void widgetSelected(SelectionEvent selectionEvent) {
try {
action.execute(event);
@@ -143,6 +145,7 @@ public class RebaseAction extends RepositoryAction implements
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
// not used
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseActionHandler.java
index b867161763..3de4d9897d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RebaseActionHandler.java
@@ -23,6 +23,7 @@ import org.eclipse.jgit.lib.RepositoryState;
*/
public class RebaseActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RebaseCurrentRefCommand rebaseCurrent = new RebaseCurrentRefCommand();
rebaseCurrent.setEnabled(event.getApplicationContext());
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java
index d8531e1109..d8dca1cdef 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java
@@ -31,6 +31,7 @@ import org.eclipse.egit.ui.internal.UIText;
*/
public class RemoveFromIndexActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final IPath[] sel = getSelectedLocations(event);
if (sel.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RenameBranchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RenameBranchActionHandler.java
index 3571188625..8f2c331e55 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RenameBranchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RenameBranchActionHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class RenameBranchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithOursTheirsMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithOursTheirsMenu.java
index e8ad230dd6..89c05621a7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithOursTheirsMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ReplaceWithOursTheirsMenu.java
@@ -57,6 +57,7 @@ public class ReplaceWithOursTheirsMenu extends CompoundContributionItem
private IServiceLocator serviceLocator;
+ @Override
public void initialize(IServiceLocator locator) {
serviceLocator = locator;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java
index f716ce15cd..e63e74f6ea 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java
@@ -63,10 +63,12 @@ public abstract class RepositoryAction extends AbstractHandler implements
this.handler = handler;
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
serviceLocator = targetPart.getSite();
}
+ @Override
public void run(IAction action) {
if (!shouldRunAction())
return;
@@ -107,6 +109,7 @@ public abstract class RepositoryAction extends AbstractHandler implements
return serviceLocator;
}
+ @Override
public final void selectionChanged(IAction action, ISelection selection) {
mySelection = selection;
// Compare selection of handler, as it converts it to a suitable
@@ -124,6 +127,7 @@ public abstract class RepositoryAction extends AbstractHandler implements
}
}
+ @Override
public final Object execute(ExecutionEvent event) throws ExecutionException {
if (!shouldRunAction())
return null;
@@ -149,6 +153,7 @@ public abstract class RepositoryAction extends AbstractHandler implements
return handler.isEnabled();
}
+ @Override
public void init(IWorkbenchWindow window) {
this.serviceLocator = window;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
index c444cecc0e..ea594e11e9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
@@ -325,6 +325,7 @@ abstract class RepositoryActionHandler extends AbstractHandler {
return SelectionUtils.getSelection(evaluationContext);
}
+ @Override
public void setEnabled(Object evaluationContext) {
this.evaluationContext = (IEvaluationContext) evaluationContext;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
index 307ce2fe7f..8be1600041 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetActionHandler.java
@@ -30,6 +30,7 @@ import org.eclipse.osgi.util.NLS;
*/
public class ResetActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java
index 19979d6cfd..4a4911e1c4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowBlameActionHandler.java
@@ -36,6 +36,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
public class ShowBlameActionHandler extends RepositoryActionHandler {
/** @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) */
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
Data data = getData(getSelection(event));
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java
index 8a0315c101..145c4b0c86 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowHistoryActionHandler.java
@@ -25,6 +25,7 @@ import org.eclipse.ui.PlatformUI;
* An action to show the history for a resource.
*/
public class ShowHistoryActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repo = getRepository(true, event);
// assert all resources map to the same repository
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewActionHandler.java
index a8278c2eff..dd4a98b790 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ShowRepositoriesViewActionHandler.java
@@ -25,6 +25,7 @@ import org.eclipse.ui.part.ShowInContext;
*/
public class ShowRepositoriesViewActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoriesView view;
try {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimpleFetchActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimpleFetchActionHandler.java
index 1517546648..132480c4f5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimpleFetchActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimpleFetchActionHandler.java
@@ -23,6 +23,7 @@ import org.eclipse.jgit.transport.RemoteConfig;
* Action for "Simple fetch"
*/
public class SimpleFetchActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimplePushActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimplePushActionHandler.java
index 6ba2a00bfb..bac5da84d2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimplePushActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SimplePushActionHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.jgit.transport.RemoteConfig;
* Action for "Simple Push"
*/
public class SimplePushActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashCreateHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashCreateHandler.java
index 2dd6cb7208..6178ca783d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashCreateHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashCreateHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class StashCreateHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository();
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashToolbarAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashToolbarAction.java
index ce42e9a10d..bce8722ff5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashToolbarAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashToolbarAction.java
@@ -39,6 +39,7 @@ public class StashToolbarAction extends RepositoryAction implements
});
}
+ @Override
public Menu getMenu(Control parent) {
stashesMenu.initialize(getServiceLocator());
if (menu != null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashesMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashesMenu.java
index 05aa81c80e..36b051d720 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashesMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/StashesMenu.java
@@ -45,6 +45,7 @@ public class StashesMenu extends CompoundContributionItem implements
private IServiceLocator serviceLocator;
+ @Override
public void initialize(IServiceLocator locator) {
this.serviceLocator = locator;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java
index a71e569cba..c2f4df0c3f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java
@@ -205,6 +205,7 @@ public class SwitchToMenu extends ContributionItem implements
return true;
}
+ @Override
public void initialize(IServiceLocator serviceLocator) {
handlerService = CommonUtils.getService(serviceLocator, IHandlerService.class);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWithMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWithMenu.java
index 1b58e95427..f1036317e6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWithMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWithMenu.java
@@ -181,6 +181,7 @@ public class SynchronizeWithMenu extends ContributionItem implements
});
}
+ @Override
public void initialize(IServiceLocator serviceLocator) {
srv = CommonUtils.getService(serviceLocator, ISelectionService.class);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java
index 4e61527e5f..94cc92e5dc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java
@@ -48,6 +48,7 @@ public class SynchronizeWorkspaceActionHandler extends RepositoryActionHandler {
return true;
}
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
Map<Repository, Set<IResource>> containerMap = mapContainerResources(resources);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagActionHandler.java
index 3819cf6baa..1be9ab2a1d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/TagActionHandler.java
@@ -44,6 +44,7 @@ import org.eclipse.osgi.util.NLS;
*/
public class TagActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repo = getRepository(true, event);
if (repo == null)
@@ -94,6 +95,7 @@ public class TagActionHandler extends RepositoryActionHandler {
final boolean shouldMoveTag = dialog.shouldOverWriteTag();
Job tagJob = new Job(tagJobName) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
new TagOperation(repo, tag, shouldMoveTag).execute(monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java
index 2a6ae5d065..aa0f3d217f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.egit.ui.internal.UIText;
* @see UntrackOperation
*/
public class UntrackActionHandler extends RepositoryActionHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources();
if (resources.length == 0)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java
index fed939859c..a6335b82a7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java
@@ -135,14 +135,17 @@ public class BlameInformationControl extends AbstractInformationControl
create();
}
+ @Override
public IInformationControlCreator getInformationPresenterControlCreator() {
return this.creator;
}
+ @Override
public boolean hasContents() {
return true;
}
+ @Override
protected void createContent(Composite parent) {
scrolls = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolls.setExpandHorizontal(true);
@@ -206,6 +209,7 @@ public class BlameInformationControl extends AbstractInformationControl
GridDataFactory.fillDefaults().grab(true, true).applyTo(messageText);
}
+ @Override
public Point computeSizeHint() {
Point computed = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
@@ -225,6 +229,7 @@ public class BlameInformationControl extends AbstractInformationControl
((GridData) control.getLayoutData()).exclude = !visible;
}
+ @Override
public void setInput(Object input) {
if (input == null) {
// Make sure we don't hold a reference to this when nothing is
@@ -464,6 +469,7 @@ public class BlameInformationControl extends AbstractInformationControl
}
}
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (!visible)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java
index 5de28288e7..eaf560b67b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java
@@ -79,6 +79,7 @@ public class BlameOperation implements IEGitOperation {
this.commit = commit;
}
+ @Override
public Object getAdapter(Class adapter) {
if (RevCommit.class == adapter)
return commit;
@@ -103,6 +104,7 @@ public class BlameOperation implements IEGitOperation {
nonResourceFile = new File(repository.getWorkTree(), path);
}
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
// Don't show the commit for the first selection change, as that was
// not initiated by the user directly. Instead, show the commit the
@@ -194,6 +196,7 @@ public class BlameOperation implements IEGitOperation {
this.lineNumberToReveal = lineNumberToReveal;
}
+ @Override
public void execute(IProgressMonitor monitor) throws CoreException {
final RevisionInformation info = new RevisionInformation();
@@ -262,6 +265,7 @@ public class BlameOperation implements IEGitOperation {
previous.register();
shell.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
openEditor(info);
}
@@ -356,6 +360,7 @@ public class BlameOperation implements IEGitOperation {
}
}
+ @Override
public ISchedulingRule getSchedulingRule() {
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameRevision.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameRevision.java
index 4c7fef8b12..a92d341b50 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameRevision.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameRevision.java
@@ -54,18 +54,22 @@ public class BlameRevision extends Revision {
private Map<RevCommit, Diff> diffToParentCommit = new HashMap<RevCommit, Diff>();
+ @Override
public Object getHoverInfo() {
return this;
}
+ @Override
public RGB getColor() {
return AuthorColors.getDefault().getCommitterRGB(getAuthor());
}
+ @Override
public String getId() {
return commit.abbreviate(7).name();
}
+ @Override
public Date getDate() {
PersonIdent person = commit.getAuthorIdent();
if( person == null)
@@ -145,6 +149,7 @@ public class BlameRevision extends Revision {
return this.repository;
}
+ @Override
public String getAuthor() {
return commit.getAuthorIdent().getName();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
index 57338506a6..48eba2c0fb 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
@@ -258,6 +258,7 @@ public class BranchOperationUI {
final AtomicReference<IMemento> memento = new AtomicReference<IMemento>();
bop.addPreExecuteTask(new PreExecuteTask() {
+ @Override
public void preExecute(Repository pRepo,
IProgressMonitor pMonitor)
throws CoreException {
@@ -268,6 +269,7 @@ public class BranchOperationUI {
});
bop.addPostExecuteTask(new PostExecuteTask() {
+ @Override
public void postExecute(Repository pRepo,
IProgressMonitor pMonitor)
throws CoreException {
@@ -328,6 +330,7 @@ public class BranchOperationUI {
public void run(IProgressMonitor monitor) throws CoreException {
if (!repository.getRepositoryState().canCheckout()) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openError(getShell(),
UIText.BranchAction_cannotCheckout, NLS.bind(
@@ -381,6 +384,7 @@ public class BranchOperationUI {
private String getTargetWithDialog() {
final String[] dialogResult = new String[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
dialogResult[0] = getTargetWithDialogInUI();
}
@@ -424,6 +428,7 @@ public class BranchOperationUI {
private String getTargetWithCheckoutRemoteTrackingDialog() {
final String[] dialogResult = new String[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
dialogResult[0] = getTargetWithCheckoutRemoteTrackingDialogInUI();
}
@@ -471,6 +476,7 @@ public class BranchOperationUI {
public void show(final CheckoutResult result) {
if (result.getStatus() == CheckoutResult.Status.CONFLICTS) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -501,6 +507,7 @@ public class BranchOperationUI {
if (!show)
return;
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -516,6 +523,7 @@ public class BranchOperationUI {
private void showDetachedHeadWarning() {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
IPreferenceStore store = Activator.getDefault()
.getPreferenceStore();
@@ -549,6 +557,7 @@ public class BranchOperationUI {
if (launchConfiguration != null) {
final boolean[] dialogResult = new boolean[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
dialogResult[0] = showContinueDialogInUI(store,
launchConfiguration);
@@ -588,6 +597,7 @@ public class BranchOperationUI {
try {
ModalContext.run(new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor m)
throws InvocationTargetException, InterruptedException {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
index bb54a476e4..9a8ef3a552 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
@@ -131,16 +131,20 @@ class BranchProjectTracker {
final String workDir = repository.getWorkTree().getAbsolutePath();
for (IProject project : projects) {
IPath path = project.getLocation();
- if (path == null)
+ if (path == null) {
continue;
+ }
// Only remember mapped projects
- if (!(RepositoryProvider.getProvider(project) instanceof GitProvider))
+ if (RepositoryProvider.getProvider(project,
+ GitProvider.ID) == null) {
continue;
+ }
String fullPath = path.toOSString();
if (fullPath.startsWith(workDir)) {
String relative = fullPath.substring(workDir.length());
- if (relative.length() == 0)
+ if (relative.length() == 0) {
relative = REPO_ROOT;
+ }
IMemento child = memento.createChild(KEY_PROJECT);
child.putTextData(relative);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
index 11ed5e0739..2b77bb8f19 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
@@ -64,6 +64,7 @@ public class CleanRepositoryPage extends WizardPage {
setMessage(UIText.CleanRepositoryPage_message);
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(main);
@@ -112,6 +113,7 @@ public class CleanRepositoryPage extends WizardPage {
setPageComplete(false);
cleanTable.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updatePageComplete();
}
@@ -179,6 +181,7 @@ public class CleanRepositoryPage extends WizardPage {
if(visible)
getShell().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
updateCleanItems();
}
@@ -188,6 +191,7 @@ public class CleanRepositoryPage extends WizardPage {
private void updateCleanItems() {
try {
getContainer().run(true, false, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
monitor.beginTask(UIText.CleanRepositoryPage_findingItems, IProgressMonitor.UNKNOWN);
@@ -200,6 +204,7 @@ public class CleanRepositoryPage extends WizardPage {
final Set<String> paths = command.call();
getShell().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
cleanTable.setInput(paths);
}
@@ -250,6 +255,7 @@ public class CleanRepositoryPage extends WizardPage {
final Set<String> itemsToClean = getItemsToClean();
getContainer().run(true, false, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
monitor.beginTask(UIText.CleanRepositoryPage_cleaningItems, IProgressMonitor.UNKNOWN);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
index 29ac089a04..b1c53431e5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/AbstractGitCloneWizard.java
@@ -260,6 +260,7 @@ public abstract class AbstractGitCloneWizard extends Wizard {
if (cloneDestination.isImportProjects()) {
final IWorkingSet[] sets = cloneDestination.getWorkingSets();
op.addPostCloneTask(new PostCloneTask() {
+ @Override
public void execute(Repository repository,
IProgressMonitor monitor) throws CoreException {
importProjects(repository, sets);
@@ -361,6 +362,7 @@ public abstract class AbstractGitCloneWizard extends Wizard {
Job importJob = new WorkspaceJob(MessageFormat.format(
UIText.GitCloneWizard_jobImportProjects, repoName)) {
+ @Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
List<File> files = new ArrayList<File>();
ProjectUtil.findProjectFiles(files, repository.getWorkTree(),
@@ -391,6 +393,7 @@ public abstract class AbstractGitCloneWizard extends Wizard {
public void runCloneOperation(IWizardContainer container, final GitRepositoryInfo repositoryInfo) {
try {
container.run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
executeCloneOperation(cloneOperation, repositoryInfo, monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
index 8f098c8ebe..0b104c14e8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
@@ -94,6 +94,7 @@ public class CloneDestinationPage extends WizardPage {
setTitle(UIText.CloneDestinationPage_title);
}
+ @Override
public void createControl(final Composite parent) {
final Composite panel = new Composite(parent, SWT.NULL);
final GridLayout layout = new GridLayout();
@@ -164,6 +165,7 @@ public class CloneDestinationPage extends WizardPage {
directoryText = new Text(p, SWT.BORDER);
directoryText.setLayoutData(createFieldGridData());
directoryText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
checkPage();
}
@@ -171,6 +173,7 @@ public class CloneDestinationPage extends WizardPage {
final Button b = new Button(p, SWT.PUSH);
b.setText(UIText.CloneDestinationPage_browseButton);
b.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
final FileDialog d;
@@ -220,6 +223,7 @@ public class CloneDestinationPage extends WizardPage {
remoteText.setText(Constants.DEFAULT_REMOTE_NAME);
remoteText.setLayoutData(createFieldGridData());
remoteText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -237,6 +241,7 @@ public class CloneDestinationPage extends WizardPage {
.getPreferenceStore()
.getBoolean(UIPreferences.CLONE_WIZARD_IMPORT_PROJECTS));
importProjectsButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Activator
.getDefault()
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
index 2589a74b52..04d981c2e1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateGeneralProjectPage.java
@@ -90,6 +90,7 @@ public class GitCreateGeneralProjectPage extends WizardPage {
myDirectory = null;
}
+ @Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
@@ -110,6 +111,7 @@ public class GitCreateGeneralProjectPage extends WizardPage {
else
projectText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -170,6 +172,7 @@ public class GitCreateGeneralProjectPage extends WizardPage {
// make sure there is not already a .project file
if (myDirectory.list(new FilenameFilter() {
+ @Override
public boolean accept(File dir, String name) {
if (name.equals(".project")) //$NON-NLS-1$
return true;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
index cee6dc5266..fbec2d6cfa 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCreateProjectViaWizardWizard.java
@@ -126,6 +126,7 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
public boolean performFinish() {
try {
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
importProjects(monitor);
@@ -152,6 +153,7 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
final List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();
// get the data from the page in the UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
projectsToCreate.addAll(myProjectsImportPage
.getCheckedProjects());
@@ -171,12 +173,14 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
.asList(ResourcesPlugin.getWorkspace().getRoot()
.getProjects());
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
new NewProjectAction(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()).run();
}
});
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor actMonitor)
throws CoreException {
IProject[] currentProjects = ResourcesPlugin.getWorkspace()
@@ -203,6 +207,7 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
final boolean[] defaultLocation = new boolean[1];
// get the data from the page in the UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
projectName[0] = myCreateGeneralProjectPage
.getProjectName();
@@ -213,6 +218,7 @@ public class GitCreateProjectViaWizardWizard extends Wizard {
try {
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor actMonitor)
throws CoreException {
final IProjectDescription desc = ResourcesPlugin
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
index c520c006a7..deffb29604 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitImportWizard.java
@@ -59,6 +59,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
private GitSelectRepositoryPage selectRepoPage = new GitSelectRepositoryPage();
private GitSelectWizardPage importWithDirectoriesPage = new GitSelectWizardPage(){
+ @Override
public void setVisible(boolean visible) {
if (existingRepo == null && visible && (cloneDestination.cloneSettingsChanged())) {
setCallerRunsCloneOperation(true);
@@ -67,6 +68,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
performClone(repositoryInfo);
importWithDirectoriesPage.getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
runCloneOperation(getContainer(), repositoryInfo);
cloneDestination.saveSettingsForClonedRepo();
@@ -84,6 +86,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
};
private GitProjectsImportPage projectsImportPage = new GitProjectsImportPage() {
+ @Override
public void setVisible(boolean visible) {
if (visible)
setProjectsList(importWithDirectoriesPage.getPath());
@@ -92,6 +95,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
};
private GitCreateGeneralProjectPage createGeneralProjectPage = new GitCreateGeneralProjectPage() {
+ @Override
public void setVisible(boolean visible) {
if (visible)
setPath(importWithDirectoriesPage.getPath());
@@ -142,6 +146,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
return cloneSourceProvider;
}
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
// nothing to do
}
@@ -194,6 +199,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
public boolean performFinish() {
try {
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
importProjects(monitor);
@@ -234,6 +240,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
final List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();
// get the data from the pages in the UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
projectsToCreate.addAll(projectsImportPage
.getCheckedProjects());
@@ -251,6 +258,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
case GitSelectWizardPage.NEW_WIZARD: {
final File[] repoDir = new File[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
repoDir[0] = getTargetRepository().getDirectory();
}
@@ -259,12 +267,14 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
.asList(ResourcesPlugin.getWorkspace().getRoot()
.getProjects());
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
new NewProjectAction(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()).run();
}
});
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor actMonitor)
throws CoreException {
IProject[] currentProjects = ResourcesPlugin.getWorkspace()
@@ -291,6 +301,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
final File[] repoDir = new File[1];
// get the data from the page in the UI thread
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
projectName[0] = createGeneralProjectPage.getProjectName();
defaultLocation[0] = createGeneralProjectPage
@@ -301,6 +312,7 @@ public class GitImportWizard extends AbstractGitCloneWizard implements IImportWi
});
try {
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor actMonitor)
throws CoreException {
final IProjectDescription desc = ResourcesPlugin
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
index 2bd6807e48..1d174f5ef8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java
@@ -70,6 +70,7 @@ public class GitProjectsImportPage extends WizardPage {
private final class ProjectLabelProvider extends GitLabelProvider implements
IColorProvider {
+ @Override
public Color getForeground(Object element) {
if (isProjectInWorkspace(((ProjectRecord) element).getProjectName()))
return PlatformUI.getWorkbench().getDisplay().getSystemColor(
@@ -77,6 +78,7 @@ public class GitProjectsImportPage extends WizardPage {
return null;
}
+ @Override
public Color getBackground(Object element) {
return null;
}
@@ -124,6 +126,7 @@ public class GitProjectsImportPage extends WizardPage {
setDescription(UIText.WizardProjectsImportPage_ImportProjectsDescription);
}
+ @Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
@@ -209,6 +212,7 @@ public class GitProjectsImportPage extends WizardPage {
projectsList.getControl().setLayoutData(listData);
projectsList.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
ProjectRecord element = (ProjectRecord) event.getElement();
if (isProjectInWorkspace(element.getProjectName())) {
@@ -223,26 +227,32 @@ public class GitProjectsImportPage extends WizardPage {
projectsList.setContentProvider(new ITreeContentProvider() {
+ @Override
public Object[] getChildren(Object parentElement) {
return children;
}
+ @Override
public Object[] getElements(Object inputElement) {
return selectedProjects;
}
+ @Override
public boolean hasChildren(Object element) {
return false;
}
+ @Override
public Object getParent(Object element) {
return null;
}
+ @Override
public void dispose() {
// ignore
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput,
Object newInput) {
// ignore
@@ -251,6 +261,7 @@ public class GitProjectsImportPage extends WizardPage {
});
projectsList.getTree().addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
checkPageComplete();
}
@@ -281,6 +292,7 @@ public class GitProjectsImportPage extends WizardPage {
selectAll = new Button(buttonsComposite, SWT.PUSH);
selectAll.setText(UIText.WizardProjectsImportPage_selectAll);
selectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
selectAllNewProjects();
enableSelectAllButtons();
@@ -293,6 +305,7 @@ public class GitProjectsImportPage extends WizardPage {
deselectAll = new Button(buttonsComposite, SWT.PUSH);
deselectAll.setText(UIText.WizardProjectsImportPage_deselectAll);
deselectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
for (TreeItem item : projectsList.getTree().getItems())
projectsList.setChecked(item.getData(), false);
@@ -389,6 +402,7 @@ public class GitProjectsImportPage extends WizardPage {
try {
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) {
monitor.beginTask(
@@ -421,6 +435,7 @@ public class GitProjectsImportPage extends WizardPage {
if (files.isEmpty())
// run in UI thread
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
setErrorMessage(UIText.GitProjectsImportPage_NoProjectsMessage);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectRepositoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectRepositoryPage.java
index d3d0302641..bdd6259ef6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectRepositoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectRepositoryPage.java
@@ -89,6 +89,7 @@ public class GitSelectRepositoryPage extends WizardPage {
return ((RepositoryTreeNode) obj).getRepository();
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
@@ -147,6 +148,7 @@ public class GitSelectRepositoryPage extends WizardPage {
tv.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
checkPage();
}
@@ -154,6 +156,7 @@ public class GitSelectRepositoryPage extends WizardPage {
tv.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
checkPage();
if (isPageComplete())
@@ -164,9 +167,11 @@ public class GitSelectRepositoryPage extends WizardPage {
tv.setInput(util.getConfiguredRepositories());
configChangeListener = new IPreferenceChangeListener() {
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
Display display = tv.getControl().getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
refreshRepositoryList();
checkPage();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectWizardPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectWizardPage.java
index 068baa31f6..ea7a167cdd 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectWizardPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitSelectWizardPage.java
@@ -128,6 +128,7 @@ public class GitSelectWizardPage extends WizardPage {
tv.setSelection(new StructuredSelection(input.get(0)));
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NO_RADIO_GROUP);
@@ -197,6 +198,7 @@ public class GitSelectWizardPage extends WizardPage {
tv.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
checkPage();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/ProjectUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/ProjectUtils.java
index 9ca064852d..56111f547c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/ProjectUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/ProjectUtils.java
@@ -81,6 +81,7 @@ public class ProjectUtils {
final IWorkingSet[] selectedWorkingSets, IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor actMonitor) throws CoreException {
IWorkingSetManager workingSetManager = PlatformUI
.getWorkbench().getWorkingSetManager();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationContentProvider.java
index 7f892512f6..afd7e42782 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationContentProvider.java
@@ -28,25 +28,30 @@ class RepositoryLocationContentProvider implements ITreeContentProvider {
private Map<RepositoryServerInfo, CloneSourceProvider> parents = new HashMap<RepositoryServerInfo, CloneSourceProvider>();
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// nothing to do
}
+ @Override
public void dispose() {
// nothing to do
}
+ @Override
public boolean hasChildren(Object element) {
Object[] children = calculateChildren(element);
return children != null && children.length > 0;
}
+ @Override
public Object getParent(Object element) {
if (element instanceof RepositoryServerInfo)
return parents.get(element);
return null;
}
+ @Override
@SuppressWarnings("unchecked")
public Object[] getElements(Object inputElement) {
List<CloneSourceProvider> repositoryImports = (List<CloneSourceProvider>) inputElement;
@@ -54,6 +59,7 @@ class RepositoryLocationContentProvider implements ITreeContentProvider {
.size()]);
}
+ @Override
public Object[] getChildren(Object parentElement) {
return calculateChildren(parentElement);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationLabelProvider.java
index 2d849c148b..ddd7273421 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationLabelProvider.java
@@ -46,6 +46,7 @@ class RepositoryLocationLabelProvider extends LabelProvider {
return null;
}
+ @Override
public void dispose() {
repoImage.dispose();
for (Image image : images)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationPage.java
index 6c55dc34de..f28ce194d0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/RepositoryLocationPage.java
@@ -58,6 +58,7 @@ public class RepositoryLocationPage extends WizardPage {
setMessage(UIText.RepositoryLocationPage_info);
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
@@ -77,6 +78,7 @@ public class RepositoryLocationPage extends WizardPage {
tv.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
checkPage();
}
@@ -84,6 +86,7 @@ public class RepositoryLocationPage extends WizardPage {
tv.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
checkPage();
if (isPageComplete())
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
index 90964746c4..143623f992 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
@@ -117,6 +117,7 @@ class SourceBranchPage extends WizardPage {
return availableRefs.size() == refsViewer.getCheckedElements().length;
}
+ @Override
public void createControl(final Composite parent) {
final Composite panel = new Composite(parent, SWT.NULL);
final GridLayout layout = new GridLayout();
@@ -131,12 +132,15 @@ class SourceBranchPage extends WizardPage {
/*
* Overridden to check page when refreshing is done.
*/
+ @Override
protected WorkbenchJob doCreateRefreshJob() {
WorkbenchJob refreshJob = super.doCreateRefreshJob();
refreshJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()) {
getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
checkPage();
}
@@ -151,26 +155,32 @@ class SourceBranchPage extends WizardPage {
ITreeContentProvider provider = new ITreeContentProvider() {
+ @Override
public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
// nothing
}
+ @Override
public void dispose() {
// nothing
}
+ @Override
public Object[] getElements(Object input) {
return ((List) input).toArray();
}
+ @Override
public boolean hasChildren(Object element) {
return false;
}
+ @Override
public Object getParent(Object element) {
return null;
}
+ @Override
public Object[] getChildren(Object parentElement) {
return null;
}
@@ -191,6 +201,7 @@ class SourceBranchPage extends WizardPage {
});
refsViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
checkPage();
}
@@ -200,6 +211,7 @@ class SourceBranchPage extends WizardPage {
selectB = new Button(bPanel, SWT.PUSH);
selectB.setText(UIText.SourceBranchPage_selectAll);
selectB.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
refsViewer.setAllChecked(true);
checkPage();
@@ -208,6 +220,7 @@ class SourceBranchPage extends WizardPage {
unselectB = new Button(bPanel, SWT.PUSH);
unselectB.setText(UIText.SourceBranchPage_selectNone);
unselectB.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
refsViewer.setAllChecked(false);
checkPage();
@@ -295,6 +308,7 @@ class SourceBranchPage extends WizardPage {
setErrorMessage(null);
setMessage(null);
label.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
revalidateImpl(newRepoSelection);
}
@@ -319,6 +333,7 @@ class SourceBranchPage extends WizardPage {
credentials.getUser(), credentials
.getPassword()));
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
listRemoteOp.run(monitor);
@@ -356,6 +371,7 @@ class SourceBranchPage extends WizardPage {
}
}
Collections.sort(availableRefs, new Comparator<Ref>() {
+ @Override
public int compare(final Ref o1, final Ref o2) {
return o1.getName().compareTo(o2.getName());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ConfigureDebugTraceCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ConfigureDebugTraceCommand.java
index 7e39d462dd..20f0a4209c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ConfigureDebugTraceCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ConfigureDebugTraceCommand.java
@@ -18,6 +18,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Opens the "Configure Debug Trace" page
*/
public class ConfigureDebugTraceCommand extends AbstractHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
new GitTraceConfigurationDialog(HandlerUtil
.getActiveShellChecked(event)).open();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java
index ae0e6b9c1a..d4186efae8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java
@@ -25,6 +25,7 @@ import org.eclipse.team.core.RepositoryProvider;
*/
public class ProjectNameParameterValues implements IParameterValues {
+ @Override
public Map getParameterValues() {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = root.getProjects();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java
index 3d9468dd31..523c5a8489 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java
@@ -34,6 +34,7 @@ public class ShareSingleProjectCommand extends AbstractHandler {
*
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final String projectName = event.getParameter(PROJECT_NAME_PARAMETER);
final IProject projectToShare = ResourcesPlugin.getWorkspace()
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
index da1594bbb3..2ce74e4528 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java
@@ -107,6 +107,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
handleBeginError(repository, result);
} else if (result.getSeverity() == IStatus.CANCEL)
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
// don't use getShell(event) here since
// the active shell has changed since the
@@ -140,6 +141,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
private void setAmending(final boolean amending,
final boolean openStagingView) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
try {
IViewPart view;
@@ -159,6 +161,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
sv.reload(repository);
Display.getDefault().asyncExec(
new Runnable() {
+ @Override
public void run() {
sv.setAmending(amending);
}
@@ -184,6 +187,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
private void handleUncommittedChanges(final Repository repository,
final List<String> files) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -209,6 +213,7 @@ public abstract class AbstractRebaseCommandHandler extends AbstractSharedCommand
}
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(event);
execute(repository);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/FetchChangeFromGerritCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/FetchChangeFromGerritCommand.java
index b8ee968670..e160d1376e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/FetchChangeFromGerritCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/FetchChangeFromGerritCommand.java
@@ -24,6 +24,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Fetch a change from Gerrit
*/
public class FetchChangeFromGerritCommand extends AbstractSharedCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(event);
if (repository == null) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/PushHeadToGerritCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/PushHeadToGerritCommand.java
index 1d963de70c..e0058dcabe 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/PushHeadToGerritCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/PushHeadToGerritCommand.java
@@ -21,6 +21,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Push current HEAD to Gerrit
*/
public class PushHeadToGerritCommand extends AbstractSharedCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository(event);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java
index 9e9ea1ecde..262bdd0e90 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditor.java
@@ -148,6 +148,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.forms.editor.FormEditor#addPages()
*/
+ @Override
protected void addPages() {
try {
if (getCommit().isStash())
@@ -179,6 +180,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.forms.editor.SharedHeaderFormEditor#createHeaderContents(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
protected void createHeaderContents(IManagedForm headerForm) {
RepositoryCommit commit = getCommit();
ScrolledForm form = headerForm.getForm();
@@ -243,19 +245,23 @@ public class CommitEditor extends SharedHeaderFormEditor implements
toolbar.update(true);
getSite().setSelectionProvider(new ISelectionProvider() {
+ @Override
public void setSelection(ISelection selection) {
// Ignored
}
+ @Override
public void removeSelectionChangedListener(
ISelectionChangedListener listener) {
// Ignored
}
+ @Override
public ISelection getSelection() {
return new StructuredSelection(getCommit());
}
+ @Override
public void addSelectionChangedListener(
ISelectionChangedListener listener) {
// Ignored
@@ -324,6 +330,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.part.MultiPageEditorPart#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (RepositoryCommit.class == adapter)
return CommonUtils.getAdapter(getEditorInput(), adapter);
@@ -335,6 +342,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
* @see org.eclipse.ui.forms.editor.FormEditor#init(org.eclipse.ui.IEditorSite,
* org.eclipse.ui.IEditorInput)
*/
+ @Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
if (CommonUtils.getAdapter(input, RepositoryCommit.class) == null)
@@ -345,6 +353,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
setTitleToolTip(input.getToolTipText());
}
+ @Override
public void dispose() {
refListenerHandle.remove();
super.dispose();
@@ -353,6 +362,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void doSave(IProgressMonitor monitor) {
// Save not supported
}
@@ -360,6 +370,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.part.EditorPart#doSaveAs()
*/
+ @Override
public void doSaveAs() {
// Save as not supported
}
@@ -367,15 +378,18 @@ public class CommitEditor extends SharedHeaderFormEditor implements
/**
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
return false;
}
+ @Override
public void onRefsChanged(RefsChangedEvent event) {
if (getCommit().getRepository().getDirectory()
.equals(event.getRepository().getDirectory())) {
UIJob job = new UIJob("Refreshing editor") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!getContainer().isDisposed())
commitPage.refresh();
@@ -386,6 +400,7 @@ public class CommitEditor extends SharedHeaderFormEditor implements
}
}
+ @Override
public ShowInContext getShowInContext() {
if (commitPage != null && commitPage.isActive())
return commitPage.getShowInContext();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInput.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInput.java
index 3409c978aa..1f13d998a0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInput.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInput.java
@@ -45,6 +45,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return commit.getRevCommit().hashCode();
}
@@ -52,6 +53,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj == this)
return true;
@@ -67,6 +69,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getName();
}
@@ -74,6 +77,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (RepositoryCommit.class == adapter)
return commit;
@@ -90,6 +94,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IEditorInput#exists()
*/
+ @Override
public boolean exists() {
return true;
}
@@ -97,6 +102,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IEditorInput#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return UIIcons.CHANGESET;
}
@@ -104,6 +110,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IEditorInput#getName()
*/
+ @Override
public String getName() {
return MessageFormat.format(UIText.CommitEditorInput_Name,
commit.abbreviate(), commit.getRepositoryName());
@@ -112,6 +119,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IEditorInput#getPersistable()
*/
+ @Override
public IPersistableElement getPersistable() {
return this;
}
@@ -119,6 +127,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return MessageFormat.format(UIText.CommitEditorInput_ToolTip, commit
.getRevCommit().getShortMessage(), commit.getRepositoryName());
@@ -136,6 +145,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
*/
+ @Override
public void saveState(IMemento memento) {
CommitEditorInputFactory.saveState(memento, this);
}
@@ -143,6 +153,7 @@ public class CommitEditorInput extends PlatformObject implements IEditorInput,
/**
* @see org.eclipse.ui.IPersistableElement#getFactoryId()
*/
+ @Override
public String getFactoryId() {
return CommitEditorInputFactory.ID;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInputFactory.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInputFactory.java
index a36b8e5265..c64432eb2e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInputFactory.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorInputFactory.java
@@ -115,6 +115,7 @@ public class CommitEditorInputFactory implements IElementFactory {
/**
* @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
*/
+ @Override
public IAdaptable createElement(IMemento memento) {
Repository repository = getRepository(memento);
if (repository == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
index 3ac9803526..fbfae3fe47 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
@@ -130,6 +130,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
private void hookExpansionGrabbing(final Section section) {
section.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
((GridData) section.getLayoutData()).grabExcessVerticalSpace = e
.getState();
@@ -268,6 +269,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
parentCommit.abbreviate(PARENT_LENGTH).name(),
SWT.NONE);
link.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
try {
CommitEditor.open(new RepositoryCommit(getCommit()
@@ -293,6 +295,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
List<Ref> tags = new ArrayList<Ref>(repository.getTags().values());
Collections.sort(tags, new Comparator<Ref>() {
+ @Override
public int compare(Ref r1, Ref r2) {
return Repository.shortenRefName(r1.getName())
.compareToIgnoreCase(
@@ -382,6 +385,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
@Override
protected IAdaptable getDefaultTarget() {
return new PlatformObject() {
+ @Override
public Object getAdapter(Class adapter) {
return Platform.getAdapterManager().getAdapter(
getEditorInput(), adapter);
@@ -389,6 +393,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
};
}
+ @Override
protected void createMarginPainter() {
// Disabled intentionally
}
@@ -421,6 +426,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
branchViewer.setSorter(new ViewerSorter());
branchViewer.setLabelProvider(new GitLabelProvider() {
+ @Override
public String getText(Object element) {
return Repository.shortenRefName(super.getText(element));
}
@@ -465,10 +471,12 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
/**
* @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
Composite body = managedForm.getForm().getBody();
body.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
resources.dispose();
}
@@ -544,6 +552,7 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
if (UIUtils.isUsable(form))
form.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!UIUtils.isUsable(form))
return;
@@ -570,10 +579,12 @@ public class CommitEditorPage extends FormPage implements ISchedulingRule {
loadSections();
}
+ @Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
return rule == this;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java
index 1c5d423318..6f85f6f7a7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java
@@ -130,6 +130,7 @@ public class CommitJob extends Job {
private void showAbortedByHook(final Throwable cause) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openWarning(PlatformUI.getWorkbench()
.getDisplay().getActiveShell(),
@@ -142,6 +143,7 @@ public class CommitJob extends Job {
private void openCommitEditor(final RevCommit newCommit) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
CommitEditor.openQuiet(new RepositoryCommit(repository,
newCommit));
@@ -156,6 +158,7 @@ public class CommitJob extends Job {
final Display display = Display.getDefault();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
try {
PushBranchWizard pushWizard = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
index d426329251..ff418be9a7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitProposalProcessor.java
@@ -74,6 +74,7 @@ public abstract class CommitProposalProcessor implements IContentAssistProcessor
return display.toLowerCase(Locale.US).startsWith(prefix);
}
+ @Override
public int compareTo(CommitFile other) {
return display.compareTo(other.display);
}
@@ -122,6 +123,7 @@ public abstract class CommitProposalProcessor implements IContentAssistProcessor
return doc.get(start + 1, length);
}
+ @Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
String prefix;
@@ -187,23 +189,28 @@ public abstract class CommitProposalProcessor implements IContentAssistProcessor
return files;
}
+ @Override
public IContextInformation[] computeContextInformation(ITextViewer viewer,
int offset) {
return null;
}
+ @Override
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
+ @Override
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
+ @Override
public String getErrorMessage() {
return null;
}
+ @Override
public IContextInformationValidator getContextInformationValidator() {
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java
index c6b85b8f02..8eacdfb441 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitSelectionDialog.java
@@ -53,10 +53,12 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
private static class CommitLabelProvider extends GitLabelProvider {
+ @Override
public String getText(Object element) {
return getStyledText(element).getString();
}
+ @Override
public StyledString getStyledText(Object element) {
StyledString styled = new StyledString();
if (element instanceof RepositoryCommit) {
@@ -112,6 +114,7 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
setInitialPattern(Constants.HEAD, FULL_SELECTION);
}
+ @Override
protected Control createExtendedContentArea(Composite parent) {
Composite displayArea = new Composite(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().applyTo(displayArea);
@@ -119,6 +122,7 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
link.setText(UIText.CommitSelectionDialog_LinkSearch);
link.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
close();
NewSearchUI.openSearchDialog(PlatformUI.getWorkbench()
@@ -129,6 +133,7 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
return displayArea;
}
+ @Override
protected IDialogSettings getDialogSettings() {
IDialogSettings settings = Activator.getDefault().getDialogSettings();
IDialogSettings section = settings
@@ -138,30 +143,37 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
return section;
}
+ @Override
protected IStatus validateItem(Object item) {
return Status.OK_STATUS;
}
+ @Override
protected ItemsFilter createFilter() {
return new ItemsFilter() {
+ @Override
public boolean isSubFilter(ItemsFilter filter) {
return false;
}
+ @Override
public boolean matchItem(Object item) {
return true;
}
+ @Override
public boolean isConsistentItem(Object item) {
return true;
}
};
}
+ @Override
protected Comparator getItemsComparator() {
return new Comparator<RepositoryCommit>() {
+ @Override
public int compare(RepositoryCommit o1, RepositoryCommit o2) {
int compare = o1.getRepositoryName().compareToIgnoreCase(
o2.getRepositoryName());
@@ -177,6 +189,7 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
.getRepositoryCache().getAllRepositories();
}
+ @Override
protected void fillContentProvider(AbstractContentProvider contentProvider,
ItemsFilter itemsFilter, IProgressMonitor progressMonitor)
throws CoreException {
@@ -208,6 +221,7 @@ public class CommitSelectionDialog extends FilteredItemsSelectionDialog {
}
}
+ @Override
public String getElementName(Object item) {
return labelProvider.getText(item);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
index a9a1bb679c..3bb98e36a5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java
@@ -123,6 +123,7 @@ public class CommitUI {
try {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
try {
@@ -299,6 +300,7 @@ public class CommitUI {
static class CountingVisitor implements IResourceVisitor {
int count;
+ @Override
public boolean visit(IResource resource) throws CoreException {
count++;
return true;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
index 67245646c6..db50db38d5 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorPage.java
@@ -68,6 +68,7 @@ public class DiffEditorPage extends FormPage {
update();
}
+ @Override
public void update() {
if (code == ITextOperationTarget.REDO)
return;
@@ -82,6 +83,7 @@ public class DiffEditorPage extends FormPage {
: Boolean.FALSE);
}
+ @Override
public void run() {
if (code != -1)
target.doOperation(code);
@@ -134,6 +136,7 @@ public class DiffEditorPage extends FormPage {
Job job = new Job(UIText.DiffEditorPage_TaskGeneratingDiff) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
RepositoryCommit commit = CommonUtils.getAdapter(getEditor(), RepositoryCommit.class);
FileDiff diffs[] = getDiffs(commit);
@@ -153,6 +156,7 @@ public class DiffEditorPage extends FormPage {
monitor.done();
new UIJob(UIText.DiffEditorPage_TaskUpdatingViewer) {
+ @Override
public IStatus runInUIThread(IProgressMonitor uiMonitor) {
if (UIUtils.isUsable(viewer)) {
viewer.setDocument(document);
@@ -190,6 +194,7 @@ public class DiffEditorPage extends FormPage {
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
copyAction.update();
selectAllAction.update();
@@ -200,6 +205,7 @@ public class DiffEditorPage extends FormPage {
/**
* @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
Composite body = managedForm.getForm().getBody();
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(body);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
index 92f8af4004..b56cf1617c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
@@ -94,6 +94,7 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
*/
public Color lineBackground = null;
+ @Override
public boolean similarTo(StyleRange style) {
return super.similarTo(style) && style instanceof DiffStyleRange
&& diffType == ((DiffStyleRange) style).diffType;
@@ -124,6 +125,7 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
}
}
+ @Override
public void write(byte[] b, int off, int len) throws IOException {
if (charset == null)
lineBuffer.append(new String(b, off, len, "UTF-8")); //$NON-NLS-1$
@@ -131,10 +133,12 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
lineBuffer.append(new String(b, off, len, charset));
}
+ @Override
public void write(byte[] b) throws IOException {
write(b, 0, b.length);
}
+ @Override
public void write(int b) throws IOException {
write(new byte[] { (byte) b });
}
@@ -222,6 +226,7 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
* @see org.eclipse.jgit.diff.DiffFormatter#writeHunkHeader(int, int, int,
* int)
*/
+ @Override
protected void writeHunkHeader(int aStartLine, int aEndLine,
int bStartLine, int bEndLine) throws IOException {
int start = stream.offset;
@@ -234,6 +239,7 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
* @see org.eclipse.jgit.diff.DiffFormatter#writeLine(char,
* org.eclipse.jgit.diff.RawText, int)
*/
+ @Override
protected void writeLine(char prefix, RawText text, int cur)
throws IOException {
if (prefix == ' ') {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
index 285a5f081a..e63b6ebbca 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffViewer.java
@@ -85,6 +85,7 @@ public class DiffViewer extends SourceViewer {
private IPropertyChangeListener themeListener = new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (IThemeManager.CHANGE_CURRENT_THEME.equals(property)
@@ -106,6 +107,7 @@ public class DiffViewer extends SourceViewer {
private IPropertyChangeListener editorPrefListener = new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
styleViewer();
}
@@ -137,6 +139,7 @@ public class DiffViewer extends SourceViewer {
initListeners();
getControl().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
EditorsUI.getPreferenceStore().removePropertyChangeListener(
editorPrefListener);
@@ -176,6 +179,7 @@ public class DiffViewer extends SourceViewer {
this.editorPrefListener);
getTextWidget().addLineBackgroundListener(new LineBackgroundListener() {
+ @Override
public void lineGetBackground(LineBackgroundEvent event) {
StyledText text = getTextWidget();
if (event.lineOffset < text.getCharCount()) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
index ee9a7a3698..460285fb58 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/HeaderText.java
@@ -89,6 +89,7 @@ public class HeaderText {
titleLabel.setForeground(heading.getForeground());
titleLabel.setFont(heading.getFont());
titleLabel.addFocusListener(new FocusAdapter() {
+ @Override
public void focusLost(FocusEvent e) {
titleLabel.setSelection(0);
Event selectionEvent= new Event();
@@ -105,12 +106,14 @@ public class HeaderText {
busyLabel.setImage(emptyImage);
busyLabel.addControlListener(new ControlAdapter() {
+ @Override
public void controlMoved(ControlEvent e) {
updateSizeAndLocations();
}
});
titleLabel.moveAbove(busyLabel);
titleRegion.addControlListener(new ControlAdapter() {
+ @Override
public void controlResized(ControlEvent e) {
updateSizeAndLocations();
}
@@ -142,6 +145,7 @@ public class HeaderText {
copySHA1MenuItem.setText(UIText.Header_contextMenu_copy_SHA1);
final Shell shell = styledText.getShell();
copySHA1MenuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
copyToClipboard(sha1String, shell);
}
@@ -151,11 +155,13 @@ public class HeaderText {
copyMenuItem.setText(UIText.Header_contextMenu_copy);
copyMenuItem.setEnabled(false);
copyMenuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
styledText.copy();
}
});
styledText.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
copyMenuItem.setEnabled(styledText.getSelectionCount() > 0);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NoteDetailsPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NoteDetailsPage.java
index 9702f2a946..126633042d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NoteDetailsPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NoteDetailsPage.java
@@ -40,34 +40,42 @@ public class NoteDetailsPage implements IDetailsPage, IDetailsPageProvider {
private RepositoryCommitNote selectedNote;
+ @Override
public void initialize(IManagedForm form) {
toolkit = form.getToolkit();
}
+ @Override
public void dispose() {
// Does nothing
}
+ @Override
public boolean isDirty() {
return false;
}
+ @Override
public void commit(boolean onSave) {
// Update notes not currently supported
}
+ @Override
public boolean setFormInput(Object input) {
return true;
}
+ @Override
public void setFocus() {
notesText.setFocus();
}
+ @Override
public boolean isStale() {
return false;
}
+ @Override
public void refresh() {
if (selectedNote != null)
notesText.setText(selectedNote.getNoteText());
@@ -75,6 +83,7 @@ public class NoteDetailsPage implements IDetailsPage, IDetailsPageProvider {
notesText.setText(""); //$NON-NLS-1$
}
+ @Override
public void selectionChanged(IFormPart part, ISelection selection) {
Object first = ((IStructuredSelection) selection).getFirstElement();
if (first instanceof RepositoryCommitNote)
@@ -84,6 +93,7 @@ public class NoteDetailsPage implements IDetailsPage, IDetailsPageProvider {
refresh();
}
+ @Override
public void createContents(Composite parent) {
GridLayoutFactory.swtDefaults().applyTo(parent);
Section notesSection = toolkit.createSection(parent,
@@ -99,6 +109,7 @@ public class NoteDetailsPage implements IDetailsPage, IDetailsPageProvider {
notesText = new SpellcheckableMessageArea(notesArea, "", SWT.NONE) { //$NON-NLS-1$
+ @Override
protected void createMarginPainter() {
// Disabled intentionally
}
@@ -115,10 +126,12 @@ public class NoteDetailsPage implements IDetailsPage, IDetailsPageProvider {
GridDataFactory.fillDefaults().grab(true, true).applyTo(notesText);
}
+ @Override
public Object getPageKey(Object object) {
return this;
}
+ @Override
public IDetailsPage getPage(Object key) {
return this;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NotesBlock.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NotesBlock.java
index 51c0a2b0c9..6a335c0475 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NotesBlock.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/NotesBlock.java
@@ -55,6 +55,7 @@ public class NotesBlock extends MasterDetailsBlock {
this.commit = commit;
}
+ @Override
public void createContent(IManagedForm managedForm, Composite parent) {
super.createContent(managedForm, parent);
sashForm.setWeights(new int[] { 25, 75 });
@@ -95,6 +96,7 @@ public class NotesBlock extends MasterDetailsBlock {
part = new SectionPart(refsSection);
refsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
managedForm.fireSelectionChanged(part, event.getSelection());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OpenCommitAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OpenCommitAction.java
index 50e22d975c..5fd98cce38 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OpenCommitAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/OpenCommitAction.java
@@ -37,6 +37,7 @@ public class OpenCommitAction extends ActionDelegate implements
CommitEditor.openQuiet((RepositoryCommit) result);
}
+ @Override
public void init(IWorkbenchWindow window) {
shell = window.getShell();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommit.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommit.java
index e69a8c55e1..c90676699f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommit.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommit.java
@@ -96,6 +96,7 @@ public class RepositoryCommit extends WorkbenchAdapter implements IAdaptable {
this.commit = commit;
}
+ @Override
public Object getAdapter(Class adapter) {
if (Repository.class == adapter)
return repository;
@@ -231,18 +232,22 @@ public class RepositoryCommit extends WorkbenchAdapter implements IAdaptable {
return notes;
}
+ @Override
public Object[] getChildren(Object o) {
return new Object[0];
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return UIIcons.CHANGESET;
}
+ @Override
public String getLabel(Object o) {
return abbreviate();
}
+ @Override
public Object getParent(Object o) {
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommitNote.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommitNote.java
index 9c6f92470f..101e187a43 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommitNote.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/RepositoryCommitNote.java
@@ -78,6 +78,7 @@ public class RepositoryCommitNote extends PlatformObject implements
return ""; //$NON-NLS-1$
}
+ @Override
public Object getAdapter(Class adapter) {
if (RepositoryCommit.class == adapter)
return this.commit;
@@ -88,18 +89,22 @@ public class RepositoryCommitNote extends PlatformObject implements
return super.getAdapter(adapter);
}
+ @Override
public Object[] getChildren(Object o) {
return new Object[0];
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return UIIcons.NOTE;
}
+ @Override
public String getLabel(Object o) {
return NoteMap.shortenRefName(ref.getName());
}
+ @Override
public Object getParent(Object o) {
return commit;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
index 7eb5afb106..549456daa7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java
@@ -62,6 +62,7 @@ public class StashEditorPage extends CommitEditorPage {
super(editor, "stashPage", UIText.CommitEditorPage_Title); //$NON-NLS-1$
}
+ @Override
String getParentCommitLabel(int i) {
switch (i) {
case 0:
@@ -124,6 +125,7 @@ public class StashEditorPage extends CommitEditorPage {
final ScrolledForm form = getManagedForm().getForm();
if (UIUtils.isUsable(form))
form.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!UIUtils.isUsable(form))
return;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CheckoutHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CheckoutHandler.java
index 7fecb17464..3a61fd6132 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CheckoutHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CheckoutHandler.java
@@ -27,6 +27,7 @@ public class CheckoutHandler extends CommitCommandHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.Checkout"; //$NON-NLS-1$
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
index af1755362c..8a6a9113e1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CherryPickHandler.java
@@ -68,6 +68,7 @@ public class CherryPickHandler extends SelectionHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.CherryPick"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RevCommit commit = getSelectedItem(RevCommit.class, event);
if (commit == null)
@@ -149,6 +150,7 @@ public class CherryPickHandler extends SelectionHandler {
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
ConfirmCherryPickDialog dialog = new ConfirmCherryPickDialog(
shell, message, repository, Arrays.asList(commit));
@@ -195,10 +197,12 @@ public class CherryPickHandler extends SelectionHandler {
private static class ContentProvider extends WorkbenchContentProvider {
+ @Override
public Object[] getElements(final Object element) {
return (Object[]) element;
}
+ @Override
public Object[] getChildren(Object element) {
if (element instanceof RepositoryCommit)
return ((RepositoryCommit) element).getDiffs();
@@ -210,6 +214,7 @@ public class CherryPickHandler extends SelectionHandler {
private void showNotPerformedDialog(final Shell shell) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openWarning(shell,
UIText.CherryPickHandler_NoCherryPickPerformedTitle,
@@ -221,6 +226,7 @@ public class CherryPickHandler extends SelectionHandler {
private void showConflictDialog(final Shell shell) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openWarning(shell,
UIText.CherryPickHandler_CherryPickConflictsTitle,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateBranchHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateBranchHandler.java
index 0da63b99f1..88579f68f9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateBranchHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateBranchHandler.java
@@ -29,6 +29,7 @@ public class CreateBranchHandler extends CommitCommandHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.CreateBranch"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateTagHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateTagHandler.java
index 9b0959a993..2a9ba666da 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateTagHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/CreateTagHandler.java
@@ -36,6 +36,7 @@ public class CreateTagHandler extends CommitCommandHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.CreateTag"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/EditHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/EditHandler.java
index 40c398bbd8..c54c45fe23 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/EditHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/EditHandler.java
@@ -32,6 +32,7 @@ public class EditHandler extends SelectionHandler {
/** Command id */
public static final String ID = "org.eclipse.egit.ui.commit.Edit"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RevCommit commit = getSelectedItem(RevCommit.class, event);
if (commit == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
index d34980d2e7..ec0e792019 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
@@ -46,6 +46,7 @@ public class RevertHandler extends CommitCommandHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.Revert"; //$NON-NLS-1$
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> repoCommits = getCommits(event);
Repository repo = repoCommits.get(0).getRepository();
@@ -119,6 +120,7 @@ public class RevertHandler extends CommitCommandHandler {
private static void showFailureDialog(final Shell shell,
final RevCommit commit, final MergeResult result) {
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
RevertFailureDialog.show(shell, commit, result);
}
@@ -133,6 +135,7 @@ public class RevertHandler extends CommitCommandHandler {
*/
private static void showRevertedDialog(final Shell shell) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
MessageDialog.openWarning(shell,
UIText.RevertHandler_NoRevertTitle,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RewordHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RewordHandler.java
index 93406efc0e..29f0e23811 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RewordHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RewordHandler.java
@@ -39,6 +39,7 @@ public class RewordHandler extends SelectionHandler {
/** Command id */
public static final String ID = "org.eclipse.egit.ui.commit.Reword"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RevCommit commit = getSelectedItem(RevCommit.class, event);
if (commit == null)
@@ -94,6 +95,7 @@ public class RewordHandler extends SelectionHandler {
private String promptCommitMessage(final Shell shell, RevCommit commit) {
final String[] message = { commit.getFullMessage() };
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
CommitMessageEditorDialog dialog = new CommitMessageEditorDialog(
shell, message[0]);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/ShowInHistoryHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/ShowInHistoryHandler.java
index e4b527e71b..e78842fe01 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/ShowInHistoryHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/ShowInHistoryHandler.java
@@ -27,6 +27,7 @@ public class ShowInHistoryHandler extends CommitCommandHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.ShowInHistory"; //$NON-NLS-1$
+ @Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/SquashHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/SquashHandler.java
index c145d6478d..38fba91274 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/SquashHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/SquashHandler.java
@@ -43,6 +43,7 @@ public class SquashHandler extends SelectionHandler {
/** Command id */
public static final String ID = "org.eclipse.egit.ui.commit.Squash"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RevCommit> commits = getSelectedItems(RevCommit.class, event);
if ((commits == null) || commits.isEmpty())
@@ -64,10 +65,12 @@ public class SquashHandler extends SelectionHandler {
}
InteractiveHandler messageHandler = new InteractiveHandler() {
+ @Override
public void prepareSteps(List<RebaseTodoLine> steps) {
// not used
}
+ @Override
public String modifyCommitMessage(String oldMessage) {
return promptCommitMessage(shell, oldMessage);
}
@@ -103,6 +106,7 @@ public class SquashHandler extends SelectionHandler {
private String promptCommitMessage(final Shell shell, final String message) {
final String[] msg = { message };
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
CommitMessageEditorDialog dialog = new CommitMessageEditorDialog(
shell, msg[0]);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashApplyHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashApplyHandler.java
index f50629f6bb..1dab7b6fa1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashApplyHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashApplyHandler.java
@@ -36,6 +36,7 @@ public class StashApplyHandler extends SelectionHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.StashApply"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final RevCommit commit = getSelectedItem(RevCommit.class, event);
if (commit == null)
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashDropHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashDropHandler.java
index 1a9cdb20b3..ba1eae98b9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashDropHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/StashDropHandler.java
@@ -45,6 +45,7 @@ public class StashDropHandler extends SelectionHandler {
*/
public static final String ID = "org.eclipse.egit.ui.commit.StashDrop"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final RevCommit commit = getSelectedItem(RevCommit.class, event);
if (commit == null)
@@ -124,6 +125,7 @@ public class StashDropHandler extends SelectionHandler {
final AtomicBoolean confirmed = new AtomicBoolean(false);
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
String message = MessageFormat.format(
UIText.StashDropCommand_confirmSingle,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
index 18bb357d09..aa0a83ebce 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/CachedCheckboxTreeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010, 2015 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Chris Aniszczyk <caniszczyk@gmail.com> - initial implementation
+ * Lars Vogel <Lars.Vogel@vogella.com> - Bug 462864
*******************************************************************************/
package org.eclipse.egit.ui.internal.components;
@@ -47,6 +48,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
protected CachedCheckboxTreeViewer(Tree tree) {
super(tree);
addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateCheckState(event.getElement(), event.getChecked());
}
@@ -70,8 +72,8 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
if (contentProvider != null) {
Object[] children = contentProvider.getChildren(element);
if (children != null && children.length > 0) {
- for (int i = 0; i < children.length; i++) {
- updateCheckState(children[i], state);
+ for (Object child : children) {
+ updateCheckState(child, state);
}
} else {
checkState.add(element);
@@ -89,8 +91,8 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
if (contentProvider != null) {
Object[] children = contentProvider.getChildren(element);
if (children !=null && children.length > 0) {
- for (int i = 0; i < children.length; i++) {
- updateCheckState(children[i], state);
+ for (Object child : children) {
+ updateCheckState(child, state);
}
}
@@ -153,17 +155,13 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
return checkState.size();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICheckable#setChecked(java.lang.Object, boolean)
- */
+ @Override
public boolean setChecked(Object element, boolean state) {
updateCheckState(element, state);
return super.setChecked(element, state);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.CheckboxTreeViewer#setCheckedElements(java.lang.Object[])
- */
+ @Override
public void setCheckedElements(Object[] elements) {
super.setCheckedElements(elements);
checkState.clear();
@@ -183,9 +181,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.CheckboxTreeViewer#setAllChecked(boolean)
- */
+ @Override
public void setAllChecked(boolean state) {
for (TreeItem item: super.getTree().getItems())
item.setChecked(state);
@@ -200,13 +196,13 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
}
if (contentProvider == null) {
- for (int i = 0; i < visible.length; i++) {
- checkState.add(visible[i]);
+ for (Object element : visible) {
+ checkState.add(element);
}
} else {
Set<Object> toCheck = new HashSet<Object>();
- for (int i = 0; i < visible.length; i++) {
- addFilteredChildren(visible[i], contentProvider, toCheck);
+ for (Object element : visible) {
+ addFilteredChildren(element, contentProvider, toCheck);
}
checkState.addAll(toCheck);
}
@@ -214,8 +210,8 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
// Remove any item in the check state that is visible (passes the filters)
if (checkState != null) {
Object[] visible = filter(checkState.toArray());
- for (int i = 0; i < visible.length; i++) {
- checkState.remove(visible[i]);
+ for (Object element : visible) {
+ checkState.remove(element);
}
}
}
@@ -235,25 +231,21 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer {
result.add(element);
} else {
Object[] visibleChildren = getFilteredChildren(element);
- for (int i = 0; i < visibleChildren.length; i++) {
- addFilteredChildren(visibleChildren[i], contentProvider, result);
+ for (Object visibleChild : visibleChildren) {
+ addFilteredChildren(visibleChild, contentProvider, result);
}
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object[])
- */
+ @Override
public void remove(Object[] elementsOrTreePaths) {
- for (int i = 0; i < elementsOrTreePaths.length; i++) {
- updateCheckState(elementsOrTreePaths[i], false);
+ for (Object elementsOrTreePath : elementsOrTreePaths) {
+ updateCheckState(elementsOrTreePath, false);
}
super.remove(elementsOrTreePaths);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object)
- */
+ @Override
public void remove(Object elementsOrTreePaths) {
updateCheckState(elementsOrTreePaths, false);
super.remove(elementsOrTreePaths);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/ClickableCellEditor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/ClickableCellEditor.java
index 3841268caf..155f1f75b3 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/ClickableCellEditor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/ClickableCellEditor.java
@@ -61,6 +61,7 @@ public class ClickableCellEditor extends CellEditor {
fireApplyEditorValue();
}
+ @Override
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
if (activationEvent.eventType != ColumnViewerEditorActivationEvent.TRAVERSAL) {
super.activate(activationEvent);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/FilteredCheckboxTree.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/FilteredCheckboxTree.java
index 358e1db289..4b4c560b37 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/FilteredCheckboxTree.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/FilteredCheckboxTree.java
@@ -68,9 +68,7 @@ public class FilteredCheckboxTree extends FilteredTree {
fToolkit = toolkit;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int)
- */
+ @Override
protected TreeViewer doCreateTreeViewer(Composite actParent, int style) {
int treeStyle = style | SWT.CHECK | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER;
Tree tree = null;
@@ -85,16 +83,19 @@ public class FilteredCheckboxTree extends FilteredTree {
}
/*
- * Overridden to hook a listener on the job and set the deferred content provider
- * to synchronous mode before a filter is done.
- * @see org.eclipse.ui.dialogs.FilteredTree#doCreateRefreshJob()
+ * Overridden to hook a listener on the job and set the deferred content
+ * provider to synchronous mode before a filter is done.
+ *
*/
+ @Override
protected WorkbenchJob doCreateRefreshJob() {
WorkbenchJob filterJob = super.doCreateRefreshJob();
filterJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()) {
getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (checkboxViewer.getTree().isDisposed())
return;
@@ -107,9 +108,7 @@ public class FilteredCheckboxTree extends FilteredTree {
return filterJob;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.FilteredTree#doCreateFilterText(org.eclipse.swt.widgets.Composite)
- */
+ @Override
protected Text doCreateFilterText(Composite actParent) {
// Overridden so the text gets create using the toolkit if we have one
Text parentText = super.doCreateFilterText(actParent);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentAssistProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentAssistProvider.java
index a693b09427..dbb98cd7ae 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentAssistProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentAssistProvider.java
@@ -72,6 +72,7 @@ public class RefContentAssistProvider {
new ProgressMonitorDialog(shell).run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java
index 11ecf06265..6422f7816b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java
@@ -108,14 +108,17 @@ public class RefContentProposal implements IContentProposal {
this.objectId = objectId;
}
+ @Override
public String getContent() {
return refName;
}
+ @Override
public int getCursorPosition() {
return refName.length();
}
+ @Override
public String getDescription() {
if (objectId == null)
return null;
@@ -156,6 +159,7 @@ public class RefContentProposal implements IContentProposal {
}
}
+ @Override
public String getLabel() {
for (int i = 0; i < PREFIXES.length; i++)
if (refName.startsWith(PREFIXES[i]))
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java
index 90c9b3f2fa..169c6c2cfc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPage.java
@@ -112,6 +112,7 @@ public class RefSpecPage extends WizardPage {
this.credentials = credentials;
}
+ @Override
public void createControl(Composite parent) {
final Composite panel = new Composite(parent, SWT.NULL);
panel.setLayout(new GridLayout());
@@ -120,6 +121,7 @@ public class RefSpecPage extends WizardPage {
specsPanel.getControl().setLayoutData(
new GridData(SWT.FILL, SWT.FILL, true, true));
specsPanel.addRefSpecTableListener(new SelectionChangeListener() {
+ @Override
public void selectionChanged() {
checkPage();
}
@@ -226,6 +228,7 @@ public class RefSpecPage extends WizardPage {
validatedRepoSelection = null;
transportError = null;
getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
revalidateImpl(currentRepoSelection);
}
@@ -245,6 +248,7 @@ public class RefSpecPage extends WizardPage {
.setCredentialsProvider(new EGitCredentialsProvider(
credentials.getUser(), credentials.getPassword()));
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
listRemotesOp.run(monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java
index 67b8170686..6148fb367d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java
@@ -331,6 +331,7 @@ public class RefSpecPanel {
createTableGroup();
addRefSpecTableListener(new SelectionChangeListener() {
+ @Override
public void selectionChanged() {
validateSpecs();
}
@@ -627,6 +628,7 @@ public class RefSpecPanel {
errorTextColor = new Color(panel.getDisplay(), 255, 0, 0);
panel.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
imageRegistry.dispose();
errorBackgroundColor.dispose();
@@ -677,6 +679,7 @@ public class RefSpecPanel {
creationSrcDecoration = createAssistedDecoratedCombo(creationPanel,
getRefsProposalProvider(pushSpecs),
new IContentProposalListener() {
+ @Override
public void proposalAccepted(IContentProposal proposal) {
tryAutoCompleteSrcToDst();
}
@@ -685,6 +688,7 @@ public class RefSpecPanel {
creationSrcCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false));
creationSrcCombo.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
// SWT.TRAVERSE_RETURN may be also reasonable here, but
// it can be confused with RETURN for content proposal
@@ -709,6 +713,7 @@ public class RefSpecPanel {
creationDstDecoration = createAssistedDecoratedCombo(creationPanel,
getRefsProposalProvider(!pushSpecs),
new IContentProposalListener() {
+ @Override
public void proposalAccepted(IContentProposal proposal) {
tryAutoCompleteDstToSrc();
}
@@ -717,6 +722,7 @@ public class RefSpecPanel {
creationDstCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false));
creationDstCombo.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
// SWT.TRAVERSE_RETURN may be also reasonable here, but
// it can be confused with RETURN for content proposal
@@ -740,6 +746,7 @@ public class RefSpecPanel {
validateCreationPanel();
final ModifyListener validator = new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
validateCreationPanel();
}
@@ -789,6 +796,7 @@ public class RefSpecPanel {
validateDeleteCreationPanel();
deleteRefCombo.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
validateDeleteCreationPanel();
}
@@ -848,6 +856,7 @@ public class RefSpecPanel {
updateAddPredefinedButton(addTagsButton, Transport.REFSPEC_TAGS);
addRefSpecTableListener(new SelectionChangeListener() {
+ @Override
public void selectionChanged() {
updateAddPredefinedButton(addConfiguredButton,
predefinedConfigured);
@@ -910,12 +919,14 @@ public class RefSpecPanel {
tableViewer.setInput(specs);
tableViewer.setComparer(new IElementComparer() {
+ @Override
public boolean equals(Object a, Object b) {
// need that as viewers are not designed to support 2 equals
// object, while we have RefSpec#equals implemented
return a == b;
}
+ @Override
public int hashCode(Object element) {
return element.hashCode();
}
@@ -1000,6 +1011,7 @@ public class RefSpecPanel {
setRefSpec(oldSpec, newSpec);
tableViewer.getControl().getDisplay().asyncExec(
new Runnable() {
+ @Override
public void run() {
tableViewer.editElement(newSpec,
srcColumnIndex);
@@ -1326,6 +1338,7 @@ public class RefSpecPanel {
updateRemoveAllSpecButton();
addRefSpecTableListener(new SelectionChangeListener() {
+ @Override
public void selectionChanged() {
updateForceUpdateAllButton();
updateRemoveAllSpecButton();
@@ -1710,6 +1723,7 @@ public class RefSpecPanel {
private List<RefContentProposal> createContentProposals(
final Collection<Ref> refs, final Ref HEAD) {
final TreeSet<Ref> set = new TreeSet<Ref>(new Comparator<Ref>() {
+ @Override
public int compare(Ref o1, Ref o2) {
// lexicographical ordering by name seems to be fine
return o1.getName().compareTo(o2.getName());
@@ -1788,6 +1802,7 @@ public class RefSpecPanel {
this.proposals = proposals;
}
+ @Override
public IContentProposal[] getProposals(final String contents,
int position) {
final List<RefContentProposal> result = new ArrayList<RefContentProposal>();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
index 57a54294c5..485fc03a9d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
@@ -405,6 +405,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
return selection.equals(s);
}
+ @Override
public void createControl(final Composite parent) {
final Composite panel = new Composite(parent, SWT.NULL);
panel.setLayout(new GridLayout());
@@ -452,6 +453,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
remoteCombo = new RemoteSelectionCombo(remotePanel, SWT.NULL, selectionType);
remoteConfig = remoteCombo.setItems(configuredRemotes);
remoteCombo.addRemoteSelectionListener(new IRemoteSelectionListener() {
+ @Override
public void remoteSelected(RemoteConfig rc) {
remoteConfig = rc;
checkPage();
@@ -472,6 +474,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
uriButton = new Button(parent, SWT.RADIO);
uriButton.setText(UIText.RepositorySelectionPage_uriChoice + ":"); //$NON-NLS-1$
uriButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
// occurs either on selection or unselection event
updateRemoteAndURIPanels();
@@ -508,6 +511,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
uriText.setLayoutData(createFieldGridData());
uriText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
updateFields(uriText.getText());
}
@@ -562,6 +566,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
hostText = new Text(g, SWT.BORDER);
GridDataFactory.fillDefaults().span(2, 1).applyTo(hostText);
hostText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
setURI(uri.setHost(nullString(hostText.getText())));
}
@@ -571,6 +576,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
pathText = new Text(g, SWT.BORDER);
GridDataFactory.fillDefaults().span(2, 1).applyTo(pathText);
pathText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
setURI(uri.setPath(nullString(pathText.getText())));
}
@@ -586,6 +592,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
userText = new Text(g, SWT.BORDER);
userText.setLayoutData(createFieldGridData());
userText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
Protocol protocol = getProtocol();
if (protocol != Protocol.HTTP && protocol != Protocol.HTTPS)
@@ -598,6 +605,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
passText = new Text(g, SWT.BORDER | SWT.PASSWORD);
passText.setLayoutData(createFieldGridData());
passText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
setURI(uri.setPass(null));
password = passText.getText();
@@ -609,10 +617,12 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
.setText(UIText.RepositorySelectionPage_storeInSecureStore);
storeCheckbox.setSelection(storeInSecureStore);
storeCheckbox.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
storeInSecureStore = storeCheckbox.getSelection();
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
storeInSecureStore = storeCheckbox.getSelection();
}
@@ -630,6 +640,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
for (Protocol p : Protocol.values())
scheme.add(p.getDefaultScheme());
scheme.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
final int idx = scheme.getSelectionIndex();
if (idx < 0) {
@@ -648,6 +659,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
portText.addVerifyListener(new VerifyListener() {
final Pattern p = Pattern.compile("^(?:[1-9][0-9]*)?$"); //$NON-NLS-1$
+ @Override
public void verifyText(final VerifyEvent e) {
final String v = portText.getText();
e.doit = p.matcher(
@@ -656,6 +668,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
}
});
portText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
final String val = nullString(portText.getText());
if (val == null)
@@ -1041,6 +1054,7 @@ public class RepositorySelectionPage extends WizardPage implements IRepositorySe
return Activator.getDefault().getPreferenceStore();
}
+ @Override
public GitRepositoryInfo getGitRepositoryInfo() {
GitRepositoryInfo info = new GitRepositoryInfo(uri.toString());
info.setCredentials(user, password);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/EGitCredentialsProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/EGitCredentialsProvider.java
index 501b06f407..bd8a928c82 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/EGitCredentialsProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/credentials/EGitCredentialsProvider.java
@@ -120,6 +120,7 @@ public class EGitCredentialsProvider extends CredentialsProvider {
final boolean[] result = new boolean[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -221,6 +222,7 @@ public class EGitCredentialsProvider extends CredentialsProvider {
final AtomicReference<UserPasswordCredentials> aRef = new AtomicReference<UserPasswordCredentials>(
null);
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java
index 085439c933..03c848b92f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java
@@ -81,46 +81,57 @@ public class DecoratableResource implements IDecoratableResource {
this.resource = resource;
}
+ @Override
public int getType() {
return resource != null ? resource.getType() : 0;
}
+ @Override
public String getName() {
return resource != null ? resource.getName() : null;
}
+ @Override
public String getRepositoryName() {
return repositoryName;
}
+ @Override
public String getBranch() {
return branch;
}
+ @Override
public String getBranchStatus() {
return branchStatus;
}
+ @Override
public boolean isTracked() {
return tracked;
}
+ @Override
public boolean isIgnored() {
return ignored;
}
+ @Override
public boolean isDirty() {
return dirty;
}
+ @Override
public Staged staged() {
return staged;
}
+ @Override
public boolean hasConflicts() {
return conflicts;
}
+ @Override
public boolean isAssumeValid() {
return assumeValid;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceMapping.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceMapping.java
index d8d54449af..73065ff82e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceMapping.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceMapping.java
@@ -124,12 +124,14 @@ public class DecoratableResourceMapping extends DecoratableResource {
}
}
+ @Override
public int getType() {
if (mapping.getModelObject() instanceof IWorkingSet)
return WORKING_SET;
return RESOURCE_MAPPING;
}
+ @Override
public String getName() {
// TODO: check whether something other than a WorkingSet can
// appear here, and calculate a proper name for it.
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecorationResult.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecorationResult.java
index 06db06f327..a5f3026616 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecorationResult.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecorationResult.java
@@ -45,35 +45,43 @@ public class DecorationResult implements IDecoration {
* Copies the behavior of <code>DecorationBuilder</code> of only allowing
* the overlay to be set once.
*/
+ @Override
public void addOverlay(ImageDescriptor overlayImage) {
if (overlay == null)
overlay = overlayImage;
}
+ @Override
public void addOverlay(ImageDescriptor overlayImage, int quadrant) {
addOverlay(overlayImage);
}
+ @Override
public void addPrefix(String prefix) {
prefixes.add(prefix);
}
+ @Override
public void addSuffix(String suffix) {
suffixes.add(suffix);
}
+ @Override
public IDecorationContext getDecorationContext() {
return new DecorationContext();
}
+ @Override
public void setBackgroundColor(Color color) {
backgroundColor = color;
}
+ @Override
public void setForegroundColor(Color color) {
foregroundColor = color;
}
+ @Override
public void setFont(Font font) {
this.font = font;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
index 61431f9c43..15edea0453 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
@@ -72,13 +72,15 @@ class GitDocument extends Document implements RefsChangedListener {
GitTraceLocation.QUICKDIFF.getLocation(),
"(GitDocument) create: " + resource); //$NON-NLS-1$
GitDocument ret = null;
- if (RepositoryProvider.getProvider(resource.getProject()) instanceof GitProvider) {
+ if (RepositoryProvider.getProvider(resource.getProject(),
+ GitProvider.ID) != null) {
ret = new GitDocument(resource);
ret.populate();
final Repository repository = ret.getRepository();
- if (repository != null)
+ if (repository != null) {
ret.myRefsChangedHandle = repository.getListenerList()
.addRefsChangedListener(ret);
+ }
}
return ret;
}
@@ -262,6 +264,7 @@ class GitDocument extends Document implements RefsChangedListener {
disposed = true;
}
+ @Override
public void onRefsChanged(final RefsChangedEvent event) {
cancelReloadJob();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
index 8a6c085ebd..eb9364660f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
@@ -128,6 +128,7 @@ public class GitLightweightDecorator extends LabelProvider implements
final List<String> actColors) {
final Display display = PlatformUI.getWorkbench().getDisplay();
display.syncExec(new Runnable() {
+ @Override
public void run() {
ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
for (int i = 0; i < actColors.size(); i++) {
@@ -159,6 +160,7 @@ public class GitLightweightDecorator extends LabelProvider implements
* @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object,
* org.eclipse.jface.viewers.IDecoration)
*/
+ @Override
public void decorate(Object element, IDecoration decoration) {
// Don't decorate if UI plugin is not running
if (Activator.getDefault() == null)
@@ -313,6 +315,7 @@ public class GitLightweightDecorator extends LabelProvider implements
this.descriptor = descriptor;
}
+ @Override
public ImageData getImageData() {
if (data == null) {
data = descriptor.getImageData();
@@ -617,6 +620,7 @@ public class GitLightweightDecorator extends LabelProvider implements
*/
public static void refresh() {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Activator.getDefault().getWorkbench().getDecoratorManager()
.update(DECORATOR_ID);
@@ -632,6 +636,7 @@ public class GitLightweightDecorator extends LabelProvider implements
*
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
final String prop = event.getProperty();
// If the property is of any interest to us
@@ -650,6 +655,7 @@ public class GitLightweightDecorator extends LabelProvider implements
}
}
+ @Override
public void indexDiffChanged(Repository repository,
IndexDiffData indexDiffData) {
// clear calculated repo data
@@ -698,6 +704,7 @@ public class GitLightweightDecorator extends LabelProvider implements
this);
// Re-trigger decoration process (in UI thread)
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
fireLabelProviderChanged(event);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitQuickDiffProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitQuickDiffProvider.java
index 8342286a12..f2a1373a4e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitQuickDiffProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitQuickDiffProvider.java
@@ -49,6 +49,7 @@ public class GitQuickDiffProvider implements IQuickDiffReferenceProvider {
GitTraceLocation.getTrace().traceEntry(GitTraceLocation.QUICKDIFF.getLocation());
}
+ @Override
public void dispose() {
if (GitTraceLocation.QUICKDIFF.isActive())
GitTraceLocation.getTrace().traceEntry(GitTraceLocation.QUICKDIFF.getLocation());
@@ -56,10 +57,12 @@ public class GitQuickDiffProvider implements IQuickDiffReferenceProvider {
document.dispose();
}
+ @Override
public String getId() {
return id;
}
+ @Override
public IDocument getReference(IProgressMonitor monitor)
throws CoreException {
if (GitTraceLocation.QUICKDIFF.isActive())
@@ -84,12 +87,14 @@ public class GitQuickDiffProvider implements IQuickDiffReferenceProvider {
}
}
+ @Override
public boolean isEnabled() {
return resource != null
&& RepositoryProvider.getProvider(resource.getProject(),
GitProvider.ID) != null;
}
+ @Override
public void setActiveEditor(ITextEditor editor) {
if (GitTraceLocation.QUICKDIFF.isActive())
GitTraceLocation.getTrace().traceEntry(
@@ -98,6 +103,7 @@ public class GitQuickDiffProvider implements IQuickDiffReferenceProvider {
resource = ResourceUtil.getResource(editorInput);
}
+ @Override
public void setId(String id) {
this.id = id;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
index cf146c74b0..6ceea181bd 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/ProblemLabelDecorator.java
@@ -60,6 +60,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
+ @Override
public void dispose() {
resourceManager.dispose();
if (this.viewer != null)
@@ -67,6 +68,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
super.dispose();
}
+ @Override
public Image decorateImage(Image image, Object element) {
IProblemDecoratable decoratable = getProblemDecoratable(element);
if (decoratable != null) {
@@ -79,6 +81,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
return null;
}
+ @Override
public String decorateText(String text, Object element) {
// No decoration
return null;
@@ -98,6 +101,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
return (Image) this.resourceManager.get(decorated);
}
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
Set<IResource> resources = new HashSet<IResource>();
@@ -116,6 +120,7 @@ public class ProblemLabelDecorator extends BaseLabelProvider implements
final Object[] updateElements = elements.toArray(new Object[elements.size()]);
Display display = viewer.getControl().getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
viewer.update(updateElements, null);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java
index e33f0f32de..27508a7e24 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java
@@ -278,6 +278,7 @@ public abstract class AbstractBranchSelectionDialog extends TitleAreaDialog {
tree);
branchTree.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
String refName = refNameFromDialog();
refNameSelected(refName);
@@ -286,6 +287,7 @@ public abstract class AbstractBranchSelectionDialog extends TitleAreaDialog {
// double-click support
branchTree.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
RepositoryTreeNode node = (RepositoryTreeNode) ((IStructuredSelection) branchTree
.getSelection()).getFirstElement();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BasicConfigurationDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BasicConfigurationDialog.java
index c01e2528bd..02e20fb015 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BasicConfigurationDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BasicConfigurationDialog.java
@@ -71,6 +71,7 @@ public class BasicConfigurationDialog extends TitleAreaDialog {
.getBoolean(UIPreferences.SHOW_INITIAL_CONFIG_DIALOG)
&& isImplicitUserConfig(repositories))
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
new BasicConfigurationDialog(PlatformUI.getWorkbench()
.getDisplay().getActiveShell()).open();
@@ -147,6 +148,7 @@ public class BasicConfigurationDialog extends TitleAreaDialog {
if (currentName != null)
userName.setText(currentName);
userName.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
needsUpdate = true;
}
@@ -163,6 +165,7 @@ public class BasicConfigurationDialog extends TitleAreaDialog {
if (currentMail != null)
email.setText(currentMail);
email.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
needsUpdate = true;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java
index f3b0568027..18c69cb909 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchRenameDialog.java
@@ -97,6 +97,7 @@ public class BranchRenameDialog extends TitleAreaDialog {
final IInputValidator inputValidator = ValidationUtils
.getRefNameInputValidator(repository, prefix, true);
name.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
String error = inputValidator.isValid(name.getText());
setErrorMessage(error);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
index 8626c98909..a84f6cf24f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -106,12 +106,15 @@ public class BranchSelectionDialog<T> extends MessageDialog {
/*
* Overridden to check page when refreshing is done.
*/
+ @Override
protected WorkbenchJob doCreateRefreshJob() {
WorkbenchJob refreshJob = super.doCreateRefreshJob();
refreshJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()) {
getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
checkPage();
}
@@ -126,33 +129,40 @@ public class BranchSelectionDialog<T> extends MessageDialog {
CachedCheckboxTreeViewer viewer = fTree.getCheckboxTreeViewer();
GridDataFactory.fillDefaults().grab(true, true).applyTo(fTree);
viewer.setContentProvider(new ITreeContentProvider() {
+ @Override
public void inputChanged(Viewer actViewer, Object oldInput,
Object newInput) {
// nothing
}
+ @Override
public void dispose() {
// nothing
}
+ @Override
public boolean hasChildren(Object element) {
return false;
}
+ @Override
public Object getParent(Object element) {
return null;
}
+ @Override
public Object[] getElements(Object inputElement) {
return ((List) inputElement).toArray();
}
+ @Override
public Object[] getChildren(Object parentElement) {
return null;
}
});
viewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
checkPage();
}
@@ -174,11 +184,13 @@ public class BranchSelectionDialog<T> extends MessageDialog {
branchesList.setInput(nodes);
branchesList
.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
checkPage();
}
});
branchesList.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
buttonPressed(OK);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CheckoutConflictDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CheckoutConflictDialog.java
index 1df2edf50a..469dc6ae72 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CheckoutConflictDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CheckoutConflictDialog.java
@@ -69,6 +69,7 @@ public class CheckoutConflictDialog extends MessageDialog {
return main;
}
+ @Override
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case IDialogConstants.PROCEED_ID:
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java
index 54ddf636b0..5e0820a6fb 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitCombo.java
@@ -60,6 +60,7 @@ public class CommitCombo extends Composite {
private class CommitContentProposalProvider implements
IContentProposalProvider {
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
List<IContentProposal> list = new ArrayList<IContentProposal>();
Pattern pattern = Pattern.compile(contents,
@@ -79,18 +80,22 @@ public class CommitCombo extends Composite {
*/
private IContentProposal makeContentProposal(final String proposal) {
return new IContentProposal() {
+ @Override
public String getContent() {
return proposal;
}
+ @Override
public String getDescription() {
return null;
}
+ @Override
public String getLabel() {
return null;
}
+ @Override
public int getCursorPosition() {
return proposal.length();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
index 2da1085107..a30a19f58f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
@@ -36,6 +36,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.egit.core.AdaptableFileTreeIterator;
+import org.eclipse.egit.core.GitProvider;
import org.eclipse.egit.core.internal.util.ResourceUtil;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
@@ -152,14 +153,17 @@ public class CommitDialog extends TitleAreaDialog {
return new Object[0];
}
+ @Override
public Object[] getChildren(Object parentElement) {
return new Object[0];
}
+ @Override
public Object getParent(Object element) {
return null;
}
+ @Override
public boolean hasChildren(Object element) {
return false;
}
@@ -196,10 +200,12 @@ public class CommitDialog extends TitleAreaDialog {
return (Image) this.resourceManager.get(decorated);
}
+ @Override
public StyledString getStyledText(Object element) {
return new StyledString();
}
+ @Override
public Image getImage(Object element) {
CommitItem item = (CommitItem) element;
ImageDescriptor decorator = null;
@@ -233,10 +239,12 @@ public class CommitDialog extends TitleAreaDialog {
static class CommitPathLabelProvider extends ColumnLabelProvider {
+ @Override
public String getText(Object obj) {
return ((CommitItem) obj).path;
}
+ @Override
public String getToolTipText(Object element) {
return ((CommitItem) element).status.getText();
}
@@ -300,6 +308,7 @@ public class CommitDialog extends TitleAreaDialog {
class CommitItemSelectionListener extends SelectionAdapter {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) filesViewer.getSelection();
CommitItem commitItem = (CommitItem) selection.getFirstElement();
@@ -466,6 +475,7 @@ public class CommitDialog extends TitleAreaDialog {
// initially, we sort by status plus path
Collections.sort(items, new Comparator<CommitItem>() {
+ @Override
public int compare(CommitItem o1, CommitItem o2) {
int diff = o1.status.ordinal() - o2.status.ordinal();
if (diff != 0)
@@ -566,6 +576,7 @@ public class CommitDialog extends TitleAreaDialog {
updateMessage();
}
+ @Override
protected void buttonPressed(int buttonId) {
if (IDialogConstants.OK_ID == buttonId)
okPressed();
@@ -644,6 +655,7 @@ public class CommitDialog extends TitleAreaDialog {
final Menu menu = new Menu(dropDownBar);
dropDownItem.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
menu.dispose();
}
@@ -652,6 +664,7 @@ public class CommitDialog extends TitleAreaDialog {
preferencesItem.setText(UIText.CommitDialog_ConfigureLink);
preferencesItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
String[] pages = new String[] { UIPreferences.PAGE_COMMIT_PREFERENCES };
PreferencesUtil.createPreferenceDialogOn(getShell(), pages[0],
@@ -661,6 +674,7 @@ public class CommitDialog extends TitleAreaDialog {
});
dropDownItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Rectangle b = dropDownItem.getBounds();
Point p = dropDownItem.getParent().toDisplay(
@@ -678,6 +692,7 @@ public class CommitDialog extends TitleAreaDialog {
toolkit = new FormToolkit(parent.getDisplay());
parent.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
toolkit.dispose();
}
@@ -715,6 +730,7 @@ public class CommitDialog extends TitleAreaDialog {
filesViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateMessage();
}
@@ -758,9 +774,11 @@ public class CommitDialog extends TitleAreaDialog {
// listener
WorkbenchJob filterJob = super.doCreateRefreshJob();
filterJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()) {
getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
updateFileSectionText();
}
@@ -821,6 +839,7 @@ public class CommitDialog extends TitleAreaDialog {
menuManager.createContextMenu(filesViewer.getTree()));
filesViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateFileSectionText();
}
@@ -835,6 +854,7 @@ public class CommitDialog extends TitleAreaDialog {
showUntrackedItem.setSelection(showUntracked);
showUntrackedItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
showUntracked = showUntrackedItem.getSelection();
filesViewer.refresh(true);
@@ -851,6 +871,7 @@ public class CommitDialog extends TitleAreaDialog {
checkAllItem.setToolTipText(UIText.CommitDialog_SelectAll);
checkAllItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
filesViewer.setAllChecked(true);
updateFileSectionText();
@@ -866,6 +887,7 @@ public class CommitDialog extends TitleAreaDialog {
uncheckAllItem.setToolTipText(UIText.CommitDialog_DeselectAll);
uncheckAllItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
filesViewer.setAllChecked(false);
updateFileSectionText();
@@ -884,6 +906,7 @@ public class CommitDialog extends TitleAreaDialog {
filesViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
if (!event.getChecked())
filesViewer.setAllChecked(true);
@@ -1024,14 +1047,17 @@ public class CommitDialog extends TitleAreaDialog {
final ICommitMessageComponentNotifications listener = new ICommitMessageComponentNotifications() {
+ @Override
public void updateSignedOffToggleSelection(boolean selection) {
signedOffItem.setSelection(selection);
}
+ @Override
public void updateChangeIdToggleSelection(boolean selection) {
changeIdItem.setSelection(selection);
}
+ @Override
public void statusUpdated() {
updateMessage();
}
@@ -1050,6 +1076,7 @@ public class CommitDialog extends TitleAreaDialog {
commitMessageComponent.setFilesToCommit(getFileList());
amendingItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
commitMessageComponent.setAmendingButtonSelection(amendingItem
.getSelection());
@@ -1057,6 +1084,7 @@ public class CommitDialog extends TitleAreaDialog {
});
changeIdItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
commitMessageComponent.setChangeIdButtonSelection(changeIdItem
.getSelection());
@@ -1064,6 +1092,7 @@ public class CommitDialog extends TitleAreaDialog {
});
signedOffItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
commitMessageComponent
.setSignedOffButtonSelection(signedOffItem
@@ -1142,6 +1171,7 @@ public class CommitDialog extends TitleAreaDialog {
private IMenuListener createContextMenuListener() {
return new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
if (!allowToChangeSelection)
return;
@@ -1184,6 +1214,7 @@ public class CommitDialog extends TitleAreaDialog {
private Action createAddAction(final IStructuredSelection selection) {
return new Action(UIText.CommitDialog_AddFileOnDiskToIndex) {
+ @Override
public void run() {
AddCommand addCommand = new Git(repository).add();
for (Iterator<?> it = selection.iterator(); it.hasNext();) {
@@ -1321,12 +1352,13 @@ public class CommitDialog extends TitleAreaDialog {
private void compare(CommitItem commitItem) {
IFile file = findFile(commitItem.path);
- if (file == null
- || RepositoryProvider.getProvider(file.getProject()) == null)
- CompareUtils
- .compareHeadWithWorkingTree(repository, commitItem.path);
- else
+ if (file == null || RepositoryProvider.getProvider(file.getProject(),
+ GitProvider.ID) == null) {
+ CompareUtils.compareHeadWithWorkingTree(repository,
+ commitItem.path);
+ } else {
CompareUtils.compareHeadWithWorkspace(repository, file);
+ }
}
private IFile findFile(String path) {
@@ -1344,6 +1376,7 @@ class CommitItem implements IProblemDecoratable {
int problemSeverity;
+ @Override
public int getProblemSeverity() {
return problemSeverity;
}
@@ -1387,6 +1420,7 @@ class CommitItem implements IProblemDecoratable {
public static enum Order implements Comparator<CommitItem> {
ByStatus() {
+ @Override
public int compare(CommitItem o1, CommitItem o2) {
return o1.status.compareTo(o2.status);
}
@@ -1395,6 +1429,7 @@ class CommitItem implements IProblemDecoratable {
ByFile() {
+ @Override
public int compare(CommitItem o1, CommitItem o2) {
return o1.path.compareTo(
o2.path);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitLabelProvider.java
index b8f65f79b5..7a8cbb8d32 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitLabelProvider.java
@@ -43,6 +43,7 @@ public class CommitLabelProvider extends BaseLabelProvider implements
public CommitLabelProvider() {
}
+ @Override
public String getColumnText(final Object element, final int columnIndex) {
final RevCommit c = (RevCommit) element;
if (columnIndex == 0)
@@ -105,6 +106,7 @@ public class CommitLabelProvider extends BaseLabelProvider implements
return lastCommitter;
}
+ @Override
public Image getColumnImage(final Object element, final int columnIndex) {
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageArea.java
index 4384b38f78..48e0ddbb3f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageArea.java
@@ -34,12 +34,14 @@ public abstract class CommitMessageArea extends SpellcheckableMessageArea {
super(parent, initialText, styles);
}
+ @Override
protected IContentAssistant createContentAssistant(ISourceViewer viewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.enableAutoInsert(true);
final CommitProposalProcessor processor = getCommitProposalProcessor();
getTextWidget().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
processor.dispose();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
index 210b56a37e..8147136922 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
@@ -9,6 +9,7 @@
* Copyright (C) 2012, IBM Corporation (Markus Keller <markus_keller@ch.ibm.com>)
* Copyright (C) 2012, 2013 Robin Stocker <robin@nibor.org>
* Copyright (C) 2014 IBM Corporation (Daniel Megert <daniel_megert@ch.ibm.com>)
+ * Copyright (C) 2015 SAP SE (Christian Georgi <christian.georgi@sap.com>)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -44,8 +45,12 @@ import org.eclipse.egit.ui.internal.commit.CommitHelper;
import org.eclipse.egit.ui.internal.commit.CommitHelper.CommitInfo;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IRegion;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
@@ -96,10 +101,12 @@ public class CommitMessageComponent {
this.type = type;
}
+ @Override
public String getMessage() {
return message;
}
+ @Override
public int getMessageType() {
return type;
}
@@ -438,9 +445,34 @@ public class CommitMessageComponent {
UIText.CommitMessageComponent_AmendingCommitInRemoteBranch,
IMessageProvider.WARNING);
+ // Check format of commit message. The soft-wrapped text in the SWT
+ // control must be converted to a hard-wrapped text, since this will be
+ // the resulting commit message.
+ String message = commitText.getCommitMessage();
+ String formatIssue = formatIssuesInCommitMessage(message);
+ if (formatIssue != null) {
+ return new CommitStatus(formatIssue, IMessageProvider.WARNING);
+ }
+
return CommitStatus.OK;
}
+ static String formatIssuesInCommitMessage(String message) {
+ IDocument document = new Document(message);
+ int numberOfLines = document.getNumberOfLines();
+ if (numberOfLines > 1) {
+ try {
+ IRegion lineInfo = document.getLineInformation(1);
+ if (lineInfo.getLength() > 0) {
+ return UIText.CommitMessageComponent_MessageSecondLineNotEmpty;
+ }
+ } catch (BadLocationException e) {
+ Activator.logError(e.getMessage(), e);
+ }
+ }
+ return null;
+ }
+
/**
* @return true if commit info is ok
*/
@@ -496,6 +528,7 @@ public class CommitMessageComponent {
authorHandler = UIUtils.addPreviousValuesContentProposalToText(
authorText, AUTHOR_VALUES_PREF);
authorText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (!listenersEnabled || !authorText.isEnabled())
return;
@@ -505,6 +538,7 @@ public class CommitMessageComponent {
committerText.addModifyListener(new ModifyListener() {
String oldCommitter = committerText.getText();
+ @Override
public void modifyText(ModifyEvent e) {
if (!listenersEnabled || !committerText.isEnabled())
return;
@@ -524,6 +558,7 @@ public class CommitMessageComponent {
committerHandler = UIUtils.addPreviousValuesContentProposalToText(
committerText, COMMITTER_VALUES_PREF);
commitText.getDocument().addDocumentListener(new IDocumentListener() {
+ @Override
public void documentChanged(DocumentEvent event) {
if (!listenersEnabled || !commitText.isEnabled())
return;
@@ -531,6 +566,7 @@ public class CommitMessageComponent {
updateChangeIdButton();
listener.statusUpdated();
}
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {
// nothing to do
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitSelectDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitSelectDialog.java
index 6c6c87512e..7270dc70e0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitSelectDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitSelectDialog.java
@@ -85,6 +85,7 @@ public class CommitSelectDialog extends TitleAreaDialog {
tv.setInput(commits);
table.setHeaderVisible(true);
tv.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
if (!event.getSelection().isEmpty())
selected = (RevCommit) ((IStructuredSelection) event
@@ -95,6 +96,7 @@ public class CommitSelectDialog extends TitleAreaDialog {
}
});
tv.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
index d36c9ac7f2..8c8dcb8149 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
@@ -181,6 +181,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
GridDataFactory.fillDefaults().grab(true, true).applyTo(tree.getTree());
tree.addOpenListener(new IOpenListener() {
+ @Override
public void open(OpenEvent event) {
reactOnOpen(event);
}
@@ -486,6 +487,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
// this does the hard work...
new ProgressMonitorDialog(getViewSite().getShell()).run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -495,6 +497,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
monitor);
PlatformUI.getWorkbench().getDisplay()
.asyncExec(new Runnable() {
+ @Override
public void run() {
tree.setInput(input);
tree
@@ -909,6 +912,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
*/
private final class PathNodeContentProvider implements ITreeContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
ContainerNode rootContainer = containerNodes.get(new Path("")); //$NON-NLS-1$
if (rootContainer.isOnlyEqualContent() && !showEquals)
@@ -931,6 +935,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
return new PathNode[] { rootContainer };
}
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof ContainerNode) {
ContainerNode containerNode = (ContainerNode) parentElement;
@@ -939,6 +944,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
return new Object[] {};
}
+ @Override
public boolean hasChildren(Object element) {
if (element instanceof ContainerNode) {
ContainerNode containerNode = (ContainerNode) element;
@@ -947,6 +953,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
return false;
}
+ @Override
public Object getParent(Object element) {
if (element instanceof PathNode) {
PathNode pathNode = (PathNode) element;
@@ -959,10 +966,12 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
return null;
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing
}
+ @Override
public void dispose() {
// Do nothing
}
@@ -976,6 +985,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
private final WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
+ @Override
public Image getImage(Object element) {
if (element instanceof String)
return null;
@@ -1007,6 +1017,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
return null;
}
+ @Override
public String getText(Object element) {
if (element instanceof String)
return (String) element;
@@ -1050,6 +1061,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
* @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
* @since 2.1
*/
+ @Override
public void menuAboutToShow(IMenuManager manager) {
ITreeSelection selection = (ITreeSelection) tree.getSelection();
if (selection.isEmpty())
@@ -1071,6 +1083,7 @@ public class CompareTreeView extends ViewPart implements IMenuListener, IShowInS
* @see org.eclipse.ui.part.IShowInSource#getShowInContext()
* @since 2.1
*/
+ @Override
public ShowInContext getShowInContext() {
IPath repoPath = getRepositoryPath();
ITreeSelection selection = (ITreeSelection) tree.getSelection();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java
index 2b37b60010..41fedabea2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java
@@ -144,6 +144,7 @@ public class CreateTagDialog extends TitleAreaDialog {
IMG_LIGHTTAG = UIIcons.TAG.createImage();
}
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
// initially, we just display a single String ("Loading...")
if (element instanceof String)
@@ -154,6 +155,7 @@ public class CreateTagDialog extends TitleAreaDialog {
return IMG_TAG;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
// initially, we just display a single String ("Loading...")
if (element instanceof String)
@@ -164,6 +166,7 @@ public class CreateTagDialog extends TitleAreaDialog {
return ((RevTag) element).getTagName();
}
+ @Override
public void dispose() {
IMG_TAG.dispose();
IMG_LIGHTTAG.dispose();
@@ -312,6 +315,7 @@ public class CreateTagDialog extends TitleAreaDialog {
final List<Object> tags = getRevTags();
PlatformUI.getWorkbench().getDisplay()
.asyncExec(new Runnable() {
+ @Override
public void run() {
if (!tagViewer.getTable().isDisposed()) {
tagViewer.setInput(tags);
@@ -411,6 +415,7 @@ public class CreateTagDialog extends TitleAreaDialog {
| GridData.HORIZONTAL_ALIGN_FILL));
tagNameText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
String tagNameValue = tagNameText.getText();
tagNamePattern = Pattern.compile(Pattern.quote(tagNameValue),
@@ -438,6 +443,7 @@ public class CreateTagDialog extends TitleAreaDialog {
// allow to tag with ctrl-enter
tagMessageText.addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
if (UIUtils.isSubmitKeyEvent(e)) {
Control button = getButton(IDialogConstants.OK_ID);
@@ -449,6 +455,7 @@ public class CreateTagDialog extends TitleAreaDialog {
});
tagMessageText.getTextWidget().addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateInput();
}
@@ -497,6 +504,7 @@ public class CreateTagDialog extends TitleAreaDialog {
advanced.setClient(advancedComposite);
advanced.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
// fill the Combo lazily to improve UI responsiveness
if (((Boolean) e.data).booleanValue()
@@ -506,6 +514,7 @@ public class CreateTagDialog extends TitleAreaDialog {
PlatformUI.getWorkbench().getProgressService()
.busyCursorWhile(new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -550,6 +559,7 @@ public class CreateTagDialog extends TitleAreaDialog {
tagViewer.setLabelProvider(new TagLabelProvider());
tagViewer.setContentProvider(ArrayContentProvider.getInstance());
tagViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
fillTagDialog(event.getSelection());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeContentProvider.java
index bbedf15d0b..6c8287d5d9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeContentProvider.java
@@ -212,26 +212,32 @@ public class FileTreeContentProvider implements ITreeContentProvider {
this.mode = mode;
}
+ @Override
public Object[] getChildren(Object parent) {
return ((Node) parent).getChildren().toArray();
}
+ @Override
public Object getParent(Object child) {
return ((Node) child).getParent();
}
+ @Override
public boolean hasChildren(Object parent) {
return ((Node) parent).hasChildren();
}
+ @Override
public Object[] getElements(Object arg0) {
return rootNodes.toArray();
}
+ @Override
public void dispose() {
// nothing to dispose
}
+ @Override
@SuppressWarnings("unchecked")
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
rootNodes.clear();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeLabelProvider.java
index d227093094..d37f3d3f67 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/FileTreeLabelProvider.java
@@ -21,10 +21,12 @@ import org.eclipse.swt.graphics.Image;
*/
public class FileTreeLabelProvider extends BaseLabelProvider implements ILabelProvider {
+ @Override
public Image getImage(Object element) {
return ((Node) element).getImage();
}
+ @Override
public String getText(Object element) {
return ((Node) element).getName();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java
index a8888063b1..5e21263312 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java
@@ -159,6 +159,7 @@ public class GitTraceConfigurationDialog extends TitleAreaDialog {
return true;
}
+ @Override
public int compareTo(OptionNode o) {
return option.compareTo(o.option);
}
@@ -172,12 +173,14 @@ public class GitTraceConfigurationDialog extends TitleAreaDialog {
this.myOptionsMap = optionsMap;
}
+ @Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof Object[])
return (Object[]) inputElement;
return new Object[0];
}
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof PluginNode) {
PluginNode node = (PluginNode) parentElement;
@@ -194,20 +197,24 @@ public class GitTraceConfigurationDialog extends TitleAreaDialog {
return null;
}
+ @Override
public Object getParent(Object element) {
if (element instanceof OptionNode)
return ((OptionNode) element).getPlugin();
return null;
}
+ @Override
public boolean hasChildren(Object element) {
return element instanceof PluginNode;
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing
}
+ @Override
public void dispose() {
// Do nothing
}
@@ -310,6 +317,7 @@ public class GitTraceConfigurationDialog extends TitleAreaDialog {
});
tv.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
setDirty(true);
}
@@ -345,10 +353,12 @@ public class GitTraceConfigurationDialog extends TitleAreaDialog {
DebugOptions options = getOptions();
fillOptionsMapFromCurrent(options);
tv.setCheckStateProvider(new ICheckStateProvider() {
+ @Override
public boolean isGrayed(Object element) {
return false;
}
+ @Override
public boolean isChecked(Object element) {
Object data = element;
Properties props;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
index 0ebcae64a2..ad97f04ab1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/MergeTargetSelectionDialog.java
@@ -129,6 +129,7 @@ public class MergeTargetSelectionDialog extends AbstractBranchSelectionDialog {
commit.setSelection(true);
commit.setText(UIText.MergeTargetSelectionDialog_MergeTypeCommitButton);
commit.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
mergeSquash = false;
@@ -142,6 +143,7 @@ public class MergeTargetSelectionDialog extends AbstractBranchSelectionDialog {
noCommit.setSelection(true);
noCommit.setText(UIText.MergeTargetSelectionDialog_MergeTypeNoCommitButton);
noCommit.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
mergeSquash = false;
@@ -155,6 +157,7 @@ public class MergeTargetSelectionDialog extends AbstractBranchSelectionDialog {
squash.setSelection(true);
squash.setText(UIText.MergeTargetSelectionDialog_MergeTypeSquashButton);
squash.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
mergeSquash = true;
@@ -186,6 +189,7 @@ public class MergeTargetSelectionDialog extends AbstractBranchSelectionDialog {
Button btn = new Button(grp, SWT.RADIO);
btn.setText(text);
btn.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection())
fastForwardMode = ffMode;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java
index d2c7e1ac2e..8d57d007d9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NewRemoteDialog.java
@@ -86,6 +86,7 @@ public class NewRemoteDialog extends TitleAreaDialog {
nameText = new Text(main, SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText);
nameText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NonDeletedFilesTree.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NonDeletedFilesTree.java
index d09c997e27..40064e8659 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NonDeletedFilesTree.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/NonDeletedFilesTree.java
@@ -73,12 +73,14 @@ public class NonDeletedFilesTree extends TreeViewer {
final Menu menu = new Menu(dropDownBar);
dropDownItem.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
menu.dispose();
}
});
dropDownItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Rectangle b = dropDownItem.getBounds();
Point p = dropDownItem.getParent().toDisplay(
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RebaseTargetSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RebaseTargetSelectionDialog.java
index 6033b24f3b..ecc4d7e669 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RebaseTargetSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RebaseTargetSelectionDialog.java
@@ -113,6 +113,7 @@ public class RebaseTargetSelectionDialog extends AbstractBranchSelectionDialog {
.setText(UIText.RebaseTargetSelectionDialog_InteractiveButton);
interactivebutton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
interactive = interactivebutton.getSelection();
}
@@ -122,6 +123,7 @@ public class RebaseTargetSelectionDialog extends AbstractBranchSelectionDialog {
.setText(UIText.RebaseTargetSelectionDialog_PreserveMergesButton);
preserveMergesButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
preserveMerges = preserveMergesButton.getSelection();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RenameBranchDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RenameBranchDialog.java
index 0b598eae2a..90ae66df58 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RenameBranchDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RenameBranchDialog.java
@@ -101,6 +101,7 @@ public class RenameBranchDialog extends AbstractBranchSelectionDialog {
/**
* @return the message shown above the refs tree
*/
+ @Override
protected String getMessageText() {
return UIText.RenameBranchDialog_DialogMessage;
}
@@ -110,6 +111,7 @@ public class RenameBranchDialog extends AbstractBranchSelectionDialog {
*
* @param parent
*/
+ @Override
protected void createCustomArea(Composite parent) {
// do nothing
}
@@ -119,6 +121,7 @@ public class RenameBranchDialog extends AbstractBranchSelectionDialog {
*
* @return the title of the dialog
*/
+ @Override
protected String getTitle() {
return UIText.RenameBranchDialog_DialogTitle;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
index 480908d8ac..39b034c7e7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/ResetTargetSelectionDialog.java
@@ -118,14 +118,17 @@ public class ResetTargetSelectionDialog extends AbstractBranchSelectionDialog {
g.setLayout(new GridLayout(1, false));
anySha1.addFocusListener(new FocusListener() {
+ @Override
public void focusLost(FocusEvent e) {
// Do nothing
}
+ @Override
public void focusGained(FocusEvent e) {
branchTree.setSelection(null);
}
});
anySha1.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
String text = anySha1.getText();
if (text.length() == 0) {
@@ -180,6 +183,7 @@ public class ResetTargetSelectionDialog extends AbstractBranchSelectionDialog {
});
branchTree.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
if (!event.getSelection().isEmpty()) {
String refName = refNameFromDialog();
@@ -206,6 +210,7 @@ public class ResetTargetSelectionDialog extends AbstractBranchSelectionDialog {
Button button = new Button(parent, SWT.RADIO);
button.setText(text);
button.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection())
resetType = type;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RevertFailureDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RevertFailureDialog.java
index 90a5fee060..14d4effaf6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RevertFailureDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/RevertFailureDialog.java
@@ -81,10 +81,12 @@ public class RevertFailureDialog extends MessageDialog {
this.path = path;
}
+ @Override
public String getLabel(Object object) {
return path;
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
String name = new org.eclipse.core.runtime.Path(path).lastSegment();
if (name != null) {
@@ -95,6 +97,7 @@ public class RevertFailureDialog extends MessageDialog {
.getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
}
+ @Override
public StyledString getStyledText(Object object) {
int lastSlash = path.lastIndexOf('/');
StyledString styled = new StyledString();
@@ -126,10 +129,12 @@ public class RevertFailureDialog extends MessageDialog {
return this;
}
+ @Override
public Object[] getChildren(Object object) {
return paths.toArray();
}
+ @Override
public String getLabel(Object object) {
switch (reason) {
case DIRTY_INDEX:
@@ -143,6 +148,7 @@ public class RevertFailureDialog extends MessageDialog {
}
}
+ @Override
public StyledString getStyledText(Object object) {
StyledString styled = new StyledString(getLabel(object));
styled.append(' ');
@@ -168,6 +174,7 @@ public class RevertFailureDialog extends MessageDialog {
this.reasons = reasons;
}
+ @Override
protected Control createCustomArea(Composite parent) {
if (reasons == null || reasons.isEmpty())
return null;
@@ -183,6 +190,7 @@ public class RevertFailureDialog extends MessageDialog {
.applyTo(viewer.getControl());
viewer.setContentProvider(new WorkbenchContentProvider() {
+ @Override
public Object[] getElements(Object element) {
return ((Collection) element).toArray();
}
@@ -190,6 +198,7 @@ public class RevertFailureDialog extends MessageDialog {
});
final IStyledLabelProvider styleProvider = new WorkbenchStyledLabelProvider() {
+ @Override
public StyledString getStyledText(Object element) {
// TODO Replace with use of IWorkbenchAdapter3 when is no longer
// supported
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
index 8d4279a08c..975f0313d4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
@@ -137,6 +137,7 @@ public class SpellcheckableMessageArea extends Composite {
*
* @see Action#firePropertyChange(String, Object, Object)
*/
+ @Override
public void update() {
// XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=206111
if (fOperationCode == ITextOperationTarget.REDO)
@@ -153,6 +154,7 @@ public class SpellcheckableMessageArea extends Composite {
/**
* @see Action#run()
*/
+ @Override
public void run() {
if (fOperationCode != -1 && fOperationTarget != null)
fOperationTarget.doOperation(fOperationCode);
@@ -175,6 +177,7 @@ public class SpellcheckableMessageArea extends Composite {
synchronizeWithPreference();
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(getPreferenceKey()))
synchronizeWithPreference();
@@ -289,9 +292,11 @@ public class SpellcheckableMessageArea extends Composite {
configureHardWrap();
final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (UIPreferences.COMMIT_DIALOG_HARD_WRAP_MESSAGE.equals(event.getProperty())) {
getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
configureHardWrap();
if (brokenBidiPlatformTextWidth != -1) {
@@ -315,10 +320,12 @@ public class SpellcheckableMessageArea extends Composite {
EditorsUI
.getPreferenceStore()) {
+ @Override
public int getHyperlinkStateMask(ISourceViewer targetViewer) {
return SWT.NONE;
}
+ @Override
protected Map getHyperlinkDetectorTargets(ISourceViewer targetViewer) {
return getHyperlinkTargets();
}
@@ -337,6 +344,7 @@ public class SpellcheckableMessageArea extends Composite {
};
}
+ @Override
public IHyperlinkDetector[] getHyperlinkDetectors(
ISourceViewer targetViewer) {
return getRegisteredHyperlinkDetectors(sourceViewer);
@@ -349,6 +357,7 @@ public class SpellcheckableMessageArea extends Composite {
return super.getReconciler(sourceViewer);
}
+ @Override
public IContentAssistant getContentAssistant(ISourceViewer viewer) {
if (!viewer.isEditable())
return null;
@@ -370,6 +379,7 @@ public class SpellcheckableMessageArea extends Composite {
configureContextMenu();
getTextWidget().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent disposeEvent) {
support.uninstall();
Activator.getDefault().getPreferenceStore().removePropertyChangeListener(propertyChangeListener);
@@ -381,6 +391,7 @@ public class SpellcheckableMessageArea extends Composite {
class BidiSegmentListenerTester implements BidiSegmentListener {
boolean called;
+ @Override
public void lineGetSegments(BidiSegmentEvent event) {
called = true;
}
@@ -404,6 +415,7 @@ public class SpellcheckableMessageArea extends Composite {
if (hardWrapSegmentListener == null) {
final StyledText textWidget = getTextWidget();
hardWrapSegmentListener = new BidiSegmentListener() {
+ @Override
public void lineGetSegments(BidiSegmentEvent e) {
int[] segments = calculateWrapOffsets(e.lineText, MAX_LINE_WIDTH);
if (segments != null) {
@@ -611,6 +623,7 @@ public class SpellcheckableMessageArea extends Composite {
final SubMenuManager quickFixMenu = new SubMenuManager(contextMenu);
quickFixMenu.setVisible(true);
quickFixMenu.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
quickFixMenu.removeAll();
addProposals(quickFixMenu);
@@ -632,6 +645,7 @@ public class SpellcheckableMessageArea extends Composite {
private IHandlerActivation quickFixHandlerActivation;
private IHandlerActivation contentAssistHandlerActivation;
+ @Override
public void focusGained(FocusEvent e) {
IHandlerService service = getHandlerService();
if (service == null)
@@ -681,6 +695,7 @@ public class SpellcheckableMessageArea extends Composite {
new ActiveShellExpression(getParent().getShell()));
}
+ @Override
public void focusLost(FocusEvent e) {
IHandlerService service = getHandlerService();
if (service == null)
@@ -715,6 +730,7 @@ public class SpellcheckableMessageArea extends Composite {
sourceViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
if (cutAction != null)
cutAction.update();
@@ -726,6 +742,7 @@ public class SpellcheckableMessageArea extends Composite {
if (editable)
sourceViewer.addTextListener(new ITextListener() {
+ @Override
public void textChanged(TextEvent event) {
textWidget.setStyleRanges(
new StyleRange[0]);
@@ -740,6 +757,7 @@ public class SpellcheckableMessageArea extends Composite {
// set the cursor when hovering over a link
textWidget.addListener(SWT.MouseMove, new Listener() {
+ @Override
public void handleEvent(final Event e) {
StyleRange styleRange = getStyleRange(e.x, e.y);
if (styleRange != null && styleRange.underline)
@@ -750,6 +768,7 @@ public class SpellcheckableMessageArea extends Composite {
});
textWidget.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent disposeEvent) {
showWhitespaceAction.dispose();
}
@@ -803,10 +822,12 @@ public class SpellcheckableMessageArea extends Composite {
private IAction createQuickFixAction(final ICompletionProposal proposal) {
return new Action(proposal.getDisplayString()) {
+ @Override
public void run() {
proposal.apply(sourceViewer.getDocument());
}
+ @Override
public ImageDescriptor getImageDescriptor() {
Image image = proposal.getImage();
if (image != null)
@@ -886,6 +907,7 @@ public class SpellcheckableMessageArea extends Composite {
final ITextOperationTarget textOperationTarget) {
Action quickFixAction = new Action() {
+ @Override
public void run() {
textOperationTarget.doOperation(ISourceViewer.QUICK_ASSIST);
}
@@ -898,6 +920,7 @@ public class SpellcheckableMessageArea extends Composite {
private ActionHandler createContentAssistActionHandler(
final ITextOperationTarget textOperationTarget) {
Action proposalAction = new Action() {
+ @Override
public void run() {
if (textOperationTarget
.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)
@@ -1003,6 +1026,7 @@ public class SpellcheckableMessageArea extends Composite {
/**
*
*/
+ @Override
public boolean setFocus() {
return getTextWidget().setFocus();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
index 3f1c81b5c8..2f987636a6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
@@ -50,6 +50,7 @@ public class GitAdapterFactory implements IAdapterFactory {
private static final IWorkspaceRoot root = ResourcesPlugin.getWorkspace()
.getRoot();
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.isAssignableFrom(IHistoryPageSource.class)) {
return historyPageSource;
@@ -101,6 +102,7 @@ public class GitAdapterFactory implements IAdapterFactory {
return null;
}
+ @Override
public Class[] getAdapterList() {
return new Class[] { IHistoryPageSource.class,
ISynchronizationCompareAdapter.class, ResourceMapping.class,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
index ed281cb0fb..594ddbe1b9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
@@ -63,6 +63,7 @@ public class FetchDestinationPage extends WizardPage {
setTitle(UIText.FetchDestinationPage_PageTitle);
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
main.setLayout(new GridLayout(2, false));
@@ -86,6 +87,7 @@ public class FetchDestinationPage extends WizardPage {
destinationLabel.setText(UIText.FetchDestinationPage_DestinationLabel);
destinationText = new Text(main, SWT.BORDER);
destinationText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -94,6 +96,7 @@ public class FetchDestinationPage extends WizardPage {
destinationText);
UIUtils.addRefContentProposalToText(sourceText, repository,
new IRefListProvider() {
+ @Override
public List<Ref> getRefList() {
return getRemoteRefs();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
index 2aa1fe3d08..ca1ab058bd 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
@@ -167,6 +167,7 @@ public class FetchGerritChangePage extends WizardPage {
Constants.R_TAGS, true);
}
+ @Override
protected IDialogSettings getDialogSettings() {
IDialogSettings s = Activator.getDefault().getDialogSettings();
IDialogSettings section = s
@@ -176,6 +177,7 @@ public class FetchGerritChangePage extends WizardPage {
return section;
}
+ @Override
public void createControl(Composite parent) {
Clipboard clipboard = new Clipboard(parent.getDisplay());
String clipText = (String) clipboard.getContents(TextTransfer
@@ -245,6 +247,7 @@ public class FetchGerritChangePage extends WizardPage {
branchText = new Text(checkoutGroup, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, false).applyTo(branchText);
branchText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -291,6 +294,7 @@ public class FetchGerritChangePage extends WizardPage {
GridDataFactory.fillDefaults().exclude(true).grab(true, false)
.applyTo(tagText);
tagText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -337,6 +341,7 @@ public class FetchGerritChangePage extends WizardPage {
.setToolTipText(UIText.FetchGerritChangePage_ActivateAdditionalRefsTooltip);
refText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
Change change = Change.fromRef(refText.getText());
if (change != null) {
@@ -486,6 +491,7 @@ public class FetchGerritChangePage extends WizardPage {
final String uriText = uriCombo.getText();
getWizard().getContainer().run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -511,6 +517,7 @@ public class FetchGerritChangePage extends WizardPage {
}
Collections.sort(changeRefs,
new Comparator<Change>() {
+ @Override
public int compare(Change o1, Change o2) {
// change number descending
int changeDiff = o2.changeNumber
@@ -573,6 +580,7 @@ public class FetchGerritChangePage extends WizardPage {
try {
getWizard().getContainer().run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -698,6 +706,7 @@ public class FetchGerritChangePage extends WizardPage {
final Shell shell = getWizard().getContainer().getShell();
shell.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
new CheckoutConflictDialog(shell, repository,
result.getConflictList()).open();
@@ -721,6 +730,7 @@ public class FetchGerritChangePage extends WizardPage {
// do this in the UI thread as it results in a
// refresh() on the history page
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Activator
.getDefault()
@@ -741,6 +751,7 @@ public class FetchGerritChangePage extends WizardPage {
stroke.format()));
IContentProposalProvider cp = new IContentProposalProvider() {
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
List<IContentProposal> resultList = new ArrayList<IContentProposal>();
@@ -866,20 +877,24 @@ public class FetchGerritChangePage extends WizardPage {
myChange = change;
}
+ @Override
public String getContent() {
return myChange.getRefName();
}
+ @Override
public int getCursorPosition() {
return 0;
}
+ @Override
public String getDescription() {
return NLS.bind(
UIText.FetchGerritChangePage_ContentAssistDescription,
myChange.getPatchSetNumber(), myChange.getChangeNumber());
}
+ @Override
public String getLabel() {
return NLS
.bind("{0} - {1}", myChange.getChangeNumber(), myChange.getPatchSetNumber()); //$NON-NLS-1$
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java
index 3f83905c57..35469438c0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java
@@ -66,9 +66,11 @@ public class FetchResultDialog extends TitleAreaDialog {
public static void show(final Repository repository,
final FetchResult result, final String sourceString) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
PlatformUI.getWorkbench().getDisplay().asyncExec(
new Runnable() {
+ @Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
@@ -112,6 +114,7 @@ public class FetchResultDialog extends TitleAreaDialog {
if (buttonId == CONFIGURE) {
super.buttonPressed(IDialogConstants.OK_ID);
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
Dialog dlg = SimpleConfigureFetchDialog.getDialog(
PlatformUI.getWorkbench().getDisplay()
@@ -173,6 +176,7 @@ public class FetchResultDialog extends TitleAreaDialog {
this.hideConfigure = !show;
}
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
return UIUtils.getDialogBoundSettings(getClass());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultTable.java
index b050ff8b42..b796a50060 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultTable.java
@@ -74,10 +74,12 @@ class FetchResultTable {
this.update = update;
}
+ @Override
public String getLabel(Object object) {
return getStyledText(object).getString();
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
switch (update.getResult()) {
case IO_FAILURE:
@@ -136,6 +138,7 @@ class FetchResultTable {
StyledString.COUNTER_STYLER);
}
+ @Override
public Object[] getChildren(Object object) {
if (children != null)
return children;
@@ -178,6 +181,7 @@ class FetchResultTable {
return NoteMap.shortenRefName(Repository.shortenRefName(ref));
}
+ @Override
public StyledString getStyledText(Object object) {
StyledString styled = new StyledString();
final String remote = update.getRemoteName();
@@ -255,6 +259,7 @@ class FetchResultTable {
final IStyledLabelProvider styleProvider = new WorkbenchStyledLabelProvider() {
+ @Override
public StyledString getStyledText(Object element) {
// TODO Replace with use of IWorkbenchAdapter3 when is no longer
// supported
@@ -293,6 +298,7 @@ class FetchResultTable {
});
treeViewer.setSorter(new ViewerSorter() {
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof FetchResultAdapter
&& e2 instanceof FetchResultAdapter) {
@@ -328,6 +334,7 @@ class FetchResultTable {
GridDataFactory.fillDefaults().grab(true, true).applyTo(tree);
treePanel.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (reader != null)
reader.close();
@@ -336,6 +343,7 @@ class FetchResultTable {
treeViewer.setContentProvider(new WorkbenchContentProvider() {
+ @Override
public Object[] getElements(Object inputElement) {
if (inputElement == null)
return new FetchResultAdapter[0];
@@ -349,6 +357,7 @@ class FetchResultTable {
return elements;
}
+ @Override
public Object[] getChildren(Object element) {
if (element instanceof RepositoryCommit) {
return ((RepositoryCommit) element).getDiffs();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
index e1c130ce54..d177327897 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
@@ -66,6 +66,7 @@ public class FetchSourcePage extends WizardPage {
setTitle(UIText.FetchSourcePage_PageTitle);
}
+ @Override
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
main.setLayout(new GridLayout(2, false));
@@ -82,6 +83,7 @@ public class FetchSourcePage extends WizardPage {
sourceLabel.setText(UIText.FetchSourcePage_SourceLabel);
sourceText = new Text(main, SWT.BORDER);
sourceText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
checkPage();
}
@@ -89,6 +91,7 @@ public class FetchSourcePage extends WizardPage {
GridDataFactory.fillDefaults().grab(true, false).applyTo(sourceText);
UIUtils.addRefContentProposalToText(sourceText, repository,
new IRefListProvider() {
+ @Override
public List<Ref> getRefList() {
return getRemoteRefs();
}
@@ -141,6 +144,7 @@ public class FetchSourcePage extends WizardPage {
try {
new ProgressMonitorDialog(getShell()).run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -158,6 +162,7 @@ public class FetchSourcePage extends WizardPage {
proposals.add(ref);
}
Collections.sort(proposals, new Comparator<Ref>() {
+ @Override
public int compare(Ref o1, Ref o2) {
return o1.getName().compareTo(o2.getName());
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java
index 653f799642..574f331acc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java
@@ -292,6 +292,7 @@ public class SimpleConfigureFetchDialog extends TitleAreaDialog {
});
commonUriText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
deleteCommonUri
.setEnabled(commonUriText.getText().length() > 0);
@@ -415,6 +416,7 @@ public class SimpleConfigureFetchDialog extends TitleAreaDialog {
});
specViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) specViewer
.getSelection();
@@ -490,6 +492,7 @@ public class SimpleConfigureFetchDialog extends TitleAreaDialog {
try {
new ProgressMonitorDialog(getShell()).run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -505,6 +508,7 @@ public class SimpleConfigureFetchDialog extends TitleAreaDialog {
getShell().getDisplay().asyncExec(
new Runnable() {
+ @Override
public void run() {
FetchResultDialog dlg;
dlg = new FetchResultDialog(
@@ -551,6 +555,7 @@ public class SimpleConfigureFetchDialog extends TitleAreaDialog {
try {
new ProgressMonitorDialog(getShell()).run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/TrackingRefUpdateContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/TrackingRefUpdateContentProvider.java
index 02182f4078..9211f3cbaa 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/TrackingRefUpdateContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/TrackingRefUpdateContentProvider.java
@@ -24,6 +24,7 @@ import org.eclipse.jgit.transport.TrackingRefUpdate;
* @see TrackingRefUpdate
*/
class TrackingRefUpdateContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(final Object inputElement) {
if (inputElement == null)
return new TrackingRefUpdate[0];
@@ -32,10 +33,12 @@ class TrackingRefUpdateContentProvider implements IStructuredContentProvider {
return result.getTrackingRefUpdates().toArray(new TrackingRefUpdate[0]);
}
+ @Override
public void dispose() {
// nothing to do
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// nothing to do
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/gerrit/GerritConfigurationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/gerrit/GerritConfigurationPage.java
index bee1e9283b..3de5cf4e7d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/gerrit/GerritConfigurationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/gerrit/GerritConfigurationPage.java
@@ -101,6 +101,7 @@ class GerritConfigurationPage extends WizardPage {
}
+ @Override
public void createControl(Composite parent) {
final Composite panel = new Composite(parent, SWT.NULL);
final GridLayout layout = new GridLayout();
@@ -127,6 +128,7 @@ class GerritConfigurationPage extends WizardPage {
new Label(uriGroup, SWT.NULL).setText(UIText.GerritConfigurationPage_UserLabel);
user = SWTUtils.createText(uriGroup);
user.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
eventDepth++;
try {
@@ -144,6 +146,7 @@ class GerritConfigurationPage extends WizardPage {
});
uriText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
eventDepth++;
try {
@@ -165,6 +168,7 @@ class GerritConfigurationPage extends WizardPage {
scheme.add(p.getDefaultScheme());
}
scheme.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(final SelectionEvent e) {
final int idx = scheme.getSelectionIndex();
pushURI = pushURI.setScheme(scheme.getItem(idx));
@@ -194,6 +198,7 @@ class GerritConfigurationPage extends WizardPage {
branch = SWTUtils.createText(pushConfigurationGroup);
branch.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(final ModifyEvent e) {
checkPage();
}
@@ -201,6 +206,7 @@ class GerritConfigurationPage extends WizardPage {
// give focus to the branch if label is activated using the mnemonic
branchLabel.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
branch.setFocus();
branch.selectAll();
@@ -310,6 +316,7 @@ class GerritConfigurationPage extends WizardPage {
stroke.format()));
IContentProposalProvider cp = new IContentProposalProvider() {
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
List<IContentProposal> resultList = new ArrayList<IContentProposal>();
@@ -381,18 +388,22 @@ class GerritConfigurationPage extends WizardPage {
myString = string;
}
+ @Override
public String getContent() {
return myString;
}
+ @Override
public int getCursorPosition() {
return 0;
}
+ @Override
public String getDescription() {
return myString;
}
+ @Override
public String getLabel() {
return myString;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
index 6417db2f06..d7ecda44b4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
@@ -153,6 +153,7 @@ public class CommitFileDiffViewer extends TableViewer {
setLabelProvider(new FileDiffLabelProvider(dimmedForegroundRgb));
setContentProvider(new FileDiffContentProvider());
addOpenListener(new IOpenListener() {
+ @Override
public void open(final OpenEvent event) {
final ISelection s = event.getSelection();
if (s.isEmpty() || !(s instanceof IStructuredSelection))
@@ -181,6 +182,7 @@ public class CommitFileDiffViewer extends TableViewer {
});
addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateActionEnablement(event.getSelection());
}
@@ -188,6 +190,7 @@ public class CommitFileDiffViewer extends TableViewer {
clipboard = new Clipboard(rawTable.getDisplay());
rawTable.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(final DisposeEvent e) {
clipboard.dispose();
}
@@ -307,6 +310,7 @@ public class CommitFileDiffViewer extends TableViewer {
if (site instanceof IPageSite) {
final IPageSite pageSite = (IPageSite) site;
getControl().addFocusListener(new FocusListener() {
+ @Override
public void focusLost(FocusEvent e) {
pageSite.getActionBars().setGlobalActionHandler(
ActionFactory.SELECT_ALL.getId(), null);
@@ -315,6 +319,7 @@ public class CommitFileDiffViewer extends TableViewer {
pageSite.getActionBars().updateActionBars();
}
+ @Override
public void focusGained(FocusEvent e) {
updateActionEnablement(getSelection());
pageSite.getActionBars().setGlobalActionHandler(
@@ -719,6 +724,7 @@ public class CommitFileDiffViewer extends TableViewer {
if (marked) {
// Does not yet work reliably, see comment on bug 393610.
getTable().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
reveal(element);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
index 2d20960c19..89c79e9185 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
@@ -173,6 +173,7 @@ class CommitGraphTable {
rawTable.setLinesVisible(false);
rawTable.setFont(nFont);
rawTable.addListener(SWT.SetData, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (tableLoader != null) {
TableItem item = (TableItem) event.item;
@@ -193,10 +194,12 @@ class CommitGraphTable {
createPaintListener(rawTable);
table = new TableViewer(rawTable) {
+ @Override
protected Widget doFindItem(final Object element) {
return element != null ? ((SWTCommit) element).widget : null;
}
+ @Override
protected void mapElement(final Object element, final Widget item) {
((SWTCommit) element).widget = item;
}
@@ -210,6 +213,7 @@ class CommitGraphTable {
clipboard = new Clipboard(rawTable.getDisplay());
rawTable.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(final DisposeEvent e) {
clipboard.dispose();
}
@@ -220,6 +224,7 @@ class CommitGraphTable {
table.setUseHashlookup(true);
table.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection s = event.getSelection();
if (s.isEmpty() || !(s instanceof IStructuredSelection))
@@ -237,6 +242,7 @@ class CommitGraphTable {
table.getTable().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (allCommits != null)
allCommits.dispose();
@@ -256,6 +262,7 @@ class CommitGraphTable {
final IAction selectAll = createStandardAction(ActionFactory.SELECT_ALL);
getControl().addFocusListener(new FocusListener() {
+ @Override
public void focusLost(FocusEvent e) {
site.getActionBars().setGlobalActionHandler(
ActionFactory.SELECT_ALL.getId(), null);
@@ -264,6 +271,7 @@ class CommitGraphTable {
site.getActionBars().updateActionBars();
}
+ @Override
public void focusGained(FocusEvent e) {
site.getActionBars().setGlobalActionHandler(
ActionFactory.SELECT_ALL.getId(), selectAll);
@@ -274,6 +282,7 @@ class CommitGraphTable {
});
getTableView().addOpenListener(new IOpenListener() {
+ @Override
public void open(OpenEvent event) {
if (input == null || !input.isSingleFile())
return;
@@ -464,6 +473,7 @@ class CommitGraphTable {
// Tell SWT we will completely handle painting for some columns.
//
rawTable.addListener(SWT.EraseItem, new Listener() {
+ @Override
public void handleEvent(final Event event) {
if (0 <= event.index && event.index <= 5)
event.detail &= ~SWT.FOREGROUND;
@@ -471,6 +481,7 @@ class CommitGraphTable {
});
rawTable.addListener(SWT.PaintItem, new Listener() {
+ @Override
public void handleEvent(final Event event) {
doPaint(event);
}
@@ -561,6 +572,7 @@ class CommitGraphTable {
event.doit = commit.getParentCount() == 1;
}
+ @Override
public void dragSetData(DragSourceEvent event) {
boolean isFileTransfer = FileTransfer.getInstance()
.isSupportedType(event.dataType);
@@ -675,6 +687,7 @@ class CommitGraphTable {
this.input = input;
}
+ @Override
public void menuDetected(MenuDetectEvent e) {
popupMgr.removeAll();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
index ec177d1832..e71de4ab2c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
@@ -123,6 +123,7 @@ class CommitMessageViewer extends SourceViewer {
// set the cursor when hovering over a link
t.addListener(SWT.MouseMove, new Listener() {
+ @Override
public void handleEvent(final Event e) {
StyleRange styleRange = getStyleRange(e.x, e.y);
if (styleRange != null && styleRange.underline)
@@ -153,6 +154,7 @@ class CommitMessageViewer extends SourceViewer {
// react on changes in the fill and wrap preferences
listener = new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(
UIPreferences.RESOURCEHISTORY_SHOW_COMMENT_FILL)) {
@@ -197,6 +199,7 @@ class CommitMessageViewer extends SourceViewer {
};
// register and unregister the global actions upon focus events
getControl().addFocusListener(new FocusListener() {
+ @Override
public void focusLost(FocusEvent e) {
site.getActionBars().setGlobalActionHandler(
ActionFactory.SELECT_ALL.getId(), null);
@@ -205,6 +208,7 @@ class CommitMessageViewer extends SourceViewer {
site.getActionBars().updateActionBars();
}
+ @Override
public void focusGained(FocusEvent e) {
site.getActionBars().setGlobalActionHandler(
ActionFactory.SELECT_ALL.getId(), selectAll);
@@ -255,6 +259,7 @@ class CommitMessageViewer extends SourceViewer {
void addDoneListenerToFormatJob() {
formatJob.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (!event.getResult().isOK())
return;
@@ -263,6 +268,7 @@ class CommitMessageViewer extends SourceViewer {
return;
final FormatJob job = (FormatJob) event.getJob();
text.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
applyFormatJobResultInUI(job.getFormatResult());
}
@@ -314,6 +320,7 @@ class CommitMessageViewer extends SourceViewer {
refsChangedListener = db.getListenerList().addRefsChangedListener(
new RefsChangedListener() {
+ @Override
public void onRefsChanged(RefsChangedEvent event) {
allRefs = getBranches(db);
}
@@ -322,6 +329,7 @@ class CommitMessageViewer extends SourceViewer {
format();
}
+ @Override
public Object getInput() {
return commit;
}
@@ -394,6 +402,7 @@ class CommitMessageViewer extends SourceViewer {
static final class ObjectLink extends StyleRange {
RevCommit targetCommit;
+ @Override
public boolean similarTo(final StyleRange style) {
if (!(style instanceof ObjectLink))
return false;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
index 51b94185a0..36cf9680e0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
@@ -111,6 +111,7 @@ public class CommitSelectionDialog extends TitleAreaDialog {
table.setRelativeDate(GitHistoryPage.isShowingRelativeDates());
table.getTableView().addSelectionChangedListener(
new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
commitId = null;
IStructuredSelection sel = (IStructuredSelection) event
@@ -122,6 +123,7 @@ public class CommitSelectionDialog extends TitleAreaDialog {
}
});
table.getTableView().addOpenListener(new IOpenListener() {
+ @Override
public void open(OpenEvent event) {
if (getButton(OK).isEnabled())
buttonPressed(OK);
@@ -147,6 +149,7 @@ public class CommitSelectionDialog extends TitleAreaDialog {
try {
PlatformUI.getWorkbench().getProgressService().run(true, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -202,6 +205,7 @@ public class CommitSelectionDialog extends TitleAreaDialog {
}
getShell().getDisplay().asyncExec(
new Runnable() {
+ @Override
public void run() {
updateUi();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java
index 648d647ded..415b6b2818 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiff.java
@@ -59,6 +59,7 @@ public class FileDiff extends WorkbenchAdapter {
* Comparator for sorting FileDiffs based on getPath().
*/
public static final Comparator<FileDiff> PATH_COMPARATOR = new Comparator<FileDiff>() {
+ @Override
public int compare(FileDiff o1, FileDiff o2) {
return o1.getPath().compareTo(o2.getPath());
}
@@ -412,6 +413,7 @@ public class FileDiff extends WorkbenchAdapter {
|| diffEntry.getNewMode() == FileMode.GITLINK;
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
final ImageDescriptor base;
if (!isSubmodule())
@@ -433,6 +435,7 @@ public class FileDiff extends WorkbenchAdapter {
}
}
+ @Override
public String getLabel(Object object) {
return getPath();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
index 43c0a99d66..55908c9fb7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
@@ -40,6 +40,7 @@ public class FileDiffContentProvider implements IStructuredContentProvider {
private Repository repo;
+ @Override
public void inputChanged(final Viewer newViewer, final Object oldInput,
final Object newInput) {
if (newInput != null) {
@@ -67,6 +68,7 @@ public class FileDiffContentProvider implements IStructuredContentProvider {
this.diff = null;
}
+ @Override
public Object[] getElements(final Object inputElement) {
if (diff == null && walk != null && commit != null)
try {
@@ -78,6 +80,7 @@ public class FileDiffContentProvider implements IStructuredContentProvider {
return diff != null ? diff : new Object[0];
}
+ @Override
public void dispose() {
// Nothing.
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffLabelProvider.java
index 2489b4f62e..f766da16dc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffLabelProvider.java
@@ -36,10 +36,12 @@ public class FileDiffLabelProvider extends ColumnLabelProvider {
dimmedForegroundColor = resourceManager.createColor(dimmedForegroundRgb);
}
+ @Override
public String getText(final Object element) {
return ((FileDiff) element).getLabel(element);
}
+ @Override
public Image getImage(final Object element) {
final FileDiff c = (FileDiff) element;
return (Image) resourceManager.get(c.getImageDescriptor(c));
@@ -51,6 +53,7 @@ public class FileDiffLabelProvider extends ColumnLabelProvider {
super.dispose();
}
+ @Override
public Color getForeground(Object element) {
final FileDiff c = (FileDiff) element;
if (!c.isMarked(FileDiffContentProvider.INTERESTING_MARK_TREE_FILTER_INDEX))
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java
index 886bf705f3..5728627ab6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbar.java
@@ -213,6 +213,7 @@ public class FindToolbar extends Composite {
referenceItem.setImage(branchesIcon);
prefsDropDown.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (event.detail == SWT.ARROW) {
// Arrow clicked, show drop down menu
@@ -256,9 +257,11 @@ public class FindToolbar extends Composite {
progressBar.setMaximum(100);
patternField.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
final FindToolbarThread finder = createFinder();
getDisplay().timerExec(200, new Runnable() {
+ @Override
public void run() {
finder.start();
}
@@ -267,6 +270,7 @@ public class FindToolbar extends Composite {
});
final Listener findButtonsListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
if (patternField.getText().length() > 0
&& findResults.size() == 0) {
@@ -326,6 +330,7 @@ public class FindToolbar extends Composite {
});
caseItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
store.setValue(UIPreferences.FINDTOOLBAR_IGNORE_CASE,
caseItem.getSelection());
@@ -362,6 +367,7 @@ public class FindToolbar extends Composite {
private void registerDisposal() {
addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
prefsMenu.dispose();
errorBackgroundColor.dispose();
@@ -380,6 +386,7 @@ public class FindToolbar extends Composite {
private MenuItem createFindInMenuItem() {
final MenuItem menuItem = new MenuItem(prefsMenu, SWT.RADIO);
menuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
selectFindInItem(menuItem);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbarThread.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbarThread.java
index 398532bd0f..ac85984af4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbarThread.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FindToolbarThread.java
@@ -71,6 +71,7 @@ public class FindToolbarThread extends Thread {
currentThreadIx = globalThreadIx;
}
+ @Override
public void run() {
synchronized (EXEC_LOCK) {
execFind();
@@ -109,6 +110,7 @@ public class FindToolbarThread extends Thread {
if (System.currentTimeMillis() - lastUIUpdate > 500) {
final int percentage = (int) (((i + 1F) / totalRevisions) * 100);
toolbar.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (toolbar.isDisposed()) {
return;
@@ -241,6 +243,7 @@ public class FindToolbarThread extends Thread {
// Updates the toolbar with the result find info.
final boolean overflow = maxResultsOverflow;
toolbar.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (toolbar.isDisposed()) {
return;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FormatJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FormatJob.java
index 125f0cbf16..b12d38416f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FormatJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FormatJob.java
@@ -77,6 +77,7 @@ class FormatJob extends Job {
final StyleRange[] arr = new StyleRange[styles.size()];
styles.toArray(arr);
Arrays.sort(arr, new Comparator<StyleRange>() {
+ @Override
public int compare(StyleRange o1, StyleRange o2) {
return o1.start - o2.start;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
index c06fab9a25..870a5c48ad 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
@@ -188,6 +188,7 @@ class GenerateHistoryJob extends Job {
walk.close();
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
loadedCommits.dispose();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java
index 5f6218a99e..0e23668e64 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitCreatePatchWizard.java
@@ -164,6 +164,7 @@ public class GitCreatePatchWizard extends Wizard {
try {
getContainer().run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException {
try {
@@ -206,6 +207,7 @@ public class GitCreatePatchWizard extends Wizard {
private void copyToClipboard(final String content) {
getShell().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
TextTransfer plainTextTransfer = TextTransfer.getInstance();
Clipboard clipboard = new Clipboard(getShell().getDisplay());
@@ -300,6 +302,7 @@ public class GitCreatePatchWizard extends Wizard {
super(pageName, title, titleImage);
}
+ @Override
public void createControl(Composite parent) {
final Composite composite = new Composite(parent, SWT.NULL);
GridLayout gridLayout = new GridLayout(2, false);
@@ -353,6 +356,7 @@ public class GitCreatePatchWizard extends Wizard {
validatePage();
contextLines.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validatePage();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index b853344c3d..b4dad37980 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -166,6 +166,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
setChecked(historyPage.store.getBoolean(prefName));
}
+ @Override
public void run() {
historyPage.store.setValue(prefName, isChecked());
if (historyPage.store.needsSaving())
@@ -178,6 +179,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
abstract void apply(boolean value);
+ @Override
public void propertyChange(final PropertyChangeEvent event) {
if (prefName.equals(event.getProperty())) {
setChecked(historyPage.store.getBoolean(prefName));
@@ -185,6 +187,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
}
}
+ @Override
public void dispose() {
// stop listening
historyPage.store.removePropertyChangeListener(this);
@@ -316,6 +319,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
private void createFindToolbarAction() {
findAction = new Action(UIText.GitHistoryPage_FindMenuLabel,
UIIcons.ELCL16_FIND) {
+ @Override
public void run() {
historyPage.store.setValue(
UIPreferences.RESOURCEHISTORY_SHOW_FINDTOOLBAR,
@@ -441,6 +445,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showCommentAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_REV_COMMENT,
UIText.ResourceHistory_toggleRevComment) {
+ @Override
void apply(final boolean value) {
historyPage.layout();
wrapCommentAction.setEnabled(isChecked());
@@ -454,6 +459,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showFilesAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_REV_DETAIL,
UIText.ResourceHistory_toggleRevDetail) {
+ @Override
void apply(final boolean value) {
historyPage.layout();
}
@@ -465,6 +471,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showRelativeDateAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_RELATIVE_DATE,
UIText.ResourceHistory_toggleRelativeDate) {
+ @Override
void apply(boolean date) {
// nothing, just set the Preference
}
@@ -477,6 +484,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showEmailAddressesAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_EMAIL_ADDRESSES,
UIText.GitHistoryPage_toggleEmailAddresses) {
+ @Override
void apply(boolean date) {
// nothing, just set the Preference
}
@@ -489,6 +497,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showNotesAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_NOTES,
UIText.ResourceHistory_toggleShowNotes) {
+ @Override
void apply(boolean value) {
historyPage.refresh();
}
@@ -501,6 +510,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
showTagSequenceAction = new BooleanPrefAction(
UIPreferences.HISTORY_SHOW_TAG_SEQUENCE,
UIText.ResourceHistory_ShowTagSequence) {
+ @Override
void apply(boolean value) {
// nothing, just set the Preference
}
@@ -513,6 +523,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
wrapCommentAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_COMMENT_WRAP,
UIText.ResourceHistory_toggleCommentWrap) {
+ @Override
void apply(boolean wrap) {
// nothing, just set the Preference
}
@@ -525,6 +536,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
fillCommentAction = new BooleanPrefAction(
UIPreferences.RESOURCEHISTORY_SHOW_COMMENT_FILL,
UIText.ResourceHistory_toggleCommentFill) {
+ @Override
void apply(boolean fill) {
// nothing, just set the Preference
}
@@ -683,6 +695,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
// react on changes to the relative date preference
private final IPropertyChangeListener listener = new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
final String prop = event.getProperty();
if (UIPreferences.RESOURCEHISTORY_SHOW_RELATIVE_DATE.equals(prop)) {
@@ -833,6 +846,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
GridDataFactory.fillDefaults().grab(true, false).create());
commentViewer.addTextListener(new ITextListener() {
+ @Override
public void textChanged(TextEvent event) {
resizeCommentAndDiffScrolledComposite();
}
@@ -845,6 +859,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
TextSourceViewerConfiguration configuration = new TextSourceViewerConfiguration(
EditorsUI.getPreferenceStore()) {
+ @Override
public int getHyperlinkStateMask(ISourceViewer sourceViewer) {
return SWT.NONE;
}
@@ -863,6 +878,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
};
}
+ @Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
return getRegisteredHyperlinkDetectors(sourceViewer);
}
@@ -888,6 +904,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
fileViewer = new CommitFileDiffViewer(revInfoSplit, getSite());
fileViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
List<FileDiff> diffs = new ArrayList<FileDiff>();
@@ -926,6 +943,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
private void layoutSashForm(final SashForm sf, final String key) {
sf.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
final int[] w = sf.getWeights();
store.putValue(key, UIPreferences.intArrayToString(w));
@@ -992,6 +1010,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
private void attachCommitSelectionChanged() {
graph.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(final SelectionChangedEvent event) {
final ISelection s = event.getSelection();
if (s.isEmpty() || !(s instanceof IStructuredSelection)) {
@@ -1029,11 +1048,13 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
});
commentViewer
.addCommitNavigationListener(new CommitNavigationListener() {
+ @Override
public void showCommit(final RevCommit c) {
graph.selectCommit(c);
}
});
findToolbar.addSelectionListener(new Listener() {
+ @Override
public void handleEvent(Event event) {
graph.selectCommit((RevCommit) event.data);
}
@@ -1106,6 +1127,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
viewMenuMgr.add(actions.reuseCompareEditorAction);
}
+ @Override
public void dispose() {
trace = GitTraceLocation.HISTORYVIEW.isActive();
if (trace)
@@ -1177,6 +1199,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return topControl;
}
+ @Override
public void refresh() {
if (repoHasBeenRemoved(currentRepo))
clearHistoryPage();
@@ -1200,6 +1223,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return graph.getTableView();
}
+ @Override
public void onRefsChanged(final RefsChangedEvent e) {
if (input == null || e.getRepository() != input.getRepository())
return;
@@ -1210,6 +1234,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
synchronized (this) {
if (refschangedRunnable == null) {
refschangedRunnable = new Runnable() {
+ @Override
public void run() {
if (!getControl().isDisposed()) {
if (GitTraceLocation.HISTORYVIEW.isActive())
@@ -1528,6 +1553,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
GitTraceLocation.getTrace().traceEntry(
GitTraceLocation.HISTORYVIEW.getLocation(), message);
getHistoryPageSite().getShell().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (topControl.isDisposed())
return;
@@ -1547,14 +1573,17 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
GitTraceLocation.HISTORYVIEW.getLocation());
}
+ @Override
public boolean isValidInput(final Object object) {
return canShowHistoryFor(object);
}
+ @Override
public Object getAdapter(final Class adapter) {
return null;
}
+ @Override
public String getDescription() {
// this doesn't seem to be rendered anywhere, but still...
String filterHint = null;
@@ -1575,6 +1604,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return NLS.bind(DESCRIPTION_PATTERN, getName(), filterHint);
}
+ @Override
public String getName() {
return this.name;
}
@@ -1588,6 +1618,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
void setWarningTextInUIThread(final Job j) {
graph.getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (!graph.getControl().isDisposed() && job == j) {
setWarningText(UIText.GitHistoryPage_ListIncompleteWarningMessage);
@@ -1607,6 +1638,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return;
graph.getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (!graph.getControl().isDisposed() && job == j) {
graph.setInput(highlightFlag, list, asArray, input, true);
@@ -1905,6 +1937,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
final Repository repository = fileViewer.getRepository();
Job formatJob = new Job(UIText.GitHistoryPage_FormatDiffJobName) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
final IDocument document = new Document();
final DiffStyleRangeFormatter formatter = new DiffStyleRangeFormatter(
@@ -1926,6 +1959,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
}
monitor.done();
UIJob uiJob = new UIJob(UIText.GitHistoryPage_FormatDiffJobName) {
+ @Override
public IStatus runInUIThread(IProgressMonitor uiMonitor) {
if (UIUtils.isUsable(diffViewer)) {
diffViewer.setDocument(document);
@@ -2054,11 +2088,13 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return true;
}
+ @Override
public void loadItem(int item) {
if (job == null || job.loadMoreItemsThreshold() < item)
loadHistory(item, null);
}
+ @Override
public void loadCommit(RevCommit c) {
if (job == null)
return;
@@ -2184,14 +2220,17 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return Activator.getDefault().getPreferenceStore().getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_EMAIL_ADDRESSES);
}
+ @Override
public boolean contains(ISchedulingRule rule) {
return this == rule;
}
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
return this == rule;
}
+ @Override
public ShowInContext getShowInContext() {
if (fileViewer != null && fileViewer.getControl().isFocusControl())
return fileViewer.getShowInContext();
@@ -2199,6 +2238,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return null;
}
+ @Override
public String[] getShowInTargetIds() {
return new String[] { IHistoryView.VIEW_ID };
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPageSource.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPageSource.java
index 8b8504ca72..0ea3a768a1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPageSource.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPageSource.java
@@ -17,10 +17,12 @@ import org.eclipse.ui.part.Page;
* A helper class for constructing the {@link GitHistoryPage}.
*/
public class GitHistoryPageSource extends HistoryPageSource {
+ @Override
public boolean canShowHistoryFor(final Object object) {
return GitHistoryPage.canShowHistoryFor(object);
}
+ @Override
public Page createPage(final Object object) {
// don't set the input, the framework does this for us
return new GitHistoryPage();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphContentProvider.java
index 57f577ef63..401d204b38 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphContentProvider.java
@@ -14,15 +14,18 @@ import org.eclipse.jface.viewers.Viewer;
class GraphContentProvider implements IStructuredContentProvider {
private SWTCommit[] list;
+ @Override
public void inputChanged(final Viewer newViewer, final Object oldInput,
final Object newInput) {
list = (SWTCommit[]) newInput;
}
+ @Override
public Object[] getElements(final Object inputElement) {
return list;
}
+ @Override
public void dispose() {
// Nothing.
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/LocationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/LocationPage.java
index 0a54d3f983..ea00191b46 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/LocationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/LocationPage.java
@@ -103,6 +103,7 @@ public class LocationPage extends WizardPage {
//Never show closed projects
boolean showClosedProjects = false;
+ @Override
public Object[] getChildren(Object element) {
if (element instanceof IWorkspace) {
// check if closed projects should be shown
@@ -132,6 +133,7 @@ public class LocationPage extends WizardPage {
super(shell);
}
+ @Override
protected Control createContents(Composite parent) {
Control control = super.createContents(parent);
setTitle(UIText.GitCreatePatchWizard_WorkspacePatchDialogTitle);
@@ -143,6 +145,7 @@ public class LocationPage extends WizardPage {
return control;
}
+ @Override
protected Control createDialogArea(Composite parent){
Composite parentComposite = (Composite) super.createDialogArea(parent);
@@ -197,6 +200,7 @@ public class LocationPage extends WizardPage {
return parent;
}
+ @Override
protected Button createButton(Composite parent, int id,
String label, boolean defaultButton) {
Button button = super.createButton(parent, id, label,
@@ -248,6 +252,7 @@ public class LocationPage extends WizardPage {
getButton(IDialogConstants.OK_ID).setEnabled(true);
}
+ @Override
protected void okPressed() {
IFile file = wsSelectedContainer.getFile(new Path(
wsFilenameText.getText()));
@@ -267,11 +272,13 @@ public class LocationPage extends WizardPage {
return wsSelectedContainer;
}
+ @Override
protected void cancelPressed() {
validatePage();
super.cancelPressed();
}
+ @Override
public boolean close() {
if (dlgTitleImage != null)
dlgTitleImage.dispose();
@@ -281,6 +288,7 @@ public class LocationPage extends WizardPage {
void setupListeners(){
wsTreeViewer.addSelectionChangedListener(
new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection s = (IStructuredSelection)event.getSelection();
Object obj=s.getFirstElement();
@@ -297,6 +305,7 @@ public class LocationPage extends WizardPage {
wsTreeViewer.addDoubleClickListener(
new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
ISelection s= event.getSelection();
if (s instanceof IStructuredSelection) {
@@ -311,6 +320,7 @@ public class LocationPage extends WizardPage {
});
wsFilenameText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
modified = true;
validateDialog();
@@ -329,6 +339,7 @@ public class LocationPage extends WizardPage {
super(pageName, title, titleImage);
}
+ @Override
public void createControl(Composite parent) {
final Composite composite = new Composite(parent, SWT.NULL);
GridLayout gridLayout = new GridLayout();
@@ -382,6 +393,7 @@ public class LocationPage extends WizardPage {
wsBrowseButton.setEnabled(isWorkspaceSelected);
cpRadio.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
// disable other input controls
if (((Button) event.widget).getSelection()) {
@@ -397,6 +409,7 @@ public class LocationPage extends WizardPage {
fsRadio.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
// enable filesystem input controls
@@ -414,6 +427,7 @@ public class LocationPage extends WizardPage {
fsPathText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (validatePage()) {
IPath filePath= Path.fromOSString(fsPathText.getText()).removeLastSegments(1);
@@ -423,6 +437,7 @@ public class LocationPage extends WizardPage {
});
fsBrowseButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final FileDialog dialog = new FileDialog(getShell(),
SWT.PRIMARY_MODAL | SWT.SAVE);
@@ -442,6 +457,7 @@ public class LocationPage extends WizardPage {
wsRadio.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
fsPathText.setEnabled(false);
@@ -459,6 +475,7 @@ public class LocationPage extends WizardPage {
wsPathText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (validatePage()) {
IPath filePath= Path.fromOSString(wsPathText.getText()).removeLastSegments(1);
@@ -468,6 +485,7 @@ public class LocationPage extends WizardPage {
});
wsBrowseButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final WorkspaceDialog dialog = new WorkspaceDialog(getShell());
wsBrowsed = true;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RenameTracker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RenameTracker.java
index 9a6abd47ba..11089bd0f2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RenameTracker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RenameTracker.java
@@ -34,6 +34,7 @@ class RenameTracker {
private final RevFilter filter = new RevFilter() {
+ @Override
public boolean include(final RevWalk walker, final RevCommit commit)
throws IOException {
if (currentPath != null)
@@ -46,6 +47,7 @@ class RenameTracker {
return true;
}
+ @Override
public RevFilter clone() {
return null;
}
@@ -53,6 +55,7 @@ class RenameTracker {
private final RenameCallback callback = new RenameCallback() {
+ @Override
public void renamed(final DiffEntry entry) {
currentDiff = entry;
currentPath = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTCommitList.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTCommitList.java
index bde531b271..ecf26a2626 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTCommitList.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTCommitList.java
@@ -89,6 +89,7 @@ class SWTCommitList extends PlotCommitList<SWTCommitList.SWTLane> implements Dis
availableColors.add(lane.color);
}
+ @Override
public void widgetDisposed(DisposeEvent e) {
dispose();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java
index 02b027d782..f382d74637 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java
@@ -133,6 +133,7 @@ class SWTPlotRenderer extends AbstractPlotRenderer<SWTLane, Color> {
paintCommit(commit , event.height);
}
+ @Override
protected void drawLine(final Color color, final int x1, final int y1,
final int x2, final int y2, final int width) {
g.setForeground(color);
@@ -153,16 +154,19 @@ class SWTPlotRenderer extends AbstractPlotRenderer<SWTLane, Color> {
g.drawOval(dotX, dotY, dotW, dotH);
}
+ @Override
protected void drawCommitDot(final int x, final int y, final int w,
final int h) {
drawDot(commitDotOutline, commitDotFill, x, y, w, h);
}
+ @Override
protected void drawBoundaryDot(final int x, final int y, final int w,
final int h) {
drawDot(sys_gray, sys_white, x, y, w, h);
}
+ @Override
protected void drawText(final String msg, final int x, final int y) {
final Point textsz = g.textExtent(msg);
final int texty = (y - textsz.y) / 2;
@@ -291,6 +295,7 @@ class SWTPlotRenderer extends AbstractPlotRenderer<SWTLane, Color> {
return isHead;
}
+ @Override
protected Color laneColor(final SWTLane myLane) {
return myLane != null ? myLane.color : sys_black;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/AbstractRebaseHistoryCommandHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/AbstractRebaseHistoryCommandHandler.java
index 922d635803..bd2604fdf8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/AbstractRebaseHistoryCommandHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/AbstractRebaseHistoryCommandHandler.java
@@ -45,6 +45,7 @@ public abstract class AbstractRebaseHistoryCommandHandler extends
return repository.getRepositoryState().equals(RepositoryState.SAFE);
}
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
PlotCommit commit = (PlotCommit) getSelection(event).getFirstElement();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CheckoutCommitHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CheckoutCommitHandler.java
index 63398e48b8..2628f459ec 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CheckoutCommitHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CheckoutCommitHandler.java
@@ -31,6 +31,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Check out of a commit.
*/
public class CheckoutCommitHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ObjectId commitId = getSelectedCommitId(event);
Repository repo = getRepository(event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CherryPickHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CherryPickHandler.java
index 30c3f4a3a2..fdc79e8d06 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CherryPickHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CherryPickHandler.java
@@ -35,6 +35,7 @@ public class CherryPickHandler extends AbstractHistoryCommandHandler {
return repository.getRepositoryState().equals(RepositoryState.SAFE);
}
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RevCommit commit = getSelectedCommit(event);
Repository repo = getRepository(event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsHandler.java
index c550910646..d6c2003d7b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsHandler.java
@@ -29,6 +29,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Compare the file contents of two commits.
*/
public class CompareVersionsHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection selection = getSelection(event);
if (selection.size() == 2) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsInTreeHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsInTreeHandler.java
index cdd9386a7a..c8dea59dd0 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsInTreeHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareVersionsInTreeHandler.java
@@ -34,6 +34,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
public class CompareVersionsInTreeHandler extends
AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection selection = getSelection(event);
if (selection.size() == 2) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareWithWorkingTreeHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareWithWorkingTreeHandler.java
index a1f1e6ea92..3819c7977b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareWithWorkingTreeHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CompareWithWorkingTreeHandler.java
@@ -34,6 +34,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
public class CompareWithWorkingTreeHandler extends
AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection selection = getSelection(event);
if (selection.isEmpty())
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateBranchOnCommitHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateBranchOnCommitHandler.java
index 7508fb4f05..a0245d66d6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateBranchOnCommitHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateBranchOnCommitHandler.java
@@ -32,6 +32,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Create a branch based on a commit.
*/
public class CreateBranchOnCommitHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repo = getRepository(event);
IStructuredSelection selection = getSelection(event);
@@ -47,6 +48,7 @@ public class CreateBranchOnCommitHandler extends AbstractHistoryCommandHandler {
// prefer to create new branch based on a remote tracking branch
Collections.sort(branches, new Comparator<Ref>() {
+ @Override
public int compare(Ref o1, Ref o2) {
String refName1 = o1.getName();
String refName2 = o2.getName();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreatePatchHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreatePatchHandler.java
index c67a0dd465..5113783673 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreatePatchHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreatePatchHandler.java
@@ -24,6 +24,7 @@ import org.eclipse.jgit.revwalk.RevCommit;
*/
public class CreatePatchHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RevCommit> selectedCommits = getSelectedCommits(event);
RevCommit commit = selectedCommits.get(0);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateTagOnCommitHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateTagOnCommitHandler.java
index da41526c0b..0275f5e83a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateTagOnCommitHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/CreateTagOnCommitHandler.java
@@ -30,6 +30,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Create a tag based on a commit.
*/
public class CreateTagOnCommitHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ObjectId commitId = getSelectedCommitId(event);
final Repository repo = getRepository(event);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteBranchOnCommitHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteBranchOnCommitHandler.java
index 46e8ab1dec..245276bf16 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteBranchOnCommitHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteBranchOnCommitHandler.java
@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Shell;
* Delete a branch pointing to a commit.
*/
public class DeleteBranchOnCommitHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(event);
if (repository == null)
@@ -82,6 +83,7 @@ public class DeleteBranchOnCommitHandler extends AbstractHistoryCommandHandler {
try {
new ProgressMonitorDialog(shell).run(true, false,
new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
@@ -125,6 +127,7 @@ public class DeleteBranchOnCommitHandler extends AbstractHistoryCommandHandler {
try {
new ProgressMonitorDialog(shell).run(true, false,
new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteTagOnCommitHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteTagOnCommitHandler.java
index e5219b4837..636dc67e07 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteTagOnCommitHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/DeleteTagOnCommitHandler.java
@@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Shell;
*/
public class DeleteTagOnCommitHandler extends AbstractHistoryCommandHandler {
+ @Override
public Object execute(ExecutionEvent event)
throws ExecutionException {
final Repository repository = getRepository(event);
@@ -109,6 +110,7 @@ public class DeleteTagOnCommitHandler extends AbstractHistoryCommandHandler {
InterruptedException {
new ProgressMonitorDialog(shell).run(true, false,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/EditHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/EditHandler.java
index 24f5b1d143..2e82f0a589 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/EditHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/EditHandler.java
@@ -33,11 +33,13 @@ import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.progress