Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2012-12-31 23:21:03 -0500
committerIgor Fedorenko2012-12-31 23:21:03 -0500
commita8b5512972ebd9a273b8955fd1306e039428d400 (patch)
treef6cd368f8ee88082c81eb7087dcbe3bfed3997f6
parentcf04c93473bf354448dd453877b688643d4d5cf9 (diff)
downloadm2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.tar.gz
m2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.tar.xz
m2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.zip
Code format, organize imports
... also enabled automatic code format and organize imports on file save, hopefully this will help us keep formatting consistent in the future. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.core.prefs87
-rw-r--r--org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/IMavenDiscovery.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java30
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java129
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java18
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java43
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java1
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java10
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenDebugOutputAction.java10
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java69
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ModuleProjectWizardAction.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenMavenConsoleAction.java6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java40
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/PomHierarchyComposite.java9
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/ConsoleDocument.java151
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/IMavenConsoleListener.java1
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleFactory.java8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleImpl.java48
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenShowConsoleAction.java38
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AbstractMavenDialog.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/EditDependencyDialog.java114
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/InputHistory.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java24
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenMessageDialog.java19
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenPropertyDialog.java26
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java224
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateMavenProjectsDialog.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddDependencyOperation.java7
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddExclusionOperation.java11
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/ChangeCreator.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/LifecycleMappingOperation.java103
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java326
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java114
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/RemoveDependencyOperation.java12
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java11
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ILifecycleMappingLabelProvider.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/PackagingTypeMappingLabelProvider.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ProjectLifecycleMappingElement.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java20
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java188
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java40
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java61
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java81
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java154
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java26
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java49
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java96
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java63
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/UserInterfacePreferencePage.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java14
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ArtifactInfo.java46
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java1
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/IndexSearchEngine.java9
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectEvent.java92
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectListener.java32
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/SearchEngine.java17
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EErrorDialog.java70
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java30
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java14
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java47
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java173
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java37
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java43
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java11
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java7
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java29
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java7
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java17
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java6
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstactCreateMavenProjectJob.java7
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractCreateMavenProjectsOperation.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenProjectWizard.java5
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenWizardPage.java35
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/CustomArchetypeDialog.java34
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java12
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenArtifactComponent.java26
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java64
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java16
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java175
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java64
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java30
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java141
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java19
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenParentComponent.java22
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java59
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java27
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java13
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java54
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java24
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java63
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArtifactPage.java22
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardLocationPage.java50
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/ResolverConfigurationComponent.java9
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/WidthGroup.java8
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/WorkingSetGroup.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/WorkingSetHelper.java2
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.jdt.core.prefs22
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/AbstractMavenConfigurationChangeListener.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java80
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRef.java12
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRepositoryRef.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMaven.java32
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfigurationChangeListener.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenLauncherConfiguration.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISettingsChangeListener.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenConfigurationChangeEvent.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java13
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntime.java15
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java15
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/M2EUtils.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/NoSuchComponentException.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java22
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java83
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/AbstractEclipseBuildContext.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/BuildProblemInfo.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ChangedFileOutputStream.java30
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/DeltaProvider.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseIncrementalBuildContext.java32
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/InternalBuildParticipant.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java12
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java13
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomFileContentDescriber.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomHandler.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/TextContentDescriber.java28
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/XMLContentDescriber.java59
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractTransferListenerAdapter.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLogger.java60
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java68
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java94
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java39
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexListener.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifactFile.java16
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/ArtifactScanningMonitor.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/AsyncFetcher.java18
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/CompositeIndex.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/EquinoxLock.java21
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/EquinoxLocker.java23
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/IndexUpdaterJob.java14
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/IndexedArtifactGroup.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/IndexesExtensionReader.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/IndexingTransferListener.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/jobs/IBackgroundProcessingQueue.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/DefaultLifecycleMapping.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/DuplicateMappingException.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingConfigurationException.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingLifecycleExtensionPoint.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/IMavenDiscoveryProposal.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/LifecycleMappingConfiguration.java67
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/PackagingTypeMappingConfiguration.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/IEditorMarkerService.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/IMarkerLocationService.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/IMavenMarkerManager.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MarkerUtils.java14
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java23
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocation.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java33
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipseMavenMetadataCache.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IManagedCache.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenProjectImportResult.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java219
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/conversion/ProjectConversionManager.java37
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/AbstractMavenDependencyResolver.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ILifecycleMapping2.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/IProjectRegistry.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java51
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java133
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java33
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/StaleMutableProjectRegistryException.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryDiscoverer.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryIndexer.java13
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java27
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java57
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistryUpdateJob.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/lifecyclemapping/model/IPluginExecutionMetadata.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/lifecyclemapping/model/PluginExecutionAction.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/AbstractProjectScanner.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectChangedListener.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectFacade.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectImportResult.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IProjectConfigurationManager.java18
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java20
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectChangedEvent.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java44
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java14
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java30
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ILifecycleMappingConfiguration.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/conversion/AbstractProjectConversionParticipant.java40
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/conversion/IProjectConversionManager.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepository.java34
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepositoryRegistry.java13
-rw-r--r--org.eclipse.m2e.discovery/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--org.eclipse.m2e.discovery/.settings/org.eclipse.jdt.ui.prefs64
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/DiscoveryActivator.java6
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/InstallCatalogItemMappingLabelProvider.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/InstallCatalogItemMavenDiscoveryProposal.java1
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java33
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryIcons.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryLauncher.java4
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java25
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java1
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/handlers/MavenDiscoveryHandler.java3
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java30
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java7
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/MavenDiscoveryInstallOperation.java11
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/operation/RestartInstallOperation.java4
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java5
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/startup/UpdateConfigurationStartup.java11
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/strategy/M2EConnectorDiscoveryExtensionReader.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/strategy/M2ERemoteBundleDiscoveryStrategy.java5
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogConfiguration.java1
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogPage.java3
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenCatalogViewer.java8
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryInstallWizard.java3
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryUi.java40
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/wizards/MavenDiscoveryWizard.java3
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.core.prefs124
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.ui.prefs65
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java251
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java34
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java55
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java3
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java273
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java137
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java460
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java5
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java827
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomStructuredTextViewConfiguration.java8
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java313
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java19
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTextHover.java89
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java36
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/FormHoverProvider.java122
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java729
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java252
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/NodeOperation.java6
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModel.java2
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModelFactory.java10
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java123
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/dialogs/SelectSPDXLicenseDialog.java4
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingDialog.java8
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java36
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/WorkspaceLifecycleMappingProposal.java4
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/preferences/PomTemplatesPreferencePage.java1
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.jdt.core.prefs78
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.jdt.ui.prefs67
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorImages.java79
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorPlugin.java14
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComparator.java35
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java337
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java128
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java31
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java15
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/SectionExpansionAdapter.java8
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/StringLabelProvider.java3
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java146
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/MavenModuleSelectionDialog.java5
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/Messages.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/ShowDependencyHierarchyAction.java11
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java34
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java114
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ElementValueProvider.java19
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/FormUtils.java78
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/Matcher.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java414
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorContributor.java28
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java292
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPageFactory.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java291
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java102
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ScopeArtifactFilter.java8
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java15
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchMatcher.java3
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ValueProvider.java4
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.core.prefs28
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/AbstractJavaProjectConfigurator.java94
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathDescriptor.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathEntryDescriptor.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManagerDelegate.java1
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IJavaProjectConfigurator.java3
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java6
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java64
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java6
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java15
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java104
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JarLifecycleMapping.java1
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java14
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConversionParticipant.java169
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainer.java16
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java3
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerSaveHelper.java48
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathVariableInitializer.java4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java9
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/Messages.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/DownloadSourcesAction.java16
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java28
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java43
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java92
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenSourcePathProvider.java4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenClasspathContainerPage.java5
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java6
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.jdt.ui.prefs65
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java49
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/MavenLaunchConstants.java78
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java11
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java74
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java8
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java8
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchPlugin.java3
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java17
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLauncherConfigurationHandler.java22
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java58
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchConfigurationTabGroup.java1
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchExtensionsTab.java7
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java153
-rw-r--r--org.eclipse.m2e.logback.appender/.settings/org.eclipse.jdt.core.prefs23
-rw-r--r--org.eclipse.m2e.logback.appender/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.logback.appender/src/main/java/org/eclipse/m2e/logback/appender/ConsoleAppenderFilter.java1
-rw-r--r--org.eclipse.m2e.logback.appender/src/main/java/org/eclipse/m2e/logback/appender/MavenConsoleAppenderImpl.java2
-rw-r--r--org.eclipse.m2e.logback.configuration/.settings/org.eclipse.jdt.core.prefs23
-rw-r--r--org.eclipse.m2e.logback.configuration/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.logback.configuration/src/org/eclipse/m2e/logback/configuration/LogPlugin.java2
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.core.prefs81
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.ui.prefs65
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Activation.java494
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationFile.java118
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationOS.java215
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationProperty.java115
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Build.java395
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/BuildBase.java562
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/CiManagement.java188
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Configuration.java8
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Contributor.java459
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Dependency.java656
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DependencyManagement.java99
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DeploymentRepository.java416
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Developer.java501
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DistributionManagement.java580
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DocumentRoot.java177
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Exclusion.java106
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Extension.java156
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/IssueManagement.java110
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/License.java217
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/MailingList.java381
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Model.java2520
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Notifier.java676
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Organization.java99
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Parent.java218
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Plugin.java575
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginExecution.java300
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginManagement.java44
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomFactory.java699
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomPackage.java13952
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Prerequisites.java113
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Profile.java1056
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PropertyElement.java112
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Relocation.java209
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportPlugin.java426
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportSet.java251
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Reporting.java249
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Repository.java484
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/RepositoryPolicy.java228
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Resource.java311
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Scm.java272
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Site.java158
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationFileImpl.java391
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationImpl.java1352
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationOSImpl.java564
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationPropertyImpl.java393
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildBaseImpl.java1248
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildImpl.java895
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/CiManagementImpl.java492
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ConfigurationImpl.java184
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ContributorImpl.java1097
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyImpl.java1357
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyManagementImpl.java289
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeploymentRepositoryImpl.java878
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeveloperImpl.java1205
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DistributionManagementImpl.java1618
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DocumentRootImpl.java491
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExclusionImpl.java392
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExtensionImpl.java465
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/IssueManagementImpl.java389
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/LicenseImpl.java566
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/MailingListImpl.java841
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ModelImpl.java5254
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/NotifierImpl.java1370
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/OrganizationImpl.java387
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ParentImpl.java570
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginExecutionImpl.java785
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginImpl.java1269
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginManagementImpl.java246
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomFactoryImpl.java1106
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomPackageImpl.java8365
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PrerequisitesImpl.java356
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ProfileImpl.java2266
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PropertyElementImpl.java390
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RelocationImpl.java568
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportPluginImpl.java968
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportSetImpl.java669
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportingImpl.java618
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryImpl.java1284
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryPolicyImpl.java547
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ResourceImpl.java730
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ScmImpl.java681
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/SiteImpl.java448
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationFileItemProvider.java262
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationItemProvider.java361
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationOSItemProvider.java332
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationPropertyItemProvider.java260
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildBaseItemProvider.java466
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildItemProvider.java432
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/CiManagementItemProvider.java342
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ConfigurationItemProvider.java155
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ContributorItemProvider.java461
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyItemProvider.java516
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyManagementItemProvider.java258
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeploymentRepositoryItemProvider.java372
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeveloperItemProvider.java483
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DistributionManagementItemProvider.java425
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DocumentRootItemProvider.java259
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExclusionItemProvider.java256
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExtensionItemProvider.java291
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/IssueManagementItemProvider.java259
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/LicenseItemProvider.java328
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/MailingListItemProvider.java451
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ModelItemProvider.java831
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/NotifierItemProvider.java447
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/OrganizationItemProvider.java262
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ParentItemProvider.java325
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginExecutionItemProvider.java410
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginItemProvider.java445
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginManagementItemProvider.java258
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomEditPlugin.java124
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomItemProviderAdapterFactory.java2318
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PrerequisitesItemProvider.java222
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ProfileItemProvider.java485
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PropertyElementItemProvider.java262
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RelocationItemProvider.java336
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportPluginItemProvider.java450
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportSetItemProvider.java369
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportingItemProvider.java337
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryItemProvider.java465
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryPolicyItemProvider.java299
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ResourceItemProvider.java382
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ScmItemProvider.java324
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/SiteItemProvider.java286
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ConfigurationAdapter.java66
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ListAdapter.java377
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ModelObjectAdapter.java547
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/PropertiesAdapter.java401
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/SSESyncResource.java122
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/TranslatorAdapter.java671
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ValueUpdateAdapter.java245
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomAdapterFactory.java1695
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceFactoryImpl.java24
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceImpl.java41
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomSwitch.java1933
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomXMLProcessor.java58
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.core.prefs78
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.ui.prefs63
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java24
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java34
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/Messages.java1
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomVisitor.java2
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java50
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java35
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetRefactoring.java22
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/MavenDependencySetWizard.java1
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java25
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java46
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeWizardPage.java16
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/MavenExcludeWizard.java1
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/Activator.java80
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java23
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/SaveDirtyFilesDialog.java81
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizard.java1
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java22
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactHandler.java28
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameRefactoring.java113
-rw-r--r--org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs120
-rw-r--r--org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs67
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java27
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java86
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java21
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java9
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java25
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java4
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java16
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java21
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java6
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java140
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java47
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java63
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java68
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java36
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java21
-rw-r--r--org.eclipse.m2e.tests.common/.settings/org.eclipse.jdt.core.prefs37
-rw-r--r--org.eclipse.m2e.tests.common/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java4
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractMavenProjectTestCase.java76
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttpServer.java20
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/JobHelpers.java18
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java13
544 files changed, 54882 insertions, 57573 deletions
diff --git a/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.core.prefs
index d31c5d0e..80d9c54b 100644
--- a/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,22 @@
-#Sat Jul 30 19:01:59 MSD 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -7,78 +24,91 @@ org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
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=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+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.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
@@ -96,12 +126,14 @@ org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
@@ -139,11 +171,12 @@ org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not inse
org.eclipse.jdt.core.formatter.comment.line_length=120
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=
-org.eclipse.jdt.core.formatter.enabling_tag=
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
@@ -230,12 +263,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -259,6 +294,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
@@ -314,6 +350,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -323,6 +360,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -349,4 +387,7 @@ org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.ui.prefs
index 64b10b1b..595d9975 100644
--- a/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.ui.prefs
+++ b/org.eclipse.m2e.core.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -1,6 +1,7 @@
eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_m2 plugin
-formatter_settings_version=11
+formatter_settings_version=12
org.eclipse.jdt.ui.exception.name=ex
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
@@ -10,4 +11,56 @@ org.eclipse.jdt.ui.keywordthis=true
org.eclipse.jdt.ui.ondemandthreshold=99
org.eclipse.jdt.ui.overrideannotation=false
org.eclipse.jdt.ui.staticondemandthreshold=99
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return Returns the ${bare_field_name}.\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} The ${bare_field_name} to set.\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\r\n * Copyright (c) 2010 Sonatype, Inc.&\#13;\r\n * All rights reserved. This program and the accompanying materials&\#13;\r\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\r\n * which accompanies this distribution, and is available at&\#13;\r\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\r\n *&\#13;\r\n * Contributors\:&\#13;\r\n * Sonatype, Inc. - initial API and implementation&\#13;\r\n *******************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${type_name}\r\n *\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\n * Copyright (c) 2010 Sonatype, Inc.&\#13;\n * All rights reserved. This program and the accompanying materials&\#13;\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\n * which accompanies this distribution, and is available at&\#13;\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\n *&\#13;\n * Contributors\:&\#13;\n * Sonatype, Inc. - initial API and implementation&\#13;\n *******************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${type_name}\n *\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/IMavenDiscovery.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/IMavenDiscovery.java
index 9ce145f9..3f3d861c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/IMavenDiscovery.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/IMavenDiscovery.java
@@ -8,10 +8,12 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
+
package org.eclipse.m2e.core.ui.internal;
import org.eclipse.swt.widgets.Shell;
+
public interface IMavenDiscovery {
public void launch(Shell shell);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
index 3118f996..8741f64f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/M2EUIPluginActivator.java
@@ -125,7 +125,7 @@ public class M2EUIPluginActivator extends AbstractUIPlugin {
*/
public void ungetMavenDiscovery(IMavenDiscovery discovery) {
// TODO Auto-generated method ungetMavenDiscovery
-
+
}
/**
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
index 19ace897..3e0c8f6b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
@@ -23,13 +23,15 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.swt.graphics.Image;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+
/**
* @author Eugene Kuleshov
@@ -46,17 +48,17 @@ public class MavenVersionDecorator implements ILabelDecorator {
if(element instanceof IResource) {
IResource resource = (IResource) element;
IProject project = resource.getProject();
- if(project!=null) {
+ if(project != null) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade facade = projectManager.create(project, new NullProgressMonitor());
- if(facade!=null) {
+ if(facade != null) {
ArtifactKey mavenProject = facade.getArtifactKey();
- if(mavenProject!=null) {
+ if(mavenProject != null) {
String name = resource.getName();
int start = text.indexOf(name);
- if(start>-1) {
+ if(start > -1) {
int n = text.indexOf(' ', start + name.length());
- if(n>-1) {
+ if(n > -1) {
return text.substring(0, n) + " " + mavenProject.getVersion() + text.substring(n); //$NON-NLS-1$
}
}
@@ -78,10 +80,10 @@ public class MavenVersionDecorator implements ILabelDecorator {
ArrayList<IResource> pomList = new ArrayList<IResource>();
for(int i = 0; i < events.length; i++ ) {
// pomList.add(events[i].getSource());
- if(events[i]!=null && events[i].getMavenProject()!=null) {
+ if(events[i] != null && events[i].getMavenProject() != null) {
IFile pom = events[i].getMavenProject().getPom();
pomList.add(pom);
- if(pom.getParent().getType()==IResource.PROJECT) {
+ if(pom.getParent().getType() == IResource.PROJECT) {
pomList.add(pom.getParent());
}
}
@@ -89,16 +91,16 @@ public class MavenVersionDecorator implements ILabelDecorator {
listener.labelProviderChanged(new LabelProviderChangedEvent(MavenVersionDecorator.this, pomList.toArray()));
}
};
-
+
listeners.put(listener, projectChangeListener);
-
+
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.addMavenProjectChangedListener(projectChangeListener);
}
-
+
public void removeListener(ILabelProviderListener listener) {
IMavenProjectChangedListener projectChangeListener = listeners.get(listener);
- if(projectChangeListener!=null) {
+ if(projectChangeListener != null) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
projectManager.removeMavenProjectChangedListener(projectChangeListener);
}
@@ -107,5 +109,5 @@ public class MavenVersionDecorator implements ILabelDecorator {
public void dispose() {
// TODO remove all listeners
}
-
+
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
index a4d05d97..750f056c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddDependencyAction.java
@@ -58,79 +58,80 @@ import org.eclipse.m2e.core.ui.internal.editing.PomHelper;
public class AddDependencyAction extends MavenActionSupport implements IWorkbenchWindowActionDelegate {
private static final Logger log = LoggerFactory.getLogger(AddDependencyAction.class);
- public static final String ID = "org.eclipse.m2e.addDependencyAction"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.m2e.addDependencyAction"; //$NON-NLS-1$
- public void run(IAction action) {
- IFile file = getPomFileFromPomEditorOrViewSelection();
+ public void run(IAction action) {
+ IFile file = getPomFileFromPomEditorOrViewSelection();
- if(file == null) {
- return;
+ if(file == null) {
+ return;
+ }
+
+ MavenProject mp = null;
+ IProject prj = file.getProject();
+ if(prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
+ if(facade != null) {
+ mp = facade.getMavenProject();
}
+ }
- MavenProject mp = null;
- IProject prj = file.getProject();
- if (prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
- IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
- if (facade != null) {
- mp = facade.getMavenProject();
+ MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchDependencyDialog(getShell(),
+ Messages.AddDependencyAction_searchDialog_title, mp, prj, false);
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
+ if(indexedArtifactFile != null) {
+ try {
+ final Dependency dependency = indexedArtifactFile.getDependency();
+ String selectedScope = dialog.getSelectedScope();
+ dependency.setScope(selectedScope);
+
+ if(indexedArtifactFile.version == null) {
+ dependency.setVersion(null);
}
- }
-
- MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchDependencyDialog(getShell(), Messages.AddDependencyAction_searchDialog_title, mp, prj, false);
- if(dialog.open() == Window.OK) {
- IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
- if(indexedArtifactFile != null) {
- try {
- final Dependency dependency = indexedArtifactFile.getDependency();
- String selectedScope = dialog.getSelectedScope();
- dependency.setScope(selectedScope);
-
- if (indexedArtifactFile.version == null) {
- dependency.setVersion(null);
- }
- performOnDOMDocument(new OperationTuple(file, new Operation() {
- public void process(Document document) {
- Element depsEl = getChild(document.getDocumentElement(), DEPENDENCIES);
- Element dep = findChild(depsEl, DEPENDENCY,
- childEquals(GROUP_ID, dependency.getGroupId()),
- childEquals(ARTIFACT_ID, dependency.getArtifactId()));
- if (dep == null) {
- dep = PomHelper.createDependency(depsEl, dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion());
- } else {
- //only set version if already exists
- if (dependency.getVersion() != null) {
- setText(getChild(dep, VERSION), dependency.getVersion());
- }
+ performOnDOMDocument(new OperationTuple(file, new Operation() {
+ public void process(Document document) {
+ Element depsEl = getChild(document.getDocumentElement(), DEPENDENCIES);
+ Element dep = findChild(depsEl, DEPENDENCY, childEquals(GROUP_ID, dependency.getGroupId()),
+ childEquals(ARTIFACT_ID, dependency.getArtifactId()));
+ if(dep == null) {
+ dep = PomHelper.createDependency(depsEl, dependency.getGroupId(), dependency.getArtifactId(),
+ dependency.getVersion());
+ } else {
+ //only set version if already exists
+ if(dependency.getVersion() != null) {
+ setText(getChild(dep, VERSION), dependency.getVersion());
}
- if (dependency.getType() != null //
- && !"jar".equals(dependency.getType()) // //$NON-NLS-1$
- && !"null".equals(dependency.getType())) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
-
- setText(getChild(dep, TYPE), dependency.getType());
- }
-
- if (dependency.getClassifier() != null) {
- setText(getChild(dep, CLASSIFIER), dependency.getClassifier());
- }
-
- if(dependency.getScope() != null && !"compile".equals(dependency.getScope())) { //$NON-NLS-1$
- setText(getChild(dep, SCOPE), dependency.getScope());
- }
-
}
- }));
- } catch(Exception ex) {
- String msg = NLS.bind(Messages.AddDependencyAction_error_msg, file);
- log.error(msg, ex);
- MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.AddDependencyAction_error_title, msg);
- }
+ if(dependency.getType() != null //
+ && !"jar".equals(dependency.getType()) // //$NON-NLS-1$
+ && !"null".equals(dependency.getType())) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
+
+ setText(getChild(dep, TYPE), dependency.getType());
+ }
+
+ if(dependency.getClassifier() != null) {
+ setText(getChild(dep, CLASSIFIER), dependency.getClassifier());
+ }
+
+ if(dependency.getScope() != null && !"compile".equals(dependency.getScope())) { //$NON-NLS-1$
+ setText(getChild(dep, SCOPE), dependency.getScope());
+ }
+
+ }
+ }));
+ } catch(Exception ex) {
+ String msg = NLS.bind(Messages.AddDependencyAction_error_msg, file);
+ log.error(msg, ex);
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.AddDependencyAction_error_title, msg);
}
}
}
-
- public void dispose() {
- }
+ }
- public void init(IWorkbenchWindow window) {
- }
+ public void dispose() {
+ }
+
+ public void init(IWorkbenchWindow window) {
}
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
index 789b9b9f..5c4bf69d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/AddPluginAction.java
@@ -55,16 +55,15 @@ public class AddPluginAction extends MavenActionSupport implements IWorkbenchWin
}
MavenProject mp = null;
IProject prj = file.getProject();
- if (prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
- IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
- if (facade != null) {
- mp = facade.getMavenProject();
- }
+ if(prj != null && IMavenConstants.POM_FILE_NAME.equals(file.getProjectRelativePath().toString())) {
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(prj);
+ if(facade != null) {
+ mp = facade.getMavenProject();
+ }
}
-
- MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchPluginDialog(getShell(), Messages.AddPluginAction_searchDialog_title,
- mp, prj, false);
+ MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchPluginDialog(getShell(),
+ Messages.AddPluginAction_searchDialog_title, mp, prj, false);
if(dialog.open() == Window.OK) {
final IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
if(indexedArtifactFile != null) {
@@ -72,7 +71,8 @@ public class AddPluginAction extends MavenActionSupport implements IWorkbenchWin
performOnDOMDocument(new OperationTuple(file, new Operation() {
public void process(Document document) {
Element pluginsEl = getChild(document.getDocumentElement(), BUILD, PLUGINS);
- PomHelper.createPlugin(pluginsEl, indexedArtifactFile.group, indexedArtifactFile.artifact, indexedArtifactFile.version);
+ PomHelper.createPlugin(pluginsEl, indexedArtifactFile.group, indexedArtifactFile.artifact,
+ indexedArtifactFile.version);
}
}));
} catch(Exception ex) {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
index e68c34f9..b5902444 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ChangeNatureAction.java
@@ -45,21 +45,21 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExtension {
public static final String ID_ENABLE_WORKSPACE = "org.eclipse.m2e.enableWorkspaceResolutionAction"; //$NON-NLS-1$
-
+
public static final String ID_DISABLE_WORKSPACE = "org.eclipse.m2e.disableWorkspaceResolutionAction"; //$NON-NLS-1$
public static final int ENABLE_WORKSPACE = 1;
public static final int DISABLE_WORKSPACE = 2;
-
+
private ISelection selection;
-
+
private int option;
-
+
public ChangeNatureAction() {
this(ENABLE_WORKSPACE);
}
-
+
public ChangeNatureAction(int option) {
this.option = option;
}
@@ -68,16 +68,16 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
* @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
*/
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
- if (data != null) {
- if ("enableWorkspaceResolution".equals(data)) {//$NON-NLS-1$
+ if(data != null) {
+ if("enableWorkspaceResolution".equals(data)) {//$NON-NLS-1$
option = ENABLE_WORKSPACE;
}
- if ("disableWorkspaceResolution".equals(data)) {//$NON-NLS-1$
+ if("disableWorkspaceResolution".equals(data)) {//$NON-NLS-1$
option = DISABLE_WORKSPACE;
}
}
}
-
+
public void selectionChanged(IAction action, ISelection selection) {
this.selection = selection;
}
@@ -108,10 +108,13 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
static class UpdateJob extends WorkspaceJob {
private final Set<IProject> projects;
+
private final int option;
private final IProjectConfigurationManager importManager;
+
private final IMavenProjectRegistry projectManager;
+
private final IMavenConfiguration mavenConfiguration;
public UpdateJob(Set<IProject> projects, int option) {
@@ -121,14 +124,14 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
this.importManager = MavenPlugin.getProjectConfigurationManager();
this.projectManager = MavenPlugin.getMavenProjectRegistry();
-
+
this.mavenConfiguration = MavenPlugin.getMavenConfiguration();
}
-
+
public IStatus runInWorkspace(IProgressMonitor monitor) {
MultiStatus status = null;
for(IProject project : projects) {
- if (monitor.isCanceled()) {
+ if(monitor.isCanceled()) {
throw new OperationCanceledException();
}
@@ -136,9 +139,10 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
try {
changeNature(project, monitor);
- } catch (CoreException ex) {
- if (status == null) {
- status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, Messages.ChangeNatureAction_status_error, null);
+ } catch(CoreException ex) {
+ if(status == null) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR,
+ Messages.ChangeNatureAction_status_error, null);
}
status.add(ex.getStatus());
}
@@ -148,13 +152,13 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
boolean updateSnapshots = false;
projectManager.refresh(new MavenUpdateRequest(projects.toArray(new IProject[projects.size()]), //
offline, updateSnapshots));
-
- return status != null? status: Status.OK_STATUS;
+
+ return status != null ? status : Status.OK_STATUS;
}
private void changeNature(final IProject project, IProgressMonitor monitor) throws CoreException {
IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
-
+
final ResolverConfiguration configuration = configurationManager.getResolverConfiguration(project);
boolean updateSourceFolders = false;
@@ -170,11 +174,10 @@ public class ChangeNatureAction implements IObjectActionDelegate, IExecutableExt
configurationManager.setResolverConfiguration(project, configuration);
- if (updateSourceFolders) {
+ if(updateSourceFolders) {
importManager.updateProjectConfiguration(project, monitor);
}
}
}
-
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
index 9aa626af..368d27a1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/DisableNatureAction.java
@@ -31,6 +31,7 @@ import org.eclipse.m2e.core.MavenPlugin;
public class DisableNatureAction implements IObjectActionDelegate {
private static final Logger log = LoggerFactory.getLogger(DisableNatureAction.class);
+
public static final String ID = "org.eclipse.m2e.disableAction"; //$NON-NLS-1$
private ISelection selection;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
index 7be7e4e2..965dfdf1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/EnableNatureAction.java
@@ -13,6 +13,9 @@ package org.eclipse.m2e.core.ui.internal.actions;
import java.util.Iterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -21,7 +24,6 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
@@ -29,6 +31,12 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.project.IProjectConfigurationManager;
@@ -37,14 +45,6 @@ import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.wizards.MavenPomWizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
public class EnableNatureAction implements IObjectActionDelegate, IExecutableExtension {
private static final Logger log = LoggerFactory.getLogger(EnableNatureAction.class);
@@ -101,13 +101,13 @@ public class EnableNatureAction implements IObjectActionDelegate, IExecutableExt
final M2EUIPluginActivator plugin = M2EUIPluginActivator.getDefault();
IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME);
if(!pom.exists()) {
- if (isSingle) {
+ if(isSingle) {
// XXX move into AbstractProjectConfigurator and use Eclipse project settings
IWorkbench workbench = plugin.getWorkbench();
-
+
MavenPomWizard wizard = new MavenPomWizard();
wizard.init(workbench, (IStructuredSelection) selection);
-
+
Shell shell = workbench.getActiveWorkbenchWindow().getShell();
WizardDialog wizardDialog = new WizardDialog(shell, wizard);
wizardDialog.create();
@@ -118,7 +118,8 @@ public class EnableNatureAction implements IObjectActionDelegate, IExecutableExt
} else {
//if we have multiple selection and this project has no pom, just skip it.
// do not enable maven nature for projects without pom.
- log.warn(NLS.bind("Skipping project {0}, no pom.xml file present, no reason to have maven nature enabled", project.getName())); //$NON-NLS-1$
+ log.warn(NLS.bind(
+ "Skipping project {0}, no pom.xml file present, no reason to have maven nature enabled", project.getName())); //$NON-NLS-1$
return;
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
index 10c4c385..29868768 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenActionSupport.java
@@ -43,13 +43,13 @@ import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
/**
- *
* MavenActionSupport
- *
+ *
* @author Jason van Zyl
*/
public abstract class MavenActionSupport implements IObjectActionDelegate {
private static final Logger log = LoggerFactory.getLogger(MavenActionSupport.class);
+
protected IStructuredSelection selection;
protected IWorkbenchPart targetPart;
@@ -100,7 +100,7 @@ public abstract class MavenActionSupport implements IObjectActionDelegate {
}
protected IFile getPomFileFromPomEditorOrViewSelection() {
- IFile file = null;
+ IFile file = null;
//350136 we need to process the selection first! that's what is relevant for any popup menu action we have.
//the processing of active editor first might have been only relevant when we had the actions in main menu, but even
@@ -111,8 +111,8 @@ public abstract class MavenActionSupport implements IObjectActionDelegate {
file = ((IProject) o).getFile(IMavenConstants.POM_FILE_NAME);
} else if(o instanceof IFile) {
file = (IFile) o;
- }
- if (file != null) {
+ }
+ if(file != null) {
return file;
}
//
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenDebugOutputAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenDebugOutputAction.java
index f02fcd62..ecdcc273 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenDebugOutputAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenDebugOutputAction.java
@@ -15,10 +15,11 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.m2e.core.ui.internal.Messages;
+
import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -37,7 +38,7 @@ public class MavenDebugOutputAction extends Action {
public MavenDebugOutputAction() {
setToolTipText(Messages.MavenDebugOutputAction_0);
setImageDescriptor(MavenImages.DEBUG);
-
+
getPreferenceStore().addPropertyChangeListener(listener);
setChecked(isDebug());
}
@@ -45,7 +46,7 @@ public class MavenDebugOutputAction extends Action {
public void run() {
getPreferenceStore().setValue(MavenPreferenceConstants.P_DEBUG_OUTPUT, isChecked());
}
-
+
public void dispose() {
getPreferenceStore().removePropertyChangeListener(listener);
}
@@ -57,6 +58,5 @@ public class MavenDebugOutputAction extends Action {
boolean isDebug() {
return getPreferenceStore().getBoolean(MavenPreferenceConstants.P_DEBUG_OUTPUT);
}
-
-}
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
index f059183d..086033b1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
@@ -28,87 +28,93 @@ import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.project.MavenProjectUtils;
import org.eclipse.m2e.core.project.ResolverConfiguration;
+
/**
- * Helper IPropertyTester implementation to check if receiver can be launched with Maven.
- * E.g. it is pom.xml file of folder or project that has pom.xml.
- *
+ * Helper IPropertyTester implementation to check if receiver can be launched with Maven. E.g. it is pom.xml file of
+ * folder or project that has pom.xml.
+ *
* @author Eugene Kuleshov
*/
public class MavenPropertyTester extends PropertyTester {
-
private static final String IS_DIRECT_DEPENDENCY_TREE_NODE = "isDirectDependencyTreeNode"; //$NON-NLS-1$
+
private static final String IS_TRANSITIVE_DEPENDENCY_TREE_NODE = "isTransitiveDependencyTreeNode"; //$NON-NLS-1$
+
private static final String HAS_PROJECT_ARTIFACT_KEY = "hasProjectArtifactKey"; //$NON-NLS-1$
+
private static final String HAS_ARTIFACT_KEY = "hasArtifactKey"; //$NON-NLS-1$
+
private static final String WORKSPACE_RESULUTION_ENABLE = "workspaceResulutionEnable"; //$NON-NLS-1$
+
private static final String IS_BUILD_DIRECTORY = "isBuildDirectory"; //$NON-NLS-1$
+
private static final String DEFAULT_BUILD_DIR = "target"; //$NON-NLS-1$
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (WORKSPACE_RESULUTION_ENABLE.equals(property)) {
+ if(WORKSPACE_RESULUTION_ENABLE.equals(property)) {
boolean enableWorkspaceResolution = true;
IAdaptable adaptable = (IAdaptable) receiver;
-
+
IProject projectAdapter = (IProject) adaptable.getAdapter(IProject.class);
- if(projectAdapter!=null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
- IMavenProjectFacade projectFacade = projectManager.create(projectAdapter, new NullProgressMonitor());
- if(projectFacade != null) {
- ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
- return !configuration.shouldResolveWorkspaceProjects();
- }
+ if(projectAdapter != null) {
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
+ IMavenProjectFacade projectFacade = projectManager.create(projectAdapter, new NullProgressMonitor());
+ if(projectFacade != null) {
+ ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
+ return !configuration.shouldResolveWorkspaceProjects();
+ }
}
return enableWorkspaceResolution;
}
-
- if (HAS_ARTIFACT_KEY.equals(property)) {
+
+ if(HAS_ARTIFACT_KEY.equals(property)) {
ArtifactKey ak = SelectionUtil.getType(receiver, ArtifactKey.class);
return ak != null;
}
-
- if (HAS_PROJECT_ARTIFACT_KEY.equals(property)) {
+
+ if(HAS_PROJECT_ARTIFACT_KEY.equals(property)) {
ArtifactKey key = SelectionUtil.getType(receiver, ArtifactKey.class);
if(key != null) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade mavenProject = null;
mavenProject = projectManager.getMavenProject( //
key.getGroupId(), key.getArtifactId(), key.getVersion());
- return mavenProject != null;
+ return mavenProject != null;
}
}
-
- if (IS_TRANSITIVE_DEPENDENCY_TREE_NODE.equals(property)) {
- if (receiver instanceof DependencyNode) {
+
+ if(IS_TRANSITIVE_DEPENDENCY_TREE_NODE.equals(property)) {
+ if(receiver instanceof DependencyNode) {
DependencyNode nd = (DependencyNode) receiver;
return nd.getData().get("LEVEL") == null;
}
}
- if (IS_DIRECT_DEPENDENCY_TREE_NODE.equals(property)) {
- if (receiver instanceof DependencyNode) {
+ if(IS_DIRECT_DEPENDENCY_TREE_NODE.equals(property)) {
+ if(receiver instanceof DependencyNode) {
DependencyNode nd = (DependencyNode) receiver;
return "DIRECT".equals(nd.getData().get("LEVEL"));
}
}
-
- if (IS_BUILD_DIRECTORY.equals(property)) {
- if (receiver instanceof IFolder) {
+
+ if(IS_BUILD_DIRECTORY.equals(property)) {
+ if(receiver instanceof IFolder) {
IFolder folder = (IFolder) receiver;
- IProject project = folder.getProject();
+ IProject project = folder.getProject();
if(project != null) {
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
//Lookup project facade in the cache registry to minimize UI locking
IMavenProjectFacade projectFacade = projectManager.create(project, new NullProgressMonitor());
IPath outputLocation;
- if (projectFacade == null || projectFacade.getMavenProject() == null) {
+ if(projectFacade == null || projectFacade.getMavenProject() == null) {
//If the project facade has not been cached yet (ex. during workspace startup),
//fall back on the default value
outputLocation = new Path(DEFAULT_BUILD_DIR);
} else {
String buildDir = projectFacade.getMavenProject().getBuild().getDirectory();
- outputLocation = MavenProjectUtils.getProjectRelativePath(project, buildDir);
+ outputLocation = MavenProjectUtils.getProjectRelativePath(project, buildDir);
}
- if (outputLocation != null) {
+ if(outputLocation != null) {
return folder.equals(project.getFolder(outputLocation));
}
}
@@ -116,8 +122,7 @@ public class MavenPropertyTester extends PropertyTester {
}
return false;
-
+
}
}
-
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ModuleProjectWizardAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ModuleProjectWizardAction.java
index 396fc450..b1706cc6 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ModuleProjectWizardAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/ModuleProjectWizardAction.java
@@ -15,46 +15,45 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.m2e.core.ui.internal.wizards.MavenModuleWizard;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.m2e.core.ui.internal.wizards.MavenModuleWizard;
+
+
/**
* A module project wizard action.
*/
public class ModuleProjectWizardAction implements IObjectActionDelegate {
/** action id */
- public static final String ID =
- "org.eclipse.m2e.actions.moduleProjectWizardAction"; //$NON-NLS-1$
-
+ public static final String ID = "org.eclipse.m2e.actions.moduleProjectWizardAction"; //$NON-NLS-1$
+
/** the current selection */
private IStructuredSelection selection;
-
+
/** parent shell */
private Shell parent;
/** Runs the action. */
- public void run( IAction action ) {
+ public void run(IAction action) {
MavenModuleWizard wizard = new MavenModuleWizard();
- wizard.init( PlatformUI.getWorkbench(), selection );
- WizardDialog dialog = new WizardDialog( parent, wizard );
+ wizard.init(PlatformUI.getWorkbench(), selection);
+ WizardDialog dialog = new WizardDialog(parent, wizard);
dialog.open();
}
-
/** Sets the active workbench part. */
- public void setActivePart( IAction action, IWorkbenchPart part ) {
+ public void setActivePart(IAction action, IWorkbenchPart part) {
parent = part.getSite().getShell();
}
-
/** Handles the selection change */
- public void selectionChanged( IAction action, ISelection selection ) {
- if( selection instanceof IStructuredSelection ) {
- this.selection = ( IStructuredSelection ) selection;
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
}
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenMavenConsoleAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenMavenConsoleAction.java
index 108eca9a..e47580c5 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenMavenConsoleAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenMavenConsoleAction.java
@@ -12,15 +12,17 @@
package org.eclipse.m2e.core.ui.internal.actions;
import org.eclipse.jface.action.Action;
+
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
/**
* Open Maven Console Action
- *
+ *
* @author Eugene Kuleshov
*/
public class OpenMavenConsoleAction extends Action {
-
+
public void run() {
M2EUIPluginActivator.getDefault().getMavenConsole().showConsole();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
index 7dac78de..65e9ce85 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/OpenPomAction.java
@@ -8,6 +8,7 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
+
package org.eclipse.m2e.core.ui.internal.actions;
import java.io.ByteArrayInputStream;
@@ -245,8 +246,10 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
try {
part[0] = page.openEditor(editorInput, editor.getId());
} catch(PartInitException ex) {
- MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
- Messages.OpenPomAction_open_title, NLS.bind(Messages.OpenPomAction_33, editorInput.getName(), ex.toString()));
+ MessageDialog.openInformation(
+ Display.getDefault().getActiveShell(), //
+ Messages.OpenPomAction_open_title,
+ NLS.bind(Messages.OpenPomAction_33, editorInput.getName(), ex.toString()));
}
}
}
@@ -354,13 +357,13 @@ public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowAct
//implemented as hinted by IPathEditorInput javadoc.
public boolean equals(Object obj) {
IPath path = getPath();
- if (path != null && obj instanceof MavenPathStorageEditorInput) {
- return path.equals(((MavenPathStorageEditorInput)obj).getPath());
+ if(path != null && obj instanceof MavenPathStorageEditorInput) {
+ return path.equals(((MavenPathStorageEditorInput) obj).getPath());
}
return super.equals(obj);
}
}
-
+
private static class MavenStorage implements IStorage {
private String name;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
index eb678252..08cfe7e8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
@@ -8,6 +8,7 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
+
package org.eclipse.m2e.core.ui.internal.actions;
import java.io.File;
@@ -115,16 +116,16 @@ public class SelectionUtil {
}
}
- ArtifactKey artifactKey = getType(element, ArtifactKey.class);
+ ArtifactKey artifactKey = getType(element, ArtifactKey.class);
if(artifactKey != null) {
return JAR_FILE;
}
IWorkingSet workingSet = getType(element, IWorkingSet.class);
- if(workingSet!=null) {
+ if(workingSet != null) {
return WORKING_SET;
}
-
+
return UNSUPPORTED;
}
@@ -133,7 +134,7 @@ public class SelectionUtil {
*/
@SuppressWarnings("unchecked")
public static <T> T getType(Object element, Class<T> type) {
- if(element==null) {
+ if(element == null) {
return null;
}
if(type.isInstance(element)) {
@@ -160,7 +161,7 @@ public class SelectionUtil {
if(resource != null) {
return resource.getLocation();
}
-
+
// IPackageFragmentRoot fragment = getType(element, IResource.class);
// if(fragment != null) {
// IJavaProject javaProject = fragment.getJavaProject();
@@ -171,8 +172,8 @@ public class SelectionUtil {
// }
// }
// }
-
- return null;
+
+ return null;
}
public static IWorkingSet getSelectedWorkingSet(IStructuredSelection selection) {
@@ -197,7 +198,7 @@ public class SelectionUtil {
// if(resource != null) {
// return getWorkingSet(resource);
// }
-
+
// IPackageFragmentRoot fragment = getType(element, IPackageFragmentRoot.class);
// if(fragment != null) {
// IJavaProject javaProject = fragment.getJavaProject();
@@ -234,16 +235,16 @@ public class SelectionUtil {
}
return list;
}
-
+
public static ArtifactKey getArtifactKey(Object element) throws CoreException {
if(element instanceof Artifact) {
return new ArtifactKey(((Artifact) element));
-
+
} else if(element instanceof org.sonatype.aether.graph.DependencyNode) {
org.sonatype.aether.artifact.Artifact artifact = ((org.sonatype.aether.graph.DependencyNode) element)
.getDependency().getArtifact();
return new ArtifactKey(artifact);
-
+
//getArtifactKey() used only in a handful of actions, to my knowledge none of these are currently available on
//model.edit.Dependency instances.
// } else if(element instanceof Dependency) {
@@ -265,7 +266,7 @@ public class SelectionUtil {
// }
// return new ArtifactKey(dependency.getGroupId(), dependency.getArtifactId(), version, null);
}
-
+
return SelectionUtil.getType(element, ArtifactKey.class);
}
@@ -274,7 +275,7 @@ public class SelectionUtil {
IFile pomFile = ((IFileEditorInput) editorInput).getFile();
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade facade = projectManager.create(pomFile, true, monitor);
- if(facade!=null) {
+ if(facade != null) {
return facade.getMavenProject(monitor);
}
@@ -306,17 +307,18 @@ public class SelectionUtil {
}
} else if(editorInput.getClass().getName().endsWith("FileStoreEditorInput")) { //$NON-NLS-1$
- return readMavenProject(new File(Util.proxy(editorInput, FileStoreEditorInputStub.class).getURI().getPath()), monitor);
+ return readMavenProject(new File(Util.proxy(editorInput, FileStoreEditorInputStub.class).getURI().getPath()),
+ monitor);
}
-
+
return null;
}
-
+
private static MavenProject readMavenProject(File pomFile, IProgressMonitor monitor) throws CoreException {
- if(monitor==null) {
+ if(monitor == null) {
monitor = new NullProgressMonitor();
}
-
+
IMaven maven = MavenPlugin.getMaven();
MavenExecutionRequest request = maven.createExecutionRequest(monitor);
@@ -328,7 +330,7 @@ public class SelectionUtil {
MavenExecutionResult result = maven.readProject(request, monitor);
MavenProject project = result.getProject();
- if(project!=null) {
+ if(project != null) {
return project;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/PomHierarchyComposite.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/PomHierarchyComposite.java
index efb57f08..1a880933 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/PomHierarchyComposite.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/PomHierarchyComposite.java
@@ -8,6 +8,7 @@
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
+
package org.eclipse.m2e.core.ui.internal.components;
import java.lang.reflect.InvocationTargetException;
@@ -132,8 +133,8 @@ public class PomHierarchyComposite extends Composite implements IInputSelectionP
public Color getForeground(Object element) {
if(element instanceof MavenProject) {
MavenProject project = (MavenProject) element;
- IMavenProjectFacade search = MavenPlugin.getMavenProjectRegistry()
- .getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
+ IMavenProjectFacade search = MavenPlugin.getMavenProjectRegistry().getMavenProject(project.getGroupId(),
+ project.getArtifactId(), project.getVersion());
if(search == null) {
// This project is not in the workspace
return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
@@ -149,8 +150,8 @@ public class PomHierarchyComposite extends Composite implements IInputSelectionP
public Image getImage(Object element) {
if(element instanceof MavenProject) {
MavenProject project = (MavenProject) element;
- IMavenProjectFacade search = MavenPlugin.getMavenProjectRegistry()
- .getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
+ IMavenProjectFacade search = MavenPlugin.getMavenProjectRegistry().getMavenProject(project.getGroupId(),
+ project.getArtifactId(), project.getVersion());
if(search == null) {
// This project is not in the workspace
return MavenImages.getOverlayImage(MavenImages.PATH_JAR, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java
index 45c0e957..2affc2de 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java
@@ -33,7 +33,6 @@ public class TextComboBoxCellEditor extends CellEditor {
protected String[] items;
-
protected CCombo combo;
public TextComboBoxCellEditor(Composite parent, int style) {
@@ -51,13 +50,12 @@ public class TextComboBoxCellEditor extends CellEditor {
});
combo.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE
- || e.detail == SWT.TRAVERSE_RETURN) {
+ if(e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) {
e.doit = false;
}
}
});
-
+
loadItems();
return combo;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/ConsoleDocument.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/ConsoleDocument.java
index 1a3d6de6..83e5da0e 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/ConsoleDocument.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/ConsoleDocument.java
@@ -16,80 +16,89 @@ package org.eclipse.m2e.core.ui.internal.console;
*/
// TODO consider use standard ConsoleDocument
public class ConsoleDocument {
- public static final int COMMAND = 0; // command text
- public static final int MESSAGE = 1; // message received
- public static final int ERROR = 2; // error received
- public static final int STATUS = 3; // status text
- public static final int DELIMITER = 4; // delimiter text between runs
-
- private int[] lineTypes;
- private String[] lines;
-
- private int writeIndex = 0;
- private int readIndex = 0;
-
- private static final int BUFFER_SIZE = 200;
-
- protected static class ConsoleLine {
- public String line;
- public int type;
- ConsoleLine(String line, int type) {
- this.line = line;
- this.type = type;
- }
+ public static final int COMMAND = 0; // command text
+
+ public static final int MESSAGE = 1; // message received
+
+ public static final int ERROR = 2; // error received
+
+ public static final int STATUS = 3; // status text
+
+ public static final int DELIMITER = 4; // delimiter text between runs
+
+ private int[] lineTypes;
+
+ private String[] lines;
+
+ private int writeIndex = 0;
+
+ private int readIndex = 0;
+
+ private static final int BUFFER_SIZE = 200;
+
+ protected static class ConsoleLine {
+ public String line;
+
+ public int type;
+
+ ConsoleLine(String line, int type) {
+ this.line = line;
+ this.type = type;
+ }
+ }
+
+ /**
+ * Creates an empty console document.
+ */
+ public ConsoleDocument() {
+ }
+
+ /**
+ * Clears the console document.
+ */
+ public void clear() {
+ lineTypes = null;
+ lines = null;
+ writeIndex = 0;
+ readIndex = 0;
+ }
+
+ /**
+ * Appends a line of the specified type to the end of the console.
+ */
+ public void appendConsoleLine(int type, String line) {
+ if(lines == null) {
+ lines = new String[BUFFER_SIZE];
+ lineTypes = new int[BUFFER_SIZE];
}
-
- /**
- * Creates an empty console document.
- */
- public ConsoleDocument() {
+ lines[writeIndex] = line;
+ lineTypes[writeIndex] = type;
+
+ if(++writeIndex >= BUFFER_SIZE) {
+ writeIndex = 0;
}
-
- /**
- * Clears the console document.
- */
- public void clear() {
- lineTypes = null;
- lines = null;
- writeIndex = 0;
+ if(writeIndex == readIndex) {
+ if(++readIndex >= BUFFER_SIZE) {
readIndex = 0;
+ }
}
-
- /**
- * Appends a line of the specified type to the end of the console.
- */
- public void appendConsoleLine(int type, String line) {
- if(lines == null) {
- lines = new String[BUFFER_SIZE];
- lineTypes = new int[BUFFER_SIZE];
- }
- lines[writeIndex] = line;
- lineTypes[writeIndex] = type;
-
- if(++writeIndex >= BUFFER_SIZE) {
- writeIndex = 0;
- }
- if(writeIndex == readIndex) {
- if(++readIndex >= BUFFER_SIZE) {
- readIndex = 0;
- }
- }
- }
-
- public ConsoleLine[] getLines() {
- if(isEmpty()) return new ConsoleLine[0];
- ConsoleLine[] docLines = new ConsoleLine[readIndex > writeIndex ? BUFFER_SIZE : writeIndex];
- int index = readIndex;
- for (int i = 0; i < docLines.length; i++) {
- docLines[i] = new ConsoleLine(lines[index], lineTypes[index]);
- if (++index >= BUFFER_SIZE) {
- index = 0;
- }
- }
- return docLines;
- }
-
- public boolean isEmpty() {
- return writeIndex == readIndex;
+ }
+
+ public ConsoleLine[] getLines() {
+ if(isEmpty())
+ return new ConsoleLine[0];
+ ConsoleLine[] docLines = new ConsoleLine[readIndex > writeIndex ? BUFFER_SIZE : writeIndex];
+ int index = readIndex;
+ for(int i = 0; i < docLines.length; i++ ) {
+ docLines[i] = new ConsoleLine(lines[index], lineTypes[index]);
+ if(++index >= BUFFER_SIZE) {
+ index = 0;
+ }
}
+ return docLines;
+ }
+
+ public boolean isEmpty() {
+ return writeIndex == readIndex;
+ }
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/IMavenConsoleListener.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/IMavenConsoleListener.java
index 4ceefe94..6f1e264b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/IMavenConsoleListener.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/IMavenConsoleListener.java
@@ -13,6 +13,7 @@ package org.eclipse.m2e.core.ui.internal.console;
import java.util.EventListener;
+
/**
* A console listener is notified of output to the Maven console.
*
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleFactory.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleFactory.java
index 698ae936..adffe61e 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleFactory.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleFactory.java
@@ -11,15 +11,15 @@
package org.eclipse.m2e.core.ui.internal.console;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.ui.console.IConsoleFactory;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
+
/**
- * Maven Console factory is used to show the console from the "Open Console"
- * drop-down action in Console view.
+ * Maven Console factory is used to show the console from the "Open Console" drop-down action in Console view.
*
* @see org.eclipse.ui.console.consoleFactory extension point.
- *
* @author Eugene Kuleshov
*/
public class MavenConsoleFactory implements IConsoleFactory {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleImpl.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleImpl.java
index e6b4077d..5ea82e28 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleImpl.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsoleImpl.java
@@ -16,13 +16,13 @@ import java.util.Date;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import com.ibm.icu.text.DateFormat;
+import com.ibm.icu.util.ULocale;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
@@ -34,8 +34,9 @@ import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IOConsole;
import org.eclipse.ui.console.IOConsoleOutputStream;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.util.ULocale;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -65,6 +66,7 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
private IOConsoleOutputStream messageStream;
private IOConsoleOutputStream errorStream;
+
private static final String TITLE = Messages.MavenConsoleImpl_title;
private List<IMavenConsoleListener> listeners = new CopyOnWriteArrayList<IMavenConsoleListener>();
@@ -131,8 +133,8 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
//the synchronization here caused a deadlock. since the writes are simply appending to the output stream
//or the document, just doing it on the main thread to avoid deadlocks and or corruption of the
//document or output stream
- Display.getDefault().asyncExec(new Runnable(){
- public void run(){
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
if(isVisible()) {
try {
switch(type) {
@@ -174,7 +176,7 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
}
}
}
-
+
public void showConsole() {
boolean exists = false;
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
@@ -188,13 +190,12 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
}
manager.showConsoleView(this);
}
-
+
public void closeConsole() {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
manager.removeConsoles(new IConsole[] {this});
ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this.newLifecycle());
}
-
public void propertyChange(PropertyChangeEvent event) {
// font changed
@@ -205,7 +206,7 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
if(PlatformUI.isWorkbenchRunning()) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
if(!isVisible()) {
- manager.addConsoles(new IConsole[] {this});
+ manager.addConsoles(new IConsole[] {this});
}
manager.showConsoleView(this);
}
@@ -216,8 +217,8 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
// Here we can't call super.dispose() because we actually want the partitioner to remain
// connected, but we won't show lines until the console is added to the console manager
// again.
- Display.getDefault().asyncExec(new Runnable(){
- public void run(){
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
setVisible(false);
JFaceResources.getFontRegistry().removeListener(MavenConsoleImpl.this);
}
@@ -264,10 +265,10 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
}
public void info(String message) {
- if(showConsoleOnOutput()){
+ if(showConsoleOnOutput()) {
bringConsoleToFront();
}
- appendLine(ConsoleDocument.MESSAGE, getDateFormat().format(new Date()) + ": " + message);
+ appendLine(ConsoleDocument.MESSAGE, getDateFormat().format(new Date()) + ": " + message);
for(IMavenConsoleListener listener : listeners) {
try {
@@ -277,9 +278,9 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
}
}
}
-
+
public void error(String message) {
- if(showConsoleOnError()){
+ if(showConsoleOnError()) {
bringConsoleToFront();
}
appendLine(ConsoleDocument.ERROR, getDateFormat().format(new Date()) + ": " + message); //$NON-NLS-1$
@@ -293,13 +294,16 @@ public class MavenConsoleImpl extends IOConsole implements MavenConsole, IProper
}
}
- public boolean showConsoleOnError(){
- return M2EUIPluginActivator.getDefault().getPreferenceStore().getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR);
+ public boolean showConsoleOnError() {
+ return M2EUIPluginActivator.getDefault().getPreferenceStore()
+ .getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR);
}
-
- public boolean showConsoleOnOutput(){
- return M2EUIPluginActivator.getDefault().getPreferenceStore().getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT);
+
+ public boolean showConsoleOnOutput() {
+ return M2EUIPluginActivator.getDefault().getPreferenceStore()
+ .getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT);
}
+
public IConsoleListener newLifecycle() {
return new MavenConsoleLifecycle();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
index e42e4ba0..0cb80ee3 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenConsolePageParticipant.java
@@ -26,35 +26,38 @@ import org.eclipse.m2e.core.ui.internal.actions.MavenConsoleRemoveAction;
import org.eclipse.m2e.core.ui.internal.actions.MavenDebugOutputAction;
-
public class MavenConsolePageParticipant implements IConsolePageParticipant {
private IAction consoleRemoveAction;
+
private IAction debugAction;
+
private IAction showOnErrorAction;
+
private IAction showOnOutputAction;
-
+
private static final String SHOW_ON_OUTPUT_LBL = Messages.MavenConsolePageParticipant_any;
+
private static final String SHOW_ON_ERR_LBL = Messages.MavenConsolePageParticipant_error;
-
+
public void init(IPageBookViewPage page, IConsole console) {
this.consoleRemoveAction = new MavenConsoleRemoveAction();
this.debugAction = new MavenDebugOutputAction();
-
showOnOutputAction = new ShowOnOutputAction(console, SHOW_ON_OUTPUT_LBL);
showOnErrorAction = new ShowOnErrorAction(console, SHOW_ON_ERR_LBL);
-
+
IActionBars actionBars = page.getSite().getActionBars();
configureToolBar(actionBars.getToolBarManager());
}
- private void configureToolBar(IToolBarManager mgr){
+ private void configureToolBar(IToolBarManager mgr) {
mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, consoleRemoveAction);
mgr.prependToGroup(IConsoleConstants.OUTPUT_GROUP, debugAction);
mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, showOnOutputAction);
mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, showOnErrorAction);
}
+
public void dispose() {
this.consoleRemoveAction = null;
this.debugAction = null;
@@ -71,10 +74,8 @@ public class MavenConsolePageParticipant implements IConsolePageParticipant {
return null;
}
-
-
- class ShowOnErrorAction extends MavenShowConsoleAction{
- public ShowOnErrorAction(IConsole console, String name){
+ class ShowOnErrorAction extends MavenShowConsoleAction {
+ public ShowOnErrorAction(IConsole console, String name) {
super(name);
setImageDescriptor(MavenImages.SHOW_CONSOLE_ERR);
}
@@ -86,8 +87,8 @@ public class MavenConsolePageParticipant implements IConsolePageParticipant {
return MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR;
}
}
-
- class ShowOnOutputAction extends MavenShowConsoleAction{
+
+ class ShowOnOutputAction extends MavenShowConsoleAction {
/**
* @param console
@@ -103,6 +104,6 @@ public class MavenConsolePageParticipant implements IConsolePageParticipant {
protected String getKey() {
return MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT;
}
-
+
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenShowConsoleAction.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenShowConsoleAction.java
index 4e6c745e..b873895b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenShowConsoleAction.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/console/MavenShowConsoleAction.java
@@ -16,16 +16,18 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
/**
* MavenShowConsoleAction
- *
+ *
* @author dyocum
*/
-public abstract class MavenShowConsoleAction extends Action implements IPropertyChangeListener{
-
- public MavenShowConsoleAction(String name){
+public abstract class MavenShowConsoleAction extends Action implements IPropertyChangeListener {
+
+ public MavenShowConsoleAction(String name) {
super(name, IAction.AS_CHECK_BOX);
setToolTipText(name);
getPreferenceStore().addPropertyChangeListener(this);
@@ -36,23 +38,23 @@ public abstract class MavenShowConsoleAction extends Action implements IProperty
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property.equals(getKey())) {
- update();
- }
+ String property = event.getProperty();
+ if(property.equals(getKey())) {
+ update();
+ }
}
-
+
protected abstract String getKey();
-
+
private void update() {
IPreferenceStore store = getPreferenceStore();
- if (store.getBoolean(getKey())) {
- // on
- setChecked(true);
- } else {
- // off
- setChecked(false);
- }
+ if(store.getBoolean(getKey())) {
+ // on
+ setChecked(true);
+ } else {
+ // off
+ setChecked(false);
+ }
}
/**
@@ -72,7 +74,7 @@ public abstract class MavenShowConsoleAction extends Action implements IProperty
store.setValue(getKey(), show);
store.addPropertyChangeListener(this);
}
-
+
/**
* Must be called to dispose this action.
*/
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AbstractMavenDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AbstractMavenDialog.java
index c614d2f6..52819139 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AbstractMavenDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/AbstractMavenDialog.java
@@ -13,12 +13,13 @@ package org.eclipse.m2e.core.ui.internal.dialogs;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
/**
* A dialog superclass, featuring position and size settings.
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/EditDependencyDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/EditDependencyDialog.java
index d0d66484..74a08208 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/EditDependencyDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/EditDependencyDialog.java
@@ -49,7 +49,6 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
-import org.eclipse.m2e.core.ui.internal.editing.PomHelper;
import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
import org.eclipse.m2e.core.ui.internal.util.ProposalUtil;
@@ -88,10 +87,9 @@ public class EditDependencyDialog extends AbstractMavenDialog {
private Operation resultOperation;
/**
- *
* @param parent
* @param dependencyManagement
- * @param project can be null, only used for indexer search as scope
+ * @param project can be null, only used for indexer search as scope
* @param mavenProject
*/
public EditDependencyDialog(Shell parent, boolean dependencyManagement, IProject project, MavenProject mavenProject) {
@@ -205,85 +203,83 @@ public class EditDependencyDialog extends AbstractMavenDialog {
return superComposite;
}
-
+
public Operation getEditOperation() {
return resultOperation;
}
protected void computeResult() {
final String oldArtifactId = dependency.getArtifactId();
- final String oldGroupId = dependency.getGroupId();
+ final String oldGroupId = dependency.getGroupId();
final String groupId = valueOrNull(groupIdText.getText());
final String artifactId = valueOrNull(artifactIdText.getText());
- final String version = valueOrNull(versionText.getText());
+ final String version = valueOrNull(versionText.getText());
final String type = valueOrNull(typeCombo.getText());
final String scope = valueOrNull(scopeCombo.getText());
final String classifier = valueOrNull(classifierText.getText());
final String system = valueOrNull(systemPathText.getText());
final boolean optional = optionalButton.getSelection();
- resultOperation = new Operation() {
- public void process(Document document) {
- Element depsEl = dependencyManagement ? getChild(document.getDocumentElement(), DEPENDENCY_MANAGEMENT, DEPENDENCIES) : getChild(document.getDocumentElement(), DEPENDENCIES);
- Element dep = findChild(depsEl, DEPENDENCY,
- childEquals(GROUP_ID, oldGroupId),
- childEquals(ARTIFACT_ID, oldArtifactId));
- if (dep != null)
- {
- if (artifactId != null && !artifactId.equals(oldArtifactId)) {
- setText(getChild(dep, ARTIFACT_ID), artifactId);
- }
- if (groupId != null && !groupId.equals(oldGroupId)) {
- setText(getChild(dep, GROUP_ID), groupId);
- }
- //only set version if already exists
- if (version != null) {
- setText(getChild(dep, VERSION), version);
- } else {
- removeChild(dep, findChild(dep, VERSION));
- }
- if (type != null //
- && !"jar".equals(type) // //$NON-NLS-1$
- && !"null".equals(type)) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
-
- setText(getChild(dep, TYPE), type);
- } else {
- removeChild(dep, findChild(dep, TYPE));
- }
- if (classifier != null) {
- setText(getChild(dep, CLASSIFIER), classifier);
- } else {
- removeChild(dep, findChild(dep, CLASSIFIER));
- }
- if (scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
- setText(getChild(dep, SCOPE), scope);
- } else {
- removeChild(dep, findChild(dep, SCOPE));
- }
- if (system != null) {
- setText(getChild(dep, SYSTEM_PATH), system);
- } else {
- removeChild(dep, findChild(dep, SYSTEM_PATH));
- }
- if (optional) {
- setText(getChild(dep, OPTIONAL), Boolean.toString(optional));
- } else {
- removeChild(dep, findChild(dep, OPTIONAL));
- }
+ resultOperation = new Operation() {
+ public void process(Document document) {
+ Element depsEl = dependencyManagement ? getChild(document.getDocumentElement(), DEPENDENCY_MANAGEMENT,
+ DEPENDENCIES) : getChild(document.getDocumentElement(), DEPENDENCIES);
+ Element dep = findChild(depsEl, DEPENDENCY, childEquals(GROUP_ID, oldGroupId),
+ childEquals(ARTIFACT_ID, oldArtifactId));
+ if(dep != null) {
+ if(artifactId != null && !artifactId.equals(oldArtifactId)) {
+ setText(getChild(dep, ARTIFACT_ID), artifactId);
+ }
+ if(groupId != null && !groupId.equals(oldGroupId)) {
+ setText(getChild(dep, GROUP_ID), groupId);
+ }
+ //only set version if already exists
+ if(version != null) {
+ setText(getChild(dep, VERSION), version);
+ } else {
+ removeChild(dep, findChild(dep, VERSION));
+ }
+ if(type != null //
+ && !"jar".equals(type) // //$NON-NLS-1$
+ && !"null".equals(type)) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
+
+ setText(getChild(dep, TYPE), type);
+ } else {
+ removeChild(dep, findChild(dep, TYPE));
+ }
+ if(classifier != null) {
+ setText(getChild(dep, CLASSIFIER), classifier);
+ } else {
+ removeChild(dep, findChild(dep, CLASSIFIER));
+ }
+ if(scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
+ setText(getChild(dep, SCOPE), scope);
+ } else {
+ removeChild(dep, findChild(dep, SCOPE));
+ }
+ if(system != null) {
+ setText(getChild(dep, SYSTEM_PATH), system);
+ } else {
+ removeChild(dep, findChild(dep, SYSTEM_PATH));
+ }
+ if(optional) {
+ setText(getChild(dep, OPTIONAL), Boolean.toString(optional));
+ } else {
+ removeChild(dep, findChild(dep, OPTIONAL));
}
}
- };
+ }
+ };
}
-
+
private String valueOrNull(String value) {
- if (value != null) {
+ if(value != null) {
value = value.trim();
- if (value.length() == 0) {
+ if(value.length() == 0) {
value = null;
}
}
return value;
}
-
public void setDependency(Dependency dependency) {
this.dependency = dependency;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/InputHistory.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/InputHistory.java
index c585956d..238ceba8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/InputHistory.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/InputHistory.java
@@ -11,7 +11,6 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.DisposeEvent;
@@ -19,6 +18,8 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+
public class InputHistory {
/** the history limit */
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
index 2e44a665..65384f6b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenGoalSelectionDialog.java
@@ -17,6 +17,9 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -27,13 +30,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.internal.IMavenConstants;
-import org.eclipse.m2e.core.internal.index.IIndex;
-import org.eclipse.m2e.core.internal.index.IndexManager;
-import org.eclipse.m2e.core.internal.index.IndexedArtifact;
-import org.eclipse.m2e.core.internal.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
@@ -52,8 +48,14 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.core.internal.index.IIndex;
+import org.eclipse.m2e.core.internal.index.IndexManager;
+import org.eclipse.m2e.core.internal.index.IndexedArtifact;
+import org.eclipse.m2e.core.internal.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.internal.Messages;
public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
@@ -66,7 +68,7 @@ public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
public MavenGoalSelectionDialog(Shell parent) {
super(parent, new GoalsLabelProvider(), new GoalsContentProvider());
- setTitle(Messages.launchGoalsDialogTitle);
+ setTitle(Messages.launchGoalsDialogTitle);
setMessage(org.eclipse.m2e.core.ui.internal.Messages.MavenGoalSelectionDialog_message);
setValidator(new GoalsSelectionValidator());
setInput(new Object());
@@ -179,7 +181,7 @@ public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
try {
// TODO: this will search ALL indexes, isn't the right to search _this_ project reposes only?
// I did not find (at first glance, maybe was hasty) a way to get IProject
- Map<String, IndexedArtifact> result = indexManager.getAllIndexes().search(null, IIndex.SEARCH_PLUGIN);
+ Map<String, IndexedArtifact> result = indexManager.getAllIndexes().search(null, IIndex.SEARCH_PLUGIN);
TreeMap<String, Group> map = new TreeMap<String, Group>();
for(IndexedArtifact a : result.values()) {
IndexedArtifactFile f = a.getFiles().iterator().next();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenMessageDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenMessageDialog.java
index 8dd4c980..667b1b08 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenMessageDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenMessageDialog.java
@@ -24,14 +24,16 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+
/**
* MavenMessageDialog
- *
+ *
* @author dyocum
*/
public class MavenMessageDialog extends MessageDialog {
private StyledText messageArea;
+
/**
* @param parentShell
* @param dialogTitle
@@ -51,7 +53,7 @@ public class MavenMessageDialog extends MessageDialog {
*/
protected Control createCustomArea(Composite parent) {
// TODO Auto-generated method createCustomArea
- this.messageArea = new StyledText(parent, SWT.WRAP|SWT.READ_ONLY|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
+ this.messageArea = new StyledText(parent, SWT.WRAP | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
this.messageArea.setLayout(new GridLayout());
GridData gd = new GridData(SWT.LEFT, SWT.TOP, true, true);
//size hints
@@ -62,15 +64,15 @@ public class MavenMessageDialog extends MessageDialog {
}
/**
- *
* @param parent Parent shell
* @param title Title of the dialog
* @param label The label shown above the msg.
* @param message The actual message to show in the text area.
*/
public static void openInfo(Shell parent, String title, String label, String message) {
- MavenMessageDialog dialog = new MavenMessageDialog(parent, title, Display.getDefault().getSystemImage(SWT.ICON_INFORMATION), // accept
- label, INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); // ok
+ MavenMessageDialog dialog = new MavenMessageDialog(parent, title, Display.getDefault().getSystemImage(
+ SWT.ICON_INFORMATION), // accept
+ label, INFORMATION, new String[] {IDialogConstants.OK_LABEL}, 0); // ok
dialog.create();
dialog.getMessageArea().setText(message);
dialog.getDialogArea().pack(true);
@@ -79,7 +81,6 @@ public class MavenMessageDialog extends MessageDialog {
}
/**
- *
* @param parent
* @param title
* @param label
@@ -87,15 +88,17 @@ public class MavenMessageDialog extends MessageDialog {
* @param severity constants from MessageDialog
*/
public static void openWithSeverity(Shell parent, String title, String label, String message, int severity) {
- Image icon = severity == IMessageProvider.ERROR ? Display.getDefault().getSystemImage(SWT.ICON_ERROR) : Display.getDefault().getSystemImage(SWT.ICON_INFORMATION);
+ Image icon = severity == IMessageProvider.ERROR ? Display.getDefault().getSystemImage(SWT.ICON_ERROR) : Display
+ .getDefault().getSystemImage(SWT.ICON_INFORMATION);
MavenMessageDialog dialog = new MavenMessageDialog(parent, title, icon, // accept
- label, severity, new String[] { IDialogConstants.OK_LABEL }, 0); // ok
+ label, severity, new String[] {IDialogConstants.OK_LABEL}, 0); // ok
dialog.create();
dialog.getMessageArea().setText(message);
dialog.getDialogArea().pack(true);
dialog.open();
return;
}
+
/**
* @return Returns the messageArea.
*/
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenPropertyDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenPropertyDialog.java
index 3e1ec49c..2fcdf99a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenPropertyDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenPropertyDialog.java
@@ -14,7 +14,6 @@ package org.eclipse.m2e.core.ui.internal.dialogs;
// import org.eclipse.debug.ui.StringVariableSelectionDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -29,26 +28,29 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
public class MavenPropertyDialog extends Dialog {
private final String title;
-
+
private final String initialName;
-
+
private final String initialValue;
-
+
private final VerifyListener verifyListener;
-
+
protected Text nameText;
protected Text valueText;
private String name;
-
+
private String value;
- public MavenPropertyDialog(Shell shell, String title, String initialName, String initialValue, VerifyListener verifyListener) {
+ public MavenPropertyDialog(Shell shell, String title, String initialName, String initialValue,
+ VerifyListener verifyListener) {
super(shell);
this.title = title;
this.initialName = initialName;
@@ -75,7 +77,7 @@ public class MavenPropertyDialog extends Dialog {
gd.widthHint = 300;
nameText.setLayoutData(gd);
nameText.setFont(comp.getFont());
- nameText.setText(initialName==null ? "" : initialName); //$NON-NLS-1$
+ nameText.setText(initialName == null ? "" : initialName); //$NON-NLS-1$
nameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateButtons();
@@ -91,7 +93,7 @@ public class MavenPropertyDialog extends Dialog {
gd.widthHint = 300;
valueText.setLayoutData(gd);
valueText.setFont(comp.getFont());
- valueText.setText(initialValue==null ? "" : initialValue); //$NON-NLS-1$
+ valueText.setText(initialValue == null ? "" : initialValue); //$NON-NLS-1$
valueText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateButtons();
@@ -120,14 +122,14 @@ public class MavenPropertyDialog extends Dialog {
// }
// });
// }
-
+
return comp;
}
public String getName() {
return this.name;
}
-
+
public String getValue() {
return this.value;
}
@@ -172,7 +174,7 @@ public class MavenPropertyDialog extends Dialog {
e.widget = nameText;
VerifyEvent ev = new VerifyEvent(e);
ev.doit = true;
- if (verifyListener != null) {
+ if(verifyListener != null) {
ev.text = name;
verifyListener.verifyText(ev);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
index 5f5b65f8..82c1a450 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/MavenRepositorySearchDialog.java
@@ -50,6 +50,7 @@ import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
import org.eclipse.m2e.core.ui.internal.util.ProposalUtil;
import org.eclipse.m2e.core.ui.internal.wizards.MavenPomSelectionComponent;
+
/**
* Maven POM Search dialog
*
@@ -57,7 +58,7 @@ import org.eclipse.m2e.core.ui.internal.wizards.MavenPomSelectionComponent;
*/
public class MavenRepositorySearchDialog extends AbstractMavenDialog {
private static final String DIALOG_SETTINGS = MavenRepositorySearchDialog.class.getName();
-
+
public static final String[] SCOPES = new String[] {"compile", "provided", "runtime", "test", "system"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
/*
@@ -65,103 +66,102 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
*/
public static final String[] DEP_MANAGEMENT_SCOPES = new String[] {"compile", "provided", "runtime", "test", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"system", "import"}; //$NON-NLS-1$ //$NON-NLS-2$
-
/**
- *
* @param parent
* @param title
* @return
*/
public static MavenRepositorySearchDialog createOpenPomDialog(Shell parent, String title) {
- return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_ARTIFACT, Collections.<ArtifactKey>emptySet(), Collections.<ArtifactKey>emptySet(), false, null, null, false);
+ return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_ARTIFACT, Collections.<ArtifactKey> emptySet(),
+ Collections.<ArtifactKey> emptySet(), false, null, null, false);
}
-
+
/**
- *
* @param parent
* @param title
* @param mp
* @param p
- * @param inManagedSection true when the result will be added to the dependencyManagement section of the pom.
+ * @param inManagedSection true when the result will be added to the dependencyManagement section of the pom.
* @return
*/
- public static MavenRepositorySearchDialog createSearchDependencyDialog(Shell parent, String title, MavenProject mp, IProject p, boolean inManagedSection) {
- Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
- Set<ArtifactKey> managed = new HashSet<ArtifactKey>();
- if (mp != null) {
- Set<ArtifactKey> keys = inManagedSection ? artifacts : managed;
- DependencyManagement dm = mp.getDependencyManagement();
- if (dm != null && dm.getDependencies() != null) {
- for (Dependency dep : dm.getDependencies()) {
- keys.add(new ArtifactKey(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getClassifier()));
- }
+ public static MavenRepositorySearchDialog createSearchDependencyDialog(Shell parent, String title, MavenProject mp,
+ IProject p, boolean inManagedSection) {
+ Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
+ Set<ArtifactKey> managed = new HashSet<ArtifactKey>();
+ if(mp != null) {
+ Set<ArtifactKey> keys = inManagedSection ? artifacts : managed;
+ DependencyManagement dm = mp.getDependencyManagement();
+ if(dm != null && dm.getDependencies() != null) {
+ for(Dependency dep : dm.getDependencies()) {
+ keys.add(new ArtifactKey(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getClassifier()));
}
- if (!inManagedSection) {
- for (Dependency dep : mp.getModel().getDependencies()) {
- artifacts.add(new ArtifactKey(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getClassifier()));
- }
+ }
+ if(!inManagedSection) {
+ for(Dependency dep : mp.getModel().getDependencies()) {
+ artifacts.add(new ArtifactKey(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getClassifier()));
}
+ }
}
- return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_ARTIFACT, artifacts, managed, true, mp, p, true);
+ return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_ARTIFACT, artifacts, managed, true, mp, p, true);
}
+
/**
- *
* @param parent
* @param title
* @param mp
* @param p
* @return
*/
- public static MavenRepositorySearchDialog createSearchParentDialog(Shell parent, String title, MavenProject mp, IProject p) {
- Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
- Set<ArtifactKey> managed = new HashSet<ArtifactKey>();
- if (mp != null && mp.getModel().getParent() != null) {
+ public static MavenRepositorySearchDialog createSearchParentDialog(Shell parent, String title, MavenProject mp,
+ IProject p) {
+ Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
+ Set<ArtifactKey> managed = new HashSet<ArtifactKey>();
+ if(mp != null && mp.getModel().getParent() != null) {
Parent par = mp.getModel().getParent();
- artifacts.add(new ArtifactKey(par.getGroupId(), par.getArtifactId(), par.getVersion(), null));
+ artifacts.add(new ArtifactKey(par.getGroupId(), par.getArtifactId(), par.getVersion(), null));
}
- return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_PARENTS, artifacts, managed, false, mp, p, true);
+ return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_PARENTS, artifacts, managed, false, mp, p, true);
}
-
+
/**
- *
* @param parent
* @param title
* @param mp
* @param p
- * @param inManagedSection true when the result will be added to the dependencyManagement section of the pom.
+ * @param inManagedSection true when the result will be added to the dependencyManagement section of the pom.
* @return
*/
- public static MavenRepositorySearchDialog createSearchPluginDialog(Shell parent, String title, MavenProject mp, IProject p, boolean inManagedSection) {
- Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
+ public static MavenRepositorySearchDialog createSearchPluginDialog(Shell parent, String title, MavenProject mp,
+ IProject p, boolean inManagedSection) {
+ Set<ArtifactKey> artifacts = new HashSet<ArtifactKey>();
Set<ArtifactKey> managed = new HashSet<ArtifactKey>();
Set<ArtifactKey> keys = inManagedSection ? artifacts : managed;
- if (mp != null && mp.getBuild() != null) {
- PluginManagement pm = mp.getBuild().getPluginManagement();
- if (pm != null && pm.getPlugins() != null) {
- for (Plugin plug : pm.getPlugins()) {
- keys.add(new ArtifactKey(plug.getGroupId(), plug.getArtifactId(), plug.getVersion(), null));
- }
+ if(mp != null && mp.getBuild() != null) {
+ PluginManagement pm = mp.getBuild().getPluginManagement();
+ if(pm != null && pm.getPlugins() != null) {
+ for(Plugin plug : pm.getPlugins()) {
+ keys.add(new ArtifactKey(plug.getGroupId(), plug.getArtifactId(), plug.getVersion(), null));
}
- if (!inManagedSection && mp.getModel().getBuild() != null) {
- for (Plugin plug : mp.getModel().getBuild().getPlugins()) {
- artifacts.add(new ArtifactKey(plug.getGroupId(), plug.getArtifactId(), plug.getVersion(), null));
- }
+ }
+ if(!inManagedSection && mp.getModel().getBuild() != null) {
+ for(Plugin plug : mp.getModel().getBuild().getPlugins()) {
+ artifacts.add(new ArtifactKey(plug.getGroupId(), plug.getArtifactId(), plug.getVersion(), null));
}
-
+ }
+
}
- return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_PLUGIN, artifacts, managed, false, mp, p, true);
- }
+ return new MavenRepositorySearchDialog(parent, title, IIndex.SEARCH_PLUGIN, artifacts, managed, false, mp, p, true);
+ }
+
private final boolean showScope;
-
+
private final Set<ArtifactKey> artifacts;
private final Set<ArtifactKey> managed;
/**
- * One of
- * {@link IIndex#SEARCH_ARTIFACT},
- * {@link IIndex#SEARCH_CLASS_NAME},
+ * One of {@link IIndex#SEARCH_ARTIFACT}, {@link IIndex#SEARCH_CLASS_NAME},
*/
private final String queryType;
@@ -182,7 +182,7 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
private Text txtArtifactId;
private Text txtVersion;
-
+
private boolean ignoreTextChange = false;
private IProject project;
@@ -191,8 +191,8 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
private final boolean showCoords;
- private MavenRepositorySearchDialog(Shell parent, String title, String queryType,
- Set<ArtifactKey> artifacts, Set<ArtifactKey> managed, boolean showScope, MavenProject mp, IProject p, boolean showCoordinates) {
+ private MavenRepositorySearchDialog(Shell parent, String title, String queryType, Set<ArtifactKey> artifacts,
+ Set<ArtifactKey> managed, boolean showScope, MavenProject mp, IProject p, boolean showCoordinates) {
super(parent, DIALOG_SETTINGS);
this.artifacts = artifacts;
this.managed = managed;
@@ -213,22 +213,22 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
protected Control createDialogArea(Composite parent) {
readSettings();
-
+
Composite composite = (Composite) super.createDialogArea(parent);
- if (showCoords) {
+ if(showCoords) {
createGAVControls(composite);
Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
}
-
+
pomSelectionComponent = new MavenPomSelectionComponent(composite, SWT.NONE);
pomSelectionComponent.init(queryText, queryType, project, artifacts, managed);
-
+
pomSelectionComponent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
+
pomSelectionComponent.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
- if (!pomSelectionComponent.getStatus().matches(IStatus.ERROR)) {
+ if(!pomSelectionComponent.getStatus().matches(IStatus.ERROR)) {
okPressedDelegate();
}
}
@@ -240,10 +240,10 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
}
});
pomSelectionComponent.setFocus();
-
+
return composite;
}
-
+
/**
* Sets the up group-artifact-version controls
*/
@@ -263,11 +263,11 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
txtGroupId.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
M2EUIUtils.addRequiredDecoration(txtGroupId);
- if (showScope) {
+ if(showScope) {
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
}
-
+
Label artifactIDlabel = new Label(composite, SWT.NONE);
artifactIDlabel.setText(Messages.AddDependencyDialog_artifactId_label);
@@ -275,7 +275,7 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
txtArtifactId.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
M2EUIUtils.addRequiredDecoration(txtArtifactId);
- if (showScope) {
+ if(showScope) {
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
}
@@ -285,11 +285,11 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
txtVersion = new Text(composite, SWT.BORDER);
txtVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
- if (showScope) {
+
+ if(showScope) {
Label scopeLabel = new Label(composite, SWT.NONE);
scopeLabel.setText(Messages.AddDependencyDialog_scope_label);
-
+
comScope = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
comScope.setItems(SCOPES);
GridData scopeListData = new GridData(SWT.LEFT, SWT.CENTER, false, false);
@@ -297,7 +297,7 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
comScope.setText(SCOPES[0]);
}
- if (showScope) {
+ if(showScope) {
/*
* Fix the tab order (group -> artifact -> version -> scope)
*/
@@ -307,9 +307,9 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
}
Packaging pack;
- if (queryType.equals(IIndex.SEARCH_PARENTS)) {
+ if(queryType.equals(IIndex.SEARCH_PARENTS)) {
pack = Packaging.POM;
- } else if (queryType.equals(IIndex.SEARCH_PLUGIN)) {
+ } else if(queryType.equals(IIndex.SEARCH_PLUGIN)) {
pack = Packaging.PLUGIN;
} else {
pack = Packaging.ALL;
@@ -321,8 +321,9 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
txtArtifactId.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!ignoreTextChange) {
- computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()), valueOrNull(txtVersion.getText()));
+ if(!ignoreTextChange) {
+ computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()),
+ valueOrNull(txtVersion.getText()));
}
}
});
@@ -330,46 +331,49 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
txtGroupId.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!ignoreTextChange) {
- computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()), valueOrNull(txtVersion.getText()));
+ if(!ignoreTextChange) {
+ computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()),
+ valueOrNull(txtVersion.getText()));
}
}
});
txtVersion.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!ignoreTextChange) {
- computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()), valueOrNull(txtVersion.getText()));
+ if(!ignoreTextChange) {
+ computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()),
+ valueOrNull(txtVersion.getText()));
}
}
});
return composite;
- }
-
+ }
+
void okPressedDelegate() {
okPressed();
}
-
+
void updateStatusDelegate(IStatus status) {
updateStatus(status);
}
-
+
private String valueOrNull(String text) {
- return text.trim().length() == 0 ? null : text;
+ return text.trim().length() == 0 ? null : text;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
*/
protected void computeResult() {
- if (showCoords) {
- computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()), valueOrNull(txtVersion.getText()));
+ if(showCoords) {
+ computeResultFromField(valueOrNull(txtGroupId.getText()), valueOrNull(txtArtifactId.getText()),
+ valueOrNull(txtVersion.getText()));
} else {
computeResultFromTree();
}
- }
-
+ }
+
private void computeResultFromField(String groupId, String artifactId, String version) {
selectedIndexedArtifact = cloneIndexedArtifact(selectedIndexedArtifact, groupId, artifactId);
selectedIndexedArtifactFile = cloneIndexedArtifactFile(selectedIndexedArtifactFile, groupId, artifactId, version);
@@ -382,12 +386,13 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
selectedIndexedArtifactFile = pomSelectionComponent.getIndexedArtifactFile();
selectedScope = comScope == null ? null : comScope.getText();
setResult(Collections.singletonList(selectedIndexedArtifactFile));
- if (selectedIndexedArtifactFile != null && showCoords) {
+ if(selectedIndexedArtifactFile != null && showCoords) {
ignoreTextChange = true;
try {
txtGroupId.setText(selectedIndexedArtifactFile.group);
txtArtifactId.setText(selectedIndexedArtifactFile.artifact);
- if (!managed.contains(new ArtifactKey(selectedIndexedArtifactFile.group, selectedIndexedArtifactFile.artifact, selectedIndexedArtifactFile.version, selectedIndexedArtifactFile.classifier))) {
+ if(!managed.contains(new ArtifactKey(selectedIndexedArtifactFile.group, selectedIndexedArtifactFile.artifact,
+ selectedIndexedArtifactFile.version, selectedIndexedArtifactFile.classifier))) {
txtVersion.setText(selectedIndexedArtifactFile.version);
} else {
txtVersion.setText(""); //$NON-NLS-1$
@@ -397,47 +402,34 @@ public class MavenRepositorySearchDialog extends AbstractMavenDialog {
}
}
}
-
+
public IndexedArtifact getSelectedIndexedArtifact() {
return this.selectedIndexedArtifact;
}
-
+
public IndexedArtifactFile getSelectedIndexedArtifactFile() {
return this.selectedIndexedArtifactFile;
}
-
+
public String getSelectedScope() {
return this.selectedScope;
- }
-
+ }
+
private IndexedArtifact cloneIndexedArtifact(IndexedArtifact old, String groupId, String artifactId) {
- if (old == null) {
+ if(old == null) {
return new IndexedArtifact(groupId, artifactId, null, null, null);
}
- return new IndexedArtifact(groupId != null ? groupId : old.getGroupId(),
- artifactId != null ? artifactId : old.getArtifactId(),
- old.getPackageName(), old.getClassname(), old.getPackaging());
+ return new IndexedArtifact(groupId != null ? groupId : old.getGroupId(), artifactId != null ? artifactId
+ : old.getArtifactId(), old.getPackageName(), old.getClassname(), old.getPackaging());
}
-
- private IndexedArtifactFile cloneIndexedArtifactFile(IndexedArtifactFile old, String groupId, String artifactId, String version) {
- if (old == null) {
+
+ private IndexedArtifactFile cloneIndexedArtifactFile(IndexedArtifactFile old, String groupId, String artifactId,
+ String version) {
+ if(old == null) {
return new IndexedArtifactFile(null, groupId, artifactId, version, null, null, null, 0L, null, 0, 0, null, null);
}
- return new IndexedArtifactFile(old.repository,
- groupId,
- artifactId,
- version,
- old.type,
- old.classifier,
- old.fname,
- old.size,
- old.date,
- old.sourcesExists,
- old.javadocExists,
- old.prefix,
- old.goals);
+ return new IndexedArtifactFile(old.repository, groupId, artifactId, version, old.type, old.classifier, old.fname,
+ old.size, old.date, old.sourcesExists, old.javadocExists, old.prefix, old.goals);
}
-
-
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateMavenProjectsDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateMavenProjectsDialog.java
index 9a806989..033dff32 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateMavenProjectsDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/dialogs/UpdateMavenProjectsDialog.java
@@ -79,7 +79,7 @@ public class UpdateMavenProjectsDialog extends TitleAreaDialog implements IMenuL
private Button forceUpdateBtn;
- private Map<String,IProject> projectPaths;
+ private Map<String, IProject> projectPaths;
private final IProject[] initialSelection;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddDependencyOperation.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddDependencyOperation.java
index 2f50b086..da38b76f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddDependencyOperation.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddDependencyOperation.java
@@ -11,12 +11,15 @@ package org.eclipse.m2e.core.ui.internal.editing;
import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCIES;
import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Exclusion;
+
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+
public class AddDependencyOperation implements Operation {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddExclusionOperation.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddExclusionOperation.java
index 5cd9c4b2..011ce86f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddExclusionOperation.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/AddExclusionOperation.java
@@ -5,6 +5,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
+
package org.eclipse.m2e.core.ui.internal.editing;
import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.ARTIFACT_ID;
@@ -17,14 +18,18 @@ import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElementWit
import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
-import org.apache.maven.model.Dependency;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+
+
public class AddExclusionOperation implements Operation {
private static final Logger log = LoggerFactory.getLogger(AddExclusionOperation.class);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/ChangeCreator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/ChangeCreator.java
index c0507e05..ed0dad56 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/ChangeCreator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/ChangeCreator.java
@@ -14,6 +14,9 @@ package org.eclipse.m2e.core.ui.internal.editing;
import java.util.ArrayList;
import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.compare.rangedifferencer.IRangeComparator;
import org.eclipse.compare.rangedifferencer.RangeDifference;
import org.eclipse.compare.rangedifferencer.RangeDifferencer;
@@ -30,8 +33,6 @@ import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/LifecycleMappingOperation.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/LifecycleMappingOperation.java
index d3f3fbe7..a77beabb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/LifecycleMappingOperation.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/LifecycleMappingOperation.java
@@ -12,26 +12,45 @@
package org.eclipse.m2e.core.ui.internal.editing;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.ARTIFACT_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.BUILD;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.CONFIGURATION;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GOAL;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GOALS;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GROUP_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGIN;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGINS;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGIN_MANAGEMENT;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.childEquals;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElementWithText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChilds;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getTextValue;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.setText;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+
import org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory;
import org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+
public class LifecycleMappingOperation implements Operation {
-
private static final Logger log = LoggerFactory.getLogger(LifecycleMappingOperation.class);
@@ -42,16 +61,18 @@ public class LifecycleMappingOperation implements Operation {
private static final String LIFECYCLE_PLUGIN_GROUPID = LifecycleMappingFactory.LIFECYCLE_MAPPING_PLUGIN_GROUPID;
private String version;
+
private String groupId;
+
private String artifactId;
private PluginExecutionAction action;
+
private String[] goals;
-
+
/**
- * If set to true, then the lifecycle mapping metadata is created
- * at the top level of the file, rather than within a plugin.
- * For use when not inside a pom
+ * If set to true, then the lifecycle mapping metadata is created at the top level of the file, rather than within a
+ * plugin. For use when not inside a pom
*/
private boolean createAtTopLevel = false;
@@ -59,7 +80,7 @@ public class LifecycleMappingOperation implements Operation {
PluginExecutionAction action, String[] goals) {
this(pluginGroupId, pluginArtifactId, pluginVersion, action, goals, false);
}
-
+
public LifecycleMappingOperation(String pluginGroupId, String pluginArtifactId, String pluginVersion,
PluginExecutionAction action, String[] goals, boolean createAtTopLevel) {
this.artifactId = pluginArtifactId;
@@ -73,53 +94,51 @@ public class LifecycleMappingOperation implements Operation {
public void process(Document document) {
Element root = document.getDocumentElement();
- Element pluginExecutions; // add the new plugins here
+ Element pluginExecutions; // add the new plugins here
-
//now find the lifecycle stuff if it's there.
- if (createAtTopLevel) {
- if (root == null) {
+ if(createAtTopLevel) {
+ if(root == null) {
// probably an empty document
root = document.createElement("lifecycleMappingMetadata"); //$NON-NLS-1$
document.appendChild(root);
}
- pluginExecutions = getChild(root, "pluginExecutions"); //$NON-NLS-1$
+ pluginExecutions = getChild(root, "pluginExecutions"); //$NON-NLS-1$
} else {
Element managedPlugins = getChild(root, BUILD, PLUGIN_MANAGEMENT, PLUGINS);
- Element lifecyclePlugin = findChild(managedPlugins, PLUGIN,
- childEquals(GROUP_ID, LIFECYCLE_PLUGIN_GROUPID),
+ Element lifecyclePlugin = findChild(managedPlugins, PLUGIN, childEquals(GROUP_ID, LIFECYCLE_PLUGIN_GROUPID),
childEquals(ARTIFACT_ID, LIFECYCLE_PLUGIN_ARTIFACTID));
-
-
- if (lifecyclePlugin == null) {
+
+ if(lifecyclePlugin == null) {
//not found, create
- lifecyclePlugin = PomHelper.createPlugin(managedPlugins, LIFECYCLE_PLUGIN_GROUPID, LIFECYCLE_PLUGIN_ARTIFACTID, LIFECYCLE_PLUGIN_VERSION);
-
+ lifecyclePlugin = PomHelper.createPlugin(managedPlugins, LIFECYCLE_PLUGIN_GROUPID, LIFECYCLE_PLUGIN_ARTIFACTID,
+ LIFECYCLE_PLUGIN_VERSION);
+
//mkleint: a bit scared to have this text localized, with chinese/japanese locales, it could write garbage into the pom file..
- Comment comment = document.createComment("This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself."); //$NON-NLS-1$
+ Comment comment = document
+ .createComment("This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself."); //$NON-NLS-1$
managedPlugins.insertBefore(comment, lifecyclePlugin);
format(comment);
}
-
+
pluginExecutions = getChild(lifecyclePlugin, CONFIGURATION, "lifecycleMappingMetadata", "pluginExecutions"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
//now find the plugin execution for the plugin we have..
Element execution = null;
- for (Element exec : findChilds(pluginExecutions, "pluginExecution")) { //$NON-NLS-1$
- Element filter = findChild(exec, "pluginExecutionFilter", //$NON-NLS-1$
- childEquals(GROUP_ID, groupId),
- childEquals(ARTIFACT_ID, artifactId));
+ for(Element exec : findChilds(pluginExecutions, "pluginExecution")) { //$NON-NLS-1$
+ Element filter = findChild(exec, "pluginExecutionFilter", //$NON-NLS-1$
+ childEquals(GROUP_ID, groupId), childEquals(ARTIFACT_ID, artifactId));
//the action needs to match the action we want..
Element actionEl = findChild(findChild(exec, "action"), action.toString()); //$NON-NLS-1$
- if (filter != null && actionEl != null) {
+ if(filter != null && actionEl != null) {
String versionRange = getTextValue(getChild(filter, "versionRange")); //$NON-NLS-1$
- if (versionRange != null) { // paranoid null check
+ if(versionRange != null) { // paranoid null check
//now we shall do some smart matching on the existing versionRange and our version..
//so far the "smart" thing involves just overwriting the range.
try {
VersionRange range = VersionRange.createFromVersionSpec(versionRange);
- if (!range.containsVersion(new DefaultArtifactVersion(version))) {
+ if(!range.containsVersion(new DefaultArtifactVersion(version))) {
Element rangeEl = findChild(filter, "versionRange"); //$NON-NLS-1$
setText(rangeEl, "[" + version + ",)"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -131,24 +150,24 @@ public class LifecycleMappingOperation implements Operation {
break;
}
}
- if (execution == null) {
+ if(execution == null) {
execution = createPluginExecution(document, pluginExecutions);
}
//now enter/update the goal(s)..
Element goalsEl = getChild(execution, "pluginExecutionFilter", GOALS); //$NON-NLS-1$
List<String> toAddGoals = new ArrayList<String>(Arrays.asList(goals));
- for (Element existingGoal : findChilds(goalsEl, GOAL)) {
+ for(Element existingGoal : findChilds(goalsEl, GOAL)) {
String glValue = getTextValue(existingGoal);
- if (glValue != null && toAddGoals.contains(glValue)) {
+ if(glValue != null && toAddGoals.contains(glValue)) {
toAddGoals.remove(glValue);
}
}
- if (toAddGoals.size() > 0) {
- for (String goal : toAddGoals) {
+ if(toAddGoals.size() > 0) {
+ for(String goal : toAddGoals) {
format(createElementWithText(goalsEl, GOAL, goal));
}
}
-
+
}
private Element createPluginExecution(Document document, Element parent) {
@@ -159,16 +178,18 @@ public class LifecycleMappingOperation implements Operation {
createElementWithText(filter, GROUP_ID, groupId);
createElementWithText(filter, ARTIFACT_ID, artifactId);
createElementWithText(filter, "versionRange", "[" + version + ",)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
Element actionEl = document.createElement("action"); //$NON-NLS-1$
exec.appendChild(actionEl);
Element actionEl2 = document.createElement(action.toString());
actionEl.appendChild(actionEl2);
if(PluginExecutionAction.execute.equals(action)) {
//mkleint: a bit scared to have this text localized, with chinese/japanese locales, it could write garbage into the pom file..
- actionEl2.appendChild(document.createComment("use <runOnIncremental>false</runOnIncremental>to only execute the mojo during full/clean build")); //$NON-NLS-1$
+ actionEl2
+ .appendChild(document
+ .createComment("use <runOnIncremental>false</runOnIncremental>to only execute the mojo during full/clean build")); //$NON-NLS-1$
}
-
+
format(exec);
return exec;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
index 11529a5e..f27262cf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomEdits.java
@@ -10,13 +10,18 @@
* Andrew Eisenberg - Work on Bug 350414
*******************************************************************************/
-
package org.eclipse.m2e.core.ui.internal.editing;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.DocumentRewriteSession;
@@ -30,108 +35,148 @@ import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
+
/**
* this class contains tools for editing the pom files using dom tree operations.
+ *
* @author mkleint
- *
*/
@SuppressWarnings("restriction")
public class PomEdits {
public static final String DEPENDENCIES = "dependencies"; //$NON-NLS-1$
+
public static final String GROUP_ID = "groupId";//$NON-NLS-1$
+
public static final String ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
+
public static final String DEPENDENCY = "dependency"; //$NON-NLS-1$
+
public static final String DEPENDENCY_MANAGEMENT = "dependencyManagement"; //$NON-NLS-1$
+
public static final String EXCLUSIONS = "exclusions"; //$NON-NLS-1$
+
public static final String EXCLUSION = "exclusion"; //$NON-NLS-1$
+
public static final String VERSION = "version"; //$NON-NLS-1$
+
public static final String PLUGIN = "plugin"; //$NON-NLS-1$
+
public static final String CONFIGURATION = "configuration";//$NON-NLS-1$
+
public static final String PLUGINS = "plugins";//$NON-NLS-1$
+
public static final String PLUGIN_MANAGEMENT = "pluginManagement";//$NON-NLS-1$
+
public static final String BUILD = "build";//$NON-NLS-1$
+
public static final String PARENT = "parent";//$NON-NLS-1$
+
public static final String RELATIVE_PATH = "relativePath";//$NON-NLS-1$
+
public static final String TYPE = "type";//$NON-NLS-1$
+
public static final String CLASSIFIER = "classifier";//$NON-NLS-1$
+
public static final String OPTIONAL = "optional";//$NON-NLS-1$
+
public static final String SCOPE = "scope";//$NON-NLS-1$
+
public static final String MODULES = "modules";//$NON-NLS-1$
+
public static final String MODULE = "module";//$NON-NLS-1$
+
public static final String PROFILE = "profile";//$NON-NLS-1$
+
public static final String ID = "id";//$NON-NLS-1$
+
public static final String NAME = "name"; //$NON-NLS-1$
+
public static final String URL = "url";//$NON-NLS-1$
+
public static final String DESCRIPTION = "description";//$NON-NLS-1$
+
public static final String INCEPTION_YEAR = "inceptionYear";//$NON-NLS-1$
+
public static final String ORGANIZATION = "organization"; //$NON-NLS-1$
+
public static final String SCM = "scm"; //$NON-NLS-1$
+
public static final String CONNECTION = "connection";//$NON-NLS-1$
+
public static final String DEV_CONNECTION = "developerConnection";//$NON-NLS-1$
+
public static final String TAG = "tag";//$NON-NLS-1$
+
public static final String ISSUE_MANAGEMENT = "issueManagement"; //$NON-NLS-1$
+
public static final String SYSTEM = "system"; //$NON-NLS-1$
+
public static final String SYSTEM_PATH = "systemPath"; //$NON-NLS-1$
+
public static final String CI_MANAGEMENT = "ciManagement"; //$NON-NLS-1$
+
public static final String PACKAGING = "packaging"; //$NON-NLS-1$
+
public static final String PROPERTIES = "properties"; //$NON-NLS-1$
+
public static final String EXTENSION = "extension"; //$NON-NLS-1$
+
public static final String EXTENSIONS = "extensions"; //$NON-NLS-1$
+
public static final String PROFILES = "profiles";//$NON-NLS-1$
+
public static final String EXECUTIONS = "executions"; //$NON-NLS-1$
+
public static final String EXECUTION = "execution";//$NON-NLS-1$
+
public static final String GOAL = "goal";//$NON-NLS-1$
+
public static final String GOALS = "goals";//$NON-NLS-1$
-
public static Element findChild(Element parent, String name) {
- if (parent == null) {
+ if(parent == null) {
return null;
}
- NodeList rootList = parent.getChildNodes();
- for (int i = 0; i < rootList.getLength(); i++) {
- Node nd = rootList.item(i);
- if (nd instanceof Element) {
- Element el = (Element)nd;
- if (name.equals(el.getNodeName())) {
- return el;
- }
+ NodeList rootList = parent.getChildNodes();
+ for(int i = 0; i < rootList.getLength(); i++ ) {
+ Node nd = rootList.item(i);
+ if(nd instanceof Element) {
+ Element el = (Element) nd;
+ if(name.equals(el.getNodeName())) {
+ return el;
}
+ }
}
return null;
}
public static List<Element> findChilds(Element parent, String name) {
List<Element> toRet = new ArrayList<Element>();
- if (parent != null) {
+ if(parent != null) {
NodeList rootList = parent.getChildNodes();
- for (int i = 0; i < rootList.getLength(); i++) {
- Node nd = rootList.item(i);
- if (nd instanceof Element) {
- Element el = (Element)nd;
- if (name.equals(el.getNodeName())) {
- toRet.add(el);
- }
+ for(int i = 0; i < rootList.getLength(); i++ ) {
+ Node nd = rootList.item(i);
+ if(nd instanceof Element) {
+ Element el = (Element) nd;
+ if(name.equals(el.getNodeName())) {
+ toRet.add(el);
}
+ }
}
}
return toRet;
}
public static String getTextValue(Node element) {
- if (element == null) return null;
+ if(element == null)
+ return null;
StringBuffer buff = new StringBuffer();
NodeList list = element.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
+ for(int i = 0; i < list.getLength(); i++ ) {
Node child = list.item(i);
- if (child instanceof Text) {
- Text text = (Text)child;
+ if(child instanceof Text) {
+ Text text = (Text) child;
buff.append(text.getData().trim()); //352416 the value is trimmed because of the multiline values
//that get trimmed by maven itself as well, any comparison to resolved model needs to do the trimming
// or risks false negative results.
@@ -139,19 +184,20 @@ public class PomEdits {
}
return buff.toString();
}
-
+
/**
- * finds exactly one (first) occurence of child element with the given name (eg. dependency)
- * that fulfills conditions expressed by the Matchers (eg. groupId/artifactId match)
+ * finds exactly one (first) occurence of child element with the given name (eg. dependency) that fulfills conditions
+ * expressed by the Matchers (eg. groupId/artifactId match)
+ *
* @param parent
* @param name
* @param matchers
* @return
*/
public static Element findChild(Element parent, String name, Matcher... matchers) {
- OUTTER: for (Element el : findChilds(parent, name)) {
- for (Matcher match : matchers) {
- if (!match.matches(el)) {
+ OUTTER: for(Element el : findChilds(parent, name)) {
+ for(Matcher match : matchers) {
+ if(!match.matches(el)) {
continue OUTTER;
}
}
@@ -159,10 +205,11 @@ public class PomEdits {
}
return null;
}
-
+
/**
- * helper method, creates a subelement with text embedded. does not format the result.
- * primarily to be used in cases like <code>&lt;goals&gt;&lt;goal&gt;xxx&lt;/goal&gt;&lt;/goals&gt;</code>
+ * helper method, creates a subelement with text embedded. does not format the result. primarily to be used in cases
+ * like <code>&lt;goals&gt;&lt;goal&gt;xxx&lt;/goal&gt;&lt;/goals&gt;</code>
+ *
* @param parent
* @param name
* @param value
@@ -191,30 +238,31 @@ public class PomEdits {
}
/**
- * sets text value to the given element. any existing text children are removed and replaced by this new one.
+ * sets text value to the given element. any existing text children are removed and replaced by this new one.
+ *
* @param element
* @param value
*/
public static void setText(Element element, String value) {
NodeList list = element.getChildNodes();
List<Node> toRemove = new ArrayList<Node>();
- for (int i = 0; i < list.getLength(); i++) {
+ for(int i = 0; i < list.getLength(); i++ ) {
Node child = list.item(i);
- if (child instanceof Text) {
+ if(child instanceof Text) {
toRemove.add(child);
}
}
- for (Node rm : toRemove) {
+ for(Node rm : toRemove) {
element.removeChild(rm);
}
Document doc = element.getOwnerDocument();
element.appendChild(doc.createTextNode(value));
}
-
-
+
/**
- * unlike the findChild() equivalent, this one creates the element if not present and returns it.
- * Therefore it shall only be invoked within the PomEdits.Operation
+ * unlike the findChild() equivalent, this one creates the element if not present and returns it. Therefore it shall
+ * only be invoked within the PomEdits.Operation
+ *
* @param parent
* @param names chain of element names to find/create
* @return
@@ -222,34 +270,34 @@ public class PomEdits {
public static Element getChild(Element parent, String... names) {
Element toFormat = null;
Element toRet = null;
- if (names.length == 0) {
+ if(names.length == 0) {
throw new IllegalArgumentException("At least one child name has to be specified");
}
- for (String name : names) {
+ for(String name : names) {
toRet = findChild(parent, name);
- if (toRet == null) {
+ if(toRet == null) {
toRet = parent.getOwnerDocument().createElement(name);
parent.appendChild(toRet);
- if (toFormat == null) {
+ if(toFormat == null) {
toFormat = toRet;
}
}
parent = toRet;
}
- if (toFormat != null) {
+ if(toFormat != null) {
format(toFormat);
}
return toRet;
}
-
+
/**
* proper remove of a child element
*/
public static void removeChild(Element parent, Element child) {
- if (child != null) {
+ if(child != null) {
Node prev = child.getPreviousSibling();
- if (prev instanceof Text) {
- Text txt = (Text)prev;
+ if(prev instanceof Text) {
+ Text txt = (Text) prev;
int lastnewline = getLastEolIndex(txt.getData());
if(lastnewline >= 0) {
txt.setData(txt.getData().substring(0, lastnewline));
@@ -258,7 +306,7 @@ public class PomEdits {
parent.removeChild(child);
}
}
-
+
private static int getLastEolIndex(String s) {
if(s == null || s.length() == 0) {
return -1;
@@ -279,36 +327,37 @@ public class PomEdits {
}
/**
- * remove the current element if it doesn't contain any sublements, useful for lists etc,
- * works recursively removing all parents up that don't have any children elements.
+ * remove the current element if it doesn't contain any sublements, useful for lists etc, works recursively removing
+ * all parents up that don't have any children elements.
+ *
* @param el
*/
public static void removeIfNoChildElement(Element el) {
NodeList nl = el.getChildNodes();
boolean hasChilds = false;
- for (int i = 0; i < nl.getLength(); i++) {
+ for(int i = 0; i < nl.getLength(); i++ ) {
Node child = nl.item(i);
- if (child instanceof Element) {
+ if(child instanceof Element) {
hasChilds = true;
}
}
- if (!hasChilds) {
+ if(!hasChilds) {
Node parent = el.getParentNode();
- if (parent != null && parent instanceof Element) {
- removeChild((Element)parent, el);
- removeIfNoChildElement((Element)parent);
+ if(parent != null && parent instanceof Element) {
+ removeChild((Element) parent, el);
+ removeIfNoChildElement((Element) parent);
}
}
}
-
+
public static Element insertAt(Element newElement, int offset) {
Document doc = newElement.getOwnerDocument();
- if (doc instanceof IDOMDocument) {
+ if(doc instanceof IDOMDocument) {
IDOMDocument domDoc = (IDOMDocument) doc;
IndexedRegion ir = domDoc.getModel().getIndexedRegion(offset);
- Node parent = ((Node)ir).getParentNode();
- if (ir instanceof Text) {
- Text txt = (Text)ir;
+ Node parent = ((Node) ir).getParentNode();
+ if(ir instanceof Text) {
+ Text txt = (Text) ir;
String data = txt.getData();
int dataSplitIndex = offset - ir.getStartOffset();
String beforeText = data.substring(0, dataSplitIndex);
@@ -318,8 +367,8 @@ public class PomEdits {
parent.replaceChild(after, txt);
parent.insertBefore(newElement, after);
parent.insertBefore(before, newElement);
- } else if (ir instanceof Element) {
- ((Element)ir).appendChild(newElement);
+ } else if(ir instanceof Element) {
+ ((Element) ir).appendChild(newElement);
} else {
throw new IllegalArgumentException();
}
@@ -328,35 +377,37 @@ public class PomEdits {
}
return newElement;
}
-
+
/**
* finds the element at offset, if other type of node at offset, will return it's parent element (if any)
+ *
* @param doc
* @param offset
* @return
*/
public static Element elementAtOffset(Document doc, int offset) {
- if (doc instanceof IDOMDocument) {
+ if(doc instanceof IDOMDocument) {
IDOMDocument domDoc = (IDOMDocument) doc;
IndexedRegion ir = domDoc.getModel().getIndexedRegion(offset);
- if (ir instanceof Element) {
+ if(ir instanceof Element) {
return (Element) ir;
} else {
- Node parent = ((Node)ir).getParentNode();
- if (parent instanceof Element) {
+ Node parent = ((Node) ir).getParentNode();
+ if(parent instanceof Element) {
return (Element) parent;
}
}
}
- return null;
+ return null;
}
-
+
/**
* formats the node (and content). please make sure to only format the node you have created..
+ *
* @param newNode
*/
public static void format(Node newNode) {
- if (newNode.getParentNode() != null && newNode.equals(newNode.getParentNode().getLastChild())) {
+ if(newNode.getParentNode() != null && newNode.equals(newNode.getParentNode().getLastChild())) {
//add a new line to get the newly generated content correctly formatted.
newNode.getParentNode().appendChild(newNode.getParentNode().getOwnerDocument().createTextNode("\n")); //$NON-NLS-1$
}
@@ -367,7 +418,8 @@ public class PomEdits {
}
/**
- * performs an modifying operation on top the
+ * performs an modifying operation on top the
+ *
* @param file
* @param operation
* @throws IOException
@@ -381,35 +433,36 @@ public class PomEdits {
try {
DocumentRewriteSession session = null;
IStructuredTextUndoManager undo = null;
- if (tuple.isReadOnly()) {
+ if(tuple.isReadOnly()) {
domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(tuple.getDocument());
- if (domModel == null) {
- domModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)tuple.getDocument());
+ if(domModel == null) {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(
+ (IStructuredDocument) tuple.getDocument());
}
} else {
- domModel = tuple.getModel() != null ? tuple.getModel() :
- (tuple.getFile() != null
- ? (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(tuple.getFile())
- : (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(tuple.getDocument())); //existing shall be ok here..
-
+ domModel = tuple.getModel() != null ? tuple.getModel()
+ : (tuple.getFile() != null ? (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(
+ tuple.getFile()) : (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(
+ tuple.getDocument())); //existing shall be ok here..
+
//let the model know we make changes
domModel.aboutToChangeModel();
undo = domModel.getStructuredDocument().getUndoManager();
//let the document know we make changes
- if (domModel.getStructuredDocument() instanceof IDocumentExtension4) {
- IDocumentExtension4 ext4 = (IDocumentExtension4)domModel.getStructuredDocument();
+ if(domModel.getStructuredDocument() instanceof IDocumentExtension4) {
+ IDocumentExtension4 ext4 = (IDocumentExtension4) domModel.getStructuredDocument();
session = ext4.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED_SMALL);
}
undo.beginRecording(domModel);
}
-
+
try {
tuple.getOperation().process(domModel.getDocument());
} finally {
- if (!tuple.isReadOnly()) {
+ if(!tuple.isReadOnly()) {
undo.endRecording(domModel);
- if (session != null && domModel.getStructuredDocument() instanceof IDocumentExtension4) {
- IDocumentExtension4 ext4 = (IDocumentExtension4)domModel.getStructuredDocument();
+ if(session != null && domModel.getStructuredDocument() instanceof IDocumentExtension4) {
+ IDocumentExtension4 ext4 = (IDocumentExtension4) domModel.getStructuredDocument();
ext4.stopRewriteSession(session);
}
domModel.changedModel();
@@ -417,9 +470,9 @@ public class PomEdits {
}
} finally {
if(domModel != null) {
- if (tuple.isReadOnly()) {
+ if(tuple.isReadOnly()) {
domModel.releaseFromRead();
- } else if (domModel.getId() != null) { // id will be null for files outside of workspace
+ } else if(domModel.getId() != null) { // id will be null for files outside of workspace
//for ducuments saving shall generally only happen when the model is not held elsewhere (eg. in opened view)
//for files, save always
if(tuple.isForceSave() || domModel.getReferenceCountForEdit() == 1) {
@@ -431,17 +484,23 @@ public class PomEdits {
}
}
}
-
+
public static final class OperationTuple {
private final PomEdits.Operation operation;
+
private final IFile file;
+
private final IDocument document;
+
private final IDOMModel model;
+
private boolean readOnly = false;
+
private boolean forceSave = false;
/**
* operation on top of IFile is always saved
+ *
* @param file
* @param operation
*/
@@ -454,19 +513,24 @@ public class PomEdits {
model = null;
forceSave = true;
}
+
/**
- * operation on top of IDocument is only saved when noone else is editing the document.
+ * operation on top of IDocument is only saved when noone else is editing the document.
+ *
* @param document
* @param operation
*/
public OperationTuple(IDocument document, PomEdits.Operation operation) {
this(document, operation, false);
}
+
/**
- * operation on top of IDocument is only saved when noone else is editing the document.
+ * operation on top of IDocument is only saved when noone else is editing the document.
+ *
* @param document
* @param operation
- * @param readonly operation that doesn't modify the content. Will only get the read, not edit model, up to the user of the code to ensure no edits happen
+ * @param readonly operation that doesn't modify the content. Will only get the read, not edit model, up to the user
+ * of the code to ensure no edits happen
*/
public OperationTuple(IDocument document, PomEdits.Operation operation, boolean readOnly) {
assert operation != null;
@@ -476,8 +540,10 @@ public class PomEdits {
model = null;
this.readOnly = readOnly;
}
+
/**
* only use for unmanaged models
+ *
* @param model
* @param operation
*/
@@ -488,18 +554,18 @@ public class PomEdits {
document = null;
file = null;
}
-
+
/**
* force saving the document after performing the operation
*/
public void setForceSave() {
forceSave = true;
}
-
+
public boolean isForceSave() {
return forceSave;
}
-
+
/**
* @return Returns the readOnly.
*/
@@ -518,89 +584,92 @@ public class PomEdits {
public IDocument getDocument() {
return document;
}
+
public IDOMModel getModel() {
return model;
}
-
+
}
-
+
/**
* operation to perform on top of the DOM document. see performOnDOMDocument()
+ *
* @author mkleint
- *
*/
public static interface Operation {
void process(Document document);
}
-
+
/**
* an Operation instance that aggregates multiple operations and performs then in given order.
+ *
* @author mkleint
- *
*/
public static final class CompoundOperation implements Operation {
-
+
private final Operation[] operations;
public CompoundOperation(Operation... operations) {
this.operations = operations;
}
-
+
public void process(Document document) {
- for (Operation oper : operations) {
+ for(Operation oper : operations) {
oper.process(document);
}
}
}
-
+
/**
- * an interface for identifying child elements that fulfill conditions expressed by the matcher.
+ * an interface for identifying child elements that fulfill conditions expressed by the matcher.
+ *
* @author mkleint
- *
*/
public static interface Matcher {
/**
* returns true if the given element matches the condition.
+ *
* @param child
* @return
*/
boolean matches(Element element);
}
-
+
public static Matcher childEquals(final String elementName, final String matchingValue) {
return new Matcher() {
public boolean matches(Element child) {
String toMatch = PomEdits.getTextValue(PomEdits.findChild(child, elementName));
- return toMatch != null && toMatch.trim().equals(matchingValue);
+ return toMatch != null && toMatch.trim().equals(matchingValue);
}
};
}
-
+
public static Matcher textEquals(final String matchingValue) {
return new Matcher() {
public boolean matches(Element child) {
String toMatch = PomEdits.getTextValue(child);
- return toMatch != null && toMatch.trim().equals(matchingValue);
+ return toMatch != null && toMatch.trim().equals(matchingValue);
}
};
}
-
+
public static Matcher childMissingOrEqual(final String elementName, final String matchingValue) {
return new Matcher() {
public boolean matches(Element child) {
Element match = PomEdits.findChild(child, elementName);
- if (match == null) {
+ if(match == null) {
return true;
}
String toMatch = PomEdits.getTextValue(match);
- return toMatch != null && toMatch.trim().equals(matchingValue);
+ return toMatch != null && toMatch.trim().equals(matchingValue);
}
};
}
-
+
/**
+ * keeps internal state, needs to be recreated for each query, when used in conjunction with out matchers shall
+ * probably be placed last.
*
- * keeps internal state, needs to be recreated for each query, when used in conjunction with out matchers shall probably be placed last.
* @param elementName
* @param index
* @return
@@ -608,14 +677,15 @@ public class PomEdits {
public static Matcher childAt(final int index) {
return new Matcher() {
int count = 0;
+
public boolean matches(Element child) {
- if (count == index) {
+ if(count == index) {
return true;
}
- count++;
+ count++ ;
return false;
}
};
- }
-
-} \ No newline at end of file
+ }
+
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
index 97c765f6..31d3c33e 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/PomHelper.java
@@ -8,11 +8,34 @@
package org.eclipse.m2e.core.ui.internal.editing;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.ARTIFACT_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.CLASSIFIER;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCIES;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCY;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.GROUP_ID;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.PLUGIN;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.SCOPE;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.TYPE;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.VERSION;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.childEquals;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElement;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.createElementWithText;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChilds;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.format;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.getChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.removeChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.setText;
import java.util.List;
-import org.apache.maven.model.Dependency;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -20,11 +43,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.TextChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
-
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
-import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
@@ -33,17 +51,18 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.apache.maven.model.Dependency;
-public final class PomHelper {
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
- private static final Logger LOG = LoggerFactory.getLogger(PomHelper.class);
+public final class PomHelper {
+ private static final Logger LOG = LoggerFactory.getLogger(PomHelper.class);
/*
* Return the Element matching the dependency or null,
@@ -57,15 +76,15 @@ public final class PomHelper {
}
private static boolean isOpened(IDocument document) {
- for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
- for (IWorkbenchPage page : window.getPages()) {
+ for(IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
+ for(IWorkbenchPage page : window.getPages()) {
//page.getEditors() - this call restores all the pages content, didn't feel like doing so, unless
// we can bring to life only the maven pom editors..
- for (IEditorReference ref : page.getEditorReferences()) {
+ for(IEditorReference ref : page.getEditorReferences()) {
IEditorPart editor = ref.getEditor(false);
- if (editor != null) {
+ if(editor != null) {
IDocument doc = (IDocument) editor.getAdapter(IDocument.class);
- if (doc !=null && doc.equals(document)) {
+ if(doc != null && doc.equals(document)) {
return true;
}
}
@@ -74,8 +93,8 @@ public final class PomHelper {
}
return false;
}
+
/**
- *
* @param file
* @param operation
* @param label
@@ -84,7 +103,8 @@ public final class PomHelper {
* @throws CoreException
*/
@SuppressWarnings("restriction")
- public static TextChange createChange(IFile file, Operation operation, String label, boolean forceSave) throws CoreException {
+ public static TextChange createChange(IFile file, Operation operation, String label, boolean forceSave)
+ throws CoreException {
IStructuredModel model = null;
try {
model = StructuredModelManager.getModelManager().getModelForRead(file);
@@ -96,11 +116,13 @@ public final class PomHelper {
IDocument tempDocument = tempModel.getStructuredDocument();
performOnDOMDocument(new OperationTuple((IDOMModel) tempModel, operation));
- TextChange change = new ChangeCreator(!forceSave && existing ? null : file, document, tempDocument, label).createChange();
- if (forceSave) assert change instanceof TextFileChange; //if assert not fullfilled, we will not get the file saved..
-
- if (forceSave && change instanceof TextFileChange) {
- ((TextFileChange)change).setSaveMode(TextFileChange.FORCE_SAVE);
+ TextChange change = new ChangeCreator(!forceSave && existing ? null : file, document, tempDocument, label)
+ .createChange();
+ if(forceSave)
+ assert change instanceof TextFileChange; //if assert not fullfilled, we will not get the file saved..
+
+ if(forceSave && change instanceof TextFileChange) {
+ ((TextFileChange) change).setSaveMode(TextFileChange.FORCE_SAVE);
}
return change;
} catch(Exception exc) {
@@ -116,6 +138,7 @@ public final class PomHelper {
/**
* by default will create a change that won't save files with opened documents
+ *
* @param file
* @param operation
* @param label
@@ -128,6 +151,7 @@ public final class PomHelper {
/**
* creates and adds new plugin to the parent. Formats the result.
+ *
* @param parentList
* @param groupId null or value
* @param artifactId never null
@@ -138,12 +162,12 @@ public final class PomHelper {
Document doc = parentList.getOwnerDocument();
Element plug = doc.createElement(PLUGIN);
parentList.appendChild(plug);
-
- if (groupId != null) {
+
+ if(groupId != null) {
createElementWithText(plug, GROUP_ID, groupId);
}
createElementWithText(plug, ARTIFACT_ID, artifactId);
- if (version != null) {
+ if(version != null) {
createElementWithText(plug, VERSION, version);
}
format(plug);
@@ -152,6 +176,7 @@ public final class PomHelper {
/**
* creates and adds new dependency to the parent. formats the result.
+ *
* @param parentList
* @param groupId null or value
* @param artifactId never null
@@ -160,12 +185,12 @@ public final class PomHelper {
*/
public static Element createDependency(Element parentList, String groupId, String artifactId, String version) {
Element dep = createElement(parentList, DEPENDENCY);
-
- if (groupId != null) {
+
+ if(groupId != null) {
createElementWithText(dep, GROUP_ID, groupId);
}
createElementWithText(dep, ARTIFACT_ID, artifactId);
- if (version != null) {
+ if(version != null) {
createElementWithText(dep, VERSION, version);
}
format(dep);
@@ -174,15 +199,17 @@ public final class PomHelper {
/**
* node is expected to be the node containing <dependencies> node, so <project>, <dependencyManagement> etc..
+ *
* @param node
* @return
*/
public static List<Element> findDependencies(Element node) {
return findChilds(findChild(node, DEPENDENCIES), DEPENDENCY);
}
-
+
/**
* null in any value parameter mean remove the element.
+ *
* @param depsEl
* @param groupId
* @param artifactId
@@ -192,36 +219,35 @@ public final class PomHelper {
* @param classifier
* @return the root xml element of the dependency
*/
- public static Element addOrUpdateDependency(Element depsEl, String groupId, String artifactId, String version, String type, String scope, String classifier) {
- Element dep = findChild(depsEl, DEPENDENCY,
- childEquals(GROUP_ID, groupId),
- childEquals(ARTIFACT_ID, artifactId));
- if (dep == null) {
+ public static Element addOrUpdateDependency(Element depsEl, String groupId, String artifactId, String version,
+ String type, String scope, String classifier) {
+ Element dep = findChild(depsEl, DEPENDENCY, childEquals(GROUP_ID, groupId), childEquals(ARTIFACT_ID, artifactId));
+ if(dep == null) {
dep = createDependency(depsEl, groupId, artifactId, version);
} else {
//only set version if already exists
- if (version != null) {
+ if(version != null) {
setText(getChild(dep, VERSION), version);
} else {
removeChild(dep, findChild(dep, VERSION));
}
}
- if (type != null //
+ if(type != null //
&& !"jar".equals(type) // //$NON-NLS-1$
&& !"null".equals(type)) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
-
+
setText(getChild(dep, TYPE), type);
} else {
removeChild(dep, findChild(dep, TYPE));
}
-
- if (classifier != null) {
+
+ if(classifier != null) {
setText(getChild(dep, CLASSIFIER), classifier);
} else {
removeChild(dep, findChild(dep, CLASSIFIER));
}
-
- if (scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
+
+ if(scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
setText(getChild(dep, SCOPE), scope);
} else {
removeChild(dep, findChild(dep, SCOPE));
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/RemoveDependencyOperation.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/RemoveDependencyOperation.java
index 93fb88a3..b670a682 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/RemoveDependencyOperation.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/editing/RemoveDependencyOperation.java
@@ -8,11 +8,19 @@
package org.eclipse.m2e.core.ui.internal.editing;
-import org.apache.maven.model.Dependency;
-import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.*;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.DEPENDENCIES;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.findChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.removeChild;
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.removeIfNoChildElement;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+
+
public class RemoveDependencyOperation implements Operation {
private Dependency dependency;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
index 4ee049ef..c261f314 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
@@ -25,18 +25,21 @@ import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.PackagingTypeMap
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.PackagingTypeMappingConfiguration.PackagingTypeMappingRequirement;
import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
+
/**
* AggregateMappingLabelProvider
- *
+ *
* @author mkleint
*/
@SuppressWarnings("restriction")
public class AggregateMappingLabelProvider implements ILifecycleMappingLabelProvider {
private final List<ILifecycleMappingLabelProvider> content;
+
private final ILifecycleMappingRequirement element;
- public AggregateMappingLabelProvider(ILifecycleMappingRequirement element, List<ILifecycleMappingLabelProvider> content) {
+ public AggregateMappingLabelProvider(ILifecycleMappingRequirement element,
+ List<ILifecycleMappingLabelProvider> content) {
this.content = content;
this.element = element;
}
@@ -57,8 +60,8 @@ public class AggregateMappingLabelProvider implements ILifecycleMappingLabelProv
}
public boolean isError(LifecycleMappingConfiguration mappingConfiguration) {
- for (ILifecycleMappingLabelProvider pr : content) {
- if (pr.isError(mappingConfiguration)) {
+ for(ILifecycleMappingLabelProvider pr : content) {
+ if(pr.isError(mappingConfiguration)) {
return true;
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ILifecycleMappingLabelProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ILifecycleMappingLabelProvider.java
index 18e1c669..7bbfa961 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ILifecycleMappingLabelProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ILifecycleMappingLabelProvider.java
@@ -15,6 +15,7 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.ILifecycleMappingRequirement;
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.LifecycleMappingConfiguration;
+
/**
* ILifecycleMappingLabelProvider
*
@@ -26,9 +27,9 @@ public interface ILifecycleMappingLabelProvider {
* Returns label of Maven Project element, i.e. project itself, packaging type, plugin execution, etc.
*/
public String getMavenText();
-
+
public boolean isError(LifecycleMappingConfiguration mappingConfiguration);
-
+
public ILifecycleMappingRequirement getKey();
public Collection<MavenProject> getProjects();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/PackagingTypeMappingLabelProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/PackagingTypeMappingLabelProvider.java
index 215bd061..a74a0f84 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/PackagingTypeMappingLabelProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/PackagingTypeMappingLabelProvider.java
@@ -28,9 +28,11 @@ import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.ProjectLifecycle
public class PackagingTypeMappingLabelProvider implements ILifecycleMappingLabelProvider {
private PackagingTypeMappingConfiguration element;
+
private ProjectLifecycleMappingConfiguration prjconf;
- public PackagingTypeMappingLabelProvider(ProjectLifecycleMappingConfiguration prjconf, PackagingTypeMappingConfiguration element) {
+ public PackagingTypeMappingLabelProvider(ProjectLifecycleMappingConfiguration prjconf,
+ PackagingTypeMappingConfiguration element) {
this.element = element;
this.prjconf = prjconf;
}
@@ -46,7 +48,6 @@ public class PackagingTypeMappingLabelProvider implements ILifecycleMappingLabel
return !mappingConfiguration.isRequirementSatisfied(getKey(), true);
}
-
/* (non-Javadoc)
* @see org.eclipse.m2e.core.ui.internal.lifecyclemapping.ILifecycleMappingLabelProvider#getKey()
*/
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ProjectLifecycleMappingElement.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ProjectLifecycleMappingElement.java
index 4691d5aa..c18258ec 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ProjectLifecycleMappingElement.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/ProjectLifecycleMappingElement.java
@@ -20,7 +20,7 @@ public class ProjectLifecycleMappingElement {
private final ProjectLifecycleMappingConfiguration project;
private final ILifecycleMappingElement element;
-
+
public ProjectLifecycleMappingElement(ProjectLifecycleMappingConfiguration project, ILifecycleMappingElement element) {
this.project = project;
this.element = element;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
index c1dddff3..71cd78f1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/markers/MarkerResolutionGenerator.java
@@ -35,12 +35,13 @@ import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob;
+
public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IMarkerResolutionGenerator2 {
private static final Logger LOG = LoggerFactory.getLogger(MarkerResolutionGenerator.class);
static QualifiedName QUALIFIED = new QualifiedName("org.eclipse.m2e.core.ui", "refreshResolution"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
public boolean hasResolutions(IMarker marker) {
// TODO is the resolution for all lifecycle markers??
return true;
@@ -52,7 +53,7 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
//for each file have just one instance of the discover proposal array.
//important for 335299
IMarkerResolution[] cached = (IMarkerResolution[]) marker.getResource().getSessionProperty(QUALIFIED);
- if (cached == null) {
+ if(cached == null) {
cached = new IMarkerResolution[] {new RefreshResolution(marker)};
marker.getResource().setSessionProperty(QUALIFIED, cached);
}
@@ -61,9 +62,8 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
return new IMarkerResolution[] {new RefreshResolution(marker)};
}
}
-
- private class RefreshResolution extends WorkbenchMarkerResolution {
+ private class RefreshResolution extends WorkbenchMarkerResolution {
private IMarker marker;
@@ -103,7 +103,7 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
final Set<IProject> projects = getProjects(marker);
new UpdateMavenProjectJob(projects.toArray(new IProject[projects.size()])).schedule();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.views.markers.WorkbenchMarkerResolution#run(org.eclipse.core.resources.IMarker[], org.eclipse.core.runtime.IProgressMonitor)
*/
@@ -111,7 +111,6 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
final Set<IProject> projects = getProjects(markers);
new UpdateMavenProjectJob(projects.toArray(new IProject[projects.size()])).schedule();
}
-
/**
* @param markers
@@ -119,10 +118,10 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
*/
private Set<IProject> getProjects(IMarker... markers) {
Set<IProject> toRet = new HashSet<IProject>();
- for (IMarker mark : markers) {
+ for(IMarker mark : markers) {
IResource res = mark.getResource();
IProject prj = res.getProject();
- if (prj != null) {
+ if(prj != null) {
toRet.add(prj);
}
}
@@ -134,9 +133,9 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
*/
public IMarker[] findOtherMarkers(IMarker[] markers) {
List<IMarker> toRet = new ArrayList<IMarker>();
- for (IMarker m : markers) {
+ for(IMarker m : markers) {
try {
- if (IMavenConstants.MARKER_CONFIGURATION_ID.equals(m.getType()) && m != marker) {
+ if(IMavenConstants.MARKER_CONFIGURATION_ID.equals(m.getType()) && m != marker) {
//TODO is this the only condition for lifecycle markers
toRet.add(m);
}
@@ -147,7 +146,6 @@ public class MarkerResolutionGenerator implements IMarkerResolutionGenerator, IM
return toRet.toArray(new IMarker[0]);
}
-
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java
index 480f0dad..433e01f5 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java
@@ -23,46 +23,44 @@ import org.eclipse.swt.widgets.Text;
/**
- * A field editor for a combo box that allows the drop-down selection of one of
- * a list of items.
- *
- * Adapted from org.eclipse.jface.preference.ComboFieldEditor
+ * A field editor for a combo box that allows the drop-down selection of one of a list of items. Adapted from
+ * org.eclipse.jface.preference.ComboFieldEditor
*/
public class GoalsFieldEditor extends FieldEditor {
- /**
- * The <code>Combo</code> widget.
- */
- Text goalsText;
-
- /**
- * The value (not the name) of the currently selected item in the Combo widget.
- */
- String value;
+ /**
+ * The <code>Combo</code> widget.
+ */
+ Text goalsText;
+
+ /**
+ * The value (not the name) of the currently selected item in the Combo widget.
+ */
+ String value;
private Button goialsSelectButton;
private final String buttonText;
-
- /**
+
+ /**
* Create the combo box field editor.
*
* @param name the name of the preference this field editor works on
* @param labelText the label text of the field editor
- * @param buttonText
+ * @param buttonText
* @param entryValues the entry values
* @param parent the parent composite
*/
- public GoalsFieldEditor(String name, String labelText, String buttonText, Composite parent) {
+ public GoalsFieldEditor(String name, String labelText, String buttonText, Composite parent) {
init(name, labelText);
this.buttonText = buttonText;
- createControl(parent);
- }
+ createControl(parent);
+ }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
- */
- protected void adjustForNumColumns(int numColumns) {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
+ */
+ protected void adjustForNumColumns(int numColumns) {
if(numColumns > 1) {
Control control = getLabelControl();
((GridData) control.getLayoutData()).horizontalSpan = numColumns;
@@ -74,10 +72,10 @@ public class GoalsFieldEditor extends FieldEditor {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
- */
- protected void doFillIntoGrid(Composite parent, int numColumns) {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
+ */
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
Control labelControl = getLabelControl(parent);
GridData gd = new GridData();
gd.horizontalSpan = numColumns;
@@ -92,7 +90,7 @@ public class GoalsFieldEditor extends FieldEditor {
gd.grabExcessHorizontalSpace = true;
goalsText.setLayoutData(gd);
goalsText.setFont(parent.getFont());
-
+
goialsSelectButton = new Button(parent, SWT.NONE);
goialsSelectButton.setText(buttonText);
goialsSelectButton.addSelectionListener(new MavenGoalSelectionAdapter(goalsText, parent.getShell()));
@@ -103,45 +101,45 @@ public class GoalsFieldEditor extends FieldEditor {
goalsText.setLayoutData(gd);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doLoad()
- */
- protected void doLoad() {
- updateComboForValue(getPreferenceStore().getString(getPreferenceName()));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
- */
- protected void doLoadDefault() {
- updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName()));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#doStore()
- */
- protected void doStore() {
- if (value == null) {
- getPreferenceStore().setToDefault(getPreferenceName());
- } else {
- getPreferenceStore().setValue(getPreferenceName(), value);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
- */
- public int getNumberOfControls() {
- return 2;
- }
-
- /*
- * Lazily create and return the Combo control.
- */
- private Text getTextControl(Composite parent) {
- if (goalsText == null) {
- goalsText = new Text(parent, SWT.BORDER);
- goalsText.setFont(parent.getFont());
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoad()
+ */
+ protected void doLoad() {
+ updateComboForValue(getPreferenceStore().getString(getPreferenceName()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
+ */
+ protected void doLoadDefault() {
+ updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doStore()
+ */
+ protected void doStore() {
+ if(value == null) {
+ getPreferenceStore().setToDefault(getPreferenceName());
+ } else {
+ getPreferenceStore().setValue(getPreferenceName(), value);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
+ */
+ public int getNumberOfControls() {
+ return 2;
+ }
+
+ /*
+ * Lazily create and return the Combo control.
+ */
+ private Text getTextControl(Composite parent) {
+ if(goalsText == null) {
+ goalsText = new Text(parent, SWT.BORDER);
+ goalsText.setFont(parent.getFont());
// for (int i = 0; i < entryValues.length; i++) {
// goalsCombo.add(entryValues[i], i);
// }
@@ -153,26 +151,26 @@ public class GoalsFieldEditor extends FieldEditor {
// fireValueChanged(VALUE, oldValue, value);
// }
// });
- goalsText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent modifyevent) {
- String oldValue = value;
- value = goalsText.getText();
- setPresentsDefaultValue(false);
- fireValueChanged(VALUE, oldValue, value);
- }
- });
- }
- return goalsText;
- }
-
- protected void setPresentsDefaultValue(boolean booleanValue) {
- super.setPresentsDefaultValue(booleanValue);
- }
-
- protected void fireValueChanged(String property, Object oldValue, Object newValue) {
- super.fireValueChanged(property, oldValue, newValue);
- }
-
+ goalsText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent modifyevent) {
+ String oldValue = value;
+ value = goalsText.getText();
+ setPresentsDefaultValue(false);
+ fireValueChanged(VALUE, oldValue, value);
+ }
+ });
+ }
+ return goalsText;
+ }
+
+ protected void setPresentsDefaultValue(boolean booleanValue) {
+ super.setPresentsDefaultValue(booleanValue);
+ }
+
+ protected void fireValueChanged(String property, Object oldValue, Object newValue) {
+ super.fireValueChanged(property, oldValue, newValue);
+ }
+
// /*
// * Given the name (label) of an entry, return the corresponding value.
// */
@@ -185,12 +183,12 @@ public class GoalsFieldEditor extends FieldEditor {
// }
// return fEntryValues[0][0];
// }
-
- /*
- * Set the name in the combo widget to match the specified value.
- */
- private void updateComboForValue(String value) {
- this.value = value;
- goalsText.setText(value);
- }
+
+ /*
+ * Set the name in the combo widget to match the specified value.
+ */
+ private void updateComboForValue(String value) {
+ this.value = value;
+ goalsText.setText(value);
+ }
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
index 30644535..7385f938 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LifecycleMappingPropertyPage.java
@@ -39,9 +39,9 @@ public class LifecycleMappingPropertyPage extends PropertyPage {
public void setElement(IAdaptable element) {
super.setElement(element);
-
+
IProject project = (IProject) getElement().getAdapter(IProject.class);
- if (project != null) {
+ if(project != null) {
mappingsViewer.setTarget(project);
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
index 8b58738f..1befee5d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
@@ -16,18 +16,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.catalog.ArchetypeCatalog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.TitleAreaDialog;
-
-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory;
-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -44,6 +37,15 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+
+import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+
/**
* Local Archetype catalog dialog
*
@@ -54,7 +56,7 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
private static final String DIALOG_SETTINGS = LocalArchetypeCatalogDialog.class.getName();
private static final String KEY_LOCATIONS = "catalogLocation"; //$NON-NLS-1$
-
+
private static final int MAX_HISTORY = 15;
private String title;
@@ -69,7 +71,6 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
private ArchetypeCatalogFactory archetypeCatalogFactory;
-
protected LocalArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) {
super(shell);
this.archetypeCatalogFactory = factory;
@@ -119,7 +120,7 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title);
String location = dialog.open();
- if(location!=null) {
+ if(location != null) {
catalogLocationCombo.setText(location);
update();
}
@@ -132,13 +133,12 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
catalogDescriptionText = new Text(composite, SWT.BORDER);
catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
-
- if(archetypeCatalogFactory!=null) {
+
+ if(archetypeCatalogFactory != null) {
catalogLocationCombo.setText(archetypeCatalogFactory.getId());
catalogDescriptionText.setText(archetypeCatalogFactory.getDescription());
}
-
+
ModifyListener modifyListener = new ModifyListener() {
public void modifyText(final ModifyEvent e) {
update();
@@ -168,9 +168,9 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
protected void okPressed() {
String description = catalogDescriptionText.getText().trim();
String location = catalogLocationCombo.getText().trim();
-
+
archetypeCatalogFactory = new LocalCatalogFactory(location, description, true);
-
+
saveValue(KEY_LOCATIONS, location);
super.okPressed();
@@ -205,11 +205,11 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
setMessage(null, IStatus.WARNING);
String location = catalogLocationCombo.getText().trim();
- if(location.length()==0) {
+ if(location.length() == 0) {
setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_no_location);
return false;
}
-
+
if(!new File(location).exists()) {
setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_exist);
return false;
@@ -219,10 +219,10 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
ArchetypeCatalog archetypeCatalog = factory.getArchetypeCatalog();
@SuppressWarnings("unchecked")
List<Archetype> archetypes = archetypeCatalog.getArchetypes();
- if(archetypes==null || archetypes.size()==0) {
+ if(archetypes == null || archetypes.size() == 0) {
setMessage(Messages.LocalArchetypeCatalogDialog_error_empty, IStatus.WARNING);
}
-
+
return true;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
index e38c377c..bdef27cd 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
@@ -57,9 +57,9 @@ import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory;
-import org.eclipse.m2e.core.internal.archetype.ArchetypeManager;
import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.internal.archetype.ArchetypeManager;
import org.eclipse.m2e.core.ui.internal.Messages;
@@ -72,16 +72,17 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
private static final Logger log = LoggerFactory.getLogger(MavenArchetypesPreferencePage.class);
ArchetypeManager archetypeManager;
+
TableViewer archetypesViewer;
List<ArchetypeCatalogFactory> archetypeCatalogs;
-
+
public MavenArchetypesPreferencePage() {
setTitle(Messages.MavenArchetypesPreferencePage_title);
this.archetypeManager = MavenPluginActivator.getDefault().getArchetypeManager();
}
-
+
protected void performDefaults() {
for(Iterator<ArchetypeCatalogFactory> it = archetypeCatalogs.iterator(); it.hasNext();) {
ArchetypeCatalogFactory factory = it.next();
@@ -89,10 +90,10 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
it.remove();
}
}
-
+
archetypesViewer.setInput(archetypeCatalogs);
archetypesViewer.setSelection(null, true);
-
+
super.performDefaults();
}
@@ -108,17 +109,17 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
archetypeManager.addArchetypeCatalogFactory(factory);
}
}
-
+
try {
archetypeManager.saveCatalogs();
} catch(IOException ex) {
setErrorMessage(NLS.bind(Messages.MavenArchetypesPreferencePage_error, ex.getMessage()));
return false;
}
-
+
return super.performOk();
}
-
+
public void init(IWorkbench workbench) {
}
@@ -136,7 +137,8 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
addRemoveOrLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
- URL url = new URL("http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-catalog.html"); //$NON-NLS-1$
+ URL url = new URL(
+ "http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-catalog.html"); //$NON-NLS-1$
IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
browser.openURL(url);
} catch(MalformedURLException ex) {
@@ -144,7 +146,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
} catch(PartInitException ex) {
log.error(ex.getMessage(), ex);
}
- }
+ }
});
// archetypesViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.FULL_SELECTION);
@@ -160,13 +162,13 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
}
return new Object[0];
}
-
+
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public void dispose() {
}
-
+
});
Table table = archetypesViewer.getTable();
@@ -184,7 +186,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
addLocalButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null);
- if (dialog.open()==Window.OK) {
+ if(dialog.open() == Window.OK) {
ArchetypeCatalogFactory factory = dialog.getArchetypeCatalogFactory();
archetypeCatalogs.add(factory);
archetypesViewer.setInput(archetypeCatalogs);
@@ -199,7 +201,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
addRemoteButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null);
- if (dialog.open()==Window.OK) {
+ if(dialog.open() == Window.OK) {
ArchetypeCatalogFactory factory = dialog.getArchetypeCatalogFactory();
archetypeCatalogs.add(factory);
archetypesViewer.setInput(archetypeCatalogs);
@@ -207,7 +209,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
}
}
});
-
+
final Button editButton = new Button(composite, SWT.NONE);
editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
editButton.setEnabled(false);
@@ -218,18 +220,18 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
ArchetypeCatalogFactory newFactory = null;
if(factory instanceof LocalCatalogFactory) {
LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory);
- if (dialog.open()==Window.OK) {
+ if(dialog.open() == Window.OK) {
newFactory = dialog.getArchetypeCatalogFactory();
}
} else if(factory instanceof RemoteCatalogFactory) {
RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory);
- if (dialog.open()==Window.OK) {
+ if(dialog.open() == Window.OK) {
newFactory = dialog.getArchetypeCatalogFactory();
}
}
- if(newFactory!=null) {
+ if(newFactory != null) {
int n = archetypeCatalogs.indexOf(factory);
- if(n>-1) {
+ if(n > -1) {
archetypeCatalogs.set(n, newFactory);
archetypesViewer.setInput(archetypeCatalogs);
archetypesViewer.setSelection(new StructuredSelection(newFactory), true);
@@ -250,7 +252,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
archetypesViewer.setSelection(null, true);
}
});
-
+
archetypesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if(archetypesViewer.getSelection() instanceof IStructuredSelection) {
@@ -261,11 +263,11 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
}
}
});
-
+
archetypeCatalogs = new ArrayList<ArchetypeCatalogFactory>(archetypeManager.getArchetypeCatalogs());
archetypesViewer.setInput(archetypeCatalogs);
- archetypesViewer.refresh(); // should listen on property changes instead?
-
+ archetypesViewer.refresh(); // should listen on property changes instead?
+
return composite;
}
@@ -274,9 +276,8 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
return (ArchetypeCatalogFactory) selection.getFirstElement();
}
-
static class CatalogsLabelProvider implements ITableLabelProvider, IColorProvider {
-
+
private Color disabledColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
public String getColumnText(Object element, int columnIndex) {
@@ -285,13 +286,13 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
return NLS.bind(Messages.MavenArchetypesPreferencePage_local, factory.getDescription());
} else if(factory instanceof RemoteCatalogFactory) {
if(factory.isEditable()) {
- return NLS.bind(Messages.MavenArchetypesPreferencePage_remote,factory.getDescription());
+ return NLS.bind(Messages.MavenArchetypesPreferencePage_remote, factory.getDescription());
}
return NLS.bind(Messages.MavenArchetypesPreferencePage_packaged, factory.getDescription());
}
return factory.getDescription();
}
-
+
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
@@ -304,7 +305,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
ArchetypeCatalogFactory factory = (ArchetypeCatalogFactory) element;
return !factory.isEditable() ? disabledColor : null;
}
-
+
public void dispose() {
}
@@ -314,10 +315,10 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo
public void addListener(ILabelProviderListener listener) {
}
-
+
public void removeListener(ILabelProviderListener listener) {
}
}
-
+
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java
index 10f316b9..97a26369 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java
@@ -12,61 +12,64 @@
package org.eclipse.m2e.core.ui.internal.preferences;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.m2e.core.ui.internal.dialogs.MavenGoalSelectionDialog;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.m2e.core.ui.internal.dialogs.MavenGoalSelectionDialog;
+
+
public class MavenGoalSelectionAdapter extends SelectionAdapter {
- private Shell shell;
- private Text text;
+ private Shell shell;
- public MavenGoalSelectionAdapter(Text text, Shell shell) {
- this.text = text;
- this.shell = shell;
- }
+ private Text text;
+
+ public MavenGoalSelectionAdapter(Text text, Shell shell) {
+ this.text = text;
+ this.shell = shell;
+ }
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(SelectionEvent e) {
// String fileName = Util.substituteVar(fPomDirName.getText());
// if(!isDirectoryExist(fileName)) {
// MessageDialog.openError(getShell(), Messages.getString("launch.errorPomMissing"),
// Messages.getString("launch.errorSelectPom")); //$NON-NLS-1$ //$NON-NLS-2$
// return;
// }
- MavenGoalSelectionDialog dialog = new MavenGoalSelectionDialog(shell);
- int rc = dialog.open();
- if(rc == IDialogConstants.OK_ID) {
- text.insert(""); // clear selected text //$NON-NLS-1$
-
- String txt = text.getText();
- int len = txt.length();
- int pos = text.getCaretPosition();
-
- StringBuffer sb = new StringBuffer();
- if((pos > 0 && txt.charAt(pos - 1) != ' ')) {
- sb.append(' ');
- }
+ MavenGoalSelectionDialog dialog = new MavenGoalSelectionDialog(shell);
+ int rc = dialog.open();
+ if(rc == IDialogConstants.OK_ID) {
+ text.insert(""); // clear selected text //$NON-NLS-1$
- String sep = ""; //$NON-NLS-1$
- Object[] o = dialog.getResult();
- for(int i = 0; i < o.length; i++ ) {
- if(o[i] instanceof MavenGoalSelectionDialog.Entry) {
- if(dialog.isQualifiedName()) {
- sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getQualifiedName());
- } else {
- sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getName());
- }
+ String txt = text.getText();
+ int len = txt.length();
+ int pos = text.getCaretPosition();
+
+ StringBuffer sb = new StringBuffer();
+ if((pos > 0 && txt.charAt(pos - 1) != ' ')) {
+ sb.append(' ');
+ }
+
+ String sep = ""; //$NON-NLS-1$
+ Object[] o = dialog.getResult();
+ for(int i = 0; i < o.length; i++ ) {
+ if(o[i] instanceof MavenGoalSelectionDialog.Entry) {
+ if(dialog.isQualifiedName()) {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getQualifiedName());
+ } else {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getName());
}
- sep = " "; //$NON-NLS-1$
- }
-
- if(pos < len && txt.charAt(pos) != ' ') {
- sb.append(' ');
}
-
- text.insert(sb.toString());
- text.setFocus();
+ sep = " "; //$NON-NLS-1$
}
+
+ if(pos < len && txt.charAt(pos) != ' ') {
+ sb.append(' ');
+ }
+
+ text.insert(sb.toString());
+ text.setFocus();
}
- } \ No newline at end of file
+ }
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
index bd4d5569..c2105492 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
@@ -97,9 +97,9 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
private static final Logger log = LoggerFactory.getLogger(MavenInstallationsPreferencePage.class);
final MavenRuntimeManager runtimeManager;
-
+
final IMavenConfiguration mavenConfiguration;
-
+
final IMaven maven;
MavenRuntime defaultRuntime;
@@ -109,7 +109,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
CheckboxTableViewer runtimesViewer;
Text globalSettingsText;
-
+
private String globalSettings;
boolean dirty = false;
@@ -133,8 +133,8 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
runtimesViewer.setInput(runtimes);
runtimesViewer.setChecked(defaultRuntime, true);
- runtimesViewer.refresh();
-
+ runtimesViewer.refresh();
+
storeCustom(""); //$NON-NLS-1$
globalSettingsText.setText(""); //$NON-NLS-1$
try {
@@ -142,14 +142,13 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
} catch(CoreException e) {
log.error(e.getMessage(), e);
}
-
+
updateGlobals(true);
super.performDefaults();
setDirty(true);
}
-
-
- protected void storeCustom(String dir){
+
+ protected void storeCustom(String dir) {
M2EUIPluginActivator.getDefault().getPreferenceStore().setValue(P_MAVEN_CUSTOM_GLOBAL, dir == null ? "" : dir); //$NON-NLS-1$
}
@@ -173,7 +172,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
log.error(e.getMessage(), e);
throw new RuntimeException(e.getMessage(), e);
}
- if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
+ if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime) {
storeCustom(dir);
}
IndexManager indexManager = MavenPlugin.getIndexManager();
@@ -182,48 +181,51 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
} catch(CoreException ex) {
return ex.getStatus();
}
- if((dir == null && oldSettings != null) || (dir != null && !(dir.equals(oldSettings)))){
+ if((dir == null && oldSettings != null) || (dir != null && !(dir.equals(oldSettings)))) {
//mavenPlugin.getIndexManager().scheduleIndexUpdate(IndexManager.LOCAL_INDEX, true, 0L);
}
return Status.OK_STATUS;
}
}.schedule();
}
-
+
@Override
public boolean performOk() {
- if (dirty) {
+ if(dirty) {
updateSettings();
}
return true;
}
-
- public void setDirty(boolean dirty){
+
+ public void setDirty(boolean dirty) {
this.dirty = dirty;
}
-
- public boolean isDirty(){
+
+ public boolean isDirty() {
return this.dirty;
}
-
- protected boolean validateMavenInstall(String dir){
- if(dir == null || dir.length() == 0){
+
+ protected boolean validateMavenInstall(String dir) {
+ if(dir == null || dir.length() == 0) {
return false;
}
File selectedDir = new File(dir);
- if(!selectedDir.isDirectory()){
- MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error_message);
+ if(!selectedDir.isDirectory()) {
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title,
+ Messages.MavenInstallationsPreferencePage_error_message);
return false;
}
File binDir = new File(dir, "bin"); //$NON-NLS-1$
File confDir = new File(dir, "conf"); //$NON-NLS-1$
File libDir = new File(dir, "lib"); //$NON-NLS-1$
- if(!binDir.exists() || !confDir.exists() || !libDir.exists()){
- MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error2_message);
+ if(!binDir.exists() || !confDir.exists() || !libDir.exists()) {
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title,
+ Messages.MavenInstallationsPreferencePage_error2_message);
return false;
}
return true;
}
+
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
@@ -237,12 +239,10 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
Label link = new Label(composite, SWT.NONE);
link.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
link.setText(Messages.MavenInstallationsPreferencePage_link);
-
createTable(composite);
createGlobalSettings(composite);
-
defaultRuntime = runtimeManager.getDefaultRuntime();
runtimes = runtimeManager.getMavenRuntimes();
@@ -257,13 +257,13 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
setGlobalSettingsText(globalSettingsText.getText());
updateGlobalSettingsLink();
checkSettings();
- setDirty(true);
+ setDirty(true);
}
});
return composite;
}
-
+
/**
*
*/
@@ -271,30 +271,34 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
String globalSettings = getGlobalSettingsFile(useLastCustomGlobal);
globalSettingsText.setText(globalSettings == null ? "" : globalSettings); //$NON-NLS-1$
}
-
+
/**
* Use this to retrieve the global settings file which has not been applied yet
+ *
* @return
*/
private String getGlobalSettingsFile(boolean useLastCustomGlobal) {
- if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
+ if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime) {
String globalSettings = null;
- if(useLastCustomGlobal){
+ if(useLastCustomGlobal) {
globalSettings = M2EUIPluginActivator.getDefault().getPreferenceStore().getString(P_MAVEN_CUSTOM_GLOBAL);
} else {
- globalSettings = M2EUIPluginActivator.getDefault().getPreferenceStore().getString(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE);
+ globalSettings = M2EUIPluginActivator.getDefault().getPreferenceStore()
+ .getString(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE);
}
- return globalSettings.trim().length()==0 ? null : globalSettings;
+ return globalSettings.trim().length() == 0 ? null : globalSettings;
}
return defaultRuntime == null ? null : defaultRuntime.getSettings();
- }
-
- public void setGlobalSettingsText(String settings){
+ }
+
+ public void setGlobalSettingsText(String settings) {
this.globalSettings = settings;
}
- public String getGlobalSettingsText(){
+
+ public String getGlobalSettingsText() {
return this.globalSettings;
}
+
/**
*
*/
@@ -307,55 +311,55 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
private Link globalSettingsLink;
private Button globalSettingsBrowseButton;
-
- private MavenRuntime getCheckedRuntime(){
+
+ private MavenRuntime getCheckedRuntime() {
Object[] runtimes = runtimesViewer.getCheckedElements();
- if(runtimes != null && runtimes.length > 0){
- return (MavenRuntime)runtimes[0];
+ if(runtimes != null && runtimes.length > 0) {
+ return (MavenRuntime) runtimes[0];
}
return null;
}
-
- protected MavenRuntime getSelectedMavenRuntime(){
- IStructuredSelection sel = (IStructuredSelection)runtimesViewer.getSelection();
+
+ protected MavenRuntime getSelectedMavenRuntime() {
+ IStructuredSelection sel = (IStructuredSelection) runtimesViewer.getSelection();
return (MavenRuntime) sel.getFirstElement();
}
-
- private void updateGlobalSettingsLink(){
+
+ private void updateGlobalSettingsLink() {
MavenRuntime runtime = getCheckedRuntime();
String text = ""; //$NON-NLS-1$
String currText = globalSettingsText.getText();
boolean showURL = false;
-
+
File f = new File(currText);
- if(f.exists()){
+ if(f.exists()) {
showURL = true;
}
String openFile = showURL ? Messages.MavenInstallationsPreferencePage_link_open : ""; //$NON-NLS-1$
- if(runtime instanceof MavenEmbeddedRuntime){
+ if(runtime instanceof MavenEmbeddedRuntime) {
text = NLS.bind(Messages.MavenInstallationsPreferencePage_settings, openFile);
} else {
text = NLS.bind(Messages.MavenInstallationsPreferencePage_settings_install, openFile);
}
globalSettingsLink.setText(text);
}
-
- private void updateGlobalSettingsBrowseButton(){
+
+ private void updateGlobalSettingsBrowseButton() {
MavenRuntime runtime = getCheckedRuntime();
boolean enabled = (runtime != null && (runtime instanceof MavenEmbeddedRuntime));
globalSettingsBrowseButton.setEnabled(enabled);
globalSettingsText.setEditable(enabled);
}
-
+
private void createGlobalSettings(Composite composite) {
globalSettingsLink = new Link(composite, SWT.NONE);
globalSettingsLink.setData("name", "globalSettingsLink"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
globalSettingsLink.setToolTipText(Messages.MavenInstallationsPreferencePage_link_global);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
gd.verticalIndent = 25;
globalSettingsLink.setLayoutData(gd);
-
+
globalSettingsLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String globalSettings = getGlobalSettings();
@@ -391,9 +395,8 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
}
});
}
-
- private void createTable(Composite composite){
+ private void createTable(Composite composite) {
runtimesViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.FULL_SELECTION);
runtimesViewer.setLabelProvider(new RuntimesLabelProvider());
@@ -436,20 +439,21 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
dlg.setText(Messages.MavenInstallationsPreferencePage_dialog_install_title);
dlg.setMessage(Messages.MavenInstallationsPreferencePage_dialog_install_message);
String dir = dlg.open();
- if(dir == null){
+ if(dir == null) {
return;
}
boolean ok = validateMavenInstall(dir);
- if(ok){
+ if(ok) {
MavenRuntime runtime = MavenRuntimeManager.createExternalRuntime(dir);
if(runtimes.contains(runtime)) {
- MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error3_message);
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title,
+ Messages.MavenInstallationsPreferencePage_error3_message);
} else {
runtimes.add(runtime);
runtimesViewer.refresh();
runtimesViewer.setAllChecked(false);
runtimesViewer.setChecked(runtime, true);
- if(runtime != null){
+ if(runtime != null) {
setCheckedRuntime(runtime);
}
}
@@ -473,12 +477,13 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
if(ok && !dir.equals(runtime.getLocation())) {
MavenRuntime newRuntime = MavenRuntimeManager.createExternalRuntime(dir);
if(runtimes.contains(newRuntime)) {
- MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error4_message);
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title,
+ Messages.MavenInstallationsPreferencePage_error4_message);
} else {
runtimes.set(runtimes.indexOf(runtime), newRuntime);
runtimesViewer.refresh();
setDirty(true);
- if(newRuntime != null){
+ if(newRuntime != null) {
setCheckedRuntime(newRuntime);
}
}
@@ -518,9 +523,9 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
runtimesViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
- if(event.getElement() != null && event.getChecked()){
-
- setCheckedRuntime((MavenRuntime)event.getElement());
+ if(event.getElement() != null && event.getChecked()) {
+
+ setCheckedRuntime((MavenRuntime) event.getElement());
}
}
});
@@ -528,10 +533,10 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
GridData noteLabelData = new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1);
noteLabelData.horizontalIndent = 15;
noteLabelData.widthHint = 100;
-
+
noteLabel.setLayoutData(noteLabelData);
- noteLabel.setText(Messages.MavenInstallationsPreferencePage_lblNote1 +
- Messages.MavenInstallationsPreferencePage_lblNote2);
+ noteLabel.setText(Messages.MavenInstallationsPreferencePage_lblNote1
+ + Messages.MavenInstallationsPreferencePage_lblNote2);
noteLabel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
@@ -546,10 +551,10 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
}
});
}
-
+
private static final String P_MAVEN_CUSTOM_GLOBAL = "customGlobalSettingsFile"; //$NON-NLS-1$
-
- protected void setCheckedRuntime(MavenRuntime runtime){
+
+ protected void setCheckedRuntime(MavenRuntime runtime) {
runtimesViewer.setAllChecked(false);
runtimesViewer.setChecked(runtime, true);
defaultRuntime = runtime;
@@ -575,13 +580,12 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
List<SettingsProblem> result = maven.validateSettings(globalSettings);
if(result.size() > 0) {
- setMessage(Messages.MavenInstallationsPreferencePage_error_global_parse + result.get(0).getMessage(), IMessageProvider.WARNING);
+ setMessage(Messages.MavenInstallationsPreferencePage_error_global_parse + result.get(0).getMessage(),
+ IMessageProvider.WARNING);
}
}
-
-
@SuppressWarnings("rawtypes")
void openEditor(final String fileName) {
// XXX create new settings.xml if does not exist
@@ -626,7 +630,6 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
}
}
-
void invalidateMavenSettings(final boolean reindex) {
// new Job("Invalidating Maven settings") {
// protected IStatus run(IProgressMonitor monitor) {
@@ -638,6 +641,7 @@ public class MavenInstallationsPreferencePage extends PreferencePage implements
// }
// }.schedule();
}
+
String getGlobalSettings() {
return globalSettingsText.getText().trim();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
index 89c2d53d..d8704424 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
@@ -15,24 +15,15 @@ package org.eclipse.m2e.core.ui.internal.preferences;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.eclipse.core.internal.filesystem.local.LocalFile;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.Messages;
@@ -41,7 +32,7 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class MavenPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private static final Logger log = LoggerFactory.getLogger(MavenPreferencePage.class);
-
+
public MavenPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
@@ -64,32 +55,29 @@ public class MavenPreferencePage extends FieldEditorPreferencePage implements IW
Messages.preferencesGlobalUpdateNever, getFieldEditorParent()));
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DEBUG_OUTPUT, //
- Messages.preferencesDebugOutput,
- getFieldEditorParent()));
+ Messages.preferencesDebugOutput, getFieldEditorParent()));
// addField( new BooleanFieldEditor( MavenPreferenceConstants.P_UPDATE_SNAPSHOTS,
// Messages.getString( "preferences.updateSnapshots" ), //$NON-NLS-1$
// getFieldEditorParent() ) );
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DOWNLOAD_SOURCES, //
- Messages.preferencesDownloadSources,
- getFieldEditorParent()));
+ Messages.preferencesDownloadSources, getFieldEditorParent()));
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DOWNLOAD_JAVADOC, //
- Messages.preferencesDownloadJavadoc,
- getFieldEditorParent()));
+ Messages.preferencesDownloadJavadoc, getFieldEditorParent()));
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_UPDATE_INDEXES, //
Messages.MavenPreferencePage_download, //
getFieldEditorParent()));
-
+
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_UPDATE_PROJECTS, //
Messages.MavenPreferencePage_update, //
getFieldEditorParent()));
-
+
addField(new BooleanFieldEditor(MavenPreferenceConstants.P_HIDE_FOLDERS_OF_NESTED_PROJECTS, //
Messages.MavenPreferencePage_hide, getFieldEditorParent()));
-
+
GridData comboCompositeGridData = new GridData();
comboCompositeGridData.verticalIndent = 25;
comboCompositeGridData.horizontalSpan = 3;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
index 36cb144c..9dc7f03b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
@@ -38,17 +38,19 @@ import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.core.project.ResolverConfiguration;
import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* Maven project preference page
- *
+ *
* @author Eugene Kuleshov
*/
public class MavenProjectPreferencePage extends PropertyPage {
private static final Logger log = LoggerFactory.getLogger(MavenProjectPreferencePage.class);
private Button resolveWorspaceProjectsButton;
+
// private Button includeModulesButton;
-
+
private Text selectedProfilesText;
public MavenProjectPreferencePage() {
@@ -93,14 +95,14 @@ public class MavenProjectPreferencePage extends PropertyPage {
// + "project build path (use \"Update Sources\" action)");
init(getResolverConfiguration());
-
+
return composite;
}
protected void performDefaults() {
init(new ResolverConfiguration());
}
-
+
private void init(ResolverConfiguration configuration) {
resolveWorspaceProjectsButton.setSelection(configuration.shouldResolveWorkspaceProjects());
@@ -122,37 +124,37 @@ public class MavenProjectPreferencePage extends PropertyPage {
final ResolverConfiguration configuration = getResolverConfiguration();
if(configuration.getSelectedProfiles().equals(selectedProfilesText.getText()) &&
// configuration.shouldIncludeModules()==includeModulesButton.getSelection() &&
- configuration.shouldResolveWorkspaceProjects()==resolveWorspaceProjectsButton.getSelection()) {
+ configuration.shouldResolveWorkspaceProjects() == resolveWorspaceProjectsButton.getSelection()) {
return true;
}
-
+
configuration.setResolveWorkspaceProjects(resolveWorspaceProjectsButton.getSelection());
// configuration.setIncludeModules(includeModulesButton.getSelection());
configuration.setSelectedProfiles(selectedProfilesText.getText());
-
+
IProjectConfigurationManager projectManager = MavenPlugin.getProjectConfigurationManager();
boolean isSet = projectManager.setResolverConfiguration(getProject(), configuration);
if(isSet) {
- boolean res = MessageDialog.openQuestion(getShell(), Messages.MavenProjectPreferencePage_dialog_title, //
- Messages.MavenProjectPreferencePage_dialog_message);
- if(res) {
- WorkspaceJob job = new WorkspaceJob(NLS.bind(Messages.MavenProjectPreferencePage_job, project.getName() )) {
- public IStatus runInWorkspace(IProgressMonitor monitor) {
- try {
- MavenPlugin.getProjectConfigurationManager().updateProjectConfiguration(project, monitor);
- } catch(CoreException ex) {
- return ex.getStatus();
- }
- return Status.OK_STATUS;
+ boolean res = MessageDialog.openQuestion(getShell(), Messages.MavenProjectPreferencePage_dialog_title, //
+ Messages.MavenProjectPreferencePage_dialog_message);
+ if(res) {
+ WorkspaceJob job = new WorkspaceJob(NLS.bind(Messages.MavenProjectPreferencePage_job, project.getName())) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ MavenPlugin.getProjectConfigurationManager().updateProjectConfiguration(project, monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
}
- };
- job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
- job.schedule();
- }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
}
-
+
return isSet;
}
@@ -166,4 +168,3 @@ public class MavenProjectPreferencePage extends PropertyPage {
}
}
-
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
index 6eb02459..0a171918 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
@@ -82,9 +82,9 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
private static final Logger log = LoggerFactory.getLogger(MavenSettingsPreferencePage.class);
final MavenRuntimeManager runtimeManager;
-
+
final IMavenConfiguration mavenConfiguration;
-
+
final IMaven maven;
MavenRuntime defaultRuntime;
@@ -108,13 +108,12 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
public void init(IWorkbench workbench) {
}
-
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
*/
public void setVisible(boolean visible) {
super.setVisible(visible);
- if(visible){
+ if(visible) {
updateLocalRepository();
}
}
@@ -126,9 +125,9 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
super.performDefaults();
}
- protected void updateSettings(final boolean updateMavenDependencies){
+ protected void updateSettings(final boolean updateMavenDependencies) {
final String userSettings = getUserSettings();
-
+
new Job(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_job_updating) {
protected IStatus run(IProgressMonitor monitor) {
try {
@@ -146,50 +145,50 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
IndexManager indexManager = MavenPlugin.getIndexManager();
indexManager.getWorkspaceIndex().updateIndex(true, monitor);
}
- if(updateMavenDependencies){
+ if(updateMavenDependencies) {
IMavenProjectFacade[] projects = MavenPlugin.getMavenProjectRegistry().getProjects();
ArrayList<IProject> allProjects = new ArrayList<IProject>();
- if(projects != null){
+ if(projects != null) {
MavenPlugin.getMaven().reloadSettings();
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, projects.length);
- for(int i=0;i<projects.length;i++){
- subMonitor.beginTask(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_task_updating, projects[i].getProject().getName()), 1);
+ for(int i = 0; i < projects.length; i++ ) {
+ subMonitor.beginTask(NLS.bind(
+ org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_task_updating, projects[i]
+ .getProject().getName()), 1);
allProjects.add(projects[i].getProject());
}
- MavenPlugin.getMavenProjectRegistry()
- .refresh(
- new MavenUpdateRequest(allProjects.toArray(new IProject[] {}), mavenConfiguration.isOffline(),
- true));
+ MavenPlugin.getMavenProjectRegistry().refresh(
+ new MavenUpdateRequest(allProjects.toArray(new IProject[] {}), mavenConfiguration.isOffline(), true));
subMonitor.done();
}
}
return Status.OK_STATUS;
- } catch (CoreException e) {
+ } catch(CoreException e) {
log.error(e.getMessage(), e);
return e.getStatus();
}
}
}.schedule();
}
-
+
protected void performApply() {
- if(dirty){
+ if(dirty) {
updateSettings(false);
}
}
-
+
public boolean performOk() {
- if (dirty) {
+ if(dirty) {
updateSettings(false);
}
return true;
}
-
- public void setDirty(boolean dirty){
+
+ public void setDirty(boolean dirty) {
this.dirty = dirty;
}
-
- public boolean isDirty(){
+
+ public boolean isDirty() {
return this.dirty;
}
@@ -205,30 +204,30 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
createUserSettings(composite);
Label localRepositoryLabel = new Label(composite, SWT.NONE);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
- gd.verticalIndent=25;
+ gd.verticalIndent = 25;
localRepositoryLabel.setLayoutData(gd);
localRepositoryLabel.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_lblLocal);
-
- localRepositoryText = new Text(composite, SWT.READ_ONLY|SWT.BORDER);
+
+ localRepositoryText = new Text(composite, SWT.READ_ONLY | SWT.BORDER);
localRepositoryText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
localRepositoryText.setData("name", "localRepositoryText"); //$NON-NLS-1$ //$NON-NLS-2$
localRepositoryText.setEditable(false);
Button reindexButton = new Button(composite, SWT.NONE);
reindexButton.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1));
reindexButton.setText(Messages.preferencesReindexButton);
- reindexButton.addSelectionListener(new SelectionAdapter(){
+ reindexButton.addSelectionListener(new SelectionAdapter() {
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected(SelectionEvent e) {
new WorkspaceJob(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_job_indexing) {
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
IndexManager indexManager = MavenPlugin.getIndexManager();
- indexManager.getWorkspaceIndex().updateIndex(true, monitor);
- return Status.OK_STATUS;
- }
- }.schedule();
+ indexManager.getWorkspaceIndex().updateIndex(true, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
});
defaultRuntime = runtimeManager.getDefaultRuntime();
@@ -253,14 +252,15 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
return composite;
}
-
- public void updateSettingsLink(boolean active){
+
+ public void updateSettingsLink(boolean active) {
String text = org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_link1;
- if(active){
+ if(active) {
text = org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_link2;
}
userSettingsLink.setText(text);
}
+
/**
* @param composite
*/
@@ -271,7 +271,7 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
userSettingsLink.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_link2);
userSettingsLink.setToolTipText(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_link_tooltip);
GridData gd_userSettingsLabel = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
-
+
gd_userSettingsLabel.verticalIndent = 15;
userSettingsLink.setLayoutData(gd_userSettingsLabel);
userSettingsLink.addSelectionListener(new SelectionAdapter() {
@@ -292,7 +292,7 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
Button userSettingsBrowseButton = new Button(composite, SWT.NONE);
GridData gd_userSettingsBrowseButton = new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1);
-
+
userSettingsBrowseButton.setLayoutData(gd_userSettingsBrowseButton);
userSettingsBrowseButton.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_btnBrowse);
userSettingsBrowseButton.addSelectionListener(new SelectionAdapter() {
@@ -312,11 +312,11 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
}
}
});
-
+
Button updateSettings = new Button(composite, SWT.NONE);
updateSettings.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_btnUpdate);
- updateSettings.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e){
+ updateSettings.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
updateSettings(true);
}
});
@@ -328,13 +328,13 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
try {
Settings settings = maven.buildSettings(globalSettings, userSettings);
String localRepository = settings.getLocalRepository();
- if(localRepository == null){
+ if(localRepository == null) {
localRepository = RepositorySystem.defaultUserLocalRepository.getAbsolutePath();
}
if(!localRepositoryText.isDisposed()) {
localRepositoryText.setText(localRepository == null ? "" : localRepository); //$NON-NLS-1$
}
- } catch (CoreException e) {
+ } catch(CoreException e) {
setMessage(e.getMessage(), IMessageProvider.ERROR);
}
}
@@ -347,23 +347,25 @@ public class MavenSettingsPreferencePage extends PreferencePage implements IWork
if(userSettings != null && userSettings.length() > 0) {
File userSettingsFile = new File(userSettings);
if(!userSettingsFile.exists()) {
- setMessage(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_error_missing, IMessageProvider.WARNING);
+ setMessage(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_error_missing,
+ IMessageProvider.WARNING);
userSettings = null;
-
+
} else {
fileExists = true;
}
-
+
} else {
userSettings = null;
}
updateSettingsLink(fileExists);
List<SettingsProblem> result = maven.validateSettings(userSettings);
if(result.size() > 0) {
- setMessage(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_error_parse, result.get(0).getMessage()), IMessageProvider.WARNING);
+ setMessage(NLS.bind(org.eclipse.m2e.core.ui.internal.Messages.MavenSettingsPreferencePage_error_parse, result
+ .get(0).getMessage()), IMessageProvider.WARNING);
}
}
-
+
void openEditor(final String fileName) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
index 5613ca42..50e29b98 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
@@ -16,8 +16,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import org.apache.maven.archetype.catalog.Archetype;
-import org.apache.maven.archetype.catalog.ArchetypeCatalog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -26,11 +24,6 @@ import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.TitleAreaDialog;
-
-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory;
-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -47,6 +40,15 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+
+import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+
/**
* Remote Archetype catalog dialog
*
@@ -62,7 +64,7 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
private static final String DIALOG_SETTINGS = RemoteArchetypeCatalogDialog.class.getName();
private static final String KEY_LOCATIONS = "catalogUrl"; //$NON-NLS-1$
-
+
private static final int MAX_HISTORY = 15;
private String title;
@@ -79,7 +81,6 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
Button verifyButton;
-
protected RemoteArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) {
super(shell);
this.archetypeCatalogFactory = factory;
@@ -127,12 +128,12 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
catalogDescriptionText = new Text(composite, SWT.BORDER);
catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
- if(archetypeCatalogFactory!=null) {
+
+ if(archetypeCatalogFactory != null) {
catalogUrlCombo.setText(archetypeCatalogFactory.getId());
catalogDescriptionText.setText(archetypeCatalogFactory.getDescription());
}
-
+
ModifyListener modifyListener = new ModifyListener() {
public void modifyText(final ModifyEvent e) {
update();
@@ -140,7 +141,7 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
};
catalogUrlCombo.addModifyListener(modifyListener);
catalogDescriptionText.addModifyListener(modifyListener);
-
+
return composite;
}
@@ -162,7 +163,7 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
if(isHelpAvailable()) {
createHelpControl(composite);
}
-
+
verifyButton = createButton(composite, VERIFY_ID, Messages.RemoteArchetypeCatalogDialog_btnVerify, false);
verifyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -179,17 +180,18 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
} finally {
final IStatus s = status;
@SuppressWarnings("unchecked")
- final List<Archetype> archetypes = catalog==null ? Collections.emptyList() : catalog.getArchetypes();
+ final List<Archetype> archetypes = catalog == null ? Collections.emptyList() : catalog.getArchetypes();
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
verifyButton.setEnabled(true);
if(!s.isOK()) {
- setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read,s.getMessage()));
+ setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read, s.getMessage()));
getButton(IDialogConstants.OK_ID).setEnabled(false);
- } else if(archetypes.size()==0) {
+ } else if(archetypes.size() == 0) {
setMessage(Messages.RemoteArchetypeCatalogDialog_error_empty, IStatus.WARNING);
} else {
- setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()), IStatus.INFO);
+ setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()),
+ IStatus.INFO);
}
}
});
@@ -199,20 +201,20 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
}.schedule();
}
});
-
- Label filler= new Label(composite, SWT.NONE);
+
+ Label filler = new Label(composite, SWT.NONE);
filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- layout.numColumns++;
-
- super.createButtonsForButtonBar(composite); // cancel button
-
+ layout.numColumns++ ;
+
+ super.createButtonsForButtonBar(composite); // cancel button
+
return composite;
}
-
+
protected Button getButton(int id) {
return super.getButton(id);
}
-
+
private String[] getSavedValues(String key) {
String[] array = dialogSettings.getArray(key);
return array == null ? new String[0] : array;
@@ -232,9 +234,9 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
protected void okPressed() {
String description = catalogDescriptionText.getText().trim();
String location = catalogUrlCombo.getText().trim();
-
+
archetypeCatalogFactory = new RemoteCatalogFactory(location, description, true);
-
+
saveValue(KEY_LOCATIONS, location);
super.okPressed();
@@ -268,14 +270,13 @@ public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
setErrorMessage(null);
setMessage(null, IStatus.WARNING);
-
String url = catalogUrlCombo.getText().trim();
- if(url.length()==0) {
+ if(url.length() == 0) {
setErrorMessage(Messages.RemoteArchetypeCatalogDialog_error_required);
verifyButton.setEnabled(false);
return false;
}
-
+
verifyButton.setEnabled(true);
return true;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/UserInterfacePreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/UserInterfacePreferencePage.java
index bd84fde3..fee99a74 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/UserInterfacePreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/UserInterfacePreferencePage.java
@@ -23,9 +23,9 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class UserInterfacePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
+
private Composite parent;
-
+
public UserInterfacePreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
index cf6d72f2..48cc049c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/WarningsPreferencePage.java
@@ -24,9 +24,9 @@ import org.eclipse.m2e.core.ui.internal.Messages;
public class WarningsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
+
private Composite parent;
-
+
public WarningsPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
@@ -43,17 +43,13 @@ public class WarningsPreferencePage extends FieldEditorPreferencePage implements
public void createFieldEditors() {
parent = getFieldEditorParent();
String text;
-
+
text = NLS.bind(Messages.MavenWarningsPreferencePage_groupidDupParent,
org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_groupid);
- addField(new BooleanFieldEditor(
- MavenPreferenceConstants.P_DISABLE_GROUPID_DUP_OF_PARENT_WARNING,
- text, parent));
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DISABLE_GROUPID_DUP_OF_PARENT_WARNING, text, parent));
text = NLS.bind(Messages.MavenWarningsPreferencePage_versionDupParent,
org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_version);
- addField(new BooleanFieldEditor(
- MavenPreferenceConstants.P_DISABLE_VERSION_DUP_OF_PARENT_WARNING,
- text, parent));
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DISABLE_VERSION_DUP_OF_PARENT_WARNING, text, parent));
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ArtifactInfo.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ArtifactInfo.java
index ea5b18ee..b046cabf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ArtifactInfo.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ArtifactInfo.java
@@ -11,19 +11,22 @@
package org.eclipse.m2e.core.ui.internal.search.util;
-
/**
* Information about the artifact.
- *
+ *
* @author Lukas Krecan
*/
public class ArtifactInfo {
private final String groupId;
+
private final String artifactId;
+
private final String version;
+
private final String classfier;
+
private final String type;
-
+
public ArtifactInfo(String groupId, String artifactId, String version, String classfier, String type) {
this.groupId = groupId;
this.artifactId = artifactId;
@@ -53,26 +56,23 @@ public class ArtifactInfo {
}
/**
- * Constructs a <code>String</code> with all attributes
- * in name = value format.
- *
- * @return a <code>String</code> representation
- * of this object.
+ * Constructs a <code>String</code> with all attributes in name = value format.
+ *
+ * @return a <code>String</code> representation of this object.
*/
- public String toString()
- {
- final String TAB = " "; //$NON-NLS-1$
-
- String retValue = ""; //$NON-NLS-1$
-
- retValue = "ArtifactInfo ( " //$NON-NLS-1$
- + "groupId = " + this.groupId + TAB //$NON-NLS-1$
- + "artifactId = " + this.artifactId + TAB //$NON-NLS-1$
- + "version = " + this.version + TAB //$NON-NLS-1$
- + "classfier = " + this.classfier + TAB //$NON-NLS-1$
- + "type = " + this.type + TAB //$NON-NLS-1$
- + " )"; //$NON-NLS-1$
-
- return retValue;
+ public String toString() {
+ final String TAB = " "; //$NON-NLS-1$
+
+ String retValue = ""; //$NON-NLS-1$
+
+ retValue = "ArtifactInfo ( " //$NON-NLS-1$
+ + "groupId = " + this.groupId + TAB //$NON-NLS-1$
+ + "artifactId = " + this.artifactId + TAB //$NON-NLS-1$
+ + "version = " + this.version + TAB //$NON-NLS-1$
+ + "classfier = " + this.classfier + TAB //$NON-NLS-1$
+ + "type = " + this.type + TAB //$NON-NLS-1$
+ + " )"; //$NON-NLS-1$
+
+ return retValue;
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
index aa465fc1..088b9014 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/CComboContentAdapter.java
@@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Control;
* An {@link IControlContentAdapter} for SWT CCombo controls. This is a convenience class for easily creating a
* {@link ContentProposalAdapter} for combo fields.
*/
-public class CComboContentAdapter implements IControlContentAdapter /*, IControlContentAdapter2 */ {
+public class CComboContentAdapter implements IControlContentAdapter /*, IControlContentAdapter2 */{
/*
* Set to <code>true</code> if we should compute the text
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
index 8c90a57d..e08fb8d2 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/ControlDecoration.java
@@ -9,7 +9,6 @@
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
-
package org.eclipse.m2e.core.ui.internal.search.util;
import org.eclipse.core.runtime.ListenerList;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/IndexSearchEngine.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/IndexSearchEngine.java
index 3d43497e..313f1611 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/IndexSearchEngine.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/IndexSearchEngine.java
@@ -19,16 +19,17 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.maven.artifact.versioning.ComparableVersion;
import org.eclipse.core.runtime.CoreException;
+import org.apache.maven.artifact.versioning.ComparableVersion;
+
import org.eclipse.m2e.core.internal.index.IIndex;
import org.eclipse.m2e.core.internal.index.IndexManager;
import org.eclipse.m2e.core.internal.index.IndexedArtifact;
import org.eclipse.m2e.core.internal.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.index.MatchTyped.MatchType;
import org.eclipse.m2e.core.internal.index.MatchTypedStringSearchExpression;
import org.eclipse.m2e.core.internal.index.SearchExpression;
-import org.eclipse.m2e.core.internal.index.MatchTyped.MatchType;
/**
@@ -69,8 +70,8 @@ public class IndexSearchEngine implements SearchEngine {
try {
TreeSet<String> ids = new TreeSet<String>();
- for(IndexedArtifact artifact : index.find(groupIdSearchExpressions, null, null, packaging.toSearchExpression() == null ? null :
- Collections.singleton(packaging.toSearchExpression()))) {
+ for(IndexedArtifact artifact : index.find(groupIdSearchExpressions, null, null,
+ packaging.toSearchExpression() == null ? null : Collections.singleton(packaging.toSearchExpression()))) {
ids.add(artifact.getArtifactId());
}
return subSet(ids, searchExpression);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectEvent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectEvent.java
index 15745da3..07cd9d93 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectEvent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectEvent.java
@@ -11,67 +11,61 @@
package org.eclipse.m2e.core.ui.internal.search.util;
-
import org.eclipse.swt.events.TypedEvent;
import org.eclipse.swt.widgets.Event;
+
/**
- * Instances of this class are sent whenever the platform-
- * specific trigger for showing a context menu is detected.
- *
+ * Instances of this class are sent whenever the platform- specific trigger for showing a context menu is detected.
+ *
* @see MenuDetectListener
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
* @since 3.3
*/
public final class MenuDetectEvent extends TypedEvent {
- /**
- * the display-relative x coordinate of the pointer
- * at the time the context menu trigger occurred
- */
- public int x;
-
- /**
- * the display-relative y coordinate of the pointer
- * at the time the context menu trigger occurred
- */
- public int y;
-
- /**
- * A flag indicating whether the operation should be allowed.
- * Setting this field to <code>false</code> will cancel the operation.
- */
- public boolean doit;
+ /**
+ * the display-relative x coordinate of the pointer at the time the context menu trigger occurred
+ */
+ public int x;
- private static final long serialVersionUID = -3061660596590828941L;
+ /**
+ * the display-relative y coordinate of the pointer at the time the context menu trigger occurred
+ */
+ public int y;
-/**
- * Constructs a new instance of this class based on the
- * information in the given untyped event.
- *
- * @param e the untyped event containing the information
- */
-public MenuDetectEvent(Event e) {
- super(e);
- this.x = e.x;
- this.y = e.y;
- this.doit = e.doit;
-}
+ /**
+ * A flag indicating whether the operation should be allowed. Setting this field to <code>false</code> will cancel the
+ * operation.
+ */
+ public boolean doit;
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " x=" + x //$NON-NLS-1$
- + " y=" + y //$NON-NLS-1$
- + " doit=" + doit //$NON-NLS-1$
- + "}"; //$NON-NLS-1$
-}
+ private static final long serialVersionUID = -3061660596590828941L;
+
+ /**
+ * Constructs a new instance of this class based on the information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+ public MenuDetectEvent(Event e) {
+ super(e);
+ this.x = e.x;
+ this.y = e.y;
+ this.doit = e.doit;
+ }
+
+ /**
+ * Returns a string containing a concise, human-readable description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+ public String toString() {
+ String string = super.toString();
+ return string.substring(0, string.length() - 1) // remove trailing '}'
+ + " x=" + x //$NON-NLS-1$
+ + " y=" + y //$NON-NLS-1$
+ + " doit=" + doit //$NON-NLS-1$
+ + "}"; //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectListener.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectListener.java
index 26cb1421..0b8cc610 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectListener.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/MenuDetectListener.java
@@ -11,33 +11,27 @@
package org.eclipse.m2e.core.ui.internal.search.util;
-
import java.util.EventListener;
+
/**
- * Classes which implement this interface provide methods
- * that deal with the events that are generated when the
- * platform-specific trigger for showing a context menu is
- * detected.
+ * Classes which implement this interface provide methods that deal with the events that are generated when the
+ * platform-specific trigger for showing a context menu is detected.
* <p>
- * After creating an instance of a class that implements
- * this interface it can be added to a control or TrayItem
- * using the <code>addMenuDetectListener</code> method and
- * removed using the <code>removeMenuDetectListener</code> method.
- * When the context menu trigger occurs, the
- * <code>menuDetected</code> method will be invoked.
+ * After creating an instance of a class that implements this interface it can be added to a control or TrayItem using
+ * the <code>addMenuDetectListener</code> method and removed using the <code>removeMenuDetectListener</code> method.
+ * When the context menu trigger occurs, the <code>menuDetected</code> method will be invoked.
* </p>
- *
+ *
* @see MenuDetectEvent
- *
* @since 3.3
*/
public interface MenuDetectListener extends EventListener {
-/**
- * Sent when the platform-dependent trigger for showing a menu item is detected.
- *
- * @param e an event containing information about the menu detect
- */
-public void menuDetected (MenuDetectEvent e);
+ /**
+ * Sent when the platform-dependent trigger for showing a menu item is detected.
+ *
+ * @param e an event containing information about the menu detect
+ */
+ public void menuDetected(MenuDetectEvent e);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/SearchEngine.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/SearchEngine.java
index c6f8634a..6230c4da 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/SearchEngine.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/search/util/SearchEngine.java
@@ -20,9 +20,10 @@ import java.util.Collection;
* @author Lukas Krecan
*/
public interface SearchEngine {
-
+
/**
- * Finds groupIds for given expression.
+ * Finds groupIds for given expression.
+ *
* @param searchExpression
* @param packaging
* @param containingArtifact When looking for exclusion, contains information about artifact we are excluding from.
@@ -32,18 +33,22 @@ public interface SearchEngine {
/**
* Finds artifactIds for given expression
+ *
* @param groupId
* @param searchExpression
* @param packaging
- * @param containingArtifact When looking for exclusion, contains information about artifact we are excluding from.
+ * @param containingArtifact When looking for exclusion, contains information about artifact we are excluding from.
* @return
*/
- public Collection<String> findArtifactIds(String groupId, String searchExpression, Packaging packaging, ArtifactInfo containingArtifact);
+ public Collection<String> findArtifactIds(String groupId, String searchExpression, Packaging packaging,
+ ArtifactInfo containingArtifact);
public Collection<String> findVersions(String groupId, String artifactId, String searchExpression, Packaging packaging);
- public Collection<String> findClassifiers(String groupId, String artifactId, String version, String prefix, Packaging packaging);
+ public Collection<String> findClassifiers(String groupId, String artifactId, String version, String prefix,
+ Packaging packaging);
- public Collection<String> findTypes(String groupId, String artifactId, String version, String prefix, Packaging packaging);
+ public Collection<String> findTypes(String groupId, String artifactId, String version, String prefix,
+ Packaging packaging);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EErrorDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EErrorDialog.java
index 40ed66e4..2b2b16f7 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EErrorDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EErrorDialog.java
@@ -11,7 +11,6 @@
package org.eclipse.m2e.core.ui.internal.util;
-
import java.util.Collection;
import java.util.Map;
import java.util.Set;
@@ -22,8 +21,6 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.m2e.core.internal.M2EUtils;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -34,22 +31,29 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.m2e.core.internal.M2EUtils;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+
/**
- * M2EErrorDialog
- * Error dialog for displaying a list/table of error values.
- *
+ * M2EErrorDialog Error dialog for displaying a list/table of error values.
+ *
* @author dyocum
*/
public class M2EErrorDialog extends MessageDialog {
-
private TableViewer errorTable;
+
private static final int PROJECT_COL = 0;
+
protected static final int TABLE_WIDTH = 700;
+
protected String[] COL_NAMES = {Messages.M2EErrorDialog_column_name, Messages.M2EErrorDialog_column_error};
+
protected int[] COL_STYLES = {SWT.LEFT, SWT.LEFT};
+
protected Map<String, Throwable> errorMap;
-
+
/**
* @param parentShell
* @param dialogTitle
@@ -70,20 +74,20 @@ public class M2EErrorDialog extends MessageDialog {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, true);
comp.setLayout(layout);
-
+
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.widthHint = TABLE_WIDTH+50;
- gd.grabExcessHorizontalSpace=true;
- gd.grabExcessVerticalSpace=true;
+ gd.widthHint = TABLE_WIDTH + 50;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
comp.setLayoutData(gd);
-
+
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = TABLE_WIDTH;
gd.heightHint = 200;
- errorTable = new TableViewer(comp, SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL|SWT.FULL_SELECTION);
+ errorTable = new TableViewer(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
errorTable.getTable().setHeaderVisible(true);
errorTable.getTable().setLinesVisible(true);
-
+
errorTable.setContentProvider(new ErrorTableContentProvider());
errorTable.setLabelProvider(new ErrorTableLabelProvider());
errorTable.getControl().setLayoutData(gd);
@@ -99,7 +103,7 @@ public class M2EErrorDialog extends MessageDialog {
protected void setupTableColumns() {
GC gc = new GC(errorTable.getControl());
gc.setFont(errorTable.getControl().getFont());
- for(int i=0;i<COL_NAMES.length;i++){
+ for(int i = 0; i < COL_NAMES.length; i++ ) {
TableColumn col = new TableColumn(errorTable.getTable(), COL_STYLES[i]);
col.setText(COL_NAMES[i]);
int width = calcStringWidth(gc, i);
@@ -107,38 +111,39 @@ public class M2EErrorDialog extends MessageDialog {
}
gc.dispose();
}
-
+
/**
- * Find out how wide the strings are so the columns can be set correctly.
+ * Find out how wide the strings are so the columns can be set correctly.
+ *
* @param gc
* @param column
* @return
*/
- private int calcStringWidth(GC gc, int column){
+ private int calcStringWidth(GC gc, int column) {
int maxWidth = 100;
- if(column == PROJECT_COL){
+ if(column == PROJECT_COL) {
Set<String> keySet = errorMap.keySet();
- for(String projectName : keySet){
- int width = gc.stringExtent(projectName).x+10;
+ for(String projectName : keySet) {
+ int width = gc.stringExtent(projectName).x + 10;
maxWidth = Math.max(maxWidth, width);
}
return maxWidth;
}
Collection<Throwable> values = errorMap.values();
- for(Throwable t : values){
+ for(Throwable t : values) {
String msg = M2EUtils.getRootCauseMessage(t);
- if(msg == null){
+ if(msg == null) {
msg = ""; //$NON-NLS-1$
}
- int width = gc.stringExtent(msg).x+10;
+ int width = gc.stringExtent(msg).x + 10;
maxWidth = Math.max(maxWidth, width);
}
return maxWidth;
}
-
+
/**
* ErrorTableContentProvider
- *
+ *
* @author dyocum
*/
class ErrorTableContentProvider implements IStructuredContentProvider {
@@ -147,8 +152,8 @@ public class M2EErrorDialog extends MessageDialog {
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Map){
- return ((Map)inputElement).keySet().toArray();
+ if(inputElement instanceof Map) {
+ return ((Map) inputElement).keySet().toArray();
}
return new Object[0];
}
@@ -166,7 +171,7 @@ public class M2EErrorDialog extends MessageDialog {
}
}
- class ErrorTableLabelProvider implements ITableLabelProvider{
+ class ErrorTableLabelProvider implements ITableLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
@@ -179,7 +184,7 @@ public class M2EErrorDialog extends MessageDialog {
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
*/
public String getColumnText(Object element, int columnIndex) {
- if(columnIndex == PROJECT_COL){
+ if(columnIndex == PROJECT_COL) {
return element.toString();
}
String msg = M2EUtils.getRootCauseMessage(errorMap.get(element));
@@ -190,7 +195,7 @@ public class M2EErrorDialog extends MessageDialog {
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
public void addListener(ILabelProviderListener listener) {
-
+
}
/* (non-Javadoc)
@@ -214,5 +219,4 @@ public class M2EErrorDialog extends MessageDialog {
}
}
-
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
index 0b9aa536..966fd6b3 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/M2EUIUtils.java
@@ -19,7 +19,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.m2e.core.internal.M2EUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -27,32 +26,35 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.m2e.core.internal.M2EUtils;
+
+
/**
* M2EUtils
- *
+ *
* @author dyocum
*/
public class M2EUIUtils {
- public static Font deriveFont(Font f, int style, int height){
+ public static Font deriveFont(Font f, int style, int height) {
FontData[] fd = f.getFontData();
FontData[] newFD = new FontData[fd.length];
- for(int i=0;i<fd.length;i++){
+ for(int i = 0; i < fd.length; i++ ) {
newFD[i] = new FontData(fd[i].getName(), height, style);
}
return new Font(Display.getCurrent(), newFD);
}
-
- public static void showErrorDialog(Shell shell, String title, String msg, Exception e){
+
+ public static void showErrorDialog(Shell shell, String title, String msg, Exception e) {
StringBuffer buff = new StringBuffer(msg);
Throwable t = M2EUtils.getRootCause(e);
- if(t != null && !nullOrEmpty(t.getMessage())){
+ if(t != null && !nullOrEmpty(t.getMessage())) {
buff.append(t.getMessage());
}
MessageDialog.openError(shell, title, buff.toString());
}
-
- public static boolean nullOrEmpty(String s){
+
+ public static boolean nullOrEmpty(String s) {
return s == null || s.length() == 0;
}
@@ -65,19 +67,19 @@ public class M2EUIUtils {
public static void showErrorsForProjectsDialog(final Shell shell, final String title, final String message,
final Map<String, Throwable> errorMap) {
// TODO Auto-generated method showErrorsForProjectsDialog
- Display.getDefault().asyncExec(new Runnable(){
- public void run(){
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
String[] buttons = {IDialogConstants.OK_LABEL};
int ok_button = 0;
- M2EErrorDialog errDialog = new M2EErrorDialog(shell, title, Dialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR), message, MessageDialog.ERROR, buttons, ok_button,
- errorMap);
+ M2EErrorDialog errDialog = new M2EErrorDialog(shell, title, Dialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR),
+ message, MessageDialog.ERROR, buttons, ok_button, errorMap);
errDialog.create();
errDialog.open();
}
});
}
-
+
public static void addRequiredDecoration(Control control) {
FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
FieldDecorationRegistry.DEC_REQUIRED);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
index a891db81..116f04d5 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ParentGatherer.java
@@ -13,17 +13,20 @@ package org.eclipse.m2e.core.ui.internal.util;
import java.util.LinkedList;
-import org.apache.maven.execution.MavenExecutionRequest;
-import org.apache.maven.project.MavenProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.project.MavenProject;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+
/**
- * Helper class to get the parent chain given a pom
+ * Helper class to get the parent chain given a pom
*/
public class ParentGatherer {
private MavenProject mavenProject;
@@ -37,9 +40,10 @@ public class ParentGatherer {
/**
* Return the list of parents for a give pom
+ *
* @param monitor
- * @return list of {@link MavenProject} from the given project to its ultimate parent.
- * The first entry is the given pom, the last one the ultimate parent.
+ * @return list of {@link MavenProject} from the given project to its ultimate parent. The first entry is the given
+ * pom, the last one the ultimate parent.
* @throws CoreException
*/
public LinkedList<MavenProject> getParentHierarchy(IProgressMonitor monitor) throws CoreException {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java
index beea5d61..e8d735c8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java
@@ -13,7 +13,9 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Properties;
-import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
@@ -23,11 +25,6 @@ import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.fieldassist.IControlContentAdapter;
import org.eclipse.jface.fieldassist.TextContentAdapter;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.core.ui.internal.search.util.CComboContentAdapter;
-import org.eclipse.m2e.core.ui.internal.search.util.ControlDecoration;
-import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
-import org.eclipse.m2e.core.ui.internal.search.util.SearchEngine;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
@@ -36,8 +33,13 @@ import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
import org.apache.lucene.queryParser.QueryParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.search.util.CComboContentAdapter;
+import org.eclipse.m2e.core.ui.internal.search.util.ControlDecoration;
+import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
+import org.eclipse.m2e.core.ui.internal.search.util.SearchEngine;
/**
@@ -91,7 +93,7 @@ public class ProposalUtil {
ArrayList<IContentProposal> proposals = new ArrayList<IContentProposal>();
try {
for(final String text : searcher.search()) {
- if (text.startsWith(start)) {
+ if(text.startsWith(start)) {
proposals.add(new TextProposal(text));
}
}
@@ -123,28 +125,30 @@ public class ProposalUtil {
final Text versionText, final Text classifierText, final Packaging packaging) {
addCompletionProposal(classifierText, new Searcher() {
public Collection<String> search() throws CoreException {
- return getSearchEngine(project).findClassifiers(escapeQuerySpecialCharacters(groupIdText.getText()), //
- escapeQuerySpecialCharacters(artifactIdText.getText()), escapeQuerySpecialCharacters(versionText.getText()), "", packaging);
+ return getSearchEngine(project).findClassifiers(
+ escapeQuerySpecialCharacters(groupIdText.getText()), //
+ escapeQuerySpecialCharacters(artifactIdText.getText()),
+ escapeQuerySpecialCharacters(versionText.getText()), "", packaging);
}
});
}
- public static void addVersionProposal(final IProject project, final MavenProject mp, final Text groupIdText, final Text artifactIdText,
- final Text versionText, final Packaging packaging) {
+ public static void addVersionProposal(final IProject project, final MavenProject mp, final Text groupIdText,
+ final Text artifactIdText, final Text versionText, final Packaging packaging) {
addCompletionProposal(versionText, new Searcher() {
public Collection<String> search() throws CoreException {
Collection<String> toRet = new ArrayList<String>();
toRet.addAll(getSearchEngine(project).findVersions(escapeQuerySpecialCharacters(groupIdText.getText()), //
escapeQuerySpecialCharacters(artifactIdText.getText()), "", packaging));
- if (mp != null) {
+ if(mp != null) {
//add version props now..
Properties props = mp.getProperties();
ArrayList<String> list = new ArrayList<String>();
- if (props != null) {
- for (Object prop : props.keySet()) {
+ if(props != null) {
+ for(Object prop : props.keySet()) {
String propString = prop.toString();
- if (propString.endsWith("Version") || propString.endsWith(".version")) { //$NON-NLS-1$//$NON-NLS-2$
- list.add("${" + propString + "}"); //$NON-NLS-1$//$NON-NLS-2$
+ if(propString.endsWith("Version") || propString.endsWith(".version")) { //$NON-NLS-1$//$NON-NLS-2$
+ list.add("${" + propString + "}"); //$NON-NLS-1$//$NON-NLS-2$
}
}
}
@@ -161,8 +165,8 @@ public class ProposalUtil {
addCompletionProposal(artifactIdText, new Searcher() {
public Collection<String> search() throws CoreException {
// TODO handle artifact info
- return getSearchEngine(project).findArtifactIds(escapeQuerySpecialCharacters(groupIdText.getText()), "", packaging,
- null);
+ return getSearchEngine(project).findArtifactIds(escapeQuerySpecialCharacters(groupIdText.getText()), "",
+ packaging, null);
}
});
}
@@ -171,7 +175,8 @@ public class ProposalUtil {
addCompletionProposal(groupIdText, new Searcher() {
public Collection<String> search() throws CoreException {
// TODO handle artifact info
- return getSearchEngine(project).findGroupIds(escapeQuerySpecialCharacters(groupIdText.getText()), packaging, null);
+ return getSearchEngine(project).findGroupIds(escapeQuerySpecialCharacters(groupIdText.getText()), packaging,
+ null);
}
});
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
index 36a0471c..1add2017 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
@@ -97,34 +97,43 @@ public class MavenRepositoryView extends ViewPart {
private static final Logger log = LoggerFactory.getLogger(MavenRepositoryView.class);
private static final String ENABLE_FULL = Messages.MavenRepositoryView_enable_full;
+
private static final String ENABLED_FULL = Messages.MavenRepositoryView_enabled_full;
+
private static final String DISABLE_DETAILS = Messages.MavenRepositoryView_disable_details;
+
private static final String DISABLED_DETAILS = Messages.MavenRepositoryView_details_disabled;
+
private static final String ENABLE_MIN = Messages.MavenRepositoryView_enable_minimum;
+
private static final String ENABLED_MIN = Messages.MavenRepositoryView_minimum_enabled;
+
private static final String MENU_ID = ".repositoryViewMenu"; //$NON-NLS-1$
-
+
private IndexManager indexManager = MavenPlugin.getIndexManager();
private IAction collapseAllAction;
-
+
private IAction reloadSettings;
-
+
BaseSelectionListenerAction openPomAction;
private BaseSelectionListenerAction updateAction;
-
+
private BaseSelectionListenerAction rebuildAction;
-
+
private DisableIndexAction disableAction;
+
private EnableMinIndexAction enableMinAction;
+
private EnableFullIndexAction enableFullAction;
private BaseSelectionListenerAction copyUrlAction;
-
+
//private BaseSelectionListenerAction materializeProjectAction;
-
+
TreeViewer viewer;
+
private RepositoryViewContentProvider contentProvider;
private DrillDownAdapter drillDownAdapter;
@@ -134,7 +143,7 @@ public class MavenRepositoryView extends ViewPart {
public void setFocus() {
viewer.getControl().setFocus();
}
-
+
public void createPartControl(Composite parent) {
viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
contentProvider = new RepositoryViewContentProvider();
@@ -146,7 +155,7 @@ public class MavenRepositoryView extends ViewPart {
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
-
+
}
});
viewer.setInput(getViewSite());
@@ -176,15 +185,15 @@ public class MavenRepositoryView extends ViewPart {
refreshView();
}
- public void indexUpdating(IRepository repository){
- Display.getDefault().asyncExec(new Runnable(){
- public void run(){
- viewer.refresh(true);
+ public void indexUpdating(IRepository repository) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ viewer.refresh(true);
}
});
}
};
-
+
indexManager.addIndexListener(this.indexListener);
}
@@ -215,42 +224,44 @@ public class MavenRepositoryView extends ViewPart {
manager.add(reloadSettings);
}
- protected List<AbstractIndexedRepositoryNode> getSelectedRepositoryNodes(List elements){
+ protected List<AbstractIndexedRepositoryNode> getSelectedRepositoryNodes(List elements) {
ArrayList<AbstractIndexedRepositoryNode> list = new ArrayList<AbstractIndexedRepositoryNode>();
- if (elements != null) {
- for(int i=0;i<elements.size();i++){
+ if(elements != null) {
+ for(int i = 0; i < elements.size(); i++ ) {
Object elem = elements.get(i);
if(elem instanceof AbstractIndexedRepositoryNode) {
- list.add((AbstractIndexedRepositoryNode)elem);
+ list.add((AbstractIndexedRepositoryNode) elem);
}
}
}
return list;
}
- protected List<IArtifactNode> getArtifactNodes(List elements){
- if(elements == null || elements.size() == 0){
+
+ protected List<IArtifactNode> getArtifactNodes(List elements) {
+ if(elements == null || elements.size() == 0) {
return null;
}
ArrayList<IArtifactNode> list = new ArrayList<IArtifactNode>();
- for(int i=0;i<elements.size();i++){
+ for(int i = 0; i < elements.size(); i++ ) {
Object elem = elements.get(i);
- if(elem instanceof IArtifactNode){
- IArtifactNode node = (IArtifactNode)elem;
+ if(elem instanceof IArtifactNode) {
+ IArtifactNode node = (IArtifactNode) elem;
list.add(node);
}
}
return list;
}
+
void fillContextMenu(IMenuManager manager) {
manager.add(new Separator(MENU_OPEN_GRP));
manager.add(new Separator(MENU_UPDATE_GRP));
manager.add(new Separator("import")); //$NON-NLS-1$
manager.prependToGroup(MENU_OPEN_GRP, copyUrlAction);
manager.prependToGroup(MENU_OPEN_GRP, openPomAction);
-
+
manager.prependToGroup(MENU_UPDATE_GRP, updateAction);
manager.prependToGroup(MENU_UPDATE_GRP, rebuildAction);
-
+
manager.add(disableAction);
manager.add(enableMinAction);
manager.add(enableFullAction);
@@ -278,12 +289,12 @@ public class MavenRepositoryView extends ViewPart {
collapseAllAction.setToolTipText(Messages.MavenRepositoryView_btnCollapse_tooltip);
collapseAllAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(ISharedImages.IMG_ELCL_COLLAPSEALL));
- reloadSettings = new Action(Messages.MavenRepositoryView_action_reload){
- public void run(){
+ reloadSettings = new Action(Messages.MavenRepositoryView_action_reload) {
+ public void run() {
String msg = Messages.MavenRepositoryView_reload_msg;
boolean res = MessageDialog.openConfirm(getViewSite().getShell(), //
Messages.MavenRepositoryView_reload_title, msg);
- if(res){
+ if(res) {
Job job = new WorkspaceJob(Messages.MavenRepositoryView_job_reloading) {
public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
@@ -298,7 +309,7 @@ public class MavenRepositoryView extends ViewPart {
}
}
};
-
+
reloadSettings.setImageDescriptor(MavenImages.REFRESH);
// deleteFromLocalAction = new BaseSelectionListenerAction("Delete from Repository") {
// public void run() {
@@ -320,12 +331,11 @@ public class MavenRepositoryView extends ViewPart {
// deleteFromLocalAction.setToolTipText("Delete the selected GAV from the local repository");
//updateAction.setImageDescriptor(MavenImages.UPD_INDEX);
-
updateAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_update) {
public void run() {
List<AbstractIndexedRepositoryNode> nodes = getSelectedRepositoryNodes(getStructuredSelection().toList());
for(AbstractIndexedRepositoryNode node : nodes) {
- if (node instanceof RepositoryNode) {
+ if(node instanceof RepositoryNode) {
((RepositoryNode) node).getIndex().scheduleIndexUpdate(false);
}
}
@@ -333,12 +343,12 @@ public class MavenRepositoryView extends ViewPart {
protected boolean updateSelection(IStructuredSelection selection) {
int indexCount = 0;
- for (AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
- if (node instanceof RepositoryNode && node.isEnabledIndex()) {
- indexCount ++;
+ for(AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
+ if(node instanceof RepositoryNode && node.isEnabledIndex()) {
+ indexCount++ ;
}
}
- if(indexCount > 1){
+ if(indexCount > 1) {
setText(Messages.MavenRepositoryView_update_more);
} else {
setText(Messages.MavenRepositoryView_update_one);
@@ -399,15 +409,15 @@ public class MavenRepositoryView extends ViewPart {
}
}.schedule();
}
-
+
protected boolean updateSelection(IStructuredSelection selection) {
int indexCount = 0;
- for (AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
- if ((node instanceof LocalRepositoryNode) || node.isEnabledIndex()) {
- indexCount ++;
+ for(AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
+ if((node instanceof LocalRepositoryNode) || node.isEnabledIndex()) {
+ indexCount++ ;
}
}
- if(indexCount > 1){
+ if(indexCount > 1) {
setText(Messages.MavenRepositoryView_rebuild_many);
} else {
setText(Messages.MavenRepositoryView_rebuild_one);
@@ -415,7 +425,7 @@ public class MavenRepositoryView extends ViewPart {
return indexCount > 0;
}
};
-
+
rebuildAction.setToolTipText(Messages.MavenRepositoryView_action_rebuild_tooltip);
rebuildAction.setImageDescriptor(MavenImages.REBUILD_INDEX);
@@ -482,7 +492,7 @@ public class MavenRepositoryView extends ViewPart {
copyUrlAction.setToolTipText(Messages.MavenRepositoryView_action_copy_tooltip);
copyUrlAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
-
+
// materializeProjectAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_materialize) {
// public void run() {
// Object element = getStructuredSelection().getFirstElement();
@@ -511,22 +521,23 @@ public class MavenRepositoryView extends ViewPart {
}
protected void setIndexDetails(AbstractIndexedRepositoryNode node, String details) {
- if (node != null && node.getIndex() != null) {
+ if(node != null && node.getIndex() != null) {
try {
node.getIndex().setIndexDetails(details);
} catch(CoreException ex) {
- M2EUIUtils.showErrorDialog(this.getViewSite().getShell(), Messages.MavenRepositoryView_error_title, Messages.MavenRepositoryView_error_message, ex);
+ M2EUIUtils.showErrorDialog(this.getViewSite().getShell(), Messages.MavenRepositoryView_error_title,
+ Messages.MavenRepositoryView_error_message, ex);
}
}
}
protected AbstractIndexedRepositoryNode getSelectedRepositoryNode(IStructuredSelection selection) {
List elements = selection.toList();
- if (elements.size() != 1) {
+ if(elements.size() != 1) {
return null;
}
Object element = elements.get(0);
- return element instanceof AbstractIndexedRepositoryNode? (AbstractIndexedRepositoryNode) element: null;
+ return element instanceof AbstractIndexedRepositoryNode ? (AbstractIndexedRepositoryNode) element : null;
}
public void dispose() {
@@ -546,9 +557,9 @@ public class MavenRepositoryView extends ViewPart {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
Object[] expandedElems = viewer.getExpandedElements();
- if (!viewer.getControl().isDisposed()) {
+ if(!viewer.getControl().isDisposed()) {
viewer.setInput(getViewSite());
- if(expandedElems != null && expandedElems.length > 0){
+ if(expandedElems != null && expandedElems.length > 0) {
viewer.setExpandedElements(expandedElems);
}
}
@@ -557,87 +568,89 @@ public class MavenRepositoryView extends ViewPart {
};
/**
- * Base Selection Listener does not allow the style (radio button/check) to be set.
- * This base class listens to selections and sets the appropriate index value
- * depending on its value
- * AbstractIndexAction
- *
+ * Base Selection Listener does not allow the style (radio button/check) to be set. This base class listens to
+ * selections and sets the appropriate index value depending on its value AbstractIndexAction
+ *
* @author dyocum
*/
- abstract class AbstractIndexAction extends Action implements ISelectionChangedListener{
+ abstract class AbstractIndexAction extends Action implements ISelectionChangedListener {
protected abstract String getDetailsValue();
+
protected abstract String getActionText();
-
- public AbstractIndexAction(String text, int style){
+
+ public AbstractIndexAction(String text, int style) {
super(text, style);
}
-
+
public void run() {
- IStructuredSelection sel = (IStructuredSelection)viewer.getSelection();
+ IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
setIndexDetails(getSelectedRepositoryNode(sel), getDetailsValue());
}
-
+
/*
*/
public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
updateSelection(sel);
}
-
- protected void updateSelection(IStructuredSelection selection) {
+
+ protected void updateSelection(IStructuredSelection selection) {
AbstractIndexedRepositoryNode node = getSelectedRepositoryNode(selection);
updateIndexDetails(node);
setText(getActionText());
boolean enabled = (node != null && node instanceof RepositoryNode);
this.setEnabled(enabled);
}
-
- protected void updateIndexDetails(AbstractIndexedRepositoryNode node){
- if(node == null || node.getIndex() == null){
+
+ protected void updateIndexDetails(AbstractIndexedRepositoryNode node) {
+ if(node == null || node.getIndex() == null) {
return;
}
NexusIndex index = node.getIndex();
setChecked(getDetailsValue().equals(index.getIndexDetails()));
}
-
+
}
-
+
class DisableIndexAction extends AbstractIndexAction {
- public DisableIndexAction(){
+ public DisableIndexAction() {
super(DISABLE_DETAILS, IAction.AS_CHECK_BOX);
}
-
- protected String getDetailsValue(){
+
+ protected String getDetailsValue() {
return NexusIndex.DETAILS_DISABLED;
}
- protected String getActionText(){
+
+ protected String getActionText() {
return isChecked() ? DISABLED_DETAILS : DISABLE_DETAILS;
}
}
-
+
class EnableMinIndexAction extends AbstractIndexAction {
- public EnableMinIndexAction(){
+ public EnableMinIndexAction() {
super(ENABLE_MIN, IAction.AS_CHECK_BOX);
}
-
- protected String getDetailsValue(){
+
+ protected String getDetailsValue() {
return NexusIndex.DETAILS_MIN;
}
- protected String getActionText(){
+
+ protected String getActionText() {
return isChecked() ? ENABLED_MIN : ENABLE_MIN;
}
}
class EnableFullIndexAction extends AbstractIndexAction {
- public EnableFullIndexAction(){
+ public EnableFullIndexAction() {
super(ENABLE_FULL, IAction.AS_CHECK_BOX);
}
-
- protected String getDetailsValue(){
+
+ protected String getDetailsValue() {
return NexusIndex.DETAILS_FULL;
}
- protected String getActionText(){
+
+ protected String getActionText() {
return isChecked() ? ENABLED_FULL : ENABLE_FULL;
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java
index a084fc52..773d9bcc 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java
@@ -14,25 +14,30 @@ package org.eclipse.m2e.core.ui.internal.views;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewSite;
+
import org.eclipse.m2e.core.ui.internal.views.nodes.CustomRepositoriesNode;
import org.eclipse.m2e.core.ui.internal.views.nodes.GlobalRepositoriesNode;
import org.eclipse.m2e.core.ui.internal.views.nodes.IMavenRepositoryNode;
import org.eclipse.m2e.core.ui.internal.views.nodes.LocalRepositoryRootNode;
import org.eclipse.m2e.core.ui.internal.views.nodes.ProjectRepositoriesNode;
-import org.eclipse.ui.IViewSite;
+
/**
* RepositoryViewContentProvider
- *
+ *
* @author dyocum
*/
public class RepositoryViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
private LocalRepositoryRootNode localNode;
+
private GlobalRepositoriesNode globalNode;
+
private ProjectRepositoriesNode projectNode;
+
private CustomRepositoriesNode customNode;
-
+
public RepositoryViewContentProvider() {
}
@@ -41,7 +46,7 @@ public class RepositoryViewContentProvider implements IStructuredContentProvider
public void dispose() {
}
-
+
public Object[] getElements(Object parent) {
return getChildren(parent);
}
@@ -51,18 +56,18 @@ public class RepositoryViewContentProvider implements IStructuredContentProvider
}
public boolean hasChildren(Object parent) {
- if(parent instanceof IMavenRepositoryNode){
- return ((IMavenRepositoryNode)parent).hasChildren();
+ if(parent instanceof IMavenRepositoryNode) {
+ return ((IMavenRepositoryNode) parent).hasChildren();
}
return false;
}
- public Object[] getRootNodes(){
- if(localNode == null){
+ public Object[] getRootNodes() {
+ if(localNode == null) {
localNode = new LocalRepositoryRootNode();
-
+
}
- if(globalNode == null){
+ if(globalNode == null) {
globalNode = new GlobalRepositoriesNode();
}
if(projectNode == null) {
@@ -71,15 +76,15 @@ public class RepositoryViewContentProvider implements IStructuredContentProvider
if(customNode == null) {
customNode = new CustomRepositoriesNode();
}
- return new Object[]{localNode, globalNode, projectNode, customNode};
+ return new Object[] {localNode, globalNode, projectNode, customNode};
}
-
+
public Object[] getChildren(Object parent) {
- if(parent instanceof IViewSite){
+ if(parent instanceof IViewSite) {
return getRootNodes();
- } else if(parent instanceof IMavenRepositoryNode){
- return ((IMavenRepositoryNode)parent).getChildren();
+ } else if(parent instanceof IMavenRepositoryNode) {
+ return ((IMavenRepositoryNode) parent).getChildren();
}
return new Object[0];
}
-} \ No newline at end of file
+}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java
index e83707bf..2d91d9c8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java
@@ -16,10 +16,6 @@ import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StyledString;
-
-import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
-import org.eclipse.m2e.core.ui.internal.views.nodes.IMavenRepositoryNode;
-import org.eclipse.m2e.core.ui.internal.views.nodes.RepositoryNode;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -29,28 +25,34 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
+import org.eclipse.m2e.core.ui.internal.views.nodes.IMavenRepositoryNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.RepositoryNode;
+
+
/**
* RepositoryViewLabelProvider
- *
+ *
* @author dyocum
*/
-public class RepositoryViewLabelProvider extends LabelProvider implements IStyledLabelProvider, IColorProvider, IFontProvider {
+public class RepositoryViewLabelProvider extends LabelProvider implements IStyledLabelProvider, IColorProvider,
+ IFontProvider {
private Font italicFont;
- public RepositoryViewLabelProvider(Font treeFont){
+
+ public RepositoryViewLabelProvider(Font treeFont) {
int size = 0;
FontData[] data = treeFont.getFontData();
- if(data == null){
+ if(data == null) {
size = 12;
} else {
- for(int i=0;i<data.length;i++){
+ for(int i = 0; i < data.length; i++ ) {
size = Math.max(size, data[i].getHeight());
}
}
italicFont = M2EUIUtils.deriveFont(treeFont, SWT.ITALIC, size);
}
-
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
*/
@@ -59,17 +61,16 @@ public class RepositoryViewLabelProvider extends LabelProvider implements IStyle
super.dispose();
}
-
public String getText(Object obj) {
- if(obj instanceof IMavenRepositoryNode){
- return ((IMavenRepositoryNode)obj).getName();
+ if(obj instanceof IMavenRepositoryNode) {
+ return ((IMavenRepositoryNode) obj).getName();
}
return obj.toString();
}
public Image getImage(Object obj) {
- if(obj instanceof IMavenRepositoryNode){
- return ((IMavenRepositoryNode)obj).getImage();
+ if(obj instanceof IMavenRepositoryNode) {
+ return ((IMavenRepositoryNode) obj).getImage();
}
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
@@ -79,18 +80,18 @@ public class RepositoryViewLabelProvider extends LabelProvider implements IStyle
}
public Color getForeground(Object element) {
- if(element instanceof RepositoryNode){
- if(((RepositoryNode)element).isEnabledIndex()){
+ if(element instanceof RepositoryNode) {
+ if(((RepositoryNode) element).isEnabledIndex()) {
return Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
}
return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
- }
+ }
return Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
}
public Font getFont(Object element) {
- if(element instanceof IMavenRepositoryNode){
- boolean updating = ((IMavenRepositoryNode)element).isUpdating();
+ if(element instanceof IMavenRepositoryNode) {
+ boolean updating = ((IMavenRepositoryNode) element).isUpdating();
return updating ? italicFont : null;
}
return null;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java
index 8d1cec99..60cc0fdb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java
@@ -13,14 +13,15 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.m2e.core.internal.index.nexus.IndexedArtifactGroup;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.swt.graphics.Image;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
@@ -34,7 +35,7 @@ public abstract class AbstractIndexedRepositoryNode implements IMavenRepositoryN
protected static final Object[] NO_CHILDREN = new Object[0];
protected final NexusIndex index;
-
+
protected AbstractIndexedRepositoryNode(NexusIndex index) {
this.index = index;
}
@@ -63,7 +64,7 @@ public abstract class AbstractIndexedRepositoryNode implements IMavenRepositoryN
}
public Image getImage() {
- return MavenImages.IMG_INDEX;
+ return MavenImages.IMG_INDEX;
}
public boolean hasChildren() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
index e13e7f5f..029affd3 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
@@ -14,22 +14,25 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.swt.graphics.Image;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager;
import org.eclipse.m2e.core.repository.IRepository;
import org.eclipse.m2e.core.repository.IRepositoryRegistry;
import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.swt.graphics.Image;
+
/**
* AbstractRepositoriesNode
- *
+ *
* @author igor
*/
public abstract class AbstractRepositoriesNode implements IMavenRepositoryNode {
protected final NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
+
protected final IRepositoryRegistry repositoryRegistry = MavenPlugin.getRepositoryRegistry();
public Object[] getChildren() {
@@ -37,11 +40,11 @@ public abstract class AbstractRepositoriesNode implements IMavenRepositoryNode {
ArrayList<Object> mirrorNodes = new ArrayList<Object>();
ArrayList<Object> globalRepoNodes = new ArrayList<Object>();
- for (IRepository repo : getRepositories()) {
+ for(IRepository repo : getRepositories()) {
NexusIndex index = indexManager.getIndex(repo);
RepositoryNode node = new RepositoryNode(index);
- if (repo.getMirrorOf() != null) {
- mirrorNodes.add(node);
+ if(repo.getMirrorOf() != null) {
+ mirrorNodes.add(node);
} else {
globalRepoNodes.add(node);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java
index 30135673..2d05cf49 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java
@@ -13,13 +13,14 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.List;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.repository.IRepository;
import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* CustomRepositoriesNode
- *
+ *
* @author igor
*/
public class CustomRepositoriesNode extends AbstractRepositoriesNode {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java
index b8ede9e1..5bd07027 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java
@@ -13,9 +13,9 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.List;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.repository.IRepository;
import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java
index 54c908fb..fab8dbe4 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java
@@ -11,10 +11,9 @@
package org.eclipse.m2e.core.ui.internal.views.nodes;
-
/**
* AbstractArtifactNode
- *
+ *
* @author dyocum
*/
public interface IArtifactNode {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java
index b296ca7f..0bd0caee 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java
@@ -13,16 +13,21 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import org.eclipse.swt.graphics.Image;
+
/**
* MavenRepositoryRootNode
- *
+ *
* @author dyocum
*/
public interface IMavenRepositoryNode {
public Object[] getChildren();
+
public String getName();
+
public Image getImage();
+
public boolean hasChildren();
+
public boolean isUpdating();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
index b00a472e..6e62b866 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
@@ -14,44 +14,48 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.ArrayList;
import java.util.Collection;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.internal.index.IndexedArtifact;
import org.eclipse.m2e.core.internal.index.nexus.IndexedArtifactGroup;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
/**
* IndexedArtifactGroupNode
- *
+ *
* @author dyocum
*/
public class IndexedArtifactGroupNode implements IMavenRepositoryNode, IArtifactNode {
private IndexedArtifactGroup indexedArtifactGroup;
+
private Object[] kids = null;
- public IndexedArtifactGroupNode(IndexedArtifactGroup group){
+
+ public IndexedArtifactGroupNode(IndexedArtifactGroup group) {
this.indexedArtifactGroup = group;
}
+
/* (non-Javadoc)
* @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getChildren()
*/
public Object[] getChildren() {
NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
-
+
IndexedArtifactGroup resolvedGroup = indexManager.resolveGroup(indexedArtifactGroup);
//IndexedArtifactGroup resolvedGroup = indexedArtifactGroup;
ArrayList<Object> results = new ArrayList<Object>();
Collection<IndexedArtifactGroup> groups = resolvedGroup.getNodes().values();
- for(IndexedArtifactGroup group : groups){
- IndexedArtifactGroupNode node = new IndexedArtifactGroupNode(group);
- results.add(node);
+ for(IndexedArtifactGroup group : groups) {
+ IndexedArtifactGroupNode node = new IndexedArtifactGroupNode(group);
+ results.add(node);
}
-
+
Collection<IndexedArtifact> artifacts = resolvedGroup.getFiles().values(); // IndexedArtifact
- for(IndexedArtifact artifact : artifacts){
+ for(IndexedArtifact artifact : artifacts) {
IndexedArtifactNode artifactNode = new IndexedArtifactNode(artifact);
results.add(artifactNode);
}
@@ -78,18 +82,21 @@ public class IndexedArtifactGroupNode implements IMavenRepositoryNode, IArtifact
// return kids != null && kids.length > 0;
return true;
}
+
/* (non-Javadoc)
* @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#getImage()
*/
public Image getImage() {
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
}
+
/* (non-Javadoc)
* @see org.eclipse.m2e.ui.internal.views.nodes.IArtifactNode#getDocumentKey()
*/
public String getDocumentKey() {
return indexedArtifactGroup.getPrefix();
}
+
/* (non-Javadoc)
* @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#isUpdating()
*/
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java
index b42e29a0..291bedaf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java
@@ -11,13 +11,14 @@
package org.eclipse.m2e.core.ui.internal.views.nodes;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* LocalRepositoryNode
- *
+ *
* @author igor
*/
public class LocalRepositoryNode extends AbstractIndexedRepositoryNode {
@@ -30,7 +31,7 @@ public class LocalRepositoryNode extends AbstractIndexedRepositoryNode {
IRepository repository = index.getRepository();
StringBuilder sb = new StringBuilder();
sb.append(Messages.LocalRepositoryNode_local);
- if (repository.getBasedir() != null) {
+ if(repository.getBasedir() != null) {
sb.append(" (").append(repository.getBasedir().getAbsolutePath()).append(')'); //$NON-NLS-1$
}
return sb.toString();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
index 6cc82b6a..67e7f35c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
@@ -11,28 +11,27 @@
package org.eclipse.m2e.core.ui.internal.views.nodes;
+import org.eclipse.swt.graphics.Image;
+
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager;
import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* LocalRepositoryNode
- *
+ *
* @author dyocum
*/
-public class LocalRepositoryRootNode implements IMavenRepositoryNode{
+public class LocalRepositoryRootNode implements IMavenRepositoryNode {
public Object[] getChildren() {
NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
NexusIndex localIndex = indexManager.getLocalIndex();
NexusIndex workspaceIndex = indexManager.getWorkspaceIndex();
- return new Object[]{
- new LocalRepositoryNode(localIndex),
- new WorkspaceRepositoryNode(workspaceIndex)
- };
+ return new Object[] {new LocalRepositoryNode(localIndex), new WorkspaceRepositoryNode(workspaceIndex)};
}
public String getName() {
@@ -50,5 +49,5 @@ public class LocalRepositoryRootNode implements IMavenRepositoryNode{
public boolean isUpdating() {
return false;
}
-
+
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
index f057af73..2224aabb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
@@ -13,14 +13,15 @@ package org.eclipse.m2e.core.ui.internal.views.nodes;
import java.util.ArrayList;
+import org.eclipse.swt.graphics.Image;
+
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager;
import org.eclipse.m2e.core.repository.IRepository;
import org.eclipse.m2e.core.repository.IRepositoryRegistry;
import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -29,6 +30,7 @@ import org.eclipse.swt.graphics.Image;
public class ProjectRepositoriesNode implements IMavenRepositoryNode {
private NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getIndexManager();
+
private IRepositoryRegistry repositoryRegistry = MavenPlugin.getRepositoryRegistry();
public Object[] getChildren() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java
index de94a5bd..33bbadcf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java
@@ -11,20 +11,21 @@
package org.eclipse.m2e.core.ui.internal.views.nodes;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* LocalRepsoitoryNode
- *
+ *
* @author dyocum
*/
public class RepositoryNode extends AbstractIndexedRepositoryNode {
private final IRepository repository;
- public RepositoryNode(NexusIndex index){
+ public RepositoryNode(NexusIndex index) {
super(index);
this.repository = index.getRepository();
}
@@ -33,13 +34,13 @@ public class RepositoryNode extends AbstractIndexedRepositoryNode {
StringBuilder sb = new StringBuilder();
sb.append(repository.getId());
sb.append(" (").append(repository.getUrl()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- if (repository.getMirrorOf() != null) {
+ if(repository.getMirrorOf() != null) {
sb.append(" [mirrorOf=").append(repository.getMirrorOf()).append("]"); //$NON-NLS-2$
}
- if (repository.getMirrorId() != null) {
+ if(repository.getMirrorId() != null) {
sb.append(" [mirrored by ").append(repository.getMirrorId()).append("]"); //$NON-NLS-2$
}
- if (isUpdating()) {
+ if(isUpdating()) {
sb.append(Messages.RepositoryNode_updating);
}
return sb.toString();
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java
index 2ed0da50..5d2fb626 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java
@@ -11,12 +11,13 @@
package org.eclipse.m2e.core.ui.internal.views.nodes;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.internal.index.nexus.NexusIndex;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* WorkspaceRepositoryNode
- *
+ *
* @author igor
*/
public class WorkspaceRepositoryNode extends AbstractIndexedRepositoryNode {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstactCreateMavenProjectJob.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstactCreateMavenProjectJob.java
index 83ae24eb..29c050f7 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstactCreateMavenProjectJob.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstactCreateMavenProjectJob.java
@@ -21,11 +21,12 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.m2e.core.project.IMavenProjectImportResult;
-import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.progress.IProgressConstants;
+import org.eclipse.m2e.core.project.IMavenProjectImportResult;
+import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
+
public abstract class AbstactCreateMavenProjectJob extends WorkspaceJob {
@@ -60,5 +61,5 @@ public abstract class AbstactCreateMavenProjectJob extends WorkspaceJob {
protected static ArrayList<IProject> toProjects(List<IMavenProjectImportResult> results) {
return AbstractCreateMavenProjectsOperation.toProjects(results);
}
-
+
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractCreateMavenProjectsOperation.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractCreateMavenProjectsOperation.java
index 771a1e19..15006e54 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractCreateMavenProjectsOperation.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractCreateMavenProjectsOperation.java
@@ -22,9 +22,10 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.ui.IWorkingSet;
+
import org.eclipse.m2e.core.project.IMavenProjectImportResult;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.ui.IWorkingSet;
public abstract class AbstractCreateMavenProjectsOperation implements IRunnableWithProgress {
@@ -86,7 +87,7 @@ public abstract class AbstractCreateMavenProjectsOperation implements IRunnableW
public static IStatus toStatus(InvocationTargetException e) {
Throwable t = e.getCause();
- if (t instanceof CoreException) {
+ if(t instanceof CoreException) {
return ((CoreException) t).getStatus();
}
return new Status(IStatus.ERROR, M2EUIPluginActivator.PLUGIN_ID, t.getMessage(), t);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenProjectWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenProjectWizard.java
index 33eb20ca..becf4dad 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenProjectWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenProjectWizard.java
@@ -16,12 +16,13 @@ import java.util.List;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkingSet;
+
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.IMavenDiscovery;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkingSet;
@SuppressWarnings("restriction")
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenWizardPage.java
index 4c961dde..ee5f5fbb 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/AbstractMavenWizardPage.java
@@ -24,16 +24,16 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.internal.MavenPluginActivator;
-import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.m2e.core.internal.MavenPluginActivator;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* AbstractMavenImportWizardPage
@@ -127,15 +127,14 @@ public abstract class AbstractMavenWizardPage extends WizardPage {
/** Loads the dialog settings using the page name as a section name. */
private void initDialogSettings() {
IDialogSettings pluginSettings;
-
+
// This is strictly to get SWT Designer working locally without blowing up.
- if( MavenPluginActivator.getDefault() == null ) {
+ if(MavenPluginActivator.getDefault() == null) {
pluginSettings = new DialogSettings("Workbench");
+ } else {
+ pluginSettings = M2EUIPluginActivator.getDefault().getDialogSettings();
}
- else {
- pluginSettings = M2EUIPluginActivator.getDefault().getDialogSettings();
- }
-
+
dialogSettings = pluginSettings.getSection(getName());
if(dialogSettings == null) {
dialogSettings = pluginSettings.addNewSection(getName());
@@ -200,25 +199,31 @@ public abstract class AbstractMavenWizardPage extends WizardPage {
protected String validateArtifactIdInput(String text) {
return validateIdInput(text, true);
}
+
protected String validateGroupIdInput(String text) {
return validateIdInput(text, false);
}
+
private String validateIdInput(String text, boolean artifact) {
if(text == null || text.length() == 0) {
- return artifact? Messages.wizardProjectPageMaven2ValidatorArtifactID: Messages.wizardProjectPageMaven2ValidatorGroupID;
+ return artifact ? Messages.wizardProjectPageMaven2ValidatorArtifactID
+ : Messages.wizardProjectPageMaven2ValidatorGroupID;
}
if(text.contains(" ")) { //$NON-NLS-1$
- return artifact? Messages.wizardProjectPageMaven2ValidatorArtifactIDnospaces: Messages.wizardProjectPageMaven2ValidatorGroupIDnospaces;
+ return artifact ? Messages.wizardProjectPageMaven2ValidatorArtifactIDnospaces
+ : Messages.wizardProjectPageMaven2ValidatorGroupIDnospaces;
}
IStatus nameStatus = ResourcesPlugin.getWorkspace().validateName(text, IResource.PROJECT);
if(!nameStatus.isOK()) {
- return NLS.bind(artifact? Messages.wizardProjectPageMaven2ValidatorArtifactIDinvalid: Messages.wizardProjectPageMaven2ValidatorGroupIDinvalid, nameStatus.getMessage());
+ return NLS.bind(artifact ? Messages.wizardProjectPageMaven2ValidatorArtifactIDinvalid
+ : Messages.wizardProjectPageMaven2ValidatorGroupIDinvalid, nameStatus.getMessage());
}
if(!text.matches("[A-Za-z0-9_\\-.]+")) { //$NON-NLS-1$
- return NLS.bind(artifact? Messages.wizardProjectPageMaven2ValidatorArtifactIDinvalid: Messages.wizardProjectPageMaven2ValidatorGroupIDinvalid, text);
+ return NLS.bind(artifact ? Messages.wizardProjectPageMaven2ValidatorArtifactIDinvalid
+ : Messages.wizardProjectPageMaven2ValidatorGroupIDinvalid, text);
}
return null;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/CustomArchetypeDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/CustomArchetypeDialog.java
index 45fb7375..ddc5d3dc 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/CustomArchetypeDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/CustomArchetypeDialog.java
@@ -20,8 +20,6 @@ import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -33,6 +31,10 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
+
/**
* Custom Archetype dialog
*
@@ -43,7 +45,7 @@ public class CustomArchetypeDialog extends TitleAreaDialog {
private static final String DIALOG_SETTINGS = CustomArchetypeDialog.class.getName();
private static final String KEY_ARCHETYPE_GROUP_ID = "archetypeGroupId"; //$NON-NLS-1$
-
+
private static final String KEY_ARCHETYPE_ARTIFACT_ID = "archetypeArtifactId"; //$NON-NLS-1$
private static final String KEY_ARCHETYPE_VERSION = "archetypeVersion"; //$NON-NLS-1$
@@ -134,18 +136,18 @@ public class CustomArchetypeDialog extends TitleAreaDialog {
Label repositoryLabel = new Label(composite, SWT.NONE);
repositoryLabel.setText(Messages.CustomArchetypeDialog_lblRepo);
-
+
repositoryCombo = new Combo(composite, SWT.NONE);
repositoryCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
repositoryCombo.setItems(getSavedValues(KEY_REPOSITORY_URL));
repositoryCombo.setData("name", "repository"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
ModifyListener modifyListener = new ModifyListener() {
public void modifyText(final ModifyEvent e) {
update();
}
};
-
+
archetypeGroupIdCombo.addModifyListener(modifyListener);
archetypeArtifactIdCombo.addModifyListener(modifyListener);
archetypeVersionCombo.addModifyListener(modifyListener);
@@ -179,7 +181,7 @@ public class CustomArchetypeDialog extends TitleAreaDialog {
archetypeGroupId = archetypeGroupIdCombo.getText().trim();
archetypeVersion = archetypeVersionCombo.getText().trim();
repositoryUrl = repositoryCombo.getText().trim();
-
+
saveValue(KEY_ARCHETYPE_GROUP_ID, archetypeGroupId);
saveValue(KEY_ARCHETYPE_ARTIFACT_ID, archetypeArtifactId);
saveValue(KEY_ARCHETYPE_VERSION, archetypeVersion);
@@ -199,11 +201,11 @@ public class CustomArchetypeDialog extends TitleAreaDialog {
public String getArchetypeVersion() {
return archetypeVersion;
}
-
+
public String getRepositoryUrl() {
return repositoryUrl;
}
-
+
private void saveValue(String key, String value) {
List<String> dirs = new ArrayList<String>();
dirs.addAll(Arrays.asList(getSavedValues(key)));
@@ -228,23 +230,23 @@ public class CustomArchetypeDialog extends TitleAreaDialog {
setErrorMessage(null);
setMessage(null, IStatus.WARNING);
- if(archetypeGroupIdCombo.getText().trim().length()==0) {
+ if(archetypeGroupIdCombo.getText().trim().length() == 0) {
setErrorMessage(Messages.CustomArchetypeDialog_error_grid);
return false;
}
-
- if(archetypeArtifactIdCombo.getText().trim().length()==0) {
+
+ if(archetypeArtifactIdCombo.getText().trim().length() == 0) {
setErrorMessage(Messages.CustomArchetypeDialog_error_artid);
return false;
}
-
- if(archetypeVersionCombo.getText().trim().length()==0) {
+
+ if(archetypeVersionCombo.getText().trim().length() == 0) {
setErrorMessage(Messages.CustomArchetypeDialog_error_version);
return false;
}
-
+
// TODO check if archetype available locally
-
+
return true;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
index 37ebd277..49879743 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
@@ -214,7 +214,7 @@ public class LifecycleMappingPage extends WizardPage {
for(IMavenDiscoveryProposal prop : all) {
values.add(NLS.bind(Messages.LifecycleMappingPage_installDescription, prop.toString()));
}
- if (prov.isError(mappingConfiguration)) {
+ if(prov.isError(mappingConfiguration)) {
values.add(Messages.LifecycleMappingPage_resolveLaterDescription);
} else {
values.add(EMPTY_STRING);
@@ -224,8 +224,8 @@ public class LifecycleMappingPage extends WizardPage {
.size()]));
Control cont = edit.getControl();
//this attempts to disable text edits in the combo..
- if (cont instanceof CCombo) {
- CCombo combo = (CCombo)cont;
+ if(cont instanceof CCombo) {
+ CCombo combo = (CCombo) cont;
combo.setEditable(false);
}
return edit;
@@ -387,12 +387,10 @@ public class LifecycleMappingPage extends WizardPage {
ILifecycleMappingLabelProvider prov = (ILifecycleMappingLabelProvider) ((IStructuredSelection) event
.getSelection()).getFirstElement();
if(ignore.contains(prov)) {
- details
- .setText(Messages.LifecycleMappingPage_doNotExecutePomDescription);
+ details.setText(Messages.LifecycleMappingPage_doNotExecutePomDescription);
license.setText(EMPTY_STRING);
} else if(ignoreAtDefinition.contains(prov)) {
- details
- .setText(Messages.LifecycleMappingPage_doNotExecuteParentDescription);
+ details.setText(Messages.LifecycleMappingPage_doNotExecuteParentDescription);
license.setText(EMPTY_STRING);
} else {
IMavenDiscoveryProposal proposal = mappingConfiguration.getSelectedProposal(prov.getKey());
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenArtifactComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenArtifactComponent.java
index 456e18ca..78ee06bf 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenArtifactComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenArtifactComponent.java
@@ -11,8 +11,6 @@
package org.eclipse.m2e.core.ui.internal.wizards;
-import org.apache.maven.model.Model;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
@@ -23,6 +21,10 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.ui.internal.Messages;
+
public class MavenArtifactComponent extends Composite {
@@ -39,7 +41,7 @@ public class MavenArtifactComponent extends Composite {
// MNGECLIPSE-688 add EJB Support
public static final String EJB = "ejb"; //$NON-NLS-1$
- public static final String[] PACKAGING_OPTIONS = {JAR, POM, WAR };
+ public static final String[] PACKAGING_OPTIONS = {JAR, POM, WAR};
public static final String DEFAULT_PACKAGING = JAR;
@@ -162,19 +164,17 @@ public class MavenArtifactComponent extends Composite {
packagingCombo.removeModifyListener(modifyingListener);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.swt.widgets.Composite#setFocus()
*/
public boolean setFocus() {
- if (groupIdCombo != null) {
+ if(groupIdCombo != null) {
return groupIdCombo.setFocus();
}
return super.setFocus();
}
-
-
public String getModelName() {
return nameCombo.getText();
}
@@ -230,19 +230,19 @@ public class MavenArtifactComponent extends Composite {
public Model getModel() {
Model model = new Model();
model.setModelVersion("4.0.0"); //$NON-NLS-1$
-
+
model.setGroupId(getGroupId());
model.setArtifactId(getArtifactId());
model.setVersion(getVersion());
model.setPackaging(getPackaging());
-
- if(getModelName().length()>0) {
+
+ if(getModelName().length() > 0) {
model.setName(getModelName());
}
- if(getDescription().length()>0) {
+ if(getDescription().length() > 0) {
model.setDescription(getDescription());
}
-
+
return model;
}
@@ -266,7 +266,7 @@ public class MavenArtifactComponent extends Composite {
public Combo getNameCombo() {
return nameCombo;
}
-
+
public void setWidthGroup(WidthGroup widthGroup) {
widthGroup.addControl(this.groupIdlabel);
widthGroup.addControl(this.artifactIdLabel);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
index a236cdc9..e8bba957 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenDependenciesWizardPage.java
@@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import org.apache.maven.model.Dependency;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
@@ -25,13 +24,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizardContainer;
-
-import org.eclipse.m2e.core.internal.index.IndexedArtifact;
-import org.eclipse.m2e.core.internal.index.IndexedArtifactFile;
-import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.MavenImages;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -42,19 +34,28 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.internal.index.IndexedArtifact;
+import org.eclipse.m2e.core.internal.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.internal.MavenImages;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
+
+
/**
- * Wizard page for gathering information about Maven artifacts. Allows to select
- * artifacts from the repository index.
+ * Wizard page for gathering information about Maven artifacts. Allows to select artifacts from the repository index.
*/
public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
- /**
+ /**
* Viewer containing dependencies
*/
TableViewer dependencyViewer;
-
+
private Dependency[] dependencies;
-
+
/**
* Listeners notified about all changes
*/
@@ -65,8 +66,9 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
public MavenDependenciesWizardPage() {
this(null, Messages.wizardProjectPageDependenciesTitle, Messages.wizardProjectPageDependenciesDescription);
}
-
- public MavenDependenciesWizardPage(ProjectImportConfiguration projectImportConfiguration, String title, String description) {
+
+ public MavenDependenciesWizardPage(ProjectImportConfiguration projectImportConfiguration, String title,
+ String description) {
super("MavenDependenciesWizardPage", projectImportConfiguration); //$NON-NLS-1$
setTitle(title);
setDescription(description);
@@ -76,11 +78,11 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
public void setShowScope(boolean showScope) {
this.showScope = showScope;
}
-
+
public void setDependencies(Dependency[] dependencies) {
this.dependencies = dependencies;
}
-
+
/**
* {@inheritDoc} This wizard page contains a <code>TableViewer</code> to display the currently included Maven2
* directories and a button area with buttons to add further dependencies or remove existing ones.
@@ -90,10 +92,10 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
GridLayout layout = new GridLayout(3, false);
composite.setLayout(layout);
- if(dependencies!=null) {
+ if(dependencies != null) {
createArtifacts(composite);
}
-
+
createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
setControl(composite);
@@ -105,7 +107,7 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
Label mavenArtifactsLabel = new Label(composite, SWT.NONE);
mavenArtifactsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
mavenArtifactsLabel.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenDependenciesWizardPage_lblArtifacts);
-
+
dependencyViewer = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
dependencyViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
dependencyViewer.setUseHashlookup(true);
@@ -120,8 +122,11 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
addDependencyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog.createSearchDependencyDialog(getShell(), //
- org.eclipse.m2e.core.ui.internal.Messages.MavenDependenciesWizardPage_searchDialog_title, null, null, false);
+ MavenRepositorySearchDialog dialog = MavenRepositorySearchDialog
+ .createSearchDependencyDialog(
+ getShell(), //
+ org.eclipse.m2e.core.ui.internal.Messages.MavenDependenciesWizardPage_searchDialog_title, null, null,
+ false);
if(dialog.open() == Window.OK) {
Object result = dialog.getFirstResult();
if(result instanceof IndexedArtifactFile) {
@@ -146,7 +151,7 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
removeDependencyButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
removeDependencyButton.setText(Messages.wizardProjectPageDependenciesRemove);
removeDependencyButton.setEnabled(false);
-
+
removeDependencyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) dependencyViewer.getSelection();
@@ -164,7 +169,7 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
}
});
}
-
+
public IWizardContainer getContainer() {
return super.getContainer();
}
@@ -177,7 +182,7 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
setErrorMessage(null);
return true;
}
-
+
/**
* Notify listeners about changes
*/
@@ -191,12 +196,11 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
public void addListener(ISelectionChangedListener listener) {
listeners.add(listener);
}
-
+
/**
* Returns dependencies currently chosen by the user.
*
- * @return dependencies currently chosen by the user. Neither the array nor any of its elements is
- * <code>null</code>.
+ * @return dependencies currently chosen by the user. Neither the array nor any of its elements is <code>null</code>.
*/
public Dependency[] getDependencies() {
List<Dependency> dependencies = new ArrayList<Dependency>();
@@ -208,7 +212,6 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
}
return dependencies.toArray(new Dependency[dependencies.size()]);
}
-
/**
* Simple <code>LabelProvider</code> attached to the dependency viewer.
@@ -238,7 +241,8 @@ public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
public String getText(Object element) {
if(element instanceof Dependency) {
Dependency d = (Dependency) element;
- return d.getGroupId() + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier() == null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return d.getGroupId()
+ + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier() == null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return super.getText(element);
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
index 2cae6cec..1f6942c3 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizard.java
@@ -74,6 +74,7 @@ import org.eclipse.m2e.core.ui.internal.editing.PomEdits;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
import org.eclipse.m2e.core.ui.internal.lifecyclemapping.ILifecycleMappingLabelProvider;
+
/**
* Maven Import Wizard
*
@@ -91,7 +92,7 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
private List<String> locations;
private boolean showLocation = true;
-
+
private boolean basedirRemameRequired = false;
private boolean initialized = false;
@@ -114,7 +115,7 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
this(importConfiguration, locations);
this.mappingConfiguration = mappingConfiguration;
}
-
+
public void setBasedirRemameRequired(boolean basedirRemameRequired) {
this.basedirRemameRequired = basedirRemameRequired;
}
@@ -319,7 +320,7 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
discoverProposals(mappingConfiguration, monitor);
}
- void discoverProposals(LifecycleMappingConfiguration mappingConfiguration, IProgressMonitor monitor) {
+ void discoverProposals(LifecycleMappingConfiguration mappingConfiguration, IProgressMonitor monitor) {
final IMavenDiscovery discovery = getDiscovery();
if(discovery == null) {
@@ -338,9 +339,10 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
MavenProject mavenProject = project.getMavenProject();
List<MojoExecution> mojoExecutions = project.getMojoExecutions();
try {
- proposals.putAll(discovery.discover(mavenProject, mojoExecutions,
- mappingConfiguration.getSelectedProposals(),
- SubMonitor.convert(monitor, NLS.bind(Messages.MavenImportWizard_analyzingProject, project.getRelpath()), 1)));
+ proposals
+ .putAll(discovery.discover(mavenProject, mojoExecutions, mappingConfiguration.getSelectedProposals(),
+ SubMonitor.convert(monitor,
+ NLS.bind(Messages.MavenImportWizard_analyzingProject, project.getRelpath()), 1)));
} catch(CoreException e) {
//XXX we shall not swallow this exception but associate with the project/execution
LOG.error(e.getMessage(), e);
@@ -357,7 +359,7 @@ public class MavenImportWizard extends AbstractMavenProjectWizard implements IIm
}
private boolean warnIncompleteMapping() {
- if (!skipIncompleteWarning()) {
+ if(!skipIncompleteWarning()) {
MessageDialogWithToggle dialog = MessageDialogWithToggle.open(MessageDialog.CONFIRM, getShell(),
Messages.MavenImportWizard_titleIncompleteMapping, Messages.MavenImportWizard_messageIncompleteMapping,
Messages.MavenImportWizard_hideWarningMessage, false, null, null, SWT.SHEET);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
index ba0f1694..506ac61b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenImportWizardPage.java
@@ -19,8 +19,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -43,14 +44,6 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.MavenModelManager;
-import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.LifecycleMappingConfiguration;
-import org.eclipse.m2e.core.project.AbstractProjectScanner;
-import org.eclipse.m2e.core.project.LocalProjectScanner;
-import org.eclipse.m2e.core.project.MavenProjectInfo;
-import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
@@ -68,12 +61,22 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IWorkingSet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IWorkingSet;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.LifecycleMappingConfiguration;
+import org.eclipse.m2e.core.project.AbstractProjectScanner;
+import org.eclipse.m2e.core.project.LocalProjectScanner;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -97,7 +100,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
private WorkingSetGroup workingSetGroup;
private boolean showLocation = true;
-
+
private boolean basedirRemameRequired = false;
private final List<IWorkingSet> workingSets;
@@ -125,17 +128,17 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
public void setLocations(List<String> locations) {
this.locations = locations;
}
-
+
public void setBasedirRemameRequired(boolean basedirRemameRequired) {
this.basedirRemameRequired = basedirRemameRequired;
}
-
+
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(3, false));
setControl(composite);
- if(showLocation || locations==null || locations.isEmpty()) {
+ if(showLocation || locations == null || locations.isEmpty()) {
final Label selectRootDirectoryLabel = new Label(composite, SWT.NONE);
selectRootDirectoryLabel.setLayoutData(new GridData());
selectRootDirectoryLabel.setText(Messages.wizardImportPageRoot);
@@ -144,8 +147,8 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
rootDirectoryCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
rootDirectoryCombo.setFocus();
addFieldWithHistory("rootDirectory", rootDirectoryCombo); //$NON-NLS-1$
-
- if(locations!=null && locations.size()==1) {
+
+ if(locations != null && locations.size() == 1) {
rootDirectoryCombo.setText(locations.get(0));
rootDirectory = locations.get(0);
}
@@ -158,7 +161,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
dialog.setText(Messages.wizardImportPageSelectRootFolder);
String path = rootDirectoryCombo.getText();
- if(path.length()==0) {
+ if(path.length() == 0) {
path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
}
dialog.setFilterPath(path);
@@ -166,7 +169,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
String result = dialog.open();
if(result != null) {
rootDirectoryCombo.setText(result);
- if (rootDirectoryChanged()) {
+ if(rootDirectoryChanged()) {
scanProjects();
}
}
@@ -227,19 +230,20 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
btnSelectTree.setEnabled(!selection.isEmpty());
btnDeselectTree.setEnabled(!selection.isEmpty());
- if (selection.getFirstElement() != null) {
- String errorMsg = validateProjectInfo((MavenProjectInfo) selection.getFirstElement());
- if (errorMsg != null) {
+ if(selection.getFirstElement() != null) {
+ String errorMsg = validateProjectInfo((MavenProjectInfo) selection.getFirstElement());
+ if(errorMsg != null) {
setMessage(errorMsg, IMessageProvider.WARNING);
} else {
- //TODO if no error on current, shall show any existing general errors if found..
+ //TODO if no error on current, shall show any existing general errors if found..
setMessage(loadingErrorMessage, IMessageProvider.WARNING);
}
} else {
//TODO if on current selection, shall show any existing general errors if existing..
setMessage(loadingErrorMessage, IMessageProvider.WARNING);
}
- }});
+ }
+ });
projectTreeViewer.setContentProvider(new ITreeContentProvider() {
@@ -294,10 +298,10 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
projectTreeData.heightHint = 250;
projectTreeData.widthHint = 500;
projectTree.setLayoutData(projectTreeData);
-
+
Menu menu = new Menu(projectTree);
projectTree.setMenu(menu);
-
+
MenuItem mntmSelectTree = new MenuItem(menu, SWT.NONE);
mntmSelectTree.addSelectionListener(new SelectionAdapter() {
@Override
@@ -306,7 +310,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
}
});
mntmSelectTree.setText(Messages.MavenImportWizardPage_mntmSelectTree_text);
-
+
MenuItem mntmDeselectTree = new MenuItem(menu, SWT.NONE);
mntmDeselectTree.addSelectionListener(new SelectionAdapter() {
@Override
@@ -338,7 +342,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
setPageComplete(false);
}
});
-
+
btnSelectTree = new Button(composite, SWT.NONE);
btnSelectTree.setEnabled(false);
btnSelectTree.addSelectionListener(new SelectionAdapter() {
@@ -349,7 +353,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
});
btnSelectTree.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
btnSelectTree.setText(Messages.MavenImportWizardPage_btnSelectTree_text);
-
+
btnDeselectTree = new Button(composite, SWT.NONE);
btnDeselectTree.setEnabled(false);
btnDeselectTree.addSelectionListener(new SelectionAdapter() {
@@ -371,9 +375,9 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
});
this.workingSetGroup = new WorkingSetGroup(composite, workingSets, getShell());
-
+
createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
- resolverConfigurationComponent.template.addModifyListener(new ModifyListener(){
+ resolverConfigurationComponent.template.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent arg0) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
@@ -382,11 +386,11 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
});
}
});
-
- if(locations!=null && !locations.isEmpty()) {
+
+ if(locations != null && !locations.isEmpty()) {
scanProjects();
}
-
+
}
protected boolean rootDirectoryChanged() {
@@ -399,7 +403,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
super.dispose();
workingSetGroup.dispose();
}
-
+
protected void scanProjects() {
final AbstractProjectScanner<MavenProjectInfo> projectScanner = getProjectScanner();
try {
@@ -408,17 +412,17 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
projectScanner.run(monitor);
((MavenImportWizard) getWizard()).scanProjects(getProjects(projectScanner.getProjects()), monitor);
}
-
+
//this collects all projects for analyzing..
List<MavenProjectInfo> getProjects(Collection<MavenProjectInfo> input) {
List<MavenProjectInfo> toRet = new ArrayList<MavenProjectInfo>();
- for (MavenProjectInfo info : input) {
+ for(MavenProjectInfo info : input) {
toRet.add(info);
toRet.addAll(getProjects(info.getProjects()));
}
return toRet;
}
-
+
});
projectTreeViewer.setInput(projectScanner.getProjects());
@@ -429,12 +433,12 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
setErrorMessage(null);
setMessage(null);
loadingErrorMessage = null;
- LifecycleMappingConfiguration config = ((MavenImportWizard)getWizard()).getMappingConfiguration();
-
+ LifecycleMappingConfiguration config = ((MavenImportWizard) getWizard()).getMappingConfiguration();
+
//mkleint: XXX this sort of error handling is rather unfortunate
-
+
List<Throwable> errors = new ArrayList<Throwable>(projectScanner.getErrors());
- if (config != null) {
+ if(config != null) {
errors.addAll(config.getErrors().values());
}
if(!errors.isEmpty()) {
@@ -444,17 +448,17 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
if(ex instanceof CoreException) {
String msg = ((CoreException) ex).getStatus().getMessage();
sb.append("\n ").append(n).append(" ").append(msg.trim()); //$NON-NLS-1$ //$NON-NLS-2$
-
+
} else {
- String msg = ex.getMessage()==null ? ex.toString() : ex.getMessage();
+ String msg = ex.getMessage() == null ? ex.toString() : ex.getMessage();
sb.append("\n ").append(n).append(" ").append(msg.trim()); //$NON-NLS-1$ //$NON-NLS-2$
}
- n++;
+ n++ ;
}
loadingErrorMessage = sb.toString();
setMessage(sb.toString(), IMessageProvider.WARNING);
}
-
+
} catch(InterruptedException ex) {
// canceled
@@ -477,14 +481,14 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
void setAllChecked(boolean state) {
@SuppressWarnings("unchecked")
List<MavenProjectInfo> input = (List<MavenProjectInfo>) projectTreeViewer.getInput();
- if(input!=null) {
+ if(input != null) {
for(MavenProjectInfo mavenProjectInfo : input) {
projectTreeViewer.setSubtreeChecked(mavenProjectInfo, state);
}
updateCheckedState();
}
}
-
+
void updateCheckedState() {
Object[] elements = projectTreeViewer.getCheckedElements();
for(int i = 0; i < elements.length; i++ ) {
@@ -499,7 +503,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
}
boolean isWorkspaceFolder(MavenProjectInfo info) {
- if(info!=null) {
+ if(info != null) {
File pomFile = info.getPomFile();
if(pomFile != null) {
File parentFile = pomFile.getParentFile();
@@ -509,57 +513,58 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
}
}
return false;
- }
-
+ }
+
boolean isAlreadyExists(MavenProjectInfo info) {
- if(info!=null) {
+ if(info != null) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
String name = getImportConfiguration().getProjectName(info.getModel());
- if (name != null && name.length() > 0) {
+ if(name != null && name.length() > 0) {
IProject project = workspace.getRoot().getProject(name);
return project.exists();
}
}
return false;
}
-
+
/**
- * this will iterate all existing projects and return true
- * if the absolute location URI of the old (imported) and new (to-be-imported) projects match
+ * this will iterate all existing projects and return true if the absolute location URI of the old (imported) and new
+ * (to-be-imported) projects match
+ *
* @param info
* @return
*/
boolean isAlreadyImported(MavenProjectInfo info) {
- if(info!=null) {
+ if(info != null) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
- for (IProject project : workspace.getRoot().getProjects()) {
+ for(IProject project : workspace.getRoot().getProjects()) {
URI mavenuri = info.getPomFile().getParentFile().toURI();
//mkleint: this is sort of heuristic blah blah code. unfortunately for some reason the
// URI returned by the eclipse code in project.getLocationURI() differs by the ending / character from the
// java.io.File code. That results in failing match of the URIs. I've blah it by removing the ending slash.
// please tell me there is a more sane solution!
- if (mavenuri.toString().endsWith("/")) { //$NON-NLS-1$
+ if(mavenuri.toString().endsWith("/")) { //$NON-NLS-1$
try {
mavenuri = new URI(mavenuri.toString().substring(0, mavenuri.toString().length() - 1));
} catch(URISyntaxException ex) {
log.error(ex.getMessage(), ex);
}
}
- boolean ok = project.exists() && project.getLocationURI().equals(mavenuri);
- if (ok) {
+ boolean ok = project.exists() && project.getLocationURI().equals(mavenuri);
+ if(ok) {
return true;
}
}
}
return false;
- }
+ }
protected AbstractProjectScanner<MavenProjectInfo> getProjectScanner() {
File root = workspaceRoot.getLocation().toFile();
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
if(showLocation) {
String location = rootDirectoryCombo.getText().trim();
- if (location.length() > 0) {
+ if(location.length() > 0) {
return new LocalProjectScanner(root, location, basedirRemameRequired, modelManager);
}
} else if(locations != null && !locations.isEmpty()) {
@@ -592,21 +597,20 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
}
/**
- *
* @param info
* @return
*/
protected String validateProjectInfo(MavenProjectInfo info) {
- if(info!=null) {
+ if(info != null) {
if(isWorkspaceFolder(info)) {
String projectName = getImportConfiguration().getProjectName(info.getModel());
- return NLS.bind(Messages.wizardImportValidatorWorkspaceFolder, projectName);
+ return NLS.bind(Messages.wizardImportValidatorWorkspaceFolder, projectName);
} else if(isAlreadyImported(info)) {
String projectName = getImportConfiguration().getProjectName(info.getModel());
- return NLS.bind(Messages.wizardImportValidatorProjectImported, projectName);
+ return NLS.bind(Messages.wizardImportValidatorProjectImported, projectName);
} else if(isAlreadyExists(info)) {
String projectName = getImportConfiguration().getProjectName(info.getModel());
- return NLS.bind(Messages.wizardImportValidatorProjectExists, projectName);
+ return NLS.bind(Messages.wizardImportValidatorProjectExists, projectName);
}
}
return null;
@@ -617,8 +621,8 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
for(int i = 0; i < elements.length; i++ ) {
Object element = elements[i];
if(element instanceof MavenProjectInfo) {
- String errorMsg = validateProjectInfo((MavenProjectInfo) element);
- if (errorMsg != null) {
+ String errorMsg = validateProjectInfo((MavenProjectInfo) element);
+ if(errorMsg != null) {
setPageComplete(false);
return;
}
@@ -633,7 +637,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
public IWizardPage getNextPage() {
IWizardPage next = super.getNextPage();
LifecycleMappingConfiguration config = getMappingConfiguration();
- if (config == null || (config.isMappingComplete(true) && config.getAllProposals().isEmpty())) {
+ if(config == null || (config.isMappingComplete(true) && config.getAllProposals().isEmpty())) {
next = null;
}
return next;
@@ -659,16 +663,17 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
/**
* ProjectLabelProvider
*/
- class ProjectLabelProvider extends LabelProvider implements IColorProvider, DelegatingStyledCellLabelProvider.IStyledLabelProvider {
+ class ProjectLabelProvider extends LabelProvider implements IColorProvider,
+ DelegatingStyledCellLabelProvider.IStyledLabelProvider {
public String getText(Object element) {
if(element instanceof MavenProjectInfo) {
MavenProjectInfo info = (MavenProjectInfo) element;
-
+
if(info.getProfiles().isEmpty()) {
return info.getLabel() + " - " + getId(info); //$NON-NLS-1$
}
-
+
return info.getLabel() + " - " + getId(info) + " " + info.getProfiles(); //$NON-NLS-1$ //$NON-NLS-2$
}
return super.getText(element);
@@ -676,7 +681,7 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
private String getId(MavenProjectInfo info) {
Model model = info.getModel();
-
+
String groupId = model.getGroupId();
String artifactId = model.getArtifactId();
String version = model.getVersion();
@@ -684,17 +689,17 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
Parent parent = model.getParent();
- if(groupId==null && parent!=null) {
+ if(groupId == null && parent != null) {
groupId = parent.getGroupId();
}
- if(groupId==null) {
+ if(groupId == null) {
groupId = org.eclipse.m2e.core.ui.internal.Messages.MavenImportWizardPage_inherited;
}
-
- if(version==null && parent!=null) {
+
+ if(version == null && parent != null) {
version = parent.getVersion();
}
- if(version==null) {
+ if(version == null) {
version = org.eclipse.m2e.core.ui.internal.Messages.MavenImportWizardPage_inherited;
}
@@ -732,8 +737,8 @@ public class MavenImportWizardPage extends AbstractMavenWizardPage {
StyledString ss = new StyledString();
ss.append(info.getLabel() + " ");
ss.append(getId(info), StyledString.DECORATIONS_STYLER);
- if (! info.getProfiles().isEmpty()) {
- ss.append(" - " + info.getProfiles(), StyledString.QUALIFIER_STYLER );
+ if(!info.getProfiles().isEmpty()) {
+ ss.append(" - " + info.getProfiles(), StyledString.QUALIFIER_STYLER);
}
return ss;
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
index 0bd5dd5e..545f4a45 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileArtifactWizardPage.java
@@ -55,15 +55,21 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
private static final Logger log = LoggerFactory.getLogger(MavenInstallFileArtifactWizardPage.class);
Text artifactFileNameText;
+
Text pomFileNameText;
private Combo groupIdCombo;
+
private Combo artifactIdCombo;
+
private Combo versionCombo;
+
private Combo packagingCombo;
+
private Combo classifierCombo;
Button createChecksumButton;
+
Button generatePomButton;
private final IFile file;
@@ -88,7 +94,7 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
Label artifactFileNameLabel = new Label(container, SWT.NONE);
artifactFileNameLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblFileName);
-
+
artifactFileNameText = new Text(container, SWT.BORDER);
artifactFileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
artifactFileNameText.setData("name", "artifactFileNametext"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -98,7 +104,7 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
pageChanged();
}
});
-
+
final Button artifactFileNameButton = new Button(container, SWT.NONE);
artifactFileNameButton.setLayoutData(new GridData());
artifactFileNameButton.setData("name", "externalPomFileButton"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -109,7 +115,7 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
fileDialog.setFileName(artifactFileNameText.getText());
String name = fileDialog.open();
- if(name!=null) {
+ if(name != null) {
updateFileName(name);
}
}
@@ -123,7 +129,7 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
pomFileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
pomFileNameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- generatePomButton.setSelection(getPomFileName().length()==0);
+ generatePomButton.setSelection(getPomFileName().length() == 0);
pageChanged();
}
});
@@ -138,12 +144,12 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
fileDialog.setFileName(pomFileNameText.getText());
String res = fileDialog.open();
- if(res!=null) {
+ if(res != null) {
updatePOMFileName(res);
}
}
});
-
+
new Label(container, SWT.NONE);
generatePomButton = new Button(container, SWT.CHECK);
@@ -204,10 +210,10 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
packagingComboData.widthHint = 150;
packagingCombo.setLayoutData(packagingComboData);
packagingCombo.addModifyListener(modifyingListener);
-
+
Label classifierLabel = new Label(container, SWT.NONE);
classifierLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblClassifier);
-
+
classifierCombo = new Combo(container, SWT.NONE);
classifierCombo.setData("name", "classifierText"); //$NON-NLS-1$ //$NON-NLS-2$
classifierCombo.setItems(new String[] {"sources", "javadoc"}); //$NON-NLS-1$ //$NON-NLS-2$
@@ -216,14 +222,14 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
classifierCombo.setLayoutData(classifierTextData);
classifierCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- generatePomButton.setSelection(getClassifier().length()==0);
+ generatePomButton.setSelection(getClassifier().length() == 0);
}
});
if(file != null) {
updateFileName(file.getLocation().toOSString());
}
-
+
setControl(container);
}
@@ -231,18 +237,18 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
if(!getArtifactFileName().equals(fileName)) {
artifactFileNameText.setText(fileName);
}
-
+
File file = new File(fileName);
if(!file.exists() || !file.isFile()) {
return;
}
if(fileName.endsWith(".jar") || fileName.endsWith(".war") || fileName.endsWith(".ear")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- packagingCombo.setText(fileName.substring(fileName.length()-3));
+ packagingCombo.setText(fileName.substring(fileName.length() - 3));
}
int n = fileName.lastIndexOf('.');
- if(n>-1) {
+ if(n > -1) {
String pomFileName = fileName.substring(0, n) + ".pom"; //$NON-NLS-1$
if(new File(pomFileName).exists()) {
pomFileNameText.setText(pomFileName);
@@ -250,17 +256,17 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
} else {
pomFileNameText.setText(""); //$NON-NLS-1$
}
-
+
try {
IndexedArtifactFile iaf = MavenPlugin.getIndexManager().getAllIndexes().identify(file);
- if(iaf!=null) {
+ if(iaf != null) {
groupIdCombo.setText(iaf.group);
artifactIdCombo.setText(iaf.artifact);
versionCombo.setText(iaf.version);
- if(iaf.classifier!=null) {
+ if(iaf.classifier != null) {
classifierCombo.setText(iaf.classifier);
}
-
+
String name = iaf.group + ":" + iaf.artifact + "-" + iaf.version // //$NON-NLS-1$ //$NON-NLS-2$
+ (iaf.classifier == null ? "" : iaf.classifier); //$NON-NLS-1$
setMessage(NLS.bind(Messages.MavenInstallFileArtifactWizardPage_message, name), WARNING);
@@ -270,38 +276,38 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
log.error(ex.getMessage(), ex);
}
- if(n>-1) {
+ if(n > -1) {
String pomFileName = fileName.substring(0, n) + ".pom"; //$NON-NLS-1$
if(new File(pomFileName).exists()) {
pomFileNameText.setText(pomFileName);
readPOMFile(pomFileName);
}
}
-
+
ArtifactKey artifactKey = SelectionUtil.getType(file, ArtifactKey.class);
- if(artifactKey!=null) {
+ if(artifactKey != null) {
groupIdCombo.setText(artifactKey.getGroupId());
artifactIdCombo.setText(artifactKey.getArtifactId());
versionCombo.setText(artifactKey.getVersion());
- if(artifactKey.getClassifier()!=null) {
+ if(artifactKey.getClassifier() != null) {
classifierCombo.setText(artifactKey.getClassifier());
}
}
}
-
- private void updatePOMFileName(String fileName){
+
+ private void updatePOMFileName(String fileName) {
if(!getPomFileName().equals(fileName))
pomFileNameText.setText(fileName);
-
+
File file = new File(fileName);
if(!file.exists() || !file.isFile() || !fileName.endsWith(".pom")) { //$NON-NLS-1$
return;
}
-
+
readPOMFile(fileName);
}
-
- private void readPOMFile(String fileName){
+
+ private void readPOMFile(String fileName) {
try {
IMaven maven = MavenPlugin.getMaven();
MavenProject mavenProject = maven.readProject(new File(fileName), null);
@@ -329,9 +335,9 @@ public class MavenInstallFileArtifactWizardPage extends WizardPage {
updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_missing);
return;
}
-
+
String pomFileName = getPomFileName();
- if(pomFileName.length()>0) {
+ if(pomFileName.length() > 0) {
if(!new File(pomFileName).exists()) {
updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_missingpom);
return;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
index 1926cd1a..33137c81 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenInstallFileWizard.java
@@ -53,9 +53,9 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
private static final Logger log = LoggerFactory.getLogger(MavenInstallFileWizard.class);
private IFile selectedFile;
-
+
private IFile pomFile;
-
+
private MavenInstallFileArtifactWizardPage artifactPage;
public MavenInstallFileWizard() {
@@ -66,27 +66,27 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
public void addPages() {
artifactPage = new MavenInstallFileArtifactWizardPage(selectedFile);
addPage(artifactPage);
-
+
// repositoryPage = new MavenInstallFileRepositoryWizardPage(pomFile);
// addPage(repositoryPage);
}
-
+
public boolean performFinish() {
final Properties properties = new Properties();
-
+
// Mandatory Properties for install:install-file
properties.setProperty("file", artifactPage.getArtifactFileName()); //$NON-NLS-1$
-
+
properties.setProperty("groupId", artifactPage.getGroupId()); //$NON-NLS-1$
properties.setProperty("artifactId", artifactPage.getArtifactId()); //$NON-NLS-1$
properties.setProperty("version", artifactPage.getVersion()); //$NON-NLS-1$
properties.setProperty("packaging", artifactPage.getPackaging()); //$NON-NLS-1$
- if(artifactPage.getClassifier().length()>0) {
+ if(artifactPage.getClassifier().length() > 0) {
properties.setProperty("classifier", artifactPage.getClassifier()); //$NON-NLS-1$
}
- if(artifactPage.getPomFileName().length()>0) {
+ if(artifactPage.getPomFileName().length() > 0) {
properties.setProperty("pomFile", artifactPage.getPomFileName()); //$NON-NLS-1$
}
if(artifactPage.isGeneratePom()) {
@@ -95,7 +95,7 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
if(artifactPage.isCreateChecksum()) {
properties.setProperty("createChecksum", "true"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
new Job(Messages.MavenInstallFileWizard_job) {
protected IStatus run(IProgressMonitor monitor) {
setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
@@ -106,7 +106,7 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
request.setGoals(Arrays.asList("install:install-file")); //$NON-NLS-1$
request.setUserProperties(properties);
MavenExecutionResult executionResult = maven.execute(request, monitor);
-
+
List<Throwable> exceptions = executionResult.getExceptions();
if(!exceptions.isEmpty()) {
for(Throwable exception : exceptions) {
@@ -115,15 +115,15 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
log.error(msg, exception);
}
}
-
+
// TODO update index for local maven repository
- } catch (CoreException ex) {
+ } catch(CoreException ex) {
log.error("Failed to install artifact:" + ex.getMessage(), ex);
}
return Status.OK_STATUS;
}
}.schedule();
-
+
return true;
}
@@ -140,8 +140,8 @@ public class MavenInstallFileWizard extends Wizard implements IImportWizard {
private void setPomFile(IProject project) {
if(project.isAccessible()) {
IFile pomFile = project.getFile(IMavenConstants.POM_FILE_NAME);
- if(pomFile!=null && pomFile.isAccessible()) {
- this.pomFile = pomFile;
+ if(pomFile != null && pomFile.isAccessible()) {
+ this.pomFile = pomFile;
}
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
index c692ceba..ef7b5e3a 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenLocationComponent.java
@@ -15,7 +15,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -29,13 +28,12 @@ import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
- * Simple GUI component which allows the user to choose between a workspace
- * location and a user specified external location.
- *
- * This component is mainly used for choosing the location at which to create
- * a new project.
+ * Simple GUI component which allows the user to choose between a workspace location and a user specified external
+ * location. This component is mainly used for choosing the location at which to create a new project.
*/
public class MavenLocationComponent extends Composite {
@@ -56,137 +54,130 @@ public class MavenLocationComponent extends Composite {
protected Label locationLabel;
/**
- * Constructor.
- *
- * Constructs all the GUI components contained in this <code>Composite</code>.
- * These components allow the user to choose between a workspace location and
- * a user specified external location.
- *
- * @param parent The widget which will be the parent of this component.
- * @param styles The widget style for this component.
- * @param modifyingListener Listener which is notified when the contents of
- * this component change due to user input.
+ * Constructor. Constructs all the GUI components contained in this <code>Composite</code>. These components allow the
+ * user to choose between a workspace location and a user specified external location.
+ *
+ * @param parent The widget which will be the parent of this component.
+ * @param styles The widget style for this component.
+ * @param modifyingListener Listener which is notified when the contents of this component change due to user input.
*/
- public MavenLocationComponent( final Composite parent, int styles ) {
- super( parent, styles );
+ public MavenLocationComponent(final Composite parent, int styles) {
+ super(parent, styles);
GridLayout gridLayout = new GridLayout();
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
- setLayout( gridLayout );
+ setLayout(gridLayout);
- Group locationGroup = new Group( this, SWT.NONE );
- locationGroup.setText( Messages.locationComponentLocation);
- locationGroup.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true, 3, 1 ) );
+ Group locationGroup = new Group(this, SWT.NONE);
+ locationGroup.setText(Messages.locationComponentLocation);
+ locationGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 3, 1));
GridLayout groupLayout = new GridLayout();
groupLayout.numColumns = 3;
groupLayout.marginLeft = 0;
- locationGroup.setLayout( groupLayout );
+ locationGroup.setLayout(groupLayout);
GridData gridData = new GridData();
gridData.horizontalSpan = 3;
// first radio button
- inWorkspaceButton = new Button( locationGroup, SWT.RADIO );
- inWorkspaceButton.setText( Messages.locationComponentInWorkspace);
- inWorkspaceButton.setLayoutData( new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1) );
- inWorkspaceButton.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
+ inWorkspaceButton = new Button(locationGroup, SWT.RADIO);
+ inWorkspaceButton.setText(Messages.locationComponentInWorkspace);
+ inWorkspaceButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+ inWorkspaceButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
boolean isEnabled = !inWorkspaceButton.getSelection();
- locationLabel.setEnabled( isEnabled );
- locationCombo.setEnabled( isEnabled );
- locationBrowseButton.setEnabled( isEnabled );
- if(modifyingListener!=null) {
- modifyingListener.modifyText( null );
+ locationLabel.setEnabled(isEnabled);
+ locationCombo.setEnabled(isEnabled);
+ locationBrowseButton.setEnabled(isEnabled);
+ if(modifyingListener != null) {
+ modifyingListener.modifyText(null);
}
}
- } );
+ });
// second radio button
- inExternalLocationButton = new Button( locationGroup, SWT.RADIO );
- inExternalLocationButton.setText( Messages.locationComponentAtExternal);
- inExternalLocationButton.setLayoutData( gridData );
+ inExternalLocationButton = new Button(locationGroup, SWT.RADIO);
+ inExternalLocationButton.setText(Messages.locationComponentAtExternal);
+ inExternalLocationButton.setLayoutData(gridData);
// choose directory
- locationLabel = new Label( locationGroup, SWT.NONE );
+ locationLabel = new Label(locationGroup, SWT.NONE);
GridData gd_locationLabel = new GridData();
gd_locationLabel.horizontalIndent = 10;
locationLabel.setLayoutData(gd_locationLabel);
- locationLabel.setText( Messages.locationComponentDirectory);
+ locationLabel.setText(Messages.locationComponentDirectory);
- locationCombo = new Combo( locationGroup, SWT.BORDER );
- locationCombo.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+ locationCombo = new Combo(locationGroup, SWT.BORDER);
+ locationCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- locationBrowseButton = new Button( locationGroup, SWT.PUSH );
- locationBrowseButton.setText( Messages.locationComponentBrowse);
+ locationBrowseButton = new Button(locationGroup, SWT.PUSH);
+ locationBrowseButton.setText(Messages.locationComponentBrowse);
- gridData = new GridData( SWT.FILL, SWT.DEFAULT, false, false );
- locationBrowseButton.setLayoutData( gridData );
+ gridData = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
+ locationBrowseButton.setLayoutData(gridData);
- locationBrowseButton.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
+ locationBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setText(Messages.locationComponentSelectLocation);
-
+
String path = locationCombo.getText();
- if(path.length()==0) {
+ if(path.length() == 0) {
path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
}
dialog.setFilterPath(path);
String selectedDir = dialog.open();
if(selectedDir != null) {
- locationCombo.setText( selectedDir.trim() );
+ locationCombo.setText(selectedDir.trim());
}
}
- } );
+ });
- inWorkspaceButton.setSelection( true );
-
- locationLabel.setEnabled( false );
- locationCombo.setEnabled( false );
- locationBrowseButton.setEnabled( false );
+ inWorkspaceButton.setSelection(true);
+
+ locationLabel.setEnabled(false);
+ locationCombo.setEnabled(false);
+ locationBrowseButton.setEnabled(false);
}
/**
- * Returns the path of the location chosen by the user.
- *
- * According to the user input, the path either points to the workspace or
- * to a valid user specified location on the filesystem.
- *
- * @return The path of the location chosen by the user.
- * Is never <code>null</code>.
+ * Returns the path of the location chosen by the user. According to the user input, the path either points to the
+ * workspace or to a valid user specified location on the filesystem.
+ *
+ * @return The path of the location chosen by the user. Is never <code>null</code>.
*/
public IPath getLocationPath() {
- if ( isInWorkspace() ) {
+ if(isInWorkspace()) {
return Platform.getLocation();
}
- return Path.fromOSString( locationCombo.getText().trim() );
+ return Path.fromOSString(locationCombo.getText().trim());
}
/**
* Returns whether the workspace has been chosen as the location to use.
- *
- * @return <code>true</code> if the workspace is chosen as the location to use,
- * <code>false</code> if the specified external location is to be used.
+ *
+ * @return <code>true</code> if the workspace is chosen as the location to use, <code>false</code> if the specified
+ * external location is to be used.
*/
public boolean isInWorkspace() {
return inWorkspaceButton.getSelection();
}
-
- public void setModifyingListener( ModifyListener modifyingListener ) {
+
+ public void setModifyingListener(ModifyListener modifyingListener) {
this.modifyingListener = modifyingListener;
- locationCombo.addModifyListener( modifyingListener );
+ locationCombo.addModifyListener(modifyingListener);
}
-
+
public Combo getLocationCombo() {
return locationCombo;
}
-
+
public void dispose() {
super.dispose();
- if(modifyingListener!=null) {
- locationCombo.removeModifyListener( modifyingListener );
+ if(modifyingListener != null) {
+ locationCombo.removeModifyListener(modifyingListener);
}
}
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
index 9fa38c82..67dac3a8 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
@@ -62,6 +62,7 @@ import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
+
/**
* A project wizard for creating a new Maven2 module project.
*/
@@ -138,7 +139,7 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
copyParentValues();
}
});
-
+
archetypePage.addArchetypeSelectionListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent selectionchangedevent) {
parametersPage.setArchetype(archetypePage.getArchetype());
@@ -201,7 +202,7 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
if(parentPage.isSimpleProject()) {
final Model model = artifactPage.getModel();
- if (model.getParent() != null) {
+ if(model.getParent() != null) {
Parent par = model.getParent();
String relPath = location.makeRelativeTo(location.append(moduleName)).toOSString();
if(!"..".equals(relPath)) { //$NON-NLS-1$
@@ -209,17 +210,18 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
}
//#335331 remove current model's version and groupId if equal to parent, to prevent showing a warning marker
- if (par.getGroupId() != null && par.getGroupId().equals(model.getGroupId())) {
+ if(par.getGroupId() != null && par.getGroupId().equals(model.getGroupId())) {
model.setGroupId(null);
}
- if (par.getVersion() != null && par.getVersion().equals(model.getVersion())) {
+ if(par.getVersion() != null && par.getVersion().equals(model.getVersion())) {
model.setVersion(null);
}
}
final String[] folders = artifactPage.getFolders();
- job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreatingProject, moduleName), workingSets) {
+ job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreatingProject, moduleName),
+ workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
@@ -240,9 +242,9 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
} else {
Model model = parametersPage.getModel();
-
+
final Archetype archetype = archetypePage.getArchetype();
-
+
final String groupId = model.getGroupId();
final String artifactId = model.getArtifactId();
final String version = model.getVersion();
@@ -253,7 +255,8 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- List<IProject> projects = MavenPlugin.getProjectConfigurationManager().createArchetypeProjects(location, archetype, //
+ List<IProject> projects = MavenPlugin.getProjectConfigurationManager().createArchetypeProjects(location,
+ archetype, //
groupId, artifactId, version, javaPackage, properties, importConfiguration, monitor);
setModule(moduleName);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
index 3adb9dd2..d8ff5dfe 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizardParentPage.java
@@ -82,9 +82,9 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
private final List<IWorkingSet> workingSets;
-
/** Creates a new page. */
- public MavenModuleWizardParentPage(ProjectImportConfiguration projectImportConfiguration, List<IWorkingSet> workingSets) {
+ public MavenModuleWizardParentPage(ProjectImportConfiguration projectImportConfiguration,
+ List<IWorkingSet> workingSets) {
super("MavenModuleWizardParentPage", projectImportConfiguration);
this.workingSets = workingSets;
setTitle(Messages.wizardModulePageParentTitle);
@@ -169,8 +169,7 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
}
// check whether the project name is valid
- IStatus nameStatus =
- ResourcesPlugin.getWorkspace().validateName(moduleName, IResource.PROJECT);
+ IStatus nameStatus = ResourcesPlugin.getWorkspace().validateName(moduleName, IResource.PROJECT);
if(!nameStatus.isOK()) {
setErrorMessage(nameStatus.getMessage());
setPageComplete(false);
@@ -179,18 +178,18 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
// check if the given folder already exists
if(parentContainer != null && parentContainer.exists(new Path(moduleName))) {
- setErrorMessage(Messages.wizardModulePageParentValidatorNameExists);
+ setErrorMessage(Messages.wizardModulePageParentValidatorNameExists);
setPageComplete(false);
return;
}
-
+
if(pom == null) {
setErrorMessage(null);
setMessage(Messages.wizardModulePageParentValidatorParentProject);
setPageComplete(false);
return;
}
- if(!validateParent()){
+ if(!validateParent()) {
return;
}
setErrorMessage(null);
@@ -217,7 +216,7 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
} else if(SelectionUtil.PROJECT_WITH_NATURE == type) {
IProject project = SelectionUtil.getType(parentObject, IProject.class);
pom = project.getFile(IMavenConstants.POM_FILE_NAME);
-
+
workingSetGroup.selectWorkingSets(SelectionUtil.getAssignedWorkingSets(project));
} else if(parentObject instanceof IContainer) {
pom = ((IContainer) parentObject).getFile(new Path(IMavenConstants.POM_FILE_NAME));
@@ -236,10 +235,10 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
}
}
}
-
- private boolean validateParent(){
- if(parentModel != null){
- if(!"pom".equals(parentModel.getPackaging())){ //$NON-NLS-1$
+
+ private boolean validateParent() {
+ if(parentModel != null) {
+ if(!"pom".equals(parentModel.getPackaging())) { //$NON-NLS-1$
setMessage(null);
setErrorMessage(org.eclipse.m2e.core.ui.internal.Messages.MavenModuleWizardParentPage_error);
setPageComplete(false);
@@ -256,8 +255,8 @@ public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
/** Skips the archetype selection page if the user chooses a simple project. */
public IWizardPage getNextPage() {
- return getWizard().getPage(
- isSimpleProject() ? "MavenProjectWizardArtifactPage" : "MavenProjectWizardArchetypePage");
+ return getWizard()
+ .getPage(isSimpleProject() ? "MavenProjectWizardArtifactPage" : "MavenProjectWizardArchetypePage");
}
/** Returns the module name. */
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenParentComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenParentComponent.java
index eab6fdc6..aaa3586b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenParentComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenParentComponent.java
@@ -11,9 +11,6 @@
package org.eclipse.m2e.core.ui.internal.wizards;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -28,6 +25,11 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* Wizard page component showing panel project properties.
@@ -54,7 +56,7 @@ public class MavenParentComponent extends Composite {
private Label artifactIdLabel;
private Label versionLabel;
-
+
/** Creates a new panel with parent controls. */
public MavenParentComponent(Composite parent, int style) {
super(parent, SWT.NONE);
@@ -125,7 +127,7 @@ public class MavenParentComponent extends Composite {
});
}
}
-
+
public Combo getGroupIdCombo() {
return parentGroupIdCombo;
}
@@ -133,11 +135,11 @@ public class MavenParentComponent extends Composite {
public Combo getArtifactIdCombo() {
return this.parentArtifactIdCombo;
}
-
+
public Combo getVersionCombo() {
return this.parentVersionCombo;
}
-
+
public void setWidthGroup(WidthGroup widthGroup) {
widthGroup.addControl(this.groupIdLabel);
widthGroup.addControl(this.artifactIdLabel);
@@ -181,9 +183,9 @@ public class MavenParentComponent extends Composite {
/** Sets the parent group values. */
public void setValues(String groupId, String artifactId, String version) {
- parentGroupIdCombo.setText(groupId==null ? "" : groupId); //$NON-NLS-1$
- parentArtifactIdCombo.setText(artifactId==null ? "" : artifactId); //$NON-NLS-1$
- parentVersionCombo.setText(version==null ? "" : version); //$NON-NLS-1$
+ parentGroupIdCombo.setText(groupId == null ? "" : groupId); //$NON-NLS-1$
+ parentArtifactIdCombo.setText(artifactId == null ? "" : artifactId); //$NON-NLS-1$
+ parentVersionCombo.setText(version == null ? "" : version); //$NON-NLS-1$
}
/** Updates a Maven model. */
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
index d5fbc217..3efbb74e 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomSelectionComponent.java
@@ -132,8 +132,9 @@ public class MavenPomSelectionComponent extends Composite {
private static final long SHORT_DELAY = 150L;
private static final long LONG_DELAY = 500L;
-
+
final HashSet<String> artifactKeys = new HashSet<String>();
+
final HashSet<String> managedKeys = new HashSet<String>();
private IProject project;
@@ -213,7 +214,6 @@ public class MavenPomSelectionComponent extends Composite {
return (queryType != null && IIndex.SEARCH_ARTIFACT.equals(queryType));
}
-
public void init(String queryText, String queryType, IProject project, Set<ArtifactKey> artifacts,
Set<ArtifactKey> managed) {
this.queryType = queryType;
@@ -229,13 +229,13 @@ public class MavenPomSelectionComponent extends Composite {
artifactKeys.add(a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
- if (managed != null) {
- for (ArtifactKey a : managed) {
+ if(managed != null) {
+ for(ArtifactKey a : managed) {
managedKeys.add(a.getGroupId() + ":" + a.getArtifactId()); //$NON-NLS-1$
managedKeys.add(a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
searchResultViewer.setContentProvider(new SearchResultContentProvider());
SearchResultLabelProvider labelProvider = new SearchResultLabelProvider(artifactKeys, managedKeys);
@@ -256,10 +256,10 @@ public class MavenPomSelectionComponent extends Composite {
ArtifactFilterManager filterManager = MavenPluginActivator.getDefault().getArifactFilterManager();
- for (IndexedArtifactFile file : files) {
+ for(IndexedArtifactFile file : files) {
ArtifactKey key = (ArtifactKey) file.getAdapter(ArtifactKey.class);
IStatus status = filterManager.filter(MavenPomSelectionComponent.this.project, key);
- if (!status.isOK()) {
+ if(!status.isOK()) {
setStatus(IStatus.ERROR, status.getMessage());
return; // TODO not nice to exit method like this
}
@@ -324,8 +324,9 @@ public class MavenPomSelectionComponent extends Composite {
}
public IndexedArtifactFile getIndexedArtifactFile() {
- List<IndexedArtifactFile> files = getSelectedIndexedArtifactFiles((IStructuredSelection) searchResultViewer.getSelection());
- return !files.isEmpty()? files.get(0): null;
+ List<IndexedArtifactFile> files = getSelectedIndexedArtifactFiles((IStructuredSelection) searchResultViewer
+ .getSelection());
+ return !files.isEmpty() ? files.get(0) : null;
}
List<IndexedArtifactFile> getSelectedIndexedArtifactFiles(IStructuredSelection selection) {
@@ -352,7 +353,7 @@ public class MavenPomSelectionComponent extends Composite {
break;
}
}
- if (!added) {//just in case we deal with all snapshots..
+ if(!added) {//just in case we deal with all snapshots..
result.add(ia.getFiles().iterator().next());
}
}
@@ -385,14 +386,14 @@ public class MavenPomSelectionComponent extends Composite {
}
}
}
-
+
public static String getKey(IndexedArtifactFile file) {
return file.group + ":" + file.artifact + ":" + file.version; //$NON-NLS-1$ //$NON-NLS-2$
}
+
public static String getKey(IndexedArtifact art) {
return art.getGroupId() + ":" + art.getArtifactId(); //$NON-NLS-1$
}
-
/**
* Search Job
@@ -440,14 +441,15 @@ public class MavenPomSelectionComponent extends Composite {
setResult(IStatus.OK, NLS.bind(Messages.MavenPomSelectionComponent_searching, activeQuery.toLowerCase()),
null);
- Map<String, IndexedArtifact> res = indexManager.getAllIndexes().search( new UserInputSearchExpression(activeQuery), field, classifier);
-
+ Map<String, IndexedArtifact> res = indexManager.getAllIndexes().search(
+ new UserInputSearchExpression(activeQuery), field, classifier);
+
//335139 have the managed entries always come up as first results
LinkedHashMap<String, IndexedArtifact> managed = new LinkedHashMap<String, IndexedArtifact>();
LinkedHashMap<String, IndexedArtifact> nonManaged = new LinkedHashMap<String, IndexedArtifact>();
- for (Map.Entry<String, IndexedArtifact> art : res.entrySet()) {
+ for(Map.Entry<String, IndexedArtifact> art : res.entrySet()) {
String key = art.getValue().getGroupId() + ":" + art.getValue().getArtifactId(); //$NON-NLS-1$
- if (managedKeys.contains(key)) {
+ if(managedKeys.contains(key)) {
managed.put(art.getKey(), art.getValue());
} else {
nonManaged.put(art.getKey(), art.getValue());
@@ -489,13 +491,15 @@ public class MavenPomSelectionComponent extends Composite {
}
}
- public static class SearchResultLabelProvider extends LabelProvider implements IColorProvider, DelegatingStyledCellLabelProvider.IStyledLabelProvider {
+ public static class SearchResultLabelProvider extends LabelProvider implements IColorProvider,
+ DelegatingStyledCellLabelProvider.IStyledLabelProvider {
private final Set<String> artifactKeys;
private final Set<String> managedKeys;
/**
* both managedkeys and artifctkeys are supposed to hold both gr:art:ver combos and gr:art combos
+ *
* @param artifactKeys
* @param managedKeys
*/
@@ -515,7 +519,7 @@ public class MavenPomSelectionComponent extends Composite {
public Color getForeground(Object element) {
if(element instanceof IndexedArtifactFile) {
IndexedArtifactFile f = (IndexedArtifactFile) element;
- if(artifactKeys.contains(getKey(f))) {
+ if(artifactKeys.contains(getKey(f))) {
return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
}
} else if(element instanceof IndexedArtifact) {
@@ -534,18 +538,18 @@ public class MavenPomSelectionComponent extends Composite {
public Image getImage(Object element) {
if(element instanceof IndexedArtifactFile) {
IndexedArtifactFile f = (IndexedArtifactFile) element;
- if (managedKeys.contains(getKey(f))) {
- return MavenImages.getOverlayImage(f.sourcesExists==IIndex.PRESENT ? MavenImages.PATH_VERSION_SRC : MavenImages.PATH_VERSION,
- MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
+ if(managedKeys.contains(getKey(f))) {
+ return MavenImages.getOverlayImage(f.sourcesExists == IIndex.PRESENT ? MavenImages.PATH_VERSION_SRC
+ : MavenImages.PATH_VERSION, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
}
-
- if(f.sourcesExists==IIndex.PRESENT) {
+
+ if(f.sourcesExists == IIndex.PRESENT) {
return MavenImages.IMG_VERSION_SRC;
}
return MavenImages.IMG_VERSION;
} else if(element instanceof IndexedArtifact) {
IndexedArtifact i = (IndexedArtifact) element;
- if (managedKeys.contains(getKey(i))) {
+ if(managedKeys.contains(getKey(i))) {
return MavenImages.getOverlayImage(MavenImages.PATH_JAR, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
}
return MavenImages.IMG_JAR;
@@ -562,16 +566,17 @@ public class MavenPomSelectionComponent extends Composite {
String name = (a.getClassname() == null ? "" : a.getClassname() + " " + a.getPackageName() + " ") + a.getGroupId() + " " + a.getArtifactId(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
StyledString ss = new StyledString();
ss.append(name);
- if (managedKeys.contains(getKey(a))) {
+ if(managedKeys.contains(getKey(a))) {
ss.append(Messages.MavenPomSelectionComponent_managed_decoration, StyledString.DECORATIONS_STYLER);
}
return ss;
} else if(element instanceof IndexedArtifactFile) {
IndexedArtifactFile f = (IndexedArtifactFile) element;
StyledString ss = new StyledString();
- String name = f.version + " [" + (f.type == null ? "jar" : f.type) + (f.classifier != null ? ", " + f.classifier : "") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ String name = f.version
+ + " [" + (f.type == null ? "jar" : f.type) + (f.classifier != null ? ", " + f.classifier : "") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
ss.append(name);
- if (managedKeys.contains(getKey(f))) {
+ if(managedKeys.contains(getKey(f))) {
ss.append(Messages.MavenPomSelectionComponent_managed_decoration, StyledString.DECORATIONS_STYLER);
}
return ss;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
index dc287fe0..5795bb50 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizard.java
@@ -14,7 +14,9 @@ package org.eclipse.m2e.core.ui.internal.wizards;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
-import org.apache.maven.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -30,10 +32,6 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.embedder.MavenModelManager;
-import org.eclipse.m2e.core.internal.IMavenConstants;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -42,8 +40,13 @@ import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.core.ui.internal.Messages;
/**
@@ -51,6 +54,7 @@ import org.slf4j.LoggerFactory;
*/
public class MavenPomWizard extends Wizard implements INewWizard {
private static final Logger log = LoggerFactory.getLogger(MavenPomWizard.class);
+
private MavenPomWizardPage artifactPage;
private ISelection selection;
@@ -118,15 +122,16 @@ public class MavenPomWizard extends Wizard implements INewWizard {
IResource resource = root.findMember(new Path(projectName));
if(!resource.exists() || (resource.getType() & IResource.FOLDER | IResource.PROJECT) == 0) {
// TODO show warning popup
- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
- NLS.bind(Messages.MavenPomWizard_status_not_exists, projectName), null));
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(
+ Messages.MavenPomWizard_status_not_exists, projectName), null));
}
IContainer container = (IContainer) resource;
final IFile file = container.getFile(new Path(IMavenConstants.POM_FILE_NAME));
if(file.exists()) {
// TODO show warning popup
- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenPomWizard_error_exists, null));
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenPomWizard_error_exists, null));
}
final File pom = file.getLocation().toFile();
@@ -135,7 +140,7 @@ public class MavenPomWizard extends Wizard implements INewWizard {
//#359340 : Convert existing Eclipse config into Maven model config
//TODO We could let the user choose which conversion participants to run (in case of conflicts?)
MavenPlugin.getProjectConversionManager().convert(resource.getProject(), model, monitor);
-
+
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
modelManager.createMavenModel(file, model);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java
index d3e564eb..3c14363b 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenPomWizardPage.java
@@ -11,7 +11,6 @@
package org.eclipse.m2e.core.ui.internal.wizards;
-import org.apache.maven.model.Model;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -19,7 +18,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -30,6 +28,10 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.ui.internal.Messages;
+
/**
* Wizard page used to specify basic POM parameters
@@ -70,8 +72,6 @@ public class MavenPomWizardPage extends AbstractMavenWizardPage {
projectText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
projectText.addModifyListener(modifyingListener);
-
-
pomComponent = new MavenArtifactComponent(container, SWT.NONE);
pomComponent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
pomComponent.setModifyingListener(modifyingListener);
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java
index 2e65d088..7393f62f 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectSelectionDialog.java
@@ -14,6 +14,9 @@ package org.eclipse.m2e.core.ui.internal.wizards;
import java.util.ArrayList;
import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -27,10 +30,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.m2e.core.internal.IMavenConstants;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.dialogs.AbstractMavenDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -40,8 +39,10 @@ import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.dialogs.AbstractMavenDialog;
/**
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
index 9ee85683..e031a496 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizard.java
@@ -97,12 +97,11 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
setDefaultPageImageDescriptor(MavenImages.WIZ_NEW_PROJECT);
setNeedsProgressMonitor(true);
}
-
+
public void addPages() {
locationPage = new MavenProjectWizardLocationPage(importConfiguration, //
- Messages.wizardProjectPageProjectTitle,
- Messages.wizardProjectPageProjectDescription, workingSets) { //
-
+ Messages.wizardProjectPageProjectTitle, Messages.wizardProjectPageProjectDescription, workingSets) { //
+
protected void createAdditionalControls(Composite container) {
simpleProject = new Button(container, SWT.CHECK);
simpleProject.setText(Messages.wizardProjectPageProjectSimpleProject);
@@ -112,20 +111,20 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
validate();
}
});
-
+
Label label = new Label(container, SWT.NONE);
GridData labelData = new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1);
labelData.heightHint = 10;
label.setLayoutData(labelData);
}
-
+
/** Skips the archetype selection page if the user chooses a simple project. */
public IWizardPage getNextPage() {
return getPage(simpleProject.getSelection() ? "MavenProjectWizardArtifactPage" : "MavenProjectWizardArchetypePage"); //$NON-NLS-1$ //$NON-NLS-2$
}
};
locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
-
+
archetypePage = new MavenProjectWizardArchetypePage(importConfiguration);
parametersPage = new MavenProjectWizardArchetypeParametersPage(importConfiguration);
artifactPage = new MavenProjectWizardArtifactPage(importConfiguration);
@@ -149,7 +148,7 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
getContainer().updateButtons();
}
});
-
+
archetypePage.addArchetypeSelectionListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent selectionchangedevent) {
parametersPage.setArchetype(archetypePage.getArchetype());
@@ -172,7 +171,7 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
}
return parametersPage.getModel();
}
-
+
/**
* To perform the actual project creation, an operation is created and run using this wizard as execution context.
* That way, messages about the progress of the project creation are displayed inside the wizard.
@@ -195,29 +194,32 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
final String projectName = importConfiguration.getProjectName(model);
IStatus nameStatus = importConfiguration.validateProjectName(model);
if(!nameStatus.isOK()) {
- MessageDialog.openError(getShell(), NLS.bind(Messages.wizardProjectJobFailed, projectName), nameStatus.getMessage());
+ MessageDialog.openError(getShell(), NLS.bind(Messages.wizardProjectJobFailed, projectName),
+ nameStatus.getMessage());
return false;
}
IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
+
final IPath location = locationPage.isInWorkspace() ? null : locationPage.getLocationPath();
final IWorkspaceRoot root = workspace.getRoot();
final IProject project = importConfiguration.getProject(root, model);
-
- boolean pomExists = ( locationPage.isInWorkspace() ?
- root.getLocation().append(project.getName()) : location ).append(IMavenConstants.POM_FILE_NAME).toFile().exists();
- if ( pomExists ) {
- MessageDialog.openError(getShell(), NLS.bind(Messages.wizardProjectJobFailed, projectName), Messages.wizardProjectErrorPomAlreadyExists);
+
+ boolean pomExists = (locationPage.isInWorkspace() ? root.getLocation().append(project.getName()) : location)
+ .append(IMavenConstants.POM_FILE_NAME).toFile().exists();
+ if(pomExists) {
+ MessageDialog.openError(getShell(), NLS.bind(Messages.wizardProjectJobFailed, projectName),
+ Messages.wizardProjectErrorPomAlreadyExists);
return false;
}
final Job job;
-
+
if(simpleProject.getSelection()) {
final String[] folders = artifactPage.getFolders();
- job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreatingProject, projectName), workingSets) {
+ job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreatingProject, projectName),
+ workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
MavenPlugin.getProjectConfigurationManager().createSimpleProject(project, location, model, folders, //
@@ -228,17 +230,19 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
} else {
final Archetype archetype = archetypePage.getArchetype();
-
+
final String groupId = model.getGroupId();
final String artifactId = model.getArtifactId();
final String version = model.getVersion();
final String javaPackage = parametersPage.getJavaPackage();
final Properties properties = parametersPage.getProperties();
-
- job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreating, archetype.getArtifactId()), workingSets) {
+
+ job = new AbstactCreateMavenProjectJob(NLS.bind(Messages.wizardProjectJobCreating, archetype.getArtifactId()),
+ workingSets) {
@Override
protected List<IProject> doCreateMavenProjects(IProgressMonitor monitor) throws CoreException {
- List<IProject> projects = MavenPlugin.getProjectConfigurationManager().createArchetypeProjects(location, archetype, //
+ List<IProject> projects = MavenPlugin.getProjectConfigurationManager().createArchetypeProjects(location,
+ archetype, //
groupId, artifactId, version, javaPackage, properties, importConfiguration, monitor);
return projects;
}
@@ -252,13 +256,12 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
Display.getDefault().asyncExec(new Runnable() {
public void run() {
MessageDialog.openError(getShell(), //
- NLS.bind(Messages.wizardProjectJobFailed, projectName), result.getMessage());
+ NLS.bind(Messages.wizardProjectJobFailed, projectName), result.getMessage());
}
});
}
}
});
-
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
job.schedule();
@@ -285,7 +288,6 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
return true;
}
-
// static class ProjectListener implements IResourceChangeListener {
// private IProject newProject = null;
//
@@ -308,5 +310,5 @@ public class MavenProjectWizard extends AbstractMavenProjectWizard implements IN
// return newProject;
// }
// }
-
+
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
index 92248242..9d1f6377 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java
@@ -347,15 +347,15 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
TableColumn column1 = new TableColumn(table, SWT.LEFT);
column1.setWidth(150);
- column1.setText(Messages.wizardProjectPageArchetypeColumnGroupId);
+ column1.setText(Messages.wizardProjectPageArchetypeColumnGroupId);
TableColumn column0 = new TableColumn(table, SWT.LEFT);
column0.setWidth(150);
- column0.setText(Messages.wizardProjectPageArchetypeColumnArtifactId);
+ column0.setText(Messages.wizardProjectPageArchetypeColumnArtifactId);
TableColumn column2 = new TableColumn(table, SWT.LEFT);
column2.setWidth(100);
- column2.setText(Messages.wizardProjectPageArchetypeColumnVersion);
+ column2.setText(Messages.wizardProjectPageArchetypeColumnVersion);
GridData tableData = new GridData(SWT.FILL, SWT.FILL, true, true);
tableData.widthHint = 400;
@@ -453,7 +453,8 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
GridData buttonData = new GridData(SWT.LEFT, SWT.CENTER, true, false);
buttonData.horizontalIndent = 25;
includeShapshotsButton.setLayoutData(buttonData);
- includeShapshotsButton.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_btnSnapshots);
+ includeShapshotsButton
+ .setText(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_btnSnapshots);
includeShapshotsButton.setSelection(DEFAULT_INCLUDE_SNAPSHOTS);
includeShapshotsButton.addSelectionListener(versionFilter);
@@ -576,7 +577,7 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
}
/**
- * @deprecated this method is not used ad will be removed from 1.1
+ * @deprecated this method is not used ad will be removed from 1.1
*/
public Set<Archetype> filterVersions(Collection<Archetype> archetypes) {
HashMap<String, Archetype> filteredArchetypes = new HashMap<String, Archetype>();
@@ -752,8 +753,9 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
} else {
//Use id = archetypeArtifactId+"-repo" to enable mirror/proxy authentication
//see http://maven.apache.org/archetype/maven-archetype-plugin/faq.html
- ArtifactRepository repository = maven.createArtifactRepository(archetypeArtifactId+"-repo", repositoryUrl); //$NON-NLS-1$
-
+ ArtifactRepository repository = maven.createArtifactRepository(
+ archetypeArtifactId + "-repo", repositoryUrl); //$NON-NLS-1$
+
remoteRepositories = Collections.singletonList(repository);
}
@@ -767,7 +769,8 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
File pomFile = pomArtifact.getFile();
if(pomFile.exists()) {
- monitor.subTask(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_task_resolving2);
+ monitor
+ .subTask(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_task_resolving2);
Artifact jarArtifact = maven.resolve(archetypeGroupId, archetypeArtifactId, archetypeVersion,
"jar", null, remoteRepositories, monitor); //$NON-NLS-1$
monitor.worked(1);
@@ -815,8 +818,9 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp
throw ex;
} catch(final Exception ex) {
- final String msg = NLS.bind(
- org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_error_resolve2, archetypeName);
+ final String msg = NLS
+ .bind(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypePage_error_resolve2,
+ archetypeName);
log.error(msg, ex);
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
index a904ea88..21381c4c 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypeParametersPage.java
@@ -118,7 +118,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
public MavenProjectWizardArchetypeParametersPage(ProjectImportConfiguration projectImportConfiguration) {
super("Maven2ProjectWizardArchifactPage", projectImportConfiguration); //$NON-NLS-1$
- setTitle(Messages.wizardProjectPageMaven2Title);
+ setTitle(Messages.wizardProjectPageMaven2Title);
setDescription(Messages.wizardProjectPageMaven2ArchetypeParametersDescription);
setPageComplete(false);
@@ -154,7 +154,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
// artifactGroup.setLayout(new GridLayout(2, false));
Label groupIdlabel = new Label(parent, SWT.NONE);
- groupIdlabel.setText(Messages.artifactComponentGroupId);
+ groupIdlabel.setText(Messages.artifactComponentGroupId);
groupIdCombo = new Combo(parent, SWT.BORDER);
groupIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
@@ -168,7 +168,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
});
Label artifactIdLabel = new Label(parent, SWT.NONE);
- artifactIdLabel.setText(Messages.artifactComponentArtifactId);
+ artifactIdLabel.setText(Messages.artifactComponentArtifactId);
artifactIdCombo = new Combo(parent, SWT.BORDER);
artifactIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
@@ -182,7 +182,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
});
Label versionLabel = new Label(parent, SWT.NONE);
- versionLabel.setText(Messages.artifactComponentVersion);
+ versionLabel.setText(Messages.artifactComponentVersion);
versionCombo = new Combo(parent, SWT.BORDER);
GridData gd_versionCombo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
@@ -197,7 +197,7 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
});
Label packageLabel = new Label(parent, SWT.NONE);
- packageLabel.setText(Messages.artifactComponentPackage);
+ packageLabel.setText(Messages.artifactComponentPackage);
packageCombo = new Combo(parent, SWT.BORDER);
packageCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
@@ -216,7 +216,8 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
private void createPropertiesGroup(Composite composite) {
Label propertiesLabel = new Label(composite, SWT.NONE);
propertiesLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
- propertiesLabel.setText(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_lblProps);
+ propertiesLabel
+ .setText(org.eclipse.m2e.core.ui.internal.Messages.MavenProjectWizardArchetypeParametersPage_lblProps);
propertiesViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
propertiesTable = propertiesViewer.getTable();
@@ -226,11 +227,13 @@ public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWiza
TableColumn propertiesTableNameColumn = new TableColumn(propertiesTable, SWT.NONE);
propertiesTableNameColumn.setWidth(130);