Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jaxb
diff options
context:
space:
mode:
authorbvosburgh2012-07-20 21:21:07 +0000
committerbvosburgh2012-07-20 21:21:07 +0000
commita9acc40fabcdda7547981853cb47172a73175b41 (patch)
tree61f25593bcebffa356a03d0d6388a5d0e44060fa /jaxb
parent04bfbb636dce962376aa61d6ae51f627522c65b1 (diff)
downloadwebtools.dali-a9acc40fabcdda7547981853cb47172a73175b41.tar.gz
webtools.dali-a9acc40fabcdda7547981853cb47172a73175b41.tar.xz
webtools.dali-a9acc40fabcdda7547981853cb47172a73175b41.zip
rework plug-in classes
Diffstat (limited to 'jaxb')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/plugin/JptDbwsEclipseLinkUiPlugin.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java212
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/plugin/JptJaxbEclipseLinkCorePlugin.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java105
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/plugin/JptJaxbEclipseLinkUiPlugin.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.pngbin0 -> 2505 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/gen/GenerateJaxbClassesJob.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/plugin/JptJaxbUiPlugin.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF8
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreMiscTests.java32
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java7
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/plugin/JptJaxbCoreTestsPlugin.java (renamed from jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java)37
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java22
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml9
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF8
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java59
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreMiscTests.java32
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java24
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java21
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/plugin/JptJaxbEclipseLinkCoreTestsPlugin.java36
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java22
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml20
104 files changed, 991 insertions, 1260 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
index be182acf00..371e1a221c 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
@@ -4,10 +4,12 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.core.gen;singleton:=true
Bundle-Version: 1.0.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.persistence.dbws.builder;bundle-version="[2.3.0,3.0.0)",
javax.wsdl;bundle-version="[1.6.2,2.0.0)"
+Import-Package: org.eclipse.persistence.oxm
Export-Package: org.eclipse.jpt.dbws.eclipselink.core.gen,
org.eclipse.jpt.dbws.eclipselink.core.gen.internal;x-internal:=true
-Import-Package: org.eclipse.persistence.oxm
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
index 76f5da81fa..8f6b5b770f 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
@@ -5,7 +5,9 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
+ <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/**/plugin/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
+ <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
<accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
index 7afa8ef09c..91daa49d6f 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.ui;singleton:=true
Bundle-Version: 1.0.200.qualifier
-Bundle-Activator: org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin
+Bundle-Activator: org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Localization: plugin
@@ -24,7 +24,6 @@ Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)"
Export-Package: org.eclipse.jpt.dbws.eclipselink.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui,
org.eclipse.jpt.dbws.eclipselink.ui.internal;x-internal:=true,
org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;x-internal:=true,
org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
deleted file mode 100644
index 25b0f74546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptDbwsUiPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.dbws.eclipselink.ui"; //$NON-NLS-1$
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptDbwsUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptDbwsUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
-
- // ********** constructors **********
-
- public JptDbwsUiPlugin() {
- super();
- if(INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
index 8ca85f0a91..be3f3dd164 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal;
import java.io.File;
import java.util.Map;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.WorkspaceJob;
@@ -28,7 +27,7 @@ import org.eclipse.jpt.common.core.gen.JptGenerator;
import org.eclipse.jpt.common.ui.gen.AbstractJptGenerateJob;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.dbws.eclipselink.core.internal.gen.DbwsGenerator;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard;
import org.eclipse.persistence.oxm.XMLContext;
import org.eclipse.persistence.oxm.XMLUnmarshaller;
@@ -77,7 +76,7 @@ public class DbwsGeneratorUi
catch (CoreException e) {
return false;
}
- return (facetedProject == null) ? false : facetedProject.hasProjectFacet(projectFacet);
+ return (facetedProject != null) && facetedProject.hasProjectFacet(projectFacet);
}
public static IPath getWebContentPath(IProject project){
@@ -281,8 +280,7 @@ public class DbwsGeneratorUi
@Override
protected void jptPluginLogException(Exception exception) {
- JptDbwsUiPlugin.log(exception);
+ JptDbwsEclipseLinkUiPlugin.instance().logError(exception);
}
-
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/plugin/JptDbwsEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/plugin/JptDbwsEclipseLinkUiPlugin.java
new file mode 100644
index 0000000000..512c74cee2
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/plugin/JptDbwsEclipseLinkUiPlugin.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin;
+
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
+import org.eclipse.jpt.common.ui.internal.JptUIPlugin;
+
+public class JptDbwsEclipseLinkUiPlugin
+ extends JptUIPlugin
+{
+ // ********** singleton **********
+
+ private static volatile JptDbwsEclipseLinkUiPlugin INSTANCE;
+
+ /**
+ * Return the singleton Dali DBWS EclipseLink UI plug-in.
+ */
+ public static JptDbwsEclipseLinkUiPlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** Dali plug-in **********
+
+ public JptDbwsEclipseLinkUiPlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptDbwsEclipseLinkUiPlugin) plugin;
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
index 327a463419..9902ad2eb6 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
@@ -1,12 +1,12 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import org.eclipse.core.resources.IFile;
@@ -20,10 +20,10 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
@@ -64,7 +64,7 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
private void initialize() {
if(this.getDialogSettings() == null) {
- IDialogSettings dbwsSettings = JptDbwsUiPlugin.instance().getDialogSettings();
+ IDialogSettings dbwsSettings = JptDbwsEclipseLinkUiPlugin.instance().getDialogSettings();
IDialogSettings wizardSettings = dbwsSettings.getSection(DBWS_SECTION_NAME);
if(wizardSettings == null) {
wizardSettings = dbwsSettings.addNewSection(DBWS_SECTION_NAME);
@@ -80,7 +80,7 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
this.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
+ this.setDefaultPageImageDescriptor(JptDbwsEclipseLinkUiPlugin.instance().buildImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
this.setNeedsProgressMonitor(true);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
index 8f5c9d1f07..66f45847b1 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
@@ -1,12 +1,12 @@
/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import java.io.File;
@@ -30,9 +30,9 @@ import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -74,7 +74,7 @@ public class JdbcDriverWizardPage extends WizardPage
protected void initialize() {
this.setTitle(JptDbwsUiMessages.JdbcDriverWizardPage_title);
this.setDescription(JptDbwsUiMessages.JdbcDriverWizardPage_desc);
- this.setImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
+ this.setImageDescriptor(JptDbwsEclipseLinkUiPlugin.instance().buildImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
}
// ********** intra-wizard methods **********
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
index 7f36cc306f..f848ea46b5 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -26,6 +26,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.PageBook;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
@@ -60,7 +61,7 @@ public class SelectFileOrXMLCatalogIdPanel extends Composite implements Selectio
this.setSingleFileViewDefaultSelection(selection);
// Catalog
- ICatalog xmlCatalog = JptDbwsUiPlugin.instance().getDefaultXMLCatalog();
+ ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
index 3e1ec46a64..536c1bcf52 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
@@ -14,16 +14,16 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import java.util.Collection;
import java.util.List;
import java.util.Vector;
-
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
@@ -95,12 +95,12 @@ public class SelectXMLCatalogIdPanel extends Composite {
INextCatalog catalog = nextCatalogs[i];
ICatalog referencedCatalog = catalog.getReferencedCatalog();
if (referencedCatalog != null) {
- if (JptDbwsUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
+ if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
ICatalog systemCatalog = referencedCatalog;
addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
}
- else if (JptDbwsUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
+ else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
ICatalog userCatalog = referencedCatalog;
addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
index c556561adf..7947401523 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
@@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -40,10 +40,10 @@ public class XMLCatalogTableViewer extends TableViewer {
protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
- protected static Image dtdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptDbwsUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
+ protected static Image dtdFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/dtdfile"); //$NON-NLS-1$
+ protected static Image unknownFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/text"); //$NON-NLS-1$
+ protected static Image xsdFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/XSDFile"); //$NON-NLS-1$
+ protected static Image errorImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/ovr16/error_ovr"); //$NON-NLS-1$
// ********** constructor **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
index 6bb4d25868..f525152176 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
@@ -4,6 +4,8 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.core.schemagen;singleton:=true
Bundle-Version: 1.0.200.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: javax.xml.bind
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
index d8fbf291a5..0dc40cf9d9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
@@ -150,7 +150,7 @@ class GenericJaxbProjectManager
implements ExceptionHandler
{
public void handleException(Throwable t) {
- JptJaxbCorePlugin.log(t);
+ JptJaxbCorePlugin.instance().logError(t);
}
@Override
public String toString() {
@@ -241,7 +241,7 @@ class GenericJaxbProjectManager
FacetedProjectFramework.addListener(this.facetedProjectListener, FACETED_PROJECT_EVENT_TYPES);
JavaCore.addElementChangedListener(this.javaElementChangeListener, JAVA_CHANGE_EVENT_TYPES);
} catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
this.stop_();
}
}
@@ -255,7 +255,7 @@ class GenericJaxbProjectManager
} catch (CoreException ex) {
// if we have a problem, leave the currently built JAXB projects in
// place and keep executing (should be OK...)
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
}
}
@@ -420,7 +420,7 @@ class GenericJaxbProjectManager
return platformDefinition.getFactory().buildJaxbProject(config);
}
catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
return null;
}
}
@@ -777,7 +777,7 @@ class GenericJaxbProjectManager
GenericJaxbProjectManager.this.lock.acquire();
this.execute_();
} catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
} finally {
GenericJaxbProjectManager.this.lock.release();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
index 1f647ca770..80fe7000ec 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core;
import org.eclipse.core.resources.IProject;
@@ -42,7 +42,7 @@ public class JaxbFacet {
return FacetedProjectFramework.hasProjectFacet(project, ID);
}
catch (CoreException e) {
- JptJaxbCorePlugin.log(e);
+ JptJaxbCorePlugin.instance().logError(e);
return false;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
index c284fecf9f..f57bc70e1f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
@@ -1,129 +1,86 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core;
import java.util.List;
-
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformManagerImpl;
import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.osgi.framework.BundleContext;
import org.osgi.service.prefs.Preferences;
-/**
- * The Dali JAXB core plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
public class JptJaxbCorePlugin
- extends Plugin {
+ extends JptPlugin
+{
+ private volatile GenericJaxbProjectManager projectManager;
- // ********** public constants **********
-
- /**
- * The plug-in identifier of Dali JAXB core
- * (value <code>"org.eclipse.jpt.jaxb.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
- /**
- * The identifier for the JAXB validation marker
- * (value <code>"org.eclipse.jpt.jaxb.core.jaxbProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jaxbProblemMarker"; //$NON-NLS-1$
+ // ********** singleton **********
- /**
- * The content type for jaxb.index files
- */
- public static final IContentType JAXB_INDEX_CONTENT_TYPE = getJaxbContentType("jaxbIndex");
-
- /**
- * The resource type for jaxb.index files
- */
- public static final JptResourceType JAXB_INDEX_RESOURCE_TYPE = new JptResourceType(JAXB_INDEX_CONTENT_TYPE);
-
- /**
- * The content type for jaxb.properties files
- */
- public static final IContentType JAXB_PROPERTIES_CONTENT_TYPE = getJaxbContentType("jaxbProperties");
-
- /**
- * The resource type for jaxb.properties files
- */
- public static final JptResourceType JAXB_PROPERTIES_RESOURCE_TYPE = new JptResourceType(JAXB_PROPERTIES_CONTENT_TYPE);
-
- private static IContentType getJaxbContentType(String contentType) {
- return getContentType(CONTENT_PREFIX_ + contentType);
- }
-
- public static final String CONTENT_PREFIX = PLUGIN_ID_ + "content"; //$NON-NLS-1$
-
- public static final String CONTENT_PREFIX_ = CONTENT_PREFIX + '.';
-
- private static IContentType getContentType(String contentType) {
- return Platform.getContentTypeManager().getContentType(contentType);
- }
-
-
- // **************** fields ************************************************
-
- private volatile GenericJaxbProjectManager projectManager;
-
-
- // **************** singleton *********************************************
-
private static JptJaxbCorePlugin INSTANCE;
-
+
/**
- * Return the singleton plug-in
+ * Return the Dali JAXB core plug-in.
*/
public static JptJaxbCorePlugin instance() {
return INSTANCE;
}
-
-
- // ********** public static methods **********
+
+
+ // ********** Dali plug-in **********
+
+ public JptJaxbCorePlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbCorePlugin) plugin;
+ }
+
+ @Override
+ protected void stop_() throws Exception {
+ try {
+ if (this.projectManager != null) {
+ this.projectManager.stop();
+ this.projectManager = null;
+ }
+ } finally {
+ super.stop_();
+ }
+ }
+
+
+ // ********** project manager **********
/**
* Return the singular JAXB project manager corresponding to the current workspace.
*/
- public static JaxbProjectManager getProjectManager() {
- return INSTANCE.getProjectManager_();
+ public synchronized JaxbProjectManager getProjectManager() {
+ if ((this.projectManager == null) && this.isActive()) {
+ this.projectManager = this.buildProjectManager();
+ this.projectManager.start();
+ }
+ return this.projectManager;
}
- /**
- * Return the JAXB project corresponding to the specified Eclipse project,
- * or <code>null</code> if unable to associate the specified project with a
- * JAXB project.
- */
- public static JaxbProject getJaxbProject(IProject project) {
- return getProjectManager().getJaxbProject(project);
+ private GenericJaxbProjectManager buildProjectManager() {
+ return new GenericJaxbProjectManager();
}
+
+
+ // ********** public static methods **********
public static JaxbPlatformManager getJaxbPlatformManager() {
return JaxbPlatformManagerImpl.instance();
@@ -230,67 +187,4 @@ public class JptJaxbCorePlugin
public static void setSchemaLocations(IProject project, List<String> schemaLocations) {
(new JaxbPreferencesManager(project)).setSchemaLocations(schemaLocations);
}
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **************************************************
-
- public JptJaxbCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- if (this.projectManager != null) {
- this.projectManager.stop();
- this.projectManager = null;
- }
- } finally {
- super.stop(context);
- }
- }
-
- private synchronized GenericJaxbProjectManager getProjectManager_() {
- if (this.projectManager == null) {
- this.projectManager = this.buildProjectManager();
- this.projectManager.start();
- }
- return this.projectManager;
- }
-
- private GenericJaxbProjectManager buildProjectManager() {
- return new GenericJaxbProjectManager();
- }
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
index 9918f02d62..67cb961f77 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.context;
-import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.JptResourceTypeReference;
import org.eclipse.jpt.jaxb.core.JaxbNode;
/**
@@ -26,18 +26,13 @@ import org.eclipse.jpt.jaxb.core.JaxbNode;
* @since 3.0
*/
public interface JaxbContextNode
- extends JaxbNode {
+ extends JaxbNode, JptResourceTypeReference {
/**
* Return the root of the context model
*/
JaxbContextRoot getContextRoot();
- /**
- * Return the resource type of the context node's resource.
- */
- JptResourceType getResourceType();
-
// ********** updating **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
index 8a3575ba13..788cf013e5 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
@@ -34,7 +34,6 @@ import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.JptResourceModel;
import org.eclipse.jpt.common.core.JptResourceModelListener;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
@@ -43,6 +42,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
import org.eclipse.jpt.common.utility.command.Command;
import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor;
@@ -401,7 +401,7 @@ public abstract class AbstractJaxbProject
catch (Exception e) {
//log any developer exceptions and don't build a JaxbFile rather
//than completely failing to build the JaxbProject
- JptJaxbCorePlugin.log(e);
+ JptJaxbCorePlugin.instance().logError(e);
}
if (jaxbFile == null) {
return null;
@@ -415,8 +415,8 @@ public abstract class AbstractJaxbProject
protected boolean isJavaFile(IFile file) {
IContentType contentType = PlatformTools.getContentType(file);
return contentType != null
- && (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)
- || contentType.isKindOf(JptCommonCorePlugin.JAR_CONTENT_TYPE));
+ && (contentType.isKindOf(JavaResourceCompilationUnit.CONTENT_TYPE)
+ || contentType.isKindOf(JavaResourcePackageFragmentRoot.JAR_CONTENT_TYPE));
}
/* (non-java resource) file is in acceptable resource location */
@@ -585,7 +585,7 @@ public abstract class AbstractJaxbProject
return EmptyIterable.instance();
}
- if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
+ if (contentType.isKindOf(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE)) {
try {
return new FilteringIterable<JaxbPackageInfo>(
new TransformationIterable<IPackageDeclaration, JaxbPackageInfo>(
@@ -602,7 +602,7 @@ public abstract class AbstractJaxbProject
return EmptyIterable.instance();
}
}
- else if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
+ else if (contentType.isKindOf(JavaResourceCompilationUnit.CONTENT_TYPE)) {
try {
return new FilteringIterable<JaxbType>(
new TransformationIterable<IType, JaxbType>(
@@ -628,7 +628,7 @@ public abstract class AbstractJaxbProject
return (IFile) cu.getCorrespondingResource();
}
catch (JavaModelException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
return null;
}
}
@@ -713,7 +713,7 @@ public abstract class AbstractJaxbProject
* return JAXB files with Java source "content"
*/
protected Iterable<JaxbFile> getJavaSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
+ return this.getJaxbFiles(JavaResourceCompilationUnit.CONTENT_TYPE);
}
@@ -762,7 +762,7 @@ public abstract class AbstractJaxbProject
* return JPA files with package-info source "content"
*/
protected Iterable<JaxbFile> getPackageInfoSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
+ return this.getJaxbFiles(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE);
}
@@ -905,7 +905,7 @@ public abstract class AbstractJaxbProject
// **************** jaxb.index resources **********************************
public Iterable<JaxbIndexResource> getJaxbIndexResources() {
- return new TransformationIterable<JaxbFile, JaxbIndexResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE)) {
+ return new TransformationIterable<JaxbFile, JaxbIndexResource>(getJaxbFiles(JaxbIndexResource.CONTENT_TYPE)) {
@Override
protected JaxbIndexResource transform(JaxbFile o) {
return (JaxbIndexResource) o.getResourceModel();
@@ -926,7 +926,7 @@ public abstract class AbstractJaxbProject
// **************** jaxb.properties resources *****************************
public Iterable<JaxbPropertiesResource> getJaxbPropertiesResources() {
- return new TransformationIterable<JaxbFile, JaxbPropertiesResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE)) {
+ return new TransformationIterable<JaxbFile, JaxbPropertiesResource>(getJaxbFiles(JaxbPropertiesResource.CONTENT_TYPE)) {
@Override
protected JaxbPropertiesResource transform(JaxbFile o) {
return (JaxbPropertiesResource) o.getResourceModel();
@@ -1173,8 +1173,8 @@ public abstract class AbstractJaxbProject
facetedProject = ProjectFacetsManager.create(getProject());
}
catch (CoreException ce) {
- // fall through
- JptJaxbCorePlugin.log(ce);
+ JptJaxbCorePlugin.instance().logError(ce);
+ return;
}
IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(JaxbFacet.FACET);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
index df776cf336..764284edb3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
* Factory to build Dali adapters for an {@link IJavaElement}:<ul>
* <li>{@link JaxbPlatformDescription}
* </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
+ * See <code>org.eclipse.jpt.jaxb.core/plugin.xml:org.eclipse.core.runtime.adapters</code>.
*/
public class JavaElementAdapterFactory
implements IAdapterFactory
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
index 82ca5ea88d..214d3d341b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -14,7 +14,6 @@ import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.jaxb.core.JaxbProject;
@@ -45,7 +44,7 @@ public class JavaPackageInfoResourceModelProvider
}
public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
+ return JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE;
}
public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
@@ -62,7 +61,7 @@ public class JavaPackageInfoResourceModelProvider
//it doesn't have package declaration and can't hold annotations
return null;
} catch (JavaModelException e) {
- JptJaxbCorePlugin.log(e);
+ JptJaxbCorePlugin.instance().logError(e);
// Ignore -- project is in a bad state. This will get recalled if necessary
return null;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
index 4066f112c8..2fd3fbc884 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -12,7 +12,6 @@ package org.eclipse.jpt.jaxb.core.internal;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.jaxb.core.JaxbProject;
@@ -42,7 +41,7 @@ public class JavaResourceModelProvider
}
public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE;
+ return JavaResourceCompilationUnit.CONTENT_TYPE;
}
public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
index 85857f5824..9987f01e10 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
@@ -18,7 +18,7 @@ import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
* Factory to build Dali adapters for an {@link IResource}:<ul>
* <li>{@link JaxbPlatformDescription}
* </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
+ * See <code>org.eclipse.jpt.jaxb.core/plugin.xml:org.eclipse.core.runtime.adapters</code>.
*/
public class ResourceAdapterFactory
implements IAdapterFactory
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
index c918a9e0ad..8369a79d11 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.context;
import org.eclipse.core.runtime.IAdapterFactory;
@@ -41,7 +41,7 @@ public class JaxbPackageAdapterFactory
}
private JaxbPackage getJaxbPackage(IPackageFragment packageFragment) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(packageFragment.getJavaProject().getProject());
+ JaxbProject jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(packageFragment.getJavaProject().getProject());
if (jaxbProject == null) {
return null;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
index bcf8327607..d92a2bb966 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
@@ -1,18 +1,19 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.context.java;
import java.util.List;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.Filter;
import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
@@ -37,7 +38,7 @@ public abstract class AbstractJavaContextNode
@Override
public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
+ return PlatformTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
}
// **************** content assist ****************************************
@@ -53,7 +54,7 @@ public abstract class AbstractJavaContextNode
public abstract TextRange getValidationTextRange(CompilationUnit astRoot);
/**
- * All subclass implementations {@link #validate(List, CompilationUnit))}
+ * All subclass implementations {@link #validate(List, IReporter, CompilationUnit)}
* should be preceded by a "super" call to this method
*/
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
index 638e6ea8c5..8161a7b02f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.facet;
import java.util.ArrayList;
@@ -232,7 +232,7 @@ public abstract class JaxbFacetDataModelProvider
}
protected static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptJaxbCorePlugin.PLUGIN_ID, message);
+ return JptJaxbCorePlugin.instance().buildStatus(severity, message);
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
index 2c7a4bc95f..e99952890a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.facet;
import org.eclipse.core.resources.IProject;
@@ -19,7 +28,7 @@ public class JaxbFacetVersionChangeDelegate
SubMonitor sm = SubMonitor.convert(monitor, 2);
super.execute_(project, fv, config, sm.newChild(1));
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(project);
+ JptJaxbCorePlugin.instance().getProjectManager().rebuildJaxbProject(project);
sm.worked(1);
// nothing further to do here *just* yet
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
index 72b0f4ab33..587c59906d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,9 +13,10 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
import org.eclipse.jpt.jaxb.core.JaxbFactory;
@@ -141,11 +142,11 @@ public class GenericJaxb_2_1_PlatformDefinition
}
public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
+ if (contentType.equals(JavaResourceCompilationUnit.CONTENT_TYPE)) {
+ return PlatformTools.getResourceType(JavaResourceCompilationUnit.CONTENT_TYPE);
}
- else if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
+ if (contentType.equals(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE)) {
+ return PlatformTools.getResourceType(JavaResourceCompilationUnit.PACKAGE_INFO_CONTENT_TYPE);
}
throw new IllegalArgumentException(contentType.toString());
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
index 87d08f80ca..00e6893209 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
@@ -1,17 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.libprov;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.core.internal.libval.LibraryValidatorManager;
import org.eclipse.jpt.common.core.libval.LibraryValidator;
import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
@@ -49,7 +49,7 @@ public class JaxbJreLibraryProviderInstallOperationConfig
return status;
}
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
+ for (LibraryValidator libraryValidator : LibraryValidatorManager.instance().getLibraryValidators(this)) {
status = libraryValidator.validate(this);
if (! status.isOK()) {
return status;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
index 0fede72a1b..9308b86b10 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
* Factory to build Dali adapters for an {@link JaxbLibraryProviderInstallOperationConfig}:<ul>
* <li>{@link JaxbPlatformDescription}
* </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
+ * See <code>org.eclipse.jpt.jaxb.core/plugin.xml:org.eclipse.core.runtime.adapters</code>.
*/
public class JaxbLibraryProviderInstallOperationConfigAdapterFactory
implements IAdapterFactory
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
index c4abe11d02..c6d03ed316 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.libval;
import java.util.HashSet;
@@ -54,10 +54,7 @@ public class GenericJaxbUserLibraryValidator
// null here implies something prior to jaxb 2.1
if (jreJaxbVersion != null) {
if (jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
+ return JptJaxbCorePlugin.instance().buildErrorStatus(JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaLibrary, jaxbVersion.getVersionString());
}
}
// if jre is enough for jaxb version, we don't look for classes in the library
@@ -82,10 +79,7 @@ public class GenericJaxbUserLibraryValidator
// null here implies something prior to jaxb 2.1
if (javaJaxbVersion != null && javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
+ return JptJaxbCorePlugin.instance().buildStatus(IStatus.WARNING, JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaFacet, javaVersion.getVersionString(), jaxbVersion.getVersionString());
}
return Status.OK_STATUS;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
index 7701da3606..8bc7380965 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.libval;
import org.eclipse.core.runtime.IStatus;
@@ -30,7 +30,7 @@ public class JaxbJreLibraryValidator
= (JaxbLibraryProviderInstallOperationConfig) config;
if (! jaxbConfig.getJaxbPlatform().getGroup().equals(GenericJaxbPlatform.GROUP)) {
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, JptJaxbCoreMessages.JreLibraryValidator_invalidPlatform);
+ return JptJaxbCorePlugin.instance().buildErrorStatus(JptJaxbCoreMessages.JreLibraryValidator_invalidPlatform);
}
IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
@@ -43,10 +43,7 @@ public class JaxbJreLibraryValidator
// null here implies something prior to jaxb 2.1
if (jreJaxbVersion == null || jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
+ return JptJaxbCorePlugin.instance().buildErrorStatus(JptJaxbCoreMessages.JreLibraryValidator_invalidJavaLibrary, jaxbVersion.getVersionString());
}
// runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
@@ -55,10 +52,7 @@ public class JaxbJreLibraryValidator
// null here implies something prior to jaxb 2.1
if (javaJaxbVersion == null || javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
+ return JptJaxbCorePlugin.instance().buildStatus(IStatus.WARNING, JptJaxbCoreMessages.JreLibraryValidator_invalidJavaFacet, javaVersion.getVersionString(), jaxbVersion.getVersionString());
}
// TODO - check for xjc classes when we support jdk version of xjc
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
index e619fc47e8..4fd56b0d37 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.platform;
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
+import static org.eclipse.jpt.common.core.internal.utility.XPointTools.findRequiredAttribute;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IProject;
@@ -18,6 +18,8 @@ import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
+import org.eclipse.jpt.common.core.internal.utility.XPointTools;
import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
import org.eclipse.jpt.common.utility.internal.KeyedSet;
import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
@@ -34,7 +36,7 @@ public class JaxbPlatformManagerImpl
implements JaxbPlatformManager {
static final String EXTENSION_POINT_ID = "jaxbPlatforms"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
+ static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbCorePlugin.instance().getPluginID() + '.' + EXTENSION_POINT_ID;
static final String PLATFORM_GROUP_ELEMENT = "jaxbPlatformGroup"; //$NON-NLS-1$
static final String PLATFORM_ELEMENT = "jaxbPlatform"; //$NON-NLS-1$
static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
@@ -71,7 +73,7 @@ public class JaxbPlatformManagerImpl
final IExtensionRegistry registry = Platform.getExtensionRegistry();
final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbCorePlugin.PLUGIN_ID, EXTENSION_POINT_ID);
+ = registry.getExtensionPoint(JptJaxbCorePlugin.instance().getPluginID(), EXTENSION_POINT_ID);
if (xpoint == null) {
throw new IllegalStateException();
@@ -111,7 +113,7 @@ public class JaxbPlatformManagerImpl
desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
if (this.platformGroupDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
+ this.logError(JptCommonCoreMessages.REGISTRY_DUPLICATE, QUALIFIED_EXTENSION_POINT_ID, desc.getPluginId(), ID_ATTRIBUTE, desc.getId());
throw new XPointException();
}
@@ -137,7 +139,7 @@ public class JaxbPlatformManagerImpl
desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
if (this.platformDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
+ this.logError(JptCommonCoreMessages.REGISTRY_DUPLICATE, QUALIFIED_EXTENSION_POINT_ID, desc.getPluginId(), ID_ATTRIBUTE, desc.getId());
throw new XPointException();
}
@@ -155,7 +157,7 @@ public class JaxbPlatformManagerImpl
desc.setJaxbFacetVersion(jpaFacetVersion);
}
else {
- logInvalidValue(element, JAXB_FACET_VERSION_ATTRIBUTE, jaxbFacetVersionString);
+ this.logError(XPointTools.buildInvalidValueMessage(element, JAXB_FACET_VERSION_ATTRIBUTE, jaxbFacetVersionString));
throw new XPointException();
}
}
@@ -170,7 +172,7 @@ public class JaxbPlatformManagerImpl
desc.setDefault(false);
}
else {
- logInvalidValue(element, DEFAULT_ATTRIBUTE, defaultString);
+ this.logError(XPointTools.buildInvalidValueMessage(element, DEFAULT_ATTRIBUTE, defaultString));
throw new XPointException();
}
}
@@ -184,7 +186,7 @@ public class JaxbPlatformManagerImpl
group.addPlatform(desc);
}
else {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
+ this.logError(XPointTools.buildInvalidValueMessage(element, GROUP_ELEMENT, groupId));
throw new XPointException();
}
}
@@ -196,7 +198,7 @@ public class JaxbPlatformManagerImpl
group.addPlatform(desc);
if (this.platformGroupDescriptions.containsKey(group.getId())) {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
+ this.logError(XPointTools.buildInvalidValueMessage(element, GROUP_ELEMENT, groupId));
throw new XPointException();
}
@@ -250,4 +252,12 @@ public class JaxbPlatformManagerImpl
}
return platformDesc.buildJaxbPlatformDefinition();
}
+
+ private void logError(String msg, Object... args) {
+ JptJaxbCorePlugin.instance().logError(msg, args);
+ }
+
+ private void logError(String msg) {
+ JptJaxbCorePlugin.instance().logError(msg);
+ }
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
index 599dc4e1ac..1711627352 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
@@ -17,7 +17,7 @@ import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
/**
* Property tester for {@link JaxbPlatformDescription}.
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>
+ * See <code>org.eclipse.jpt.jaxb.core/plugin.xml:org.eclipse.core.expressions.propertyTesters</code>
*/
public class JaxbPlatformTester
extends PropertyTester
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
index 22c8f80049..bb7397f10a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
@@ -1,12 +1,12 @@
/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.prefs;
import java.util.List;
@@ -98,7 +98,7 @@ public class JaxbPreferencesManager
* Return the Dali preferences for the specified context.
*/
private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(JptJaxbCorePlugin.PLUGIN_ID);
+ return context.getNode(JptJaxbCorePlugin.instance().getPluginID());
}
/**
@@ -169,7 +169,7 @@ public class JaxbPreferencesManager
prefs.flush();
}
catch(BackingStoreException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
}
return Status.OK_STATUS;
}
@@ -192,10 +192,10 @@ public class JaxbPreferencesManager
return fproj.getPreferences(JaxbFacet.FACET);
}
catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
+ JptJaxbCorePlugin.instance().logError(bse);
}
catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
+ JptJaxbCorePlugin.instance().logError(ce);
}
return null;
}
@@ -222,7 +222,7 @@ public class JaxbPreferencesManager
platformPrefs.flush();
}
catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
+ JptJaxbCorePlugin.instance().logError(bse);
}
}
@@ -248,7 +248,7 @@ public class JaxbPreferencesManager
}
catch (BackingStoreException bse) {
// this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
+ JptJaxbCorePlugin.instance().logError(bse);
}
return schemaLocations;
}
@@ -267,7 +267,7 @@ public class JaxbPreferencesManager
classgenPrefs.flush();
}
catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
+ JptJaxbCorePlugin.instance().logError(bse);
}
}
@@ -282,8 +282,7 @@ public class JaxbPreferencesManager
schemaPref.put(SCHEMA_LOCATION_PREF_KEY, location);
i ++;
}
- boolean checkAnotherNode = true;
- for ( ; checkAnotherNode; i++ ) {
+ for (boolean checkAnotherNode = true; checkAnotherNode; i++ ) {
String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
if (schemasPrefs.nodeExists(nodeName)) {
schemasPrefs.node(nodeName).removeNode();
@@ -296,7 +295,7 @@ public class JaxbPreferencesManager
}
catch (BackingStoreException bse) {
// this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
+ JptJaxbCorePlugin.instance().logError(bse);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
index 8df576788f..26534cec3b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
@@ -86,7 +86,7 @@ public abstract class AbstractJaxbFileResourceModel<S>
// workspace out of sync - no underlying file - simply don't load
}
catch (Exception ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
}
finally {
this.closeStream(stream);
@@ -104,7 +104,7 @@ public abstract class AbstractJaxbFileResourceModel<S>
stream.close();
}
} catch (IOException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
index 4e17fb10e4..b2e965ba37 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
@@ -19,7 +19,6 @@ import org.eclipse.jpt.common.core.JptResourceType;
import org.eclipse.jpt.common.utility.internal.Transformer;
import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
@@ -86,6 +85,6 @@ public class JaxbIndexResourceImpl
}
public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_INDEX_RESOURCE_TYPE;
+ return RESOURCE_TYPE;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
index f1600741da..493e042ccf 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
import java.util.HashMap;
@@ -67,7 +67,7 @@ public class JaxbIndexResourceModelProvider
}
public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE;
+ return JaxbIndexResource.CONTENT_TYPE;
}
public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
@@ -110,7 +110,7 @@ public class JaxbIndexResourceModelProvider
}
catch (CoreException ce) {
// shouldn't happen
- JptJaxbCorePlugin.log(ce);
+ JptJaxbCorePlugin.instance().logError(ce);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
index be6842c4aa..afe3301836 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
@@ -14,7 +14,6 @@ import java.io.InputStream;
import java.util.Properties;
import org.eclipse.core.resources.IFile;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
@@ -50,6 +49,6 @@ public class JaxbPropertiesResourceImpl
}
public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_RESOURCE_TYPE;
+ return RESOURCE_TYPE;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
index d2b2e72c72..ea75a086d5 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
import java.util.HashMap;
@@ -68,7 +68,7 @@ public class JaxbPropertiesResourceModelProvider
}
public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE;
+ return JaxbPropertiesResource.CONTENT_TYPE;
}
public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
@@ -111,7 +111,7 @@ public class JaxbPropertiesResourceModelProvider
}
catch (CoreException ce) {
// shouldn't happen
- JptJaxbCorePlugin.log(ce);
+ JptJaxbCorePlugin.instance().logError(ce);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
index d79d040b3e..2ccba102da 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
@@ -58,11 +58,11 @@ public class DefaultValidationMessages {
public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange, MessageFactory messageFactory) {
IMessage message = messageFactory.buildMessage(defaultSeverity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
+ message.setMarkerId(JaxbValidator.MARKER_ID);
if (textRange == null) {
textRange = DEFAULT_TEXT_RANGE;
// log the exception but allow the message to still be used
- JptJaxbCorePlugin.log(new NullPointerException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
+ JptJaxbCorePlugin.instance().logError(new NullPointerException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
}
int lineNumber = textRange.getLineNumber();
message.setLineNo(lineNumber);
@@ -103,7 +103,7 @@ public class DefaultValidationMessages {
// severity = prefSeverity;
// }
IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
+ message.setMarkerId(JaxbValidator.MARKER_ID);
return message;
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
index 7ae65d3882..1bd5690139 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
@@ -34,6 +34,14 @@ public class JaxbValidator
extends AbstractValidator
implements IValidator {
+ public static final String RELATIVE_MARKER_ID = "problemMarker"; //$NON-NLS-1$
+
+ /**
+ * The identifier for the JAXB validation marker
+ * (value <code>"org.eclipse.jpt.jaxb.core.problemMarker"</code>).
+ */
+ public static final String MARKER_ID = JptJaxbCorePlugin.instance().getPluginID() + '.' + RELATIVE_MARKER_ID;
+
public JaxbValidator() {
super();
}
@@ -73,12 +81,12 @@ public class JaxbValidator
try {
this.clearMarkers_(project);
} catch (CoreException ex) {
- JptJaxbCorePlugin.log(ex);
+ JptJaxbCorePlugin.instance().logError(ex);
}
}
private void clearMarkers_(IProject project) throws CoreException {
- IMarker[] markers = project.findMarkers(JptJaxbCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
+ IMarker[] markers = project.findMarkers(JaxbValidator.MARKER_ID, true, IResource.DEPTH_INFINITE);
for (IMarker marker : markers) {
marker.delete();
}
@@ -95,7 +103,7 @@ public class JaxbValidator
}
private Iterable<IMessage> buildValidationMessages(IReporter reporter, IProject project) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
+ JaxbProject jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(project);
if (jaxbProject != null) {
return jaxbProject.getValidationMessages(reporter);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
index 22275336cd..ab727cfaa9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
@@ -1,20 +1,33 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.jaxbindex;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceModel;
-
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
public interface JaxbIndexResource
extends JptResourceModel {
+ /**
+ * The content type for <code>jaxb.index</code> files.
+ */
+ IContentType CONTENT_TYPE = JptJaxbCorePlugin.instance().getContentType("jaxbIndex"); //$NON-NLS-1$
+
+ /**
+ * The resource type for <code>jaxb.index</code> files.
+ */
+ JptResourceType RESOURCE_TYPE = PlatformTools.getResourceType(CONTENT_TYPE);
+
String getPackageName();
Iterable<String> getFullyQualifiedClassNames();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
index 8d0931ae4e..cdda8f39db 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
@@ -1,20 +1,34 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.jaxbprops;
+import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.JptResourceModel;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
+import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
public interface JaxbPropertiesResource
extends JptResourceModel {
+ /**
+ * The content type for <code>jaxb.properties</code> files.
+ */
+ IContentType CONTENT_TYPE = JptJaxbCorePlugin.instance().getContentType("jaxbProperties"); //$NON-NLS-1$
+
+ /**
+ * The resource type for <code>jaxb.properties</code> files.
+ */
+ JptResourceType RESOURCE_TYPE = PlatformTools.getResourceType(CONTENT_TYPE);
+
String getPackageName();
String getProperty(String propertyName);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
index af5191d2a6..3b31939d8d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
@@ -1,14 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * (copied mainly from org.eclipse.wst.xsd.contentmodel.internal.XSDImpl)
- * Oracle - extensions and modifications
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * (copied mainly from org.eclipse.wst.xsd.contentmodel.internal.XSDImpl)
+ * Oracle - extensions and modifications
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.xsd;
import java.io.IOException;
@@ -74,11 +74,11 @@ public class XsdUtil {
}
}
catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
+ JptJaxbCorePlugin.instance().logError(me);
resolvedUri = null;
}
catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
+ JptJaxbCorePlugin.instance().logError(ie);
resolvedUri = null;
}
}
@@ -145,7 +145,7 @@ public class XsdUtil {
}
}
catch (Exception e) {
- JptJaxbCorePlugin.log(e);
+ JptJaxbCorePlugin.instance().logError(e);
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
index 6094e17a01..3750a2621b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
@@ -4,6 +4,8 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.schemagen;singleton:=true
Bundle-Version: 1.1.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: javax.xml.bind,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
index ba29ee4b87..cad82b35cd 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
@@ -5,6 +5,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
+ <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/**/plugin/**"/>
<accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
<accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/listener/awt/**"/>
<accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/value/**"/>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
index 07c7256bee..2abe8f3efe 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core;singleton:=true
Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.JptJaxbEclipseLinkCorePlugin
+Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.internal.plugin.JptJaxbEclipseLinkCorePlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Localization: plugin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
deleted file mode 100644
index e69681806f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-public class JptJaxbEclipseLinkCorePlugin
- extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.core"; //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptJaxbEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptJaxbEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbEclipseLinkCorePlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
index 9e6c36dc82..4294916e5c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;
import java.util.HashSet;
@@ -80,10 +80,8 @@ public class ELJaxbUserLibraryValidator
status = LibValUtil.validate(libraryPaths, classNames);
- if (! status.isOK()) {
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, JptCommonEclipseLinkCoreMessages.ELJaxbUserLibraryValidator_noXjcClasses);
- }
-
- return Status.OK_STATUS;
+ return status.isOK() ?
+ Status.OK_STATUS :
+ JptJaxbCorePlugin.instance().buildStatus(IStatus.WARNING, JptCommonEclipseLinkCoreMessages.ELJaxbUserLibraryValidator_noXjcClasses);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/plugin/JptJaxbEclipseLinkCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/plugin/JptJaxbEclipseLinkCorePlugin.java
new file mode 100644
index 0000000000..03199d2e0b
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/plugin/JptJaxbEclipseLinkCorePlugin.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.eclipselink.core.internal.plugin;
+
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
+
+public class JptJaxbEclipseLinkCorePlugin
+ extends JptPlugin
+{
+ // ********** singleton **********
+
+ private static JptJaxbEclipseLinkCorePlugin INSTANCE;
+
+ /**
+ * Return the singleton Dali JAXB EclipseLink core plug-in.
+ */
+ public static JptJaxbEclipseLinkCorePlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** Dali plug-in **********
+
+ public JptJaxbEclipseLinkCorePlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbEclipseLinkCorePlugin) plugin;
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
index 60a8593632..64644cb824 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
@@ -16,10 +16,10 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
+import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidator;
public class ELJaxbValidationMessageBuilder {
@@ -78,7 +78,7 @@ public class ELJaxbValidationMessageBuilder {
// }
IMessage message = new EclipseLinkMessage(ELJaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
// TODO "EclipseLink JAXB" validation marker?
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
+ message.setMarkerId(JaxbValidator.MARKER_ID);
return message;
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
index 783ee1e9ed..1aba5a72b2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
@@ -4,8 +4,10 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
+ <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/**/plugin/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/ui/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
+ <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
<accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
</accessrules>
</classpathentry>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
index 8e669444a7..dfbf998780 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.ui;singleton:=true
Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin
+Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Localization: plugin
@@ -22,8 +22,8 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.2,4.0.0)",
org.eclipse.swt;bundle-version="[3.7.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.8.0,4.0.0)",
org.eclipse.ui.workbench;bundle-version="[3.7.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal;x-internal:=true,
+Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui.internal;x-internal:=true,
+ org.eclipse.jpt.jaxb.eclipselink.ui.internal.commands;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3;x-internal:=true,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
deleted file mode 100644
index 39e81583dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.ui;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java
deleted file mode 100644
index 23b5d76ee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJaxbEclipseLinkUiPlugin
- extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.ui";
-
-
- // ********** singleton **********
-
- private static JptJaxbEclipseLinkUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbEclipseLinkUiPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** error logging **********
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** Image API **********
-
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** constructors **********
-
- public JptJaxbEclipseLinkUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
index a740ddcbb4..337814d4d7 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin;
+import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
import org.eclipse.swt.graphics.Image;
@@ -21,7 +21,7 @@ public class ELJaxbMappingImageHelper {
String iconKey = iconKeyForAttributeMapping(mappingKey);
return (iconKey == null) ?
JaxbMappingImageHelper.imageForAttributeMapping(mappingKey)
- : JptJaxbEclipseLinkUiPlugin.getImage(iconKey);
+ : JptJaxbEclipseLinkUiPlugin.instance().getImage(iconKey);
}
public static String iconKeyForAttributeMapping(String mappingKey) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java
index 21bd600dfb..440ae8faca 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.ui.internal.commands;
import java.io.ByteArrayInputStream;
@@ -34,8 +34,7 @@ import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -80,7 +79,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
folder = getFolder(jaxbPackage);
}
catch (JavaModelException jme) {
- JptJaxbEclipseLinkUiPlugin.log(jme);
+ JptJaxbEclipseLinkUiPlugin.instance().logError(jme);
return;
}
Job job = new Job("Creating jaxb.properties") {
@@ -92,8 +91,8 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
file.create(stream, true, null);
}
catch (CoreException ce) {
- JptJaxbEclipseLinkUiPlugin.log(ce);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not create jaxb.properties.");
+ JptJaxbEclipseLinkUiPlugin.instance().logError(ce);
+ return JptJaxbEclipseLinkUiPlugin.instance().buildErrorStatus(ce, "Could not create jaxb.properties.");
}
AddEclipseLinkJaxbPropertyCommandHandler.this.revealAndOpenFile(file, activeWindow);
return Status.OK_STATUS;
@@ -110,7 +109,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
folder = getFolder(jaxbPackage);
}
catch (JavaModelException jme) {
- JptJaxbEclipseLinkUiPlugin.log(jme);
+ JptJaxbEclipseLinkUiPlugin.instance().logError(jme);
return;
}
Job job = new Job("Adding property to jaxb.properties.") {
@@ -119,7 +118,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
IFile file = folder.getFile("jaxb.properties");
Properties properties = loadProperties(file);
if (properties == null) {
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not load jaxb.properties.");
+ return JptJaxbEclipseLinkUiPlugin.instance().buildErrorStatus("Could not load jaxb.properties.");
}
adjustProperties(properties);
InputStream stream = createInputStream(properties);
@@ -127,8 +126,8 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
file.setContents(stream, true, true, null);
}
catch (CoreException ce) {
- JptJaxbEclipseLinkUiPlugin.log(ce);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not write to jaxb.properties.");
+ JptJaxbEclipseLinkUiPlugin.instance().logError(ce);
+ return JptJaxbEclipseLinkUiPlugin.instance().buildErrorStatus(ce, "Could not load jaxb.properties.");
}
AddEclipseLinkJaxbPropertyCommandHandler.this.revealAndOpenFile(file, activeWindow);
return Status.OK_STATUS;
@@ -159,7 +158,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
properties.load(file.getContents());
}
catch (Exception ex) {
- JptJaxbEclipseLinkUiPlugin.log(ex);
+ JptJaxbEclipseLinkUiPlugin.instance().logError(ex);
return null;
}
finally {
@@ -180,7 +179,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
properties.store(outStream, null);
}
catch (Exception e) {
- JptJaxbCorePlugin.log(e);
+ JptJaxbCorePlugin.instance().logError(e);
return new ByteArrayInputStream(new byte[0]);
}
finally {
@@ -196,7 +195,7 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
stream.close();
}
} catch (IOException ex) {
- JptJaxbEclipseLinkUiPlugin.log(ex);
+ JptJaxbEclipseLinkUiPlugin.instance().logError(ex);
}
}
@@ -210,8 +209,8 @@ public class AddEclipseLinkJaxbPropertyCommandHandler
IDE.openEditor(activeWindow.getActivePage(), file, true);
}
catch (PartInitException pie) {
- JptJaxbUiPlugin.log(pie);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not open jaxb.properties in editor.");
+ JptJaxbEclipseLinkUiPlugin.instance().logError(pie);
+ return JptJaxbEclipseLinkUiPlugin.instance().buildErrorStatus(pie, "Could not open jaxb.properties in editor.");
}
return Status.OK_STATUS;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/plugin/JptJaxbEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/plugin/JptJaxbEclipseLinkUiPlugin.java
new file mode 100644
index 0000000000..fca7cfc4e6
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/plugin/JptJaxbEclipseLinkUiPlugin.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin;
+
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
+import org.eclipse.jpt.common.ui.internal.JptUIPlugin;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public class JptJaxbEclipseLinkUiPlugin
+ extends JptUIPlugin
+{
+ // ********** singleton **********
+
+ private static JptJaxbEclipseLinkUiPlugin INSTANCE;
+
+ /**
+ * Return the singleton Dali JAXB EclipseLink UI plug-in.
+ */
+ public static JptJaxbEclipseLinkUiPlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** Dali plug-in **********
+
+ public JptJaxbEclipseLinkUiPlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbEclipseLinkUiPlugin) plugin;
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
index e8031a1416..d1d5a75e2f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.ui;singleton:=true
Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin
+Bundle-Activator: org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Localization: plugin
@@ -31,8 +31,8 @@ Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)",
org.eclipse.wst.xsd.core;bundle-version="[1.1.600,2.0.0)",
org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jaxb.ui.internal;x-internal:=true,
+Import-Package: com.ibm.icu.text;version="4.0.1"
+Export-Package: org.eclipse.jpt.jaxb.ui.internal;x-internal:=true,
org.eclipse.jpt.jaxb.ui.internal.actions;x-internal:=true,
org.eclipse.jpt.jaxb.ui.internal.commands;x-internal:=true,
org.eclipse.jpt.jaxb.ui.internal.filters;x-internal:=true,
@@ -50,4 +50,3 @@ Export-Package: org.eclipse.jpt.jaxb.ui,
org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;x-internal:=true,
org.eclipse.jpt.jaxb.ui.navigator,
org.eclipse.jpt.jaxb.ui.platform
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png
new file mode 100644
index 0000000000..95eb79dbb0
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
deleted file mode 100644
index 824a4d7507..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jpt.jaxb.ui.internal.platform.JaxbPlatformUiManagerImpl;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJaxbUiPlugin extends AbstractUIPlugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.ui";
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptJaxbUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- public static JaxbPlatformUiManager getJaxbPlatformUiManager() {
- return JaxbPlatformUiManagerImpl.instance();
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
- // ********** constructors **********
- public JptJaxbUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
index 154e971329..98062cd738 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
@@ -1,17 +1,16 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal;
import java.util.List;
import java.util.Vector;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.emf.common.util.URI;
@@ -28,8 +27,8 @@ import org.eclipse.jpt.jaxb.core.SchemaLibrary;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.gen.GenerateJaxbClassesJob;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -120,7 +119,7 @@ public class ClassesGeneratorUi {
job.schedule();
}
catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
+ JptJaxbUiPlugin.instance().logError(re);
String msg = re.getMessage();
String message = (msg == null) ? re.toString() : msg;
@@ -172,7 +171,7 @@ public class ClassesGeneratorUi {
/* may be null */
private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(this.javaProject.getProject());
+ return JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(this.javaProject.getProject());
}
private boolean isOverwritingClasses(ClassesGeneratorOptions generatorOptions) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
index 0815779e2c..004e2e89f2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal;
import java.util.ArrayList;
@@ -24,16 +24,16 @@ import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
import org.eclipse.jpt.common.utility.Filter;
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
public class JaxbJavaCompletionProposalComputer
@@ -101,11 +101,11 @@ public class JaxbJavaCompletionProposalComputer
IFile file = (cu != null) ? getCorrespondingResource(cu) : null;
IContentType contentType = (file != null) ? PlatformTools.getContentType(file) : null;
- if (contentType == null || ! contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
+ if (contentType == null || ! contentType.isKindOf(JavaResourceCompilationUnit.CONTENT_TYPE)) {
return Collections.emptyList();
}
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(file.getProject());
+ JaxbProject jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(file.getProject());
if (jaxbProject == null) {
return Collections.emptyList();
}
@@ -155,7 +155,7 @@ public class JaxbJavaCompletionProposalComputer
try {
return (IFile) cu.getCorrespondingResource();
} catch (JavaModelException ex) {
- JptJaxbUiPlugin.log(ex);
+ JptJaxbUiPlugin.instance().logError(ex);
return null;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
index 4c0ddd7a7b..b6836f5061 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
@@ -1,17 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal;
import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.graphics.Image;
public class JaxbMappingImageHelper
@@ -38,7 +37,7 @@ public class JaxbMappingImageHelper
// }
public static Image imageForAttributeMapping(String mappingKey) {
- return JptJaxbUiPlugin.getImage(iconKeyForAttributeMapping(mappingKey));
+ return JptJaxbUiPlugin.instance().getImage(iconKeyForAttributeMapping(mappingKey));
}
public static String iconKeyForAttributeMapping(String mappingKey) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java
index ec18089158..71aebe10c2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.commands;
import java.util.Iterator;
@@ -23,7 +23,7 @@ import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jpt.common.utility.internal.CollectionTools;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -51,7 +51,7 @@ public class CreatePackageInfoCommandHandler
IDE.openEditor(activeWindow.getActivePage(), file, true);
}
catch (PartInitException pie) {
- JptJaxbUiPlugin.log(pie);
+ JptJaxbUiPlugin.instance().logError(pie);
}
}
@@ -68,7 +68,7 @@ public class CreatePackageInfoCommandHandler
this.createdFiles.add((IFile) cu.getCorrespondingResource());
}
catch (JavaModelException jme) {
- JptJaxbUiPlugin.log(jme);
+ JptJaxbUiPlugin.instance().logError(jme);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/gen/GenerateJaxbClassesJob.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/gen/GenerateJaxbClassesJob.java
index 11cc53f86e..65ef9f7f1b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/gen/GenerateJaxbClassesJob.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/gen/GenerateJaxbClassesJob.java
@@ -1,12 +1,12 @@
/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.gen;
import org.eclipse.jdt.core.IJavaProject;
@@ -16,8 +16,8 @@ import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGenerator;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
/**
* GenerateJaxbClassesJob
@@ -91,6 +91,6 @@ public class GenerateJaxbClassesJob extends AbstractJptGenerateJob {
@Override
protected void jptPluginLogException(Exception exception) {
- JptJaxbUiPlugin.log(exception);
+ JptJaxbUiPlugin.instance().logError(exception);
}
} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
index 58bc367db3..33cb0dea08 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
@@ -18,9 +18,9 @@ import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
@@ -67,7 +67,7 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
protected ItemExtendedLabelProvider buildJaxbContextRootProvider(JaxbContextRoot root, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CONTENT),
+ JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_CONTENT),
JptJaxbUiMessages.JaxbContent_label,
this.buildJaxbContextRootDescription(root)
);
@@ -83,14 +83,14 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
protected ItemExtendedLabelProvider buildJaxbEnumConstantProvider(JaxbEnumConstant enumConstant, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.ENUM_CONSTANT),
+ JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.ENUM_CONSTANT),
enumConstant.getName()
);
}
protected ItemExtendedLabelProvider buildJaxbPackageProvider(JaxbPackage pkg, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PACKAGE),
+ JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.PACKAGE),
pkg.getName(),
this.buildJaxbPackageDescription(pkg)
);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
index 1b5db6e35c..6215510d1d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
@@ -20,8 +20,8 @@ import org.eclipse.jpt.jaxb.core.context.JaxbClass;
import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.graphics.Image;
@@ -100,13 +100,13 @@ public class JaxbClassItemLabelProvider
protected Image buildValue_() {
if (this.mappingModel.getValue() != null) {
if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_CLASS);
+ return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_TRANSIENT_CLASS);
}
}
else if (this.isXmlRegistryModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_REGISTRY);
+ return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_REGISTRY);
}
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CLASS);
+ return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_CLASS);
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
index 40a36bffb2..bdef1b1d44 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
@@ -19,8 +19,8 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.graphics.Image;
@@ -87,10 +87,10 @@ public class JaxbEnumItemLabelProvider
protected Image buildValue_() {
if (this.mappingModel.getValue() != null) {
if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_ENUM);
+ return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_TRANSIENT_ENUM);
}
}
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_ENUM);
+ return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_ENUM);
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
index 134eb9fd1a..9e0129a935 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
@@ -29,7 +29,7 @@ import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
/**
@@ -53,7 +53,7 @@ public class JaxbNavigatorContentProvider
public JaxbNavigatorContentProvider() {
super();
this.jaxbProjectListener = this.buildJaxbProjectListener();
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
+ JptJaxbCorePlugin.instance().getProjectManager().addCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
}
protected CollectionChangeListener buildJaxbProjectListener() {
@@ -82,7 +82,7 @@ public class JaxbNavigatorContentProvider
IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
+ JaxbProject jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(project);
if (jaxbProject != null) {
JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
JaxbPlatformUi platformUi =
@@ -101,7 +101,7 @@ public class JaxbNavigatorContentProvider
IProject project = (IProject) ((IAdaptable) parentElement).getAdapter(IProject.class);
if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
+ JaxbProject jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(project);
if (jaxbProject != null) {
JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
JaxbPlatformUi platformUi =
@@ -119,7 +119,7 @@ public class JaxbNavigatorContentProvider
@Override
public void dispose() {
super.dispose();
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
+ JptJaxbCorePlugin.instance().getProjectManager().removeCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
index fe25b2d926..4763a63deb 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
public class JaxbNavigatorItemLabelProviderFactory
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
index 5c6f3979bd..95bd99cb75 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
@@ -15,7 +15,7 @@ import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
public class JaxbNavigatorTreeItemContentProviderFactory
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
index 9a82bc98d8..affda0a90f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.platform;
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
+import static org.eclipse.jpt.common.core.internal.utility.XPointTools.findRequiredAttribute;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -17,11 +17,13 @@ import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
+import org.eclipse.jpt.common.core.internal.utility.XPointTools;
import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
import org.eclipse.jpt.common.utility.internal.KeyedSet;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
@@ -29,7 +31,7 @@ public class JaxbPlatformUiManagerImpl
implements JaxbPlatformUiManager {
static final String EXTENSION_POINT_ID = "jaxbPlatformUis"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbUiPlugin.PLUGIN_ID_ + EXTENSION_POINT_ID; //$NON-NLS-1$
+ static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbUiPlugin.instance().getPluginID() + '.' + EXTENSION_POINT_ID; //$NON-NLS-1$
static final String PLATFORM_UI_ELEMENT = "jaxbPlatformUi"; //$NON-NLS-1$
static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
static final String PLATFORM_ATTRIBUTE = "jaxbPlatform"; //$NON-NLS-1$
@@ -62,7 +64,7 @@ public class JaxbPlatformUiManagerImpl
final IExtensionRegistry registry = Platform.getExtensionRegistry();
final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbUiPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
+ = registry.getExtensionPoint(JptJaxbUiPlugin.instance().getPluginID(), EXTENSION_POINT_ID);
if (xpoint == null) {
throw new IllegalStateException();
@@ -94,7 +96,7 @@ public class JaxbPlatformUiManagerImpl
platformUiConfig.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
if (this.platformUiConfigs.containsKey(platformUiConfig.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, platformUiConfig.getId());
+ this.logError(JptCommonCoreMessages.REGISTRY_DUPLICATE, QUALIFIED_EXTENSION_POINT_ID, platformUiConfig.getPluginId(), ID_ATTRIBUTE, platformUiConfig.getId());
throw new XPointException();
}
@@ -104,11 +106,11 @@ public class JaxbPlatformUiManagerImpl
JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(jaxbPlatformId);
if (jaxbPlatform == null) {
- logInvalidValue(element, PLATFORM_ATTRIBUTE, jaxbPlatformId);
+ this.logError(XPointTools.buildInvalidValueMessage(element, PLATFORM_ATTRIBUTE, jaxbPlatformId));
}
if (this.platformToUiConfigs.containsKey(jaxbPlatform)) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, PLATFORM_ATTRIBUTE, jaxbPlatformId);
+ this.logError(JptCommonCoreMessages.REGISTRY_DUPLICATE, QUALIFIED_EXTENSION_POINT_ID, platformUiConfig.getPluginId(), PLATFORM_ATTRIBUTE, jaxbPlatformId);
throw new XPointException();
}
@@ -130,4 +132,12 @@ public class JaxbPlatformUiManagerImpl
JaxbPlatformUiConfig config = this.platformToUiConfigs.getItem(platformDesc);
return (config == null) ? null : config.getPlatformUi();
}
+
+ private void logError(String msg, Object... args) {
+ JptJaxbUiPlugin.instance().logError(msg, args);
+ }
+
+ private void logError(String msg) {
+ JptJaxbUiPlugin.instance().logError(msg);
+ }
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/plugin/JptJaxbUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/plugin/JptJaxbUiPlugin.java
new file mode 100644
index 0000000000..d6b0b25c56
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/plugin/JptJaxbUiPlugin.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.ui.internal.plugin;
+
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
+import org.eclipse.jpt.common.ui.internal.JptUIPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.platform.JaxbPlatformUiManagerImpl;
+import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public class JptJaxbUiPlugin
+ extends JptUIPlugin
+{
+ // ********** singleton **********
+
+ private static JptJaxbUiPlugin INSTANCE;
+
+ /**
+ * Return the singleton Dali JAXB UI plug-in.
+ */
+ public static JptJaxbUiPlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** Dali plug-in **********
+
+ public JptJaxbUiPlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbUiPlugin) plugin;
+ }
+
+
+ // ********** misc **********
+
+ public static JaxbPlatformUiManager getJaxbPlatformUiManager() {
+ return JaxbPlatformUiManagerImpl.instance();
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
index a7c219623c..e698f75067 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
@@ -61,20 +61,20 @@ class JaxbProjectModel
@Override
protected void engageSubject_() {
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(
+ JptJaxbCorePlugin.instance().getProjectManager().addCollectionChangeListener(
JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
this.projectManagerListener);
}
@Override
protected void disengageSubject_() {
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(
+ JptJaxbCorePlugin.instance().getProjectManager().removeCollectionChangeListener(
JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
this.projectManagerListener);
}
@Override
protected JaxbProject buildValue_() {
- return JptJaxbCorePlugin.getJaxbProject(this.subject);
+ return JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(this.subject);
}
} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
index dfd89c363b..921536e1de 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
@@ -21,7 +21,7 @@ import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
import org.eclipse.jpt.common.utility.internal.StringConverter;
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.internal.model.value.BufferedModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
@@ -62,7 +62,7 @@ public class JaxbProjectPropertiesPage
private PropertyValueModel<JaxbProject> jaxbProjectModel;
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> platformModel;
+ private BufferedModifiablePropertyValueModel<JaxbPlatformDescription> platformModel;
private PropertyChangeListener platformListener;
/* private */ static final Comparator<String> STRING_COMPARATOR = new ICUStringCollator();
@@ -85,8 +85,8 @@ public class JaxbProjectPropertiesPage
// ***** platform ID model
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> buildPlatformModel() {
- return new BufferedWritablePropertyValueModel<JaxbPlatformDescription>(
+ private BufferedModifiablePropertyValueModel<JaxbPlatformDescription> buildPlatformModel() {
+ return new BufferedModifiablePropertyValueModel<JaxbPlatformDescription>(
new PlatformModel(this.jaxbProjectModel), this.trigger);
}
@@ -252,12 +252,12 @@ public class JaxbProjectPropertiesPage
@Override
protected void rebuildProject() {
// if the JAXB platform is changed, we need to completely rebuild the JAXB project
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
+ JptJaxbCorePlugin.instance().getProjectManager().rebuildJaxbProject(getProject());
}
@Override
- protected BufferedWritablePropertyValueModel<?>[] buildBufferedModels() {
- return new BufferedWritablePropertyValueModel[] {
+ protected BufferedModifiablePropertyValueModel<?>[] buildBufferedModels() {
+ return new BufferedModifiablePropertyValueModel[] {
this.platformModel
};
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
index 7830ebd110..d860d1dd7b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.properties;
import java.lang.reflect.InvocationTargetException;
@@ -51,7 +51,7 @@ import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.internal.model.value.BufferedModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.CollectionPropertyValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
@@ -101,7 +101,7 @@ public class JaxbSchemasPropertiesPage
private final PropertyValueModel<JaxbProject> jaxbProjectModel;
- protected final BufferedWritablePropertyValueModel.Trigger trigger;
+ protected final BufferedModifiablePropertyValueModel.Trigger trigger;
private final SchemasModel schemasModel;
@@ -112,7 +112,7 @@ public class JaxbSchemasPropertiesPage
super();
this.projectModel = new SimplePropertyValueModel<IProject>();
this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
+ this.trigger = new BufferedModifiablePropertyValueModel.Trigger();
this.schemasModel = new SchemasModel(this.jaxbProjectModel, this.trigger);
this.schemasSelectionModel = new SimpleCollectionValueModel<Schema>();
setDescription(JptJaxbUiMessages.SchemasPage_description);
@@ -393,7 +393,7 @@ public class JaxbSchemasPropertiesPage
void performOk_(IProgressMonitor monitor) throws CoreException {
if (this.schemasModel.hasChanges()) {
this.trigger.accept();
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
+ JptJaxbCorePlugin.instance().getProjectManager().rebuildJaxbProject(getProject());
getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
index a584b54d4a..1dc30c213d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
@@ -1,12 +1,12 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
import org.eclipse.core.resources.IProject;
@@ -14,8 +14,8 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -106,7 +106,7 @@ public class ClassesGeneratorExtensionOptionsWizardPage extends WizardPage
facetedProject = ProjectFacetsManager.create(this.getProject());
}
catch(CoreException e) {
- JptJaxbUiPlugin.log(e);
+ JptJaxbUiPlugin.instance().logError(e);
return null;
}
return (facetedProject == null) ? null : facetedProject.getProjectFacetVersion(JaxbFacet.FACET);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
index a0412a1671..4a96eaddac 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
@@ -1,17 +1,16 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
import java.util.List;
import java.util.Vector;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -34,10 +33,10 @@ import org.eclipse.jpt.jaxb.core.SchemaLibrary;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
import org.eclipse.jpt.jaxb.ui.internal.gen.GenerateJaxbClassesJob;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
@@ -96,7 +95,7 @@ public class ClassesGeneratorWizard
this.selection = selection;
this.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.CLASSES_GEN_WIZ_BANNER));
+ this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.instance().buildImageDescriptor(JptJaxbUiIcons.CLASSES_GEN_WIZ_BANNER));
this.setNeedsProgressMonitor(true);
}
@@ -179,7 +178,7 @@ public class ClassesGeneratorWizard
/* may be null */
private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(getJavaProject().getProject());
+ return JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(getJavaProject().getProject());
}
/* return the physical location of the schema */
@@ -339,7 +338,7 @@ public class ClassesGeneratorWizard
folder.create(true, true, null);
}
catch (CoreException e) {
- JptJaxbUiPlugin.log(e);
+ JptJaxbUiPlugin.instance().logError(e);
this.logError(NLS.bind(
JptJaxbUiMessages.ClassesGeneratorWizard_couldNotCreate,
@@ -363,7 +362,7 @@ public class ClassesGeneratorWizard
generateJaxbClassesJob.schedule();
}
catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
+ JptJaxbUiPlugin.instance().logError(re);
String msg = re.getMessage();
String message = (msg == null) ? re.toString() : msg;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
index 12773e3828..3c478333d2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
@@ -1,17 +1,16 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
import java.util.ArrayList;
import java.util.Collection;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -56,8 +55,8 @@ import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGenerator;
import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
@@ -243,7 +242,7 @@ public class ClassesGeneratorWizardPage extends NewTypeWizardPage {
return true;
}
catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e); // just log, no UI in validation
+ JptJaxbUiPlugin.instance().logError(e); // just log, no UI in validation
}
return false;
}
@@ -258,7 +257,7 @@ public class ClassesGeneratorWizardPage extends NewTypeWizardPage {
return (((IPackageFragmentRoot)element).getKind() == IPackageFragmentRoot.K_SOURCE);
}
catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e.getStatus()); // just log, no UI in validation
+ JptJaxbUiPlugin.instance().logError(e); // just log, no UI in validation
return false;
}
}
@@ -452,7 +451,7 @@ public class ClassesGeneratorWizardPage extends NewTypeWizardPage {
}
private boolean projectPlatformIsJaxb() {
- return JptJaxbCorePlugin.getJaxbProject(this.getJavaProject().getProject()) != null;
+ return JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(this.getJavaProject().getProject()) != null;
}
private boolean projectJaxbPlatformIsEclipseLink() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
index da4cdc8c87..c2e8fd787b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
@@ -17,8 +17,8 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.PageBook;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
@@ -76,7 +77,7 @@ public class SelectFileOrXMLCatalogIdPanel extends Composite implements Selectio
this.setSingleFileViewDefaultSelection(selection);
// Catalog
- ICatalog xmlCatalog = JptJaxbUiPlugin.instance().getDefaultXMLCatalog();
+ ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
index 111684b49b..4e6f9da052 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
@@ -16,13 +16,14 @@ import java.util.List;
import java.util.Vector;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
@@ -94,12 +95,12 @@ public class SelectXMLCatalogIdPanel extends Composite {
INextCatalog catalog = nextCatalogs[i];
ICatalog referencedCatalog = catalog.getReferencedCatalog();
if (referencedCatalog != null) {
- if (JptJaxbUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
+ if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
ICatalog systemCatalog = referencedCatalog;
addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
}
- else if (JptJaxbUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
+ else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
ICatalog userCatalog = referencedCatalog;
addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
index 4a24f1c36b..5ba8b02336 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
@@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -40,10 +40,10 @@ public class XMLCatalogTableViewer extends TableViewer {
protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
- protected static Image dtdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptJaxbUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
+ protected static Image dtdFileImage = JptJaxbUiPlugin.instance().getImage("full/obj16/dtdfile"); //$NON-NLS-1$
+ protected static Image unknownFileImage = JptJaxbUiPlugin.instance().getImage("full/obj16/text"); //$NON-NLS-1$
+ protected static Image xsdFileImage = JptJaxbUiPlugin.instance().getImage("full/obj16/XSDFile"); //$NON-NLS-1$
+ protected static Image errorImage = JptJaxbUiPlugin.instance().getImage("full/ovr16/error_ovr"); //$NON-NLS-1$
// ********** constructor **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
index d2897cd77d..013696b8ad 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
@@ -1,21 +1,21 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.facet;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetDataModelProperties;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
import org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi;
import org.eclipse.swt.SWT;
@@ -39,7 +39,7 @@ public abstract class JaxbFacetPage
super(pageName);
setTitle(JptJaxbUiMessages.JaxbFacetWizardPage_title);
setDescription(JptJaxbUiMessages.JaxbFacetWizardPage_desc);
- setImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER));
+ setImageDescriptor(JptJaxbUiPlugin.instance().buildImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER));
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
index 696d4cee32..49dce38650 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
@@ -1,19 +1,19 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.proj;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model.JaxbProjectCreationDataModelProvider;
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -38,7 +38,7 @@ public class JaxbProjectWizard
@Override
protected ImageDescriptor getDefaultPageImageDescriptor() {
- return JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER);
+ return JptJaxbUiPlugin.instance().buildImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER);
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
index ff8a540923..f08b5653df 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
@@ -1,18 +1,17 @@
/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -36,9 +35,9 @@ import org.eclipse.jpt.common.utility.internal.FileTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jaxb.core.internal.gen.SchemaGenerator;
import org.eclipse.jpt.jaxb.core.internal.operations.SchemaFileCreationDataModelProvider;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -67,7 +66,7 @@ public class SchemaGeneratorWizard extends Wizard implements INewWizard
public SchemaGeneratorWizard() {
super();
setWindowTitle(JptJaxbUiMessages.SchemaGeneratorWizard_title);
- setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.SCHEMA_GEN_WIZ_BANNER));
+ setDefaultPageImageDescriptor(JptJaxbUiPlugin.instance().buildImageDescriptor(JptJaxbUiIcons.SCHEMA_GEN_WIZ_BANNER));
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
@@ -285,7 +284,7 @@ public class SchemaGeneratorWizard extends Wizard implements INewWizard
@Override
protected void jptPluginLogException(Exception exception) {
- JptJaxbUiPlugin.log(exception);
+ JptJaxbUiPlugin.instance().logError(exception);
}
// ********** internal methods **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
index 1f04ed438d..7b92890d9c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
@@ -1,16 +1,15 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.ui.platform;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
/**
* Repository for {@link JaxbPlatformUi}s
@@ -23,7 +22,6 @@ import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
*
* @version 3.0
* @since 3.0
- * @see JptJaxbUiPlugin#getJaxbPlatformUiManager()
*/
public interface JaxbPlatformUiManager {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
index 1284b5c67d..416f4fb696 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Tue Mar 08 12:07:36 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
index c1ecd0d512..1ed892e766 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
@@ -4,11 +4,12 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.core.tests;singleton:=true
Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.eclipse.jpt.jaxb.core.tests.internal.plugin.JptJaxbCoreTestsPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
Bundle-Localization: plugin
Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.core.tests.JptJaxbCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.6.100,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
@@ -22,8 +23,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.6.100,4.0.0)",
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)",
org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core.tests;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal;x-internal:=true,
+Export-Package: org.eclipse.jpt.jaxb.core.tests.internal;x-internal:=true,
org.eclipse.jpt.jaxb.core.tests.internal.context;x-internal:=true,
org.eclipse.jpt.jaxb.core.tests.internal.context.java;x-internal:=true,
org.eclipse.jpt.jaxb.core.tests.internal.projects;x-internal:=true,
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreMiscTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreMiscTests.java
new file mode 100644
index 0000000000..e9ef094e95
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreMiscTests.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.tests.internal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.jpt.common.core.tests.BundleActivatorTest;
+import org.eclipse.jpt.jaxb.core.JaxbProject;
+
+public class JaxbCoreMiscTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JaxbCoreMiscTests.class.getName());
+
+ suite.addTestSuite(SchemaLibraryTests.class);
+ suite.addTest(new BundleActivatorTest(JaxbProject.class));
+
+ return suite;
+ }
+
+ private JaxbCoreMiscTests() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
index 632df40d68..2e9e64e05a 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -19,10 +19,13 @@ import org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTe
public class JaxbCoreTests {
public static Test suite() {
+ // ***** keep test.xml in sync with this list *****
+ // test.xml is split up because this test suite was taking too
+ // long and triggering a time-out during the WTP build
TestSuite suite = new TestSuite(JaxbCoreTests.class.getPackage().getName());
- suite.addTestSuite(SchemaLibraryTests.class);
suite.addTest(JaxbCoreResourceModelTests.suite());
suite.addTest(JaxbCoreContextModelTests.suite());
+ suite.addTest(JaxbCoreMiscTests.suite());
return suite;
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/plugin/JptJaxbCoreTestsPlugin.java
index 6fb339c26d..93d6e109aa 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/plugin/JptJaxbCoreTestsPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -7,21 +7,25 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests;
+package org.eclipse.jpt.jaxb.core.tests.internal.plugin;
-import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
import org.eclipse.jpt.common.utility.internal.ReflectionTools;
import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.osgi.framework.BundleContext;
/**
- * configure the core to handle events synchronously when we are
- * running tests
+ * Configure the core for testing:<ul>
+ * <li>handle events synchronously
+ * <li>do not flush preferences
+ * </ul>
*/
@SuppressWarnings("nls")
-public class JptJaxbCoreTestsPlugin extends Plugin {
+public class JptJaxbCoreTestsPlugin
+ extends JptPlugin
+{
+ // ********** singleton **********
private static JptJaxbCoreTestsPlugin INSTANCE;
@@ -30,29 +34,22 @@ public class JptJaxbCoreTestsPlugin extends Plugin {
}
- // ********** plug-in implementation **********
+ // ********** Dali plug-in **********
public JptJaxbCoreTestsPlugin() {
super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
}
-
@Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
+ protected void start_() throws Exception {
+ super.start_();
+ JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.instance().getProjectManager();
ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
ReflectionTools.executeStaticMethod(JaxbPreferencesManager.class, "doNotFlushPreferences");
}
@Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbCoreTestsPlugin) plugin;
}
-
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
index bba329c672..b86ae54fa2 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
@@ -46,7 +46,7 @@ public class TestJaxbProject
return getSystemProperty(JAXB_JAR_NAME_SYSTEM_PROPERTY);
}
- public static String eclipselinkJarName() {
+ public static String eclipseLinkJarName() {
return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
}
@@ -79,11 +79,13 @@ public class TestJaxbProject
String jaxbFacetVersion =
((IProjectFacetVersion) config.getProperty(IFacetDataModelProperties.FACET_VERSION)).getVersionString();
this.installFacet(JaxbFacet.ID, jaxbFacetVersion, config);
- this.addJar(jaxbJarName());
- if (eclipselinkJarName() != null) {
- this.addJar(eclipselinkJarName());
+ String jaxbJarName = jaxbJarName();
+ this.addJar(jaxbJarName);
+ String eclipseLinkJarName = eclipseLinkJarName();
+ if ((eclipseLinkJarName != null) && ! eclipseLinkJarName.equals(jaxbJarName)) {
+ this.addJar(eclipseLinkJarName);
}
- this.jaxbProject = JptJaxbCorePlugin.getJaxbProject(this.getProject());
+ this.jaxbProject = JptJaxbCorePlugin.instance().getProjectManager().getJaxbProject(this.getProject());
this.jaxbProject.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
this.jaxbProject.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
index 86faa8d47d..e8581ab9e9 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
@@ -1,24 +1,20 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.core.tests.internal.resource;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.eclipse.jpt.jaxb.core.tests.internal.JaxbCoreTests;
import org.eclipse.jpt.jaxb.core.tests.internal.resource.java.JaxbJavaResourceModelTests;
-
-public class JaxbCoreResourceModelTests extends TestCase
+public class JaxbCoreResourceModelTests
{
public static Test suite() {
TestSuite suite = new TestSuite(JaxbCoreResourceModelTests.class.getName());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
index b86c694340..50940d5f8c 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?> <!--
- Copyright (c) 2010, 2011 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
+ Copyright (c) 2010, 2012 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
<project name="testsuite" default="run" basedir=".">
<!-- The property ${eclipse-home} should be passed into this script -->
@@ -20,9 +20,8 @@
</delete>
</target>
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target> <!-- This target holds code to cleanup the testing environment after -->
+ <!-- Test suite is split up to prevent time-outs during the WTP build. --> <!-- Keep these suites in sync with those listed in JaxbCoreTests. --> <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target>
+ <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target> <target name="suite3"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.JaxbCoreMiscTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target> <!-- This target holds code to cleanup the testing environment after -->
<!-- after all of the tests have been run. You can use this target to -->
<!-- delete temporary files that have been created. -->
<target name="cleanup">
@@ -30,6 +29,6 @@
<!-- This target runs the test suite. Any actions that need to happen -->
<!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
+ <target name="run" depends="init, suite1, suite2, suite3, cleanup">
</target>
</project> \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
index ee129ed60e..416f4fb696 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Thu May 05 17:25:11 EDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
index cf2be3c589..066e928ce0 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
@@ -4,11 +4,12 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.tests;singleton:=true
Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.plugin.JptJaxbEclipseLinkCoreTestsPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
Bundle-Localization: plugin
Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.tests.JptJaxbEclipseLinkCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
@@ -19,8 +20,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.jpt.jaxb.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.tests,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;x-internal:=true,
+Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;x-internal:=true,
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
deleted file mode 100644
index b4b6735882..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * configure the core to handle events synchronously when we are
- * running tests
- */
-@SuppressWarnings("nls")
-public class JptJaxbEclipseLinkCoreTestsPlugin
- extends Plugin {
-
- private static JptJaxbEclipseLinkCoreTestsPlugin INSTANCE;
-
-
- public static JptJaxbEclipseLinkCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbEclipseLinkCoreTestsPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
- ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JaxbPreferencesManager.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreMiscTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreMiscTests.java
new file mode 100644
index 0000000000..e8544eecbc
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreMiscTests.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.jpt.common.core.tests.BundleActivatorTest;
+import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
+
+public class ELJaxbCoreMiscTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(ELJaxbCoreMiscTests.class.getName());
+
+ suite.addTest(new BundleActivatorTest(ELJaxbPlatform.class));
+
+ return suite;
+ }
+
+
+ private ELJaxbCoreMiscTests() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
index 233d80ca4e..53a4d45c83 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
@@ -1,30 +1,32 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;
import java.io.File;
-
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbCoreContextModelTests;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.ELJaxbCoreResourceModelTests;
-
+@SuppressWarnings("nls")
public class ELJaxbCoreTests {
public static Test suite() {
+ // ***** keep test.xml in sync with this list *****
+ // test.xml is split up because this test suite was taking too
+ // long and triggering a time-out during the WTP build
TestSuite suite = new TestSuite(ELJaxbCoreTests.class.getPackage().getName());
suite.addTest(ELJaxbCoreResourceModelTests.suite());
suite.addTest(ELJaxbCoreContextModelTests.suite());
+ suite.addTest(ELJaxbCoreMiscTests.suite());
return suite;
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java
index 1eacaf9eb8..2381acc9be 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java
@@ -1,23 +1,22 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreTests;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java.ELJaxbCoreJavaContextModelTests;
-public class ELJaxbCoreContextModelTests extends TestCase
-{
+public class ELJaxbCoreContextModelTests {
+
public static Test suite() {
TestSuite suite = new TestSuite(ELJaxbCoreContextModelTests.class.getName());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/plugin/JptJaxbEclipseLinkCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/plugin/JptJaxbEclipseLinkCoreTestsPlugin.java
new file mode 100644
index 0000000000..1b7e0e22e0
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/plugin/JptJaxbEclipseLinkCoreTestsPlugin.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.plugin;
+
+import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
+
+public class JptJaxbEclipseLinkCoreTestsPlugin
+ extends JptPlugin
+{
+ // ********** singleton **********
+
+ private static JptJaxbEclipseLinkCoreTestsPlugin INSTANCE;
+
+ public static JptJaxbEclipseLinkCoreTestsPlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** Dali plug-in **********
+
+ public JptJaxbEclipseLinkCoreTestsPlugin() {
+ super();
+ }
+
+ @Override
+ protected void setInstance(JptPlugin plugin) {
+ INSTANCE = (JptJaxbEclipseLinkCoreTestsPlugin) plugin;
+ }
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
index 12a00c2ed6..58bd740164 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
@@ -1,24 +1,20 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreTests;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java.ELJaxbJavaResourceModelTests;
-
-public class ELJaxbCoreResourceModelTests
- extends TestCase {
+public class ELJaxbCoreResourceModelTests {
public static Test suite() {
TestSuite suite = new TestSuite(ELJaxbCoreResourceModelTests.class.getName());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
index 479010c881..41543c9722 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
@@ -27,7 +27,7 @@ public class ELJaxbJavaResourceModelTestCase
@Override
protected void setUp() throws Exception {
super.setUp();
- this.javaProject.addJar(TestJaxbProject.eclipselinkJarName());
+ this.javaProject.addJar(TestJaxbProject.eclipseLinkJarName());
}
@Override
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml
index 09430226e2..be2a1f380d 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2011 Oracle. All rights reserved.
+ Copyright (c) 2011, 2012 Oracle. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0, which accompanies this distribution
and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -29,7 +29,8 @@
</delete>
</target>
- <!-- This target defines the tests that need to be run. -->
+ <!-- Test suite is split up to prevent time-outs during the WTP build. -->
+ <!-- Keep these suites in sync with those listed in ELJaxbCoreTests. -->
<target name="suite1">
<property file="${testRoot}/testServer.properties"/>
<property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
@@ -56,6 +57,19 @@
<property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
</ant>
</target>
+ <target name="suite3">
+ <property file="${testRoot}/testServer.properties"/>
+ <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
+ <delete dir="${jpt-folder}" quiet="true"/>
+
+ <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${jpt-folder}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname" value="org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreMiscTests"/>
+ <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
+ <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
+ </ant>
+ </target>
<!-- This target holds code to cleanup the testing environment after -->
<!-- after all of the tests have been run. You can use this target to -->
@@ -65,6 +79,6 @@
<!-- This target runs the test suite. Any actions that need to happen -->
<!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
+ <target name="run" depends="init, suite1, suite2, suite3, cleanup">
</target>
</project> \ No newline at end of file

Back to the top