JBoss Tools SVN: r16521 - in trunk: as/plugins/org.jboss.ide.eclipse.as.core and 21 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-07-09 18:40:27 -0400 (Thu, 09 Jul 2009)
New Revision: 16521
Modified:
trunk/as/docs/reference/en/master.xml
trunk/as/docs/reference/en/master_output.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
trunk/birt/docs/en/master.xml
trunk/birt/docs/en/master_output.xml
trunk/bpel/features/org.jboss.tools.bpel.feature/feature.properties
trunk/bpel/tests/org.eclipse.tools.bpel.ui.test/META-INF/MANIFEST.MF
trunk/documentation/guides/GettingStartedGuide/en/master.xml
trunk/documentation/guides/GettingStartedGuide/en/master_output.xml
trunk/documentation/jboss-tools-docs-archetype/src/main/resources/archetype-resources/en/master.xml
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml-single.xsl
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml.xsl
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml-single.xsl
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml.xsl
trunk/drools/docs/guvnor_ref/en/master.xml
trunk/drools/docs/guvnor_ref/en/master_output.xml
trunk/drools/docs/reference/en/master.xml
trunk/drools/docs/reference/en/master_output.xml
trunk/esb/docs/esb_ref_guide/en/master.xml
trunk/esb/docs/esb_ref_guide/en/master_output.xml
trunk/jst/plugins/org.jboss.tools.jst.css/plugin.properties
trunk/maven/features/org.jboss.tools.maven.feature/feature.properties
trunk/maven/features/org.jboss.tools.maven.sdk.feature/feature.properties
trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.properties
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java
trunk/smooks/docs/reference/en/master.xml
trunk/smooks/docs/reference/en/master_output.xml
trunk/smooks/plugins/org.jboss.tools.smooks.runtime/plugin.properties
trunk/struts/docs/struts_tools_ref_guide/en/master.xml
trunk/struts/docs/struts_tools_ref_guide/en/master_output.xml
trunk/struts/docs/struts_tools_tutorial/en/master.xml
trunk/struts/docs/struts_tools_tutorial/en/master_output.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4488 switch to "JBoss by Red Hat" and update (c) to 2009 as appropriate
Modified: trunk/as/docs/reference/en/master.xml
===================================================================
--- trunk/as/docs/reference/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/as/docs/reference/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -48,7 +48,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 2.1.0.M2
Modified: trunk/as/docs/reference/en/master_output.xml
===================================================================
--- trunk/as/docs/reference/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/as/docs/reference/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -46,7 +46,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 2.1.0.M2
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -30,5 +30,5 @@
deploy.runtime.name=JBoss Deploy-Only Runtime
deploy.runtime.description=A runtime provided to allow a deploy-only server the ability to deploy certain project types.
-Bundle-Vendor.0 = JBoss, a division of Red Hat
+Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = JBoss AS Core Plug-in
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,6 +1,6 @@
/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * JBoss by Red Hat
+ * Copyright 2006-2009, Red Hat Middleware, LLC, and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified: trunk/birt/docs/en/master.xml
===================================================================
--- trunk/birt/docs/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/birt/docs/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -31,7 +31,7 @@
<copyright>
<year>2008</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 1.1.0.M2
Modified: trunk/birt/docs/en/master_output.xml
===================================================================
--- trunk/birt/docs/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/birt/docs/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -31,7 +31,7 @@
<copyright>
<year>2008</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 1.1.0.M2
Modified: trunk/bpel/features/org.jboss.tools.bpel.feature/feature.properties
===================================================================
--- trunk/bpel/features/org.jboss.tools.bpel.feature/feature.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/bpel/features/org.jboss.tools.bpel.feature/feature.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,12 +1,12 @@
###############################################################################
-# Copyright (c) 2008 JBoss, a division of Red Hat and others.
+# Copyright (c) 2009 JBoss by Red Hat and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
-# JBoss, a division of Red Hat - Initial implementation.
+# JBoss by Red Hat - Initial implementation.
##############################################################################
# feature.properties
# contains externalized strings for feature.xml
@@ -18,7 +18,7 @@
featureName=JBoss BPEL Editor
# "providerName" property - name of the company that provides the feature
-providerName=JBoss, a division of Red Hat
+providerName=JBoss by Red Hat
# "updateSiteName" property - label for the update site
updateSiteName=JBossTools Update Site
@@ -28,8 +28,8 @@
description=JBoss BPEL Editor
# "copyright" property - text of the "Feature Update Copyright"
-copyright=Copyright (c) 2008 JBoss, a division of Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
-are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss, a division of Red Hat - Initial implementation.\n
+copyright=Copyright (c) 2009 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss by Red Hat - Initial implementation.\n
############### end of copyright property ####################################
# "licenseURL" property - URL of the "Feature License"
Modified: trunk/bpel/tests/org.eclipse.tools.bpel.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.eclipse.tools.bpel.ui.test/META-INF/MANIFEST.MF 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/bpel/tests/org.eclipse.tools.bpel.ui.test/META-INF/MANIFEST.MF 2009-07-09 22:40:27 UTC (rev 16521)
@@ -10,7 +10,7 @@
org.jboss.tools.common.test;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: JBoss, a division of Red Hat
+Bundle-Vendor: JBoss by Red Hat
Import-Package: org.eclipse.core.resources,
org.eclipse.ui.ide,
org.jboss.tools.common.test.util
Modified: trunk/documentation/guides/GettingStartedGuide/en/master.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/guides/GettingStartedGuide/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -41,7 +41,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>Version: 2.0.1.GA</releaseinfo>
<abstract>
Modified: trunk/documentation/guides/GettingStartedGuide/en/master_output.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/guides/GettingStartedGuide/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -39,7 +39,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>Version: 2.0.1.GA</releaseinfo>
<abstract>
Modified: trunk/documentation/jboss-tools-docs-archetype/src/main/resources/archetype-resources/en/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs-archetype/src/main/resources/archetype-resources/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jboss-tools-docs-archetype/src/main/resources/archetype-resources/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -19,7 +19,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 3.1.0.M2
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml-single.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml-single.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml-single.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/xhtml.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml-single.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml-single.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml-single.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml.xsl 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/xhtml.xsl 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<!--
- Copyright 2008 JBoss, a division of Red Hat
+ Copyright 2009 JBoss by Red Hat
License: LGPL
Author: Mark Newton <mark.newton(a)jboss.org>
-->
Modified: trunk/drools/docs/guvnor_ref/en/master.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/drools/docs/guvnor_ref/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -42,7 +42,7 @@
<pubdate>April 2008</pubdate>
<copyright>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 5.1.0.trunk
Modified: trunk/drools/docs/guvnor_ref/en/master_output.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/drools/docs/guvnor_ref/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -40,7 +40,7 @@
<pubdate>April 2008</pubdate>
<copyright>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 5.1.0.trunk
Modified: trunk/drools/docs/reference/en/master.xml
===================================================================
--- trunk/drools/docs/reference/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/drools/docs/reference/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -43,7 +43,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 5.1.0.trunk
Modified: trunk/drools/docs/reference/en/master_output.xml
===================================================================
--- trunk/drools/docs/reference/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/drools/docs/reference/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -41,7 +41,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 5.1.0.trunk
Modified: trunk/esb/docs/esb_ref_guide/en/master.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/esb/docs/esb_ref_guide/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -41,7 +41,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 1.3.0.M2
Modified: trunk/esb/docs/esb_ref_guide/en/master_output.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/esb/docs/esb_ref_guide/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -40,7 +40,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 1.3.0.M2
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/plugin.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/plugin.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,4 +1,4 @@
-Bundle-Vendor = JBoss, a division of Red Hat
+Bundle-Vendor = JBoss by Red Hat
Bundle-Name = CSS Test Plug-in
css.tabs.textFont.label=Text/Font
css.tabs.background.label=Background
Modified: trunk/maven/features/org.jboss.tools.maven.feature/feature.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.feature/feature.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/maven/features/org.jboss.tools.maven.feature/feature.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008 JBoss by Red Hat and others.
+# Copyright (c) 2009 JBoss by Red Hat and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
description=JBoss Maven Integration
# "copyright" property - text of the "Feature Update Copyright"
-copyright=Copyright (c) 2008 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+copyright=Copyright (c) 2009 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss by Red Hat - Initial implementation.\n
############### end of copyright property ####################################
Modified: trunk/maven/features/org.jboss.tools.maven.sdk.feature/feature.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.sdk.feature/feature.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/maven/features/org.jboss.tools.maven.sdk.feature/feature.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008 JBoss by Red Hat and others.
+# Copyright (c) 2009 JBoss by Red Hat and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
description=JBoss Maven Integration
# "copyright" property - text of the "Feature Update Copyright"
-copyright=Copyright (c) 2008 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+copyright=Copyright (c) 2009 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss by Red Hat - Initial implementation.\n
############### end of copyright property ####################################
Modified: trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/maven/features/org.jboss.tools.maven.seam.feature/feature.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008 JBoss by Red Hat and others.
+# Copyright (c) 2009 JBoss by Red Hat and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@
description=JBoss Maven Seam Integration
# "copyright" property - text of the "Feature Update Copyright"
-copyright=Copyright (c) 2008 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+copyright=Copyright (c) 2009 JBoss by Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss by Red Hat - Initial implementation.\n
############### end of copyright property ####################################
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,12 +1,12 @@
/*************************************************************************************
- * Copyright (c) 2008 JBoss, a division of Red Hat and others.
+ * Copyright (c) 2009 JBoss by Red Hat and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * JBoss, a division of Red Hat - Initial implementation.
+ * JBoss by Red Hat - Initial implementation.
************************************************************************************/
package org.jboss.tools.maven.core;
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,12 +1,12 @@
/*************************************************************************************
- * Copyright (c) 2008 JBoss, a division of Red Hat and others.
+ * Copyright (c) 2009 JBoss by Red Hat and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * JBoss, a division of Red Hat - Initial implementation.
+ * JBoss by Red Hat - Initial implementation.
************************************************************************************/
package org.jboss.tools.maven.core.internal.project.facet;
Modified: trunk/smooks/docs/reference/en/master.xml
===================================================================
--- trunk/smooks/docs/reference/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/smooks/docs/reference/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -32,7 +32,7 @@
<pubdate>November 2008</pubdate>
<copyright>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 1.1.0.M2
Modified: trunk/smooks/docs/reference/en/master_output.xml
===================================================================
--- trunk/smooks/docs/reference/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/smooks/docs/reference/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -31,7 +31,7 @@
<pubdate>November 2008</pubdate>
<copyright>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 1.1.0.M2
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.runtime/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.runtime/plugin.properties 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.runtime/plugin.properties 2009-07-09 22:40:27 UTC (rev 16521)
@@ -1,2 +1,2 @@
pluginName=Smooks Runtime 1.1.2 Plug-in
-providerName=JBoss, a division of Red Hat
\ No newline at end of file
+providerName=JBoss by Red Hat
\ No newline at end of file
Modified: trunk/struts/docs/struts_tools_ref_guide/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -49,7 +49,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 3.1.0.M2
Modified: trunk/struts/docs/struts_tools_ref_guide/en/master_output.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/struts/docs/struts_tools_ref_guide/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -48,7 +48,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 3.1.0.M2
Modified: trunk/struts/docs/struts_tools_tutorial/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/master.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/struts/docs/struts_tools_tutorial/en/master.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -46,7 +46,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
Version: 3.1.0.M2
Modified: trunk/struts/docs/struts_tools_tutorial/en/master_output.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/master_output.xml 2009-07-09 16:56:28 UTC (rev 16520)
+++ trunk/struts/docs/struts_tools_tutorial/en/master_output.xml 2009-07-09 22:40:27 UTC (rev 16521)
@@ -44,7 +44,7 @@
<copyright>
<year>2007</year>
<year>2009</year>
- <holder>JBoss, a division of Red Hat</holder>
+ <holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo><diffmk:wrapper diffmk:change="changed">
Version: 3.1.0.M2
16 years, 9 months
JBoss Tools SVN: r16520 - in trunk: jbpm/releng/org.jboss.tools.jbpm3.releng and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-07-09 12:56:28 -0400 (Thu, 09 Jul 2009)
New Revision: 16520
Modified:
trunk/freemarker/releng/build.xml
trunk/jbpm/releng/org.jboss.tools.jbpm3.releng/build.xml
trunk/jbpm/releng/org.jboss.tools.jbpm4.releng/build.xml
trunk/jmx/releng/build.xml
Log:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283008
Modified: trunk/freemarker/releng/build.xml
===================================================================
--- trunk/freemarker/releng/build.xml 2009-07-09 14:00:53 UTC (rev 16519)
+++ trunk/freemarker/releng/build.xml 2009-07-09 16:56:28 UTC (rev 16520)
@@ -20,7 +20,7 @@
<!--
can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
- ${relengBuilderDir}/build
+ ${WORKSPACE}/build
-->
<property name="writableBuildRoot" value="/tmp/build" />
Modified: trunk/jbpm/releng/org.jboss.tools.jbpm3.releng/build.xml
===================================================================
--- trunk/jbpm/releng/org.jboss.tools.jbpm3.releng/build.xml 2009-07-09 14:00:53 UTC (rev 16519)
+++ trunk/jbpm/releng/org.jboss.tools.jbpm3.releng/build.xml 2009-07-09 16:56:28 UTC (rev 16520)
@@ -20,7 +20,7 @@
<!--
can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
- ${relengBuilderDir}/build
+ ${WORKSPACE}/build
-->
<property name="writableBuildRoot" value="/tmp/build" />
Modified: trunk/jbpm/releng/org.jboss.tools.jbpm4.releng/build.xml
===================================================================
--- trunk/jbpm/releng/org.jboss.tools.jbpm4.releng/build.xml 2009-07-09 14:00:53 UTC (rev 16519)
+++ trunk/jbpm/releng/org.jboss.tools.jbpm4.releng/build.xml 2009-07-09 16:56:28 UTC (rev 16520)
@@ -20,7 +20,7 @@
<!--
can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
- ${relengBuilderDir}/build
+ ${WORKSPACE}/build
-->
<property name="writableBuildRoot" value="/tmp/build" />
Modified: trunk/jmx/releng/build.xml
===================================================================
--- trunk/jmx/releng/build.xml 2009-07-09 14:00:53 UTC (rev 16519)
+++ trunk/jmx/releng/build.xml 2009-07-09 16:56:28 UTC (rev 16520)
@@ -20,7 +20,7 @@
<!--
can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
- ${relengBuilderDir}/build
+ ${WORKSPACE}/build
-->
<property name="writableBuildRoot" value="/tmp/build" />
16 years, 9 months
JBoss Tools SVN: r16519 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-09 10:00:53 -0400 (Thu, 09 Jul 2009)
New Revision: 16519
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4521
Fixed from code to view update problem.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java 2009-07-09 13:37:41 UTC (rev 16518)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java 2009-07-09 14:00:53 UTC (rev 16519)
@@ -102,4 +102,8 @@
boolean isDefaultReadOnly();
boolean DEFAULT_READ_ONLY = false;
String DEFAULT_READ_ONLY_PROPERTY = "defaultReadOnly"; //$NON-NLS-1$
+
+ void initialize(HibernateNamedQueryAnnotation resourceNamedQuery);
+
+ void update(HibernateNamedQueryAnnotation resourceNamedQuery);
}
16 years, 9 months
JBoss Tools SVN: r16518 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-09 09:37:41 -0400 (Thu, 09 Jul 2009)
New Revision: 16518
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateNamedQueryImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/CacheModeType.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/FlushModeType.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateQueryContainer.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedQueryPropertyComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJavaNamedQueryImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaNamedQuery.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateSourceNamedQueryAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/java/details/HibernateJavaEntityComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4521
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJavaNamedQueryImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJavaNamedQueryImpl.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJavaNamedQueryImpl.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.jpt.core.internal;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedQuery;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaNamedQuery;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateJavaNamedQueryImpl extends GenericJavaNamedQuery
- implements HibernateJavaNamedQuery {
-
- /**
- * @param parent
- */
- public HibernateJavaNamedQueryImpl(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
-}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -17,6 +17,7 @@
import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQueryAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.GenericGeneratorAnnotationImpl.GenericGeneratorAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotationDefinition;
/**
* @author Dmitry Geraskov
@@ -49,6 +50,7 @@
protected void addTypeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
definitions.add(GenericGeneratorAnnotationDefinition.instance());
definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
+ definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
}
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -13,7 +13,6 @@
import org.eclipse.jpt.core.context.java.JavaEntity;
import org.eclipse.jpt.core.context.java.JavaIdMapping;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.persistence.Persistence;
@@ -23,6 +22,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaIdMapping;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaParameter;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaGenericGenerator;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaGenericGeneratorImpl;
@@ -54,8 +54,8 @@
return new JavaGenericGeneratorImpl(parent);
}
- public JavaNamedQuery buildHibernateJavaNamedQuery(JavaJpaContextNode parent) {
- return new HibernateJavaNamedQueryImpl(parent);
+ public HibernateNamedQuery buildHibernateNamedQuery(JavaJpaContextNode parent) {
+ return new HibernateNamedQueryImpl(parent);
}
public JavaParameter buildJavaParameter(JavaGenericGeneratorImpl javaGenericGeneratorImpl) {
Copied: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateNamedQueryImpl.java (from rev 16282, trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJavaNamedQueryImpl.java)
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateNamedQueryImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateNamedQueryImpl.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal;
+
+import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedQuery;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.CacheModeType;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.FlushModeType;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQuery;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQueryAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateNamedQueryImpl extends GenericJavaNamedQuery
+ implements HibernateNamedQuery {
+
+ private FlushModeType specifiedFlushMode;
+
+ private CacheModeType specifiedCacheMode;
+
+ private Boolean specifiedCacheable;
+
+ private String specifiedCacheRegion;
+
+ private Integer specifiedFetchSize;
+
+ private Integer specifiedTimeout;
+
+ private String specifiedComment;
+
+ private Boolean specifiedReadOnly;
+
+ /**
+ * @param parent
+ */
+ public HibernateNamedQueryImpl(JavaJpaContextNode parent) {
+ super(parent);
+ }
+
+ public void initialize(HibernateNamedQueryAnnotation resourceQuery) {
+ this.specifiedFlushMode = this.getResourceFlushMode(resourceQuery);
+ this.specifiedCacheMode = this.getResourceCacheMode(resourceQuery);
+ this.specifiedCacheable = resourceQuery.isCacheable();
+ this.specifiedCacheRegion = resourceQuery.getCacheRegion();
+ this.specifiedFetchSize = resourceQuery.getFetchSize();
+ this.specifiedTimeout = resourceQuery.getTimeout();
+ this.specifiedComment = resourceQuery.getComment();
+ this.specifiedReadOnly = resourceQuery.isReadOnly();
+ super.initialize(resourceQuery);
+ }
+
+ public void update(HibernateNamedQueryAnnotation resourceQuery) {
+ this.setFlushMode_(resourceQuery.getFlushMode());
+ this.setCacheMode_ (resourceQuery.getCacheMode());
+ this.setSpecifiedCacheable_(resourceQuery.isCacheable());
+ this.setSpecifiedCacheRegion_(resourceQuery.getCacheRegion());
+ this.setSpecifiedFetchSize_(resourceQuery.getFetchSize());
+ this.setSpecifiedTimeout_(resourceQuery.getTimeout());
+ this.setSpecifiedComment_(resourceQuery.getComment());
+ this.setSpecifiedReadOnly_(resourceQuery.isReadOnly());
+ super.update(resourceQuery);
+ }
+
+ private CacheModeType getResourceCacheMode(HibernateNamedQueryAnnotation resourceQuery) {
+ return CacheModeType.fromJavaAnnotationValue(resourceQuery);
+ }
+
+ private FlushModeType getResourceFlushMode(HibernateNamedQueryAnnotation resourceQuery) {
+ return FlushModeType.fromJavaAnnotationValue(resourceQuery);
+ }
+
+ @Override
+ protected HibernateNamedQueryAnnotation getResourceQuery() {
+ return (HibernateNamedQueryAnnotation) super.getResourceQuery();
+ }
+
+ // ****** flushMode
+ public FlushModeType getFlushMode() {
+ return getSpecifiedFlushMode() == null ? getDefaultFlushMode() : getSpecifiedFlushMode();
+ }
+
+ public FlushModeType getSpecifiedFlushMode() {
+ return specifiedFlushMode;
+ }
+
+ public FlushModeType getDefaultFlushMode() {
+ return HibernateNamedQuery.DEFAULT_FLUSH_MODE_TYPE;
+ }
+
+ public void setSpecifiedFlushMode(FlushModeType flushMode) {
+ FlushModeType oldFlushMode = this.specifiedFlushMode;
+ this.specifiedFlushMode = flushMode;
+ getResourceQuery().setFlushMode(flushMode);
+ firePropertyChanged(SPECIFIED_FLUSH_MODE_PROPERTY, oldFlushMode, flushMode);
+ }
+
+ protected void setFlushMode_(FlushModeType flushMode) {
+ FlushModeType oldFlushMode = this.specifiedFlushMode;
+ this.specifiedFlushMode = flushMode;
+ firePropertyChanged(SPECIFIED_FLUSH_MODE_PROPERTY, oldFlushMode, flushMode);
+ }
+ // ****** cacheMode
+ public CacheModeType getCacheMode() {
+ return getSpecifiedCacheMode() == null ? getDefaultCacheMode() : getSpecifiedCacheMode();
+ }
+
+ public CacheModeType getDefaultCacheMode() {
+ return HibernateNamedQuery.DEFAULT_CACHE_MODE_TYPE;
+ }
+
+ public CacheModeType getSpecifiedCacheMode() {
+ return specifiedCacheMode;
+ }
+
+ public void setSpecifiedCacheMode(CacheModeType cacheMode) {
+ CacheModeType oldCacheMode = this.specifiedCacheMode;
+ this.specifiedCacheMode = cacheMode;
+ getResourceQuery().setCacheMode(cacheMode);
+ firePropertyChanged(SPECIFIED_CACHE_MODE_PROPERTY, oldCacheMode, cacheMode);
+ }
+
+ public void setCacheMode_(CacheModeType cacheMode) {
+ CacheModeType oldCacheMode = this.specifiedCacheMode;
+ this.specifiedCacheMode = cacheMode;
+ firePropertyChanged(SPECIFIED_CACHE_MODE_PROPERTY, oldCacheMode, cacheMode);
+ }
+ //************************ cacheable *********************************
+ public boolean isCacheable(){
+ return (this.getSpecifiedCacheable() == null) ? this.isDefaultCacheable()
+ : this.getSpecifiedCacheable().booleanValue();
+ }
+
+ public Boolean getSpecifiedCacheable(){
+ return this.specifiedCacheable;
+ }
+
+ public void setSpecifiedCacheable(Boolean newSpecifiedCacheable) {
+ Boolean oldSpecifiedCacheable = this.specifiedCacheable;
+ this.specifiedCacheable = newSpecifiedCacheable;
+ this.getResourceQuery().setCacheable(newSpecifiedCacheable);
+ firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
+
+ }
+
+ public void setSpecifiedCacheable_(Boolean newSpecifiedCacheable) {
+ Boolean oldSpecifiedCacheable = this.specifiedCacheable;
+ this.specifiedCacheable = newSpecifiedCacheable;
+ firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
+ }
+
+ public boolean isDefaultCacheable() {
+ return HibernateNamedQuery.DEFAULT_CACHEABLE;
+ }
+ //************************ cacheRegion *********************************
+ public String getCacheRegion(){
+ return (getSpecifiedCacheRegion() == null ? getDefaultCacheRegion()
+ : getSpecifiedCacheRegion());
+ }
+ public String getSpecifiedCacheRegion(){
+ return this.specifiedCacheRegion;
+ }
+
+ public void setSpecifiedCacheRegion(String cacheRegion){
+ String oldSpecifiedCacheRegion = this.specifiedCacheRegion;
+ this.specifiedCacheRegion = cacheRegion;
+ this.getResourceQuery().setCacheRegion(cacheRegion);
+ firePropertyChanged(SPECIFIED_CACHE_REGION_PROPERTY, oldSpecifiedCacheRegion, cacheRegion);
+ }
+
+ public void setSpecifiedCacheRegion_(String cacheRegion){
+ String oldSpecifiedCacheRegion = this.specifiedCacheRegion;
+ this.specifiedCacheRegion = cacheRegion;
+ firePropertyChanged(SPECIFIED_CACHE_REGION_PROPERTY, oldSpecifiedCacheRegion, cacheRegion);
+ }
+
+ public String getDefaultCacheRegion(){
+ return HibernateNamedQuery.DEFAULT_CACHE_REGION;
+ }
+ //************************ fetchSize *********************************
+ public int getFetchSize(){
+ return (getSpecifiedFetchSize() == null ? getDefaultFetchSize()
+ : getSpecifiedFetchSize().intValue());
+ }
+
+ public Integer getSpecifiedFetchSize(){
+ return this.specifiedFetchSize;
+ }
+
+ public void setSpecifiedFetchSize(Integer newSpecifiedFetchSize){
+ Integer oldSpecifiedFetchSize = this.specifiedFetchSize;
+ this.specifiedFetchSize = newSpecifiedFetchSize;
+ this.getResourceQuery().setFetchSize(newSpecifiedFetchSize);
+ firePropertyChanged(SPECIFIED_FETCH_SIZE_PROPERTY, oldSpecifiedFetchSize, newSpecifiedFetchSize);
+ }
+
+ public void setSpecifiedFetchSize_(Integer fetchSize){
+ Integer oldSpecifiedFetchSize = this.specifiedFetchSize;
+ this.specifiedFetchSize = fetchSize;
+ firePropertyChanged(SPECIFIED_FETCH_SIZE_PROPERTY, oldSpecifiedFetchSize, fetchSize);
+ }
+
+ public int getDefaultFetchSize(){
+ return HibernateNamedQuery.DEFAULT_FETCH_SIZE;
+ }
+ //************************ timeout *********************************
+ public int getTimeout(){
+ return (getSpecifiedTimeout() == null ? getDefaultTimeout()
+ : getSpecifiedTimeout().intValue());
+ }
+
+ public Integer getSpecifiedTimeout(){
+ return this.specifiedTimeout;
+ }
+
+ public void setSpecifiedTimeout(Integer newSpecifiedTimeout){
+ Integer oldSpecifiedTimeout = this.specifiedTimeout;
+ this.specifiedTimeout = newSpecifiedTimeout;
+ this.getResourceQuery().setTimeout(newSpecifiedTimeout);
+ firePropertyChanged(SPECIFIED_TIMEOUT_PROPERTY, oldSpecifiedTimeout, newSpecifiedTimeout);
+ }
+
+ public void setSpecifiedTimeout_(Integer timeout){
+ Integer oldSpecifiedTimeout = this.specifiedTimeout;
+ this.specifiedTimeout = timeout;
+ firePropertyChanged(SPECIFIED_TIMEOUT_PROPERTY, oldSpecifiedTimeout, timeout);
+ }
+
+ public int getDefaultTimeout(){
+ return HibernateNamedQuery.DEFAULT_TIMEOUT;
+ }
+ //************************ comment *********************************
+ public String getComment(){
+ return (getSpecifiedComment() == null ? getDefaultComment()
+ : getSpecifiedComment());
+ }
+ public String getSpecifiedComment(){
+ return this.specifiedComment;
+ }
+
+ public void setSpecifiedComment(String newSpecifiedComment){
+ String oldSpecifiedComment = this.specifiedComment;
+ this.specifiedComment = newSpecifiedComment;
+ this.getResourceQuery().setComment(newSpecifiedComment);
+ firePropertyChanged(SPECIFIED_COMMENT_PROPERTY, oldSpecifiedComment, newSpecifiedComment);
+ }
+
+ public void setSpecifiedComment_(String comment){
+ String oldSpecifiedComment = this.specifiedComment;
+ this.specifiedComment = comment;
+ firePropertyChanged(SPECIFIED_COMMENT_PROPERTY, oldSpecifiedComment, comment);
+ }
+
+ public String getDefaultComment(){
+ return HibernateNamedQuery.DEFAULT_COMMENT;
+ }
+
+ //************************ readOnly *********************************
+ public boolean isReadOnly(){
+ return (getSpecifiedReadOnly() == null ? isDefaultReadOnly()
+ : getSpecifiedReadOnly().booleanValue());
+ }
+
+ public Boolean getSpecifiedReadOnly(){
+ return this.specifiedReadOnly;
+ }
+
+ public void setSpecifiedReadOnly(Boolean newSpecifiedReadOnly){
+ Boolean oldSpecifiedReadOnly = this.specifiedReadOnly;
+ this.specifiedReadOnly = newSpecifiedReadOnly;
+ this.getResourceQuery().setReadOnly(newSpecifiedReadOnly);
+ firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, oldSpecifiedReadOnly, newSpecifiedReadOnly);
+ }
+
+ public void setSpecifiedReadOnly_(Boolean readOnly){
+ Boolean oldSpecifiedReadOnly = this.specifiedReadOnly;
+ this.specifiedReadOnly = readOnly;
+ firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, oldSpecifiedReadOnly, readOnly);
+ }
+
+ public boolean isDefaultReadOnly(){
+ return HibernateNamedQuery.DEFAULT_READ_ONLY;
+ }
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -36,8 +36,33 @@
String NAMED_QUERY__NAME = "name"; //$NON-NLS-1$
String NAMED_QUERY__QUERY = "query"; //$NON-NLS-1$
String NAMED_QUERY__HINTS = "hints"; //$NON-NLS-1$
+ String NAMED_QUERY__FLUSH_MODE = "flushMode"; //$NON-NLS-1$
+ String NAMED_QUERY__CACHE_MODE = "cacheMode"; //$NON-NLS-1$
+ String NAMED_QUERY__CACHEABLE = "cacheable"; //$NON-NLS-1$
+ String NAMED_QUERY__CACHE_REGION = "cacheRegion"; //$NON-NLS-1$
+ String NAMED_QUERY__FETCH_SIZE = "fetchSize"; //$NON-NLS-1$
+ String NAMED_QUERY__TIMEOUT = "timeout"; //$NON-NLS-1$
+ String NAMED_QUERY__COMMENT = "comment"; //$NON-NLS-1$
+ String NAMED_QUERY__READ_ONLY = "readOnly"; //$NON-NLS-1$
String NAMED_QUERIES = PACKAGE_ + "NamedQueries"; //$NON-NLS-1$
String NAMED_QUERIES__VALUE = "value"; //$NON-NLS-1$
+
+ String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType"; //$NON-NLS-1$
+ String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + '.';
+ String FLUSH_MODE_TYPE__ALWAYS = FLUSH_MODE_TYPE_ + "ALWAYS"; //$NON-NLS-1$
+ String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO"; //$NON-NLS-1$
+ String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT"; //$NON-NLS-1$
+ String FLUSH_MODE_TYPE__NEVER = FLUSH_MODE_TYPE_ + "NEVER"; //$NON-NLS-1$
+ String FLUSH_MODE_TYPE__MANUAL = FLUSH_MODE_TYPE_ + "MANUAL"; //$NON-NLS-1$
+
+ String CACHE_MODE_TYPE = PACKAGE_ + "CacheModeType"; //$NON-NLS-1$
+ String CACHE_MODE_TYPE_ = CACHE_MODE_TYPE + '.';
+ String CACHE_MODE_TYPE__GET = CACHE_MODE_TYPE_ + "GET"; //$NON-NLS-1$
+ String CACHE_MODE_TYPE__IGNORE = CACHE_MODE_TYPE_ + "IGNORE"; //$NON-NLS-1$
+ String CACHE_MODE_TYPE__NORMAL = CACHE_MODE_TYPE_ + "NORMAL"; //$NON-NLS-1$
+ String CACHE_MODE_TYPE__PUT = CACHE_MODE_TYPE_ + "PUT"; //$NON-NLS-1$
+ String CACHE_MODE_TYPE__REFRESH = CACHE_MODE_TYPE_ + "REFRESH"; //$NON-NLS-1$
+
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/CacheModeType.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/CacheModeType.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/CacheModeType.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+
+/**
+ * Corresponds to the Hibernate enum
+ * org.hibernate.annotations.CacheModeType
+ *
+ * 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 enum CacheModeType {
+
+ GET(Hibernate.CACHE_MODE_TYPE__GET),
+ IGNORE(Hibernate.CACHE_MODE_TYPE__IGNORE),
+ NORMAL(Hibernate.CACHE_MODE_TYPE__NORMAL),
+ PUT(Hibernate.CACHE_MODE_TYPE__PUT),
+ REFRESH(Hibernate.CACHE_MODE_TYPE__REFRESH);
+
+
+ private String javaAnnotationValue;
+
+ CacheModeType(String javaAnnotationValue) {
+ if (javaAnnotationValue == null) {
+ throw new NullPointerException();
+ }
+ this.javaAnnotationValue = javaAnnotationValue;
+ }
+
+ public String getJavaAnnotationValue() {
+ return this.javaAnnotationValue;
+ }
+
+
+ // ********** static methods **********
+
+ public static CacheModeType fromJavaAnnotationValue(Object javaAnnotationValue) {
+ return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
+ }
+
+ private static CacheModeType fromJavaAnnotationValue_(Object javaAnnotationValue) {
+ for (CacheModeType cacheModeType : CacheModeType.values()) {
+ if (cacheModeType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
+ return cacheModeType;
+ }
+ }
+ return null;
+ }
+
+ public static String toJavaAnnotationValue(CacheModeType cacheModeType) {
+ return (cacheModeType == null) ? null : cacheModeType.getJavaAnnotationValue();
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/CacheModeType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/FlushModeType.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/FlushModeType.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/FlushModeType.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+
+/**
+ * Corresponds to the Hibernate enum
+ * org.hibernate.annotations.FlushModeType
+ *
+ * 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 enum FlushModeType {
+
+ ALWAYS(Hibernate.FLUSH_MODE_TYPE__ALWAYS),
+ AUTO(Hibernate.FLUSH_MODE_TYPE__AUTO),
+ COMMIT(Hibernate.FLUSH_MODE_TYPE__COMMIT),
+ NEVER(Hibernate.FLUSH_MODE_TYPE__NEVER),
+ MANUAL(Hibernate.FLUSH_MODE_TYPE__MANUAL);
+
+
+ private String javaAnnotationValue;
+
+ FlushModeType(String javaAnnotationValue) {
+ if (javaAnnotationValue == null) {
+ throw new NullPointerException();
+ }
+ this.javaAnnotationValue = javaAnnotationValue;
+ }
+
+ public String getJavaAnnotationValue() {
+ return this.javaAnnotationValue;
+ }
+
+
+ // ********** static methods **********
+
+ public static FlushModeType fromJavaAnnotationValue(Object javaAnnotationValue) {
+ return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
+ }
+
+ private static FlushModeType fromJavaAnnotationValue_(Object javaAnnotationValue) {
+ for (FlushModeType flushModeType : FlushModeType.values()) {
+ if (flushModeType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
+ return flushModeType;
+ }
+ }
+ return null;
+ }
+
+ public static String toJavaAnnotationValue(FlushModeType flushModeType) {
+ return (flushModeType == null) ? null : flushModeType.getJavaAnnotationValue();
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/FlushModeType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -17,41 +17,67 @@
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaGenerator;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
+import org.eclipse.jpt.core.context.java.JavaQuery;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.utility.Filter;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
+import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotation;
/**
* @author Dmitry Geraskov
*
*/
-public class HibernateJavaEntity extends GenericJavaEntity implements GenericGeneratorHolder {
+public class HibernateJavaEntity extends AbstractJavaEntity
+implements GenericGeneratorHolder, HibernateQueryContainer {
protected JavaGenericGenerator genericGenerator;
+ protected final List<HibernateNamedQuery> hibernateNamedQueries;
+
public HibernateJavaEntity(JavaPersistentType parent) {
super(parent);
+ this.hibernateNamedQueries = new ArrayList<HibernateNamedQuery>();
}
@Override
public void initialize(JavaResourcePersistentType resourcePersistentType) {
super.initialize(resourcePersistentType);
this.initializeGenericGenerator();
+ this.initializeHibernateNamedQueries();
}
@Override
+ public void update(JavaResourcePersistentType resourcePersistentType) {
+ super.update(resourcePersistentType);
+ this.updateGenericGenerator();
+ this.updateHibernateNamedQueries();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Iterator<JavaQuery> queries() {
+ return new CompositeIterator<JavaQuery>(super.queries(), this.hibernateNamedQueries());
+ }
+
+ // ********************* GenericGenerator **************
+ @SuppressWarnings("unchecked")
+ @Override
public Iterator<String> correspondingAnnotationNames() {
- return new CompositeIterator<String>(Hibernate.GENERIC_GENERATOR, super.correspondingAnnotationNames());
+ return new CompositeIterator<String>(
+ new ArrayIterator<String>(Hibernate.GENERIC_GENERATOR,
+ Hibernate.NAMED_QUERY,
+ Hibernate.NAMED_QUERIES),
+ super.correspondingAnnotationNames());
}
public void setGenericGenerator(JavaGenericGenerator newGenericGenerator) {
@@ -70,20 +96,6 @@
this.genericGenerator = buildGenericGenerator(genericGeneratorResource);
}
}
-
- @Override
- protected void initializeNamedQueries() {
- super.initializeNamedQueries();
- for (ListIterator<NestableAnnotation> stream = this.javaResourcePersistentType.supportingAnnotations(Hibernate.NAMED_QUERY, Hibernate.NAMED_QUERIES); stream.hasNext(); ) {
- this.namedQueries.add(buildHibernateNamedQuery((HibernateNamedQueryAnnotation) stream.next()));
- }
- }
-
- protected JavaNamedQuery buildHibernateNamedQuery(HibernateNamedQueryAnnotation namedQueryResource) {
- JavaNamedQuery namedQuery = getJpaFactory().buildHibernateJavaNamedQuery(this);
- namedQuery.initialize(namedQueryResource);
- return namedQuery;
- }
protected GenericGeneratorAnnotation getResourceGenericGenerator() {
return (GenericGeneratorAnnotation) this.javaResourcePersistentType.getSupportingAnnotation(GenericGeneratorAnnotation.ANNOTATION_NAME);
@@ -129,12 +141,6 @@
}
}
- @Override
- public void update(JavaResourcePersistentType resourcePersistentType) {
- super.update(resourcePersistentType);
- updateGenericGenerator();
- }
-
protected void updateGenericGenerator() {
GenericGeneratorAnnotation genericGeneratorResource = getResourceGenericGenerator();
if (genericGeneratorResource == null) {
@@ -151,40 +157,85 @@
}
}
}
-
- @Override
- protected void updateNamedQueries() {
- ListIterator<JavaNamedQuery> queries = namedQueries();
- ListIterator<NestableAnnotation> resourceNamedQueries = this.javaResourcePersistentType.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
+ // ********************* NamedQuery **************
+ public ListIterator<HibernateNamedQuery> hibernateNamedQueries() {
+ return new CloneListIterator<HibernateNamedQuery>(this.hibernateNamedQueries);
+ }
+
+ public int hibernateNamedQueriesSize() {
+ return this.hibernateNamedQueries.size();
+ }
+
+ protected void initializeHibernateNamedQueries() {
+ for (ListIterator<NestableAnnotation> stream = this.javaResourcePersistentType.supportingAnnotations(HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME); stream.hasNext(); ) {
+ this.hibernateNamedQueries.add(buildHibernateNamedQuery((HibernateNamedQueryAnnotation) stream.next()));
+ }
+ }
+
+ protected HibernateNamedQuery buildHibernateNamedQuery(HibernateNamedQueryAnnotation namedQueryResource) {
+ HibernateNamedQuery hibernateNamedQuery = getJpaFactory().buildHibernateNamedQuery(this);
+ hibernateNamedQuery.initialize(namedQueryResource);
+ return hibernateNamedQuery;
+ }
+
+ protected void updateHibernateNamedQueries() {
+ ListIterator<HibernateNamedQuery> queries = hibernateNamedQueries();
+ ListIterator<NestableAnnotation> resourceNamedQueries = this.javaResourcePersistentType.supportingAnnotations(HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
- ListIterator<NestableAnnotation> hibernateNamedQueries = this.javaResourcePersistentType.supportingAnnotations(Hibernate.NAMED_QUERY, Hibernate.NAMED_QUERIES);
-
while (queries.hasNext()) {
- JavaNamedQuery namedQuery = queries.next();
- if (namedQuery instanceof HibernateJavaNamedQuery) {
- if (hibernateNamedQueries.hasNext()) {
- namedQuery.update((HibernateNamedQueryAnnotation) hibernateNamedQueries.next());
- } else {
- removeNamedQuery_(namedQuery);
- }
- } else {
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update((NamedQueryAnnotation) resourceNamedQueries.next());
- } else {
- removeNamedQuery_(namedQuery);
- }
- }
+ HibernateNamedQuery hibernateNamedQuery = queries.next();
+ if (resourceNamedQueries.hasNext()) {
+ hibernateNamedQuery.update((HibernateNamedQueryAnnotation) resourceNamedQueries.next());
+ }
+ else {
+ removeHibernateNamedQuery_(hibernateNamedQuery);
+ }
}
while (resourceNamedQueries.hasNext()) {
- addNamedQuery(buildNamedQuery((NamedQueryAnnotation) resourceNamedQueries.next()));
+ addHibernateNamedQuery(buildHibernateNamedQuery((HibernateNamedQueryAnnotation) resourceNamedQueries.next()));
}
-
- while (hibernateNamedQueries.hasNext()) {
- addNamedQuery(buildHibernateNamedQuery((HibernateNamedQueryAnnotation) hibernateNamedQueries.next()));
- }
}
+
+ public HibernateNamedQuery addHibernateNamedQuery(int index) {
+ HibernateNamedQuery hibernateNamedQuery = getJpaFactory().buildHibernateNamedQuery(this);
+ this.hibernateNamedQueries.add(index, hibernateNamedQuery);
+ HibernateNamedQueryAnnotation hibernateNamedQueryAnnotation = (HibernateNamedQueryAnnotation) this.javaResourcePersistentType
+ .addSupportingAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
+ hibernateNamedQuery.initialize(hibernateNamedQueryAnnotation);
+ fireItemAdded(HIBERNATE_NAMED_QUERIES_LIST, index, hibernateNamedQuery);
+ return hibernateNamedQuery;
+ }
+
+ protected void addHibernateNamedQuery(int index, HibernateNamedQuery hibernateNamedQuery) {
+ addItemToList(index, hibernateNamedQuery, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
+ }
+
+ protected void addHibernateNamedQuery(HibernateNamedQuery hibernateNamedQuery) {
+ this.addHibernateNamedQuery(this.hibernateNamedQueries.size(), hibernateNamedQuery);
+ }
+
+ public void removeHibernateNamedQuery(HibernateNamedQuery hibernateNamedQuery) {
+ removeHibernateNamedQuery(this.hibernateNamedQueries.indexOf(hibernateNamedQuery));
+ }
+
+ public void removeHibernateNamedQuery(int index) {
+ HibernateNamedQuery removedHibernateNamedQuery = this.hibernateNamedQueries.remove(index);
+ this.javaResourcePersistentType.removeSupportingAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
+ fireItemRemoved(HIBERNATE_NAMED_QUERIES_LIST, index, removedHibernateNamedQuery);
+ }
+
+ protected void removeHibernateNamedQuery_(HibernateNamedQuery hibernateNamedQuery) {
+ removeItemFromList(hibernateNamedQuery, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
+ }
+
+ public void moveHibernateNamedQuery(int targetIndex, int sourceIndex) {
+ CollectionTools.move(this.hibernateNamedQueries, targetIndex, sourceIndex);
+ this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
+ fireItemMoved(HIBERNATE_NAMED_QUERIES_LIST, targetIndex, sourceIndex);
+ }
+ // ************************* validation ***********************
@Override
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
super.validate(messages, reporter, astRoot);
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaNamedQuery.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaNamedQuery.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaNamedQuery.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.jpt.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface HibernateJavaNamedQuery extends JavaNamedQuery {
-
-}
Copied: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java (from rev 16282, trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaNamedQuery.java)
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQuery.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import org.eclipse.jpt.core.context.java.JavaNamedQuery;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernateNamedQuery extends JavaNamedQuery {
+
+ String HIBERNATE_NAMED_QUERY="hibernateNamedQuery"; //$NON-NLS-1$
+ // **************** flushMode ***************************************************
+
+ FlushModeType getFlushMode();
+ FlushModeType getSpecifiedFlushMode();
+ String SPECIFIED_FLUSH_MODE_PROPERTY = "specifiedFlushMode"; //$NON-NLS-1$
+ FlushModeType getDefaultFlushMode();
+ String DEFAULT_FLUSH_MODE_PROPERTY = "defaultFlushMode"; //$NON-NLS-1$
+ FlushModeType DEFAULT_FLUSH_MODE_TYPE = FlushModeType.AUTO;
+
+ void setSpecifiedFlushMode(FlushModeType flushMode);
+
+ //************************ cacheMode *********************************
+
+ CacheModeType getCacheMode();
+ CacheModeType getSpecifiedCacheMode();
+ String SPECIFIED_CACHE_MODE_PROPERTY = "specifiedCacheMode"; //$NON-NLS-1$
+ CacheModeType getDefaultCacheMode();
+ String DEFAULT_CACHE_MODE_PROPERTY = "defaultCacheMode"; //$NON-NLS-1$
+ CacheModeType DEFAULT_CACHE_MODE_TYPE = CacheModeType.NORMAL;
+
+ void setSpecifiedCacheMode(CacheModeType cacheMode);
+
+ //************************ cacheable *********************************
+ boolean isCacheable();
+ Boolean getSpecifiedCacheable();
+ void setSpecifiedCacheable(Boolean value);
+ String SPECIFIED_CACHEABLE_PROPERTY = "specifiedCacheable"; //$NON-NLS-1$
+
+ boolean isDefaultCacheable();
+ boolean DEFAULT_CACHEABLE = false;
+ String DEFAULT_CACHEABLE_PROPERTY = "defaultCacheable"; //$NON-NLS-1$
+
+ //************************ cacheRegion *********************************
+ String getCacheRegion();
+ String getSpecifiedCacheRegion();
+ void setSpecifiedCacheRegion(String value);
+ String SPECIFIED_CACHE_REGION_PROPERTY = "specifiedCacheRegion"; //$NON-NLS-1$
+
+ String getDefaultCacheRegion();
+ String DEFAULT_CACHE_REGION = ""; //$NON-NLS-1$
+ String DEFAULT_CACHE_REGION_PROPERTY = "defaultCacheRegion"; //$NON-NLS-1$
+
+ //************************ fetchSize *********************************
+ int getFetchSize();
+
+ Integer getSpecifiedFetchSize();
+ void setSpecifiedFetchSize(Integer value);
+ String SPECIFIED_FETCH_SIZE_PROPERTY = "specifiedFetchSize"; //$NON-NLS-1$
+
+ int getDefaultFetchSize();
+ int DEFAULT_FETCH_SIZE = -1;
+ String DEFAULT_FETCH_SIZE_PROPERTY = "defaultFetchSize"; //$NON-NLS-1$
+
+ //************************ timeout *********************************
+ int getTimeout();
+
+ Integer getSpecifiedTimeout();
+ void setSpecifiedTimeout(Integer value);
+ String SPECIFIED_TIMEOUT_PROPERTY = "specifiedTimeout"; //$NON-NLS-1$
+
+ int getDefaultTimeout();
+ int DEFAULT_TIMEOUT = -1;
+ String DEFAULT_TIMEOUT_PROPERTY = "defaultTimeout"; //$NON-NLS-1$
+
+ //************************ comment *********************************
+ String getComment();
+ String getSpecifiedComment();
+ void setSpecifiedComment(String value);
+ String SPECIFIED_COMMENT_PROPERTY = "specifiedComment"; //$NON-NLS-1$
+
+ String getDefaultComment();
+ String DEFAULT_COMMENT = ""; //$NON-NLS-1$
+ String DEFAULT_COMMENT_PROPERTY = "defaultComment"; //$NON-NLS-1$
+
+ //************************ readOnly *********************************
+ boolean isReadOnly();
+ Boolean getSpecifiedReadOnly();
+ void setSpecifiedReadOnly(Boolean value);
+ String SPECIFIED_READ_ONLY_PROPERTY = "specifiedReadOnly"; //$NON-NLS-1$
+
+ boolean isDefaultReadOnly();
+ boolean DEFAULT_READ_ONLY = false;
+ String DEFAULT_READ_ONLY_PROPERTY = "defaultReadOnly"; //$NON-NLS-1$
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryAnnotation.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryAnnotation.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -10,12 +10,89 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
/**
* @author Dmitry Geraskov
*
*/
public interface HibernateNamedQueryAnnotation extends NestableNamedQueryAnnotation {
+
+ //replace with Hibernate annotation
+ String ANNOTATION_NAME = Hibernate.NAMED_QUERY;
+
+ //************************ flushMode *********************************
+
+ /**
+ * Corresponds to the 'flushMode' element of the *NamedQuery annotation.
+ * Return null if the element does not exist in Java.
+ */
+ FlushModeType getFlushMode();
+ String FLUSH_MODE_PROPERTY = "flushMode"; //$NON-NLS-1$
+ /**
+ * Corresponds to the 'flushMode' element of the *NamedQuery annotation.
+ * Set to null to remove the element.
+ */
+ void setFlushMode(FlushModeType flushMode);
+
+ /**
+ * Return the {@link TextRange} for the 'flushMode' element. If element
+ * does not exist return the {@link TextRange} for the *NamedQuery annotation.
+ */
+ TextRange getFlushModeTextRange(CompilationUnit astRoot);
+
+ //************************ cacheMode *********************************
+
+ /**
+ * Corresponds to the 'cacheMode' element of the *NamedQuery annotation.
+ * Return null if the element does not exist in Java.
+ */
+ CacheModeType getCacheMode();
+ String CACHE_MODE_PROPERTY = "cacheMode"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'cacheMode' element of the *NamedQuery annotation.
+ * Set to null to remove the element.
+ */
+ void setCacheMode(CacheModeType cacheMode);
+
+ /**
+ * Return the {@link TextRange} for the 'cacheMode' element. If element
+ * does not exist return the {@link TextRange} for the *NamedQuery annotation.
+ */
+ TextRange getCacheModeTextRange(CompilationUnit astRoot);
+
+ //************************ cacheable *********************************
+ Boolean isCacheable();
+ void setCacheable(Boolean value);
+ String CACHEABLE_PROPERTY = "cacheable"; //$NON-NLS-1$
+
+ //************************ cacheRegion *********************************
+ String getCacheRegion();
+ void setCacheRegion(String value);
+ String CACHE_REGION_PROPERTY = "cacheRegion"; //$NON-NLS-1$
+
+ //************************ fetchSize *********************************
+ Integer getFetchSize();
+ void setFetchSize(Integer value);
+ String FETCH_SIZE_PROPERTY = "fetchSize"; //$NON-NLS-1$
+
+ //************************ timeout *********************************
+ Integer getTimeout();
+ void setTimeout(Integer value);
+ String TIMEOUT_PROPERTY = "timeout"; //$NON-NLS-1$
+
+ //************************ comment *********************************
+ String getComment();
+ void setComment(String value);
+ String COMMENT_PROPERTY = "comment"; //$NON-NLS-1$
+
+ //************************ readOnly *********************************
+ Boolean isReadOnly();
+ void setReadOnly(Boolean value);
+ String READ_ONLY_PROPERTY = "readOnly"; //$NON-NLS-1$
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateQueryContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateQueryContainer.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateQueryContainer.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import java.util.ListIterator;
+
+import org.eclipse.jpt.core.context.QueryContainer;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernateQueryContainer extends QueryContainer {
+
+ String HIBERNATE_NAMED_QUERIES_LIST = "hibernateNamedQueries"; //$NON-NLS-1$
+ // ********** named queries **********
+
+ /**
+ * Return a list iterator of the named queries.
+ * This will not be null.
+ */
+ <T extends HibernateNamedQuery> ListIterator<T> hibernateNamedQueries();
+
+ /**
+ * Return the number of named queries.
+ */
+ int hibernateNamedQueriesSize();
+
+ /**
+ * Add a named query to the entity return the object representing it.
+ */
+ HibernateNamedQuery addHibernateNamedQuery(int index);
+
+ /**
+ * Remove the named query at the index from the entity.
+ */
+ void removeHibernateNamedQuery(int index);
+
+ /**
+ * Remove the named query at from the entity.
+ */
+ void removeHibernateNamedQuery(HibernateNamedQuery namedQuery);
+
+ /**
+ * Move the named query from the source index to the target index.
+ */
+ void moveHibernateNamedQuery(int targetIndex, int sourceIndex);
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateQueryContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateSourceNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateSourceNamedQueryAnnotation.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateSourceNamedQueryAnnotation.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -11,17 +11,17 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
import java.util.ListIterator;
-import java.util.Vector;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.BaseNamedQueryAnnotation;
import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.resource.java.NestableQueryHintAnnotation;
import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
@@ -31,9 +31,9 @@
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
+import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
/**
@@ -41,43 +41,99 @@
*
*/
public class HibernateSourceNamedQueryAnnotation extends SourceAnnotation<Member>
- implements BaseNamedQueryAnnotation, HibernateNamedQueryAnnotation {
-
- public static String ANNOTATION_NAME = Hibernate.NAMED_QUERY;
+ implements HibernateNamedQueryAnnotation {
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
+ public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
- final AnnotationElementAdapter<String> queryAdapter;
- String query;
+ private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
+ private final AnnotationElementAdapter<String> nameAdapter;
+ private String name;
- //FIXME: can't have hints
- final Vector<NestableQueryHintAnnotation> hints = new Vector<NestableQueryHintAnnotation>();
- //final HintsAnnotationContainer hintsContainer = new HintsAnnotationContainer();
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
+ private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
+ private final AnnotationElementAdapter<String> queryAdapter;
+ private String query;
+
+ private final DeclarationAnnotationElementAdapter<String> flushModeDeclarationAdapter;
+ private final AnnotationElementAdapter<String> flushModeAdapter;
+ private FlushModeType flushMode;
+
+ private final DeclarationAnnotationElementAdapter<String> cacheModeDeclarationAdapter;
+ private final AnnotationElementAdapter<String> cacheModeAdapter;
+ private CacheModeType cacheMode;
+
+ private final DeclarationAnnotationElementAdapter<Boolean> cacheableDeclarationAdapter;
+ private final AnnotationElementAdapter<Boolean> cacheableAdapter;
+ private Boolean cacheable;
+
+ private final DeclarationAnnotationElementAdapter<String> cacheRegionDeclarationAdapter;
+ private final AnnotationElementAdapter<String> cacheRegionAdapter;
+ private String cacheRegion;
+
+ private final DeclarationAnnotationElementAdapter<Integer> fetchSizeDeclarationAdapter;
+ private final AnnotationElementAdapter<Integer> fetchSizeAdapter;
+ private Integer fetchSize;
+
+ private final DeclarationAnnotationElementAdapter<Integer> timeoutDeclarationAdapter;
+ private final AnnotationElementAdapter<Integer> timeoutAdapter;
+ private Integer timeout;
+
+ private final DeclarationAnnotationElementAdapter<String> commentDeclarationAdapter;
+ private final AnnotationElementAdapter<String> commentAdapter;
+ private String comment;
+
+ private final DeclarationAnnotationElementAdapter<Boolean> readOnlyDeclarationAdapter;
+ private final AnnotationElementAdapter<Boolean> readOnlyAdapter;
+ private Boolean readOnly;
+
HibernateSourceNamedQueryAnnotation(JavaResourceNode parent, Member member,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
super(parent, member, daa, annotationAdapter);
this.nameDeclarationAdapter = this.buildNameAdapter(daa);
+ this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
this.queryDeclarationAdapter = this.buildQueryAdapter(daa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
+ this.flushModeDeclarationAdapter = this.buildFlushModeAdapter(daa);
+ this.flushModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, flushModeDeclarationAdapter);
+ this.cacheModeDeclarationAdapter = this.buildCacheModeAdapter(daa);
+ this.cacheModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, cacheModeDeclarationAdapter);
+ this.cacheableDeclarationAdapter = this.buildCacheableAdapter(daa);
+ this.cacheableAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(member, cacheableDeclarationAdapter);
+ this.cacheRegionDeclarationAdapter = this.buildCacheRegionAdapter(daa);
+ this.cacheRegionAdapter = this.buildAdapter(this.cacheRegionDeclarationAdapter);
+ this.fetchSizeDeclarationAdapter = this.buildFetchSizeAdapter(daa);
+ this.fetchSizeAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(member, fetchSizeDeclarationAdapter);
+ this.timeoutDeclarationAdapter = this.buildTimeoutAdapter(daa);
+ this.timeoutAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(member, timeoutDeclarationAdapter);
+ this.commentDeclarationAdapter = this.buildCommentAdapter(daa);
+ this.commentAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, commentDeclarationAdapter);
+ this.readOnlyDeclarationAdapter = this.buildReadOnlyAdapter(daa);
+ this.readOnlyAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(member, readOnlyDeclarationAdapter);
}
public void initialize(CompilationUnit astRoot) {
this.name = this.buildName(astRoot);
this.query = this.buildQuery(astRoot);
- //AnnotationContainerTools.initialize(this.hintsContainer, astRoot);
+ this.flushMode = this.buildFlushMode(astRoot);
+ this.cacheMode = this.buildCacheMode(astRoot);
+ this.cacheable = this.buildCacheable(astRoot);
+ this.cacheRegion = this.buildCacheRegion(astRoot);
+ this.fetchSize = this.buildFetchSize(astRoot);
+ this.timeout = this.buildTimeout(astRoot);
+ this.comment = this.buildComment(astRoot);
+ this.readOnly = this.buildReadOnly(astRoot);
}
public void update(CompilationUnit astRoot) {
this.setName(this.buildName(astRoot));
this.setQuery(this.buildQuery(astRoot));
- //AnnotationContainerTools.update(this.hintsContainer, astRoot);
- }
+ this.setFlushMode(this.buildFlushMode(astRoot));
+ this.setCacheMode(this.buildCacheMode(astRoot));
+ this.setCacheable(this.buildCacheable(astRoot));
+ this.setCacheRegion(this.buildCacheRegion(astRoot));
+ this.setFetchSize(this.buildFetchSize(astRoot));
+ this.setTimeout(this.buildTimeout(astRoot));
+ this.setComment(this.buildComment(astRoot));
+ this.setReadOnly(this.buildReadOnly(astRoot));
+ }
public String getAnnotationName() {
return ANNOTATION_NAME;
@@ -90,12 +146,6 @@
return new ShortCircuitAnnotationElementAdapter<String>(this.member, daea);
}
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
// ********** BaseNamedQueryAnnotation implementation **********
// ***** name
@@ -119,16 +169,8 @@
public TextRange getNameTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
+ }
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, this.getNameElementName());
- }
-
- String getNameElementName() {
- return Hibernate.NAMED_QUERY__NAME;
- }
-
// ***** query
public String getQuery() {
return this.query;
@@ -152,71 +194,200 @@
return this.getElementTextRange(this.queryDeclarationAdapter, astRoot);
}
- private DeclarationAnnotationElementAdapter<String> buildQueryAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, this.getQueryElementName());
- }
-
String getQueryElementName() {
return Hibernate.NAMED_QUERY__QUERY;
}
-
+
// ***** hints
public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
+ return EmptyListIterator.instance();
}
ListIterator<NestableQueryHintAnnotation> nestableHints() {
- return new CloneListIterator<NestableQueryHintAnnotation>(this.hints);
+ return EmptyListIterator.instance();
}
public int hintsSize() {
- return this.hints.size();
+ return 0;
}
public NestableQueryHintAnnotation hintAt(int index) {
- return this.hints.get(index);
+ throw new UnsupportedOperationException();
}
public int indexOfHint(QueryHintAnnotation queryHint) {
- return this.hints.indexOf(queryHint);
+ return -1;
}
public NestableQueryHintAnnotation addHint(int index) {
return null;
}
- NestableQueryHintAnnotation addHintInternal() {
- return null;
+ public void moveHint(int targetIndex, int sourceIndex) {
+ //AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
}
- void hintAdded(int index, NestableQueryHintAnnotation hint) {
- this.fireItemAdded(HINTS_LIST, index, hint);
+ public void removeHint(int index) {
+ //AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
}
- public void moveHint(int targetIndex, int sourceIndex) {
- //AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
+ // ******************** HibernateNamedQueryAnnotation implementation *************
+ // ***** flushMode
+
+ public FlushModeType getFlushMode() {
+ return flushMode;
}
- NestableQueryHintAnnotation moveHintInternal(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.hints, targetIndex, sourceIndex).get(targetIndex);
+ public void setFlushMode(FlushModeType flushMode) {
+ if (this.attributeValueHasNotChanged(this.flushMode, flushMode)) {
+ return;
+ }
+ FlushModeType old = this.flushMode;
+ this.flushMode = flushMode;
+ this.flushModeAdapter.setValue(FlushModeType.toJavaAnnotationValue(flushMode));
+ this.firePropertyChanged(FLUSH_MODE_PROPERTY, old, flushMode);
}
- void hintMoved(int targetIndex, int sourceIndex) {
- this.fireItemMoved(HINTS_LIST, targetIndex, sourceIndex);
+ private FlushModeType buildFlushMode(CompilationUnit astRoot) {
+ return FlushModeType.fromJavaAnnotationValue(this.flushModeAdapter.getValue(astRoot));
}
- public void removeHint(int index) {
- //AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
+ public TextRange getFlushModeTextRange(CompilationUnit astRoot) {
+ return this.getElementTextRange(flushModeDeclarationAdapter, astRoot);
}
- NestableQueryHintAnnotation removeHintInternal(int index) {
- return this.hints.remove(index);
+ // ***** caheMode
+
+ public CacheModeType getCacheMode() {
+ return cacheMode;
}
- void hintRemoved(int index, NestableQueryHintAnnotation hint) {
- this.fireItemRemoved(HINTS_LIST, index, hint);
+ public void setCacheMode(CacheModeType cacheMode) {
+ if (this.attributeValueHasNotChanged(this.cacheMode, cacheMode)) {
+ return;
+ }
+ CacheModeType old = this.cacheMode;
+ this.cacheMode = cacheMode;
+ this.cacheModeAdapter.setValue(CacheModeType.toJavaAnnotationValue(cacheMode));
+ this.firePropertyChanged(CACHE_MODE_PROPERTY, old, cacheMode);
}
+
+ private CacheModeType buildCacheMode(CompilationUnit astRoot) {
+ return CacheModeType.fromJavaAnnotationValue(this.cacheModeAdapter.getValue(astRoot));
+ }
+ public TextRange getCacheModeTextRange(CompilationUnit astRoot) {
+ return this.getElementTextRange(cacheModeDeclarationAdapter, astRoot);
+ }
+
+ //************************ cacheable *********************************
+ public Boolean isCacheable(){
+ return this.cacheable;
+ }
+
+ public void setCacheable(Boolean cacheable){
+ if (this.attributeValueHasNotChanged(this.cacheable, cacheable)) {
+ return;
+ }
+ Boolean old = this.cacheable;
+ this.cacheable = cacheable;
+ this.cacheableAdapter.setValue(cacheable);
+ this.firePropertyChanged(CACHEABLE_PROPERTY, old, cacheable);
+ }
+
+ private Boolean buildCacheable(CompilationUnit astRoot) {
+ return this.cacheableAdapter.getValue(astRoot);
+ }
+
+ //************************ cacheRegion *********************************
+ public String getCacheRegion(){
+ return this.cacheRegion;
+ }
+
+ public void setCacheRegion(String cacheRegion){
+ if (this.attributeValueHasNotChanged(this.cacheRegion, cacheRegion)) {
+ return;
+ }
+ String old = this.cacheRegion;
+ this.cacheRegion = cacheRegion;
+ this.cacheRegionAdapter.setValue(cacheRegion);
+ this.firePropertyChanged(CACHE_REGION_PROPERTY, old, cacheRegion);
+ }
+
+ private String buildCacheRegion(CompilationUnit astRoot) {
+ return this.cacheRegionAdapter.getValue(astRoot);
+ }
+ //************************ fetchSize *********************************
+ public Integer getFetchSize(){
+ return this.fetchSize;
+ }
+
+ public void setFetchSize(Integer fetchSize){
+ if (this.attributeValueHasNotChanged(this.fetchSize, fetchSize)) {
+ return;
+ }
+ Integer old = this.fetchSize;
+ this.fetchSize = fetchSize;
+ this.fetchSizeAdapter.setValue(fetchSize);
+ this.firePropertyChanged(FETCH_SIZE_PROPERTY, old, fetchSize);
+ }
+
+ private Integer buildFetchSize(CompilationUnit astRoot) {
+ return this.fetchSizeAdapter.getValue(astRoot);
+ }
+ //************************ timeout *********************************
+ public Integer getTimeout(){
+ return this.timeout;
+ }
+ public void setTimeout(Integer timeout){
+ if (this.attributeValueHasNotChanged(this.timeout, timeout)) {
+ return;
+ }
+ Integer old = this.timeout;
+ this.timeout = timeout;
+ this.timeoutAdapter.setValue(timeout);
+ this.firePropertyChanged(TIMEOUT_PROPERTY, old, timeout);
+ }
+
+ private Integer buildTimeout(CompilationUnit astRoot) {
+ return this.timeoutAdapter.getValue(astRoot);
+ }
+ //************************ comment *********************************
+ public String getComment(){
+ return this.comment;
+ }
+
+ public void setComment(String comment){
+ if (this.attributeValueHasNotChanged(this.comment, comment)) {
+ return;
+ }
+ String old = this.comment;
+ this.comment = comment;
+ this.commentAdapter.setValue(comment);
+ this.firePropertyChanged(COMMENT_PROPERTY, old, comment);
+ }
+
+ private String buildComment(CompilationUnit astRoot) {
+ return this.commentAdapter.getValue(astRoot);
+ }
+ //************************ readOnly *********************************
+ public Boolean isReadOnly(){
+ return this.readOnly;
+ }
+
+ public void setReadOnly(Boolean readOnly){
+ if (this.attributeValueHasNotChanged(this.readOnly, readOnly)) {
+ return;
+ }
+ Boolean old = this.readOnly;
+ this.readOnly = readOnly;
+ this.readOnlyAdapter.setValue(readOnly);
+ this.firePropertyChanged(READ_ONLY_PROPERTY, old, readOnly);
+ }
+
+ private Boolean buildReadOnly(CompilationUnit astRoot) {
+ return this.readOnlyAdapter.getValue(astRoot);
+ }
// ********** NestableAnnotation implementation **********
/**
@@ -224,13 +395,17 @@
* for subclasses
*/
public void initializeFrom(NestableAnnotation oldAnnotation) {
- BaseNamedQueryAnnotation oldQuery = (BaseNamedQueryAnnotation) oldAnnotation;
+ HibernateSourceNamedQueryAnnotation oldQuery = (HibernateSourceNamedQueryAnnotation) oldAnnotation;
this.setName(oldQuery.getName());
this.setQuery(oldQuery.getQuery());
- for (QueryHintAnnotation oldQueryHint : CollectionTools.iterable(oldQuery.hints())) {
- NestableQueryHintAnnotation newQueryHint = this.addHint(oldQuery.indexOfHint(oldQueryHint));
- newQueryHint.initializeFrom((NestableQueryHintAnnotation) oldQueryHint);
- }
+ this.setFlushMode(oldQuery.getFlushMode());
+ this.setCacheMode(oldQuery.getCacheMode());
+ this.setCacheable(oldQuery.isCacheable());
+ this.setComment(oldQuery.getComment());
+ this.setFetchSize(oldQuery.getFetchSize());
+ this.setTimeout(oldQuery.getTimeout());
+ this.setCacheRegion(oldQuery.getCacheRegion());
+ this.setReadOnly(oldQuery.isReadOnly());
}
/**
@@ -245,7 +420,69 @@
return (IndexedAnnotationAdapter) this.annotationAdapter;
}
- public static NamedQueryAnnotation createNamedQuery(JavaResourceNode parent, Member member) {
+ public static HibernateNamedQueryAnnotation createNamedQuery(JavaResourceNode parent, Member member) {
return new HibernateSourceNamedQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
}
+
+ protected DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, Hibernate.NAMED_QUERY__NAME);
+ }
+
+ protected DeclarationAnnotationElementAdapter<String> buildQueryAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, Hibernate.NAMED_QUERY__QUERY);
+ }
+
+ protected DeclarationAnnotationElementAdapter<String> buildFlushModeAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return new EnumDeclarationAnnotationElementAdapter(daAdapter, Hibernate.NAMED_QUERY__FLUSH_MODE);
+ }
+
+ protected DeclarationAnnotationElementAdapter<String> buildCacheModeAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return new EnumDeclarationAnnotationElementAdapter(daAdapter, Hibernate.NAMED_QUERY__CACHE_MODE);
+ }
+
+ protected DeclarationAnnotationElementAdapter<Boolean> buildCacheableAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return ConversionDeclarationAnnotationElementAdapter.forBooleans(daAdapter, Hibernate.NAMED_QUERY__CACHEABLE);
+ }
+
+ protected DeclarationAnnotationElementAdapter<String> buildCacheRegionAdapter(DeclarationAnnotationAdapter daAdapter){
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, Hibernate.NAMED_QUERY__CACHE_REGION);
+ }
+
+ protected DeclarationAnnotationElementAdapter<Integer> buildFetchSizeAdapter(DeclarationAnnotationAdapter daAdapter){
+ return ConversionDeclarationAnnotationElementAdapter.forNumbers(daAdapter, Hibernate.NAMED_QUERY__FETCH_SIZE);
+ }
+
+ protected DeclarationAnnotationElementAdapter<Integer> buildTimeoutAdapter(DeclarationAnnotationAdapter daAdapter){
+ return ConversionDeclarationAnnotationElementAdapter.forNumbers(daAdapter, Hibernate.NAMED_QUERY__TIMEOUT);
+ }
+
+ protected DeclarationAnnotationElementAdapter<String> buildCommentAdapter(DeclarationAnnotationAdapter daAdapter){
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, Hibernate.NAMED_QUERY__COMMENT);
+ }
+
+ protected DeclarationAnnotationElementAdapter<Boolean> buildReadOnlyAdapter(DeclarationAnnotationAdapter daAdapter) {
+ return ConversionDeclarationAnnotationElementAdapter.forBooleans(daAdapter, Hibernate.NAMED_QUERY__READ_ONLY);
+ }
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.name);
+ }
+
+ // ********** static methods **********
+
+ public static HibernateSourceNamedQueryAnnotation createHibernateNamedQuery(JavaResourceNode parent, Member member) {
+ return new HibernateSourceNamedQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
+ }
+
+ public static HibernateSourceNamedQueryAnnotation createNestedHibernateNamedQuery(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
+ IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
+ IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
+ return new HibernateSourceNamedQueryAnnotation(parent, member, idaa, annotationAdapter);
+ }
+
+ private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateNamedQueriesAdapter) {
+ return new NestedIndexedDeclarationAnnotationAdapter(hibernateNamedQueriesAdapter, index, Hibernate.NAMED_QUERY);
+ }
+
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQueryAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernateNamedQueriesAnnotation extends
+ ContainerAnnotation<HibernateNamedQueryAnnotation> {
+
+ String ANNOTATION_NAME = Hibernate.NAMED_QUERIES;
+
+ String HIBERNATE_NAMED_QUERIES_LIST = "hibernateNamedQueries"; //$NON-NLS-1$
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.core.utility.jdt.Member;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateNamedQueriesAnnotationDefinition implements AnnotationDefinition {
+
+ // singleton
+ private static final AnnotationDefinition INSTANCE = new HibernateNamedQueriesAnnotationDefinition();
+
+ /**
+ * Return the singleton.
+ */
+ public static AnnotationDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private HibernateNamedQueriesAnnotationDefinition() {
+ super();
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
+ return new HibernateSourceNamedQueriesAnnotation(parent, member);
+ }
+
+ public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getAnnotationName() {
+ return HibernateNamedQueriesAnnotation.ANNOTATION_NAME;
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import java.util.ListIterator;
+import java.util.Vector;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
+import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
+import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.Member;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQueryAnnotation;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateSourceNamedQueryAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateSourceNamedQueriesAnnotation extends SourceAnnotation<Member>
+implements HibernateNamedQueriesAnnotation {
+
+ public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+
+ private final Vector<HibernateNamedQueryAnnotation> hibernateNamedQueries = new Vector<HibernateNamedQueryAnnotation>();
+
+
+ public HibernateSourceNamedQueriesAnnotation(JavaResourceNode parent, Member member) {
+ super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
+ }
+
+ public String getAnnotationName() {
+ return ANNOTATION_NAME;
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ AnnotationContainerTools.initialize(this, astRoot);
+ }
+
+ public void update(CompilationUnit astRoot) {
+ AnnotationContainerTools.update(this, astRoot);
+ }
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.hibernateNamedQueries);
+ }
+
+ // ********** AnnotationContainer implementation **********
+
+ public String getContainerAnnotationName() {
+ return this.getAnnotationName();
+ }
+
+ public org.eclipse.jdt.core.dom.Annotation getContainerJdtAnnotation(CompilationUnit astRoot) {
+ return this.getJdtAnnotation(astRoot);
+ }
+
+ public String getElementName() {
+ return Hibernate.NAMED_QUERIES__VALUE;
+ }
+
+ public String getNestableAnnotationName() {
+ return HibernateNamedQueryAnnotation.ANNOTATION_NAME;
+ }
+
+ public ListIterator<HibernateNamedQueryAnnotation> nestedAnnotations() {
+ return new CloneListIterator<HibernateNamedQueryAnnotation>(this.hibernateNamedQueries);
+ }
+
+ public int nestedAnnotationsSize() {
+ return this.hibernateNamedQueries.size();
+ }
+
+ public HibernateNamedQueryAnnotation addNestedAnnotationInternal() {
+ HibernateNamedQueryAnnotation namedQuery = this.buildHibernateNamedQuery(this.hibernateNamedQueries.size());
+ this.hibernateNamedQueries.add(namedQuery);
+ return namedQuery;
+ }
+
+ private HibernateNamedQueryAnnotation buildHibernateNamedQuery(int index) {
+ return HibernateSourceNamedQueryAnnotation.createNestedHibernateNamedQuery(this, member, index, this.daa);
+ }
+
+ public void nestedAnnotationAdded(int index, HibernateNamedQueryAnnotation nestedAnnotation) {
+ this.fireItemAdded(HIBERNATE_NAMED_QUERIES_LIST, index, nestedAnnotation);
+ }
+
+ public HibernateNamedQueryAnnotation moveNestedAnnotationInternal(int targetIndex, int sourceIndex) {
+ return CollectionTools.move(this.hibernateNamedQueries, targetIndex, sourceIndex).get(targetIndex);
+ }
+
+ public void nestedAnnotationMoved(int targetIndex, int sourceIndex) {
+ this.fireItemMoved(HIBERNATE_NAMED_QUERIES_LIST, targetIndex, sourceIndex);
+ }
+
+ public HibernateNamedQueryAnnotation removeNestedAnnotationInternal(int index) {
+ return this.hibernateNamedQueries.remove(index);
+ }
+
+ public void nestedAnnotationRemoved(int index, HibernateNamedQueryAnnotation nestedAnnotation) {
+ this.fireItemRemoved(HIBERNATE_NAMED_QUERIES_LIST, index, nestedAnnotation);
+ }
+
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/java/details/HibernateJavaEntityComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/java/details/HibernateJavaEntityComposite.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/java/details/HibernateJavaEntityComposite.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -17,6 +17,7 @@
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.HibernateGeneratorsComposite;
+import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.HibernateQueriesComposite;
/**
* @author Dmitry Geraskov
@@ -35,6 +36,16 @@
}
@Override
+ protected void initializeQueriesPane(Composite container) {
+ container = addCollapsableSection(
+ container,
+ JptUiMappingsMessages.EntityComposite_queries
+ );
+
+ new HibernateQueriesComposite(this, container);
+ }
+
+ @Override
protected void initializeGeneratorsPane(Composite container) {
container = addCollapsableSection(
container,
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,292 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.mapping.details;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jpt.core.context.Query;
+import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
+import org.eclipse.jpt.ui.internal.widgets.DialogPane;
+import org.eclipse.jpt.ui.internal.widgets.ValidatingDialog;
+import org.eclipse.jpt.utility.internal.StringConverter;
+import org.eclipse.jpt.utility.internal.StringTools;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
+import org.eclipse.jpt.utility.internal.node.AbstractNode;
+import org.eclipse.jpt.utility.internal.node.Node;
+import org.eclipse.jpt.utility.internal.node.Problem;
+import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQuery;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateAddQueryDialog extends ValidatingDialog<AddQueryStateObject> {
+
+ // ********** constructors **********
+
+ /**
+ * Use this constructor to edit an existing conversion value
+ */
+ public HibernateAddQueryDialog(Shell parent) {
+ super(parent);
+ }
+
+ @Override
+ protected AddQueryStateObject buildStateObject() {
+ return new AddQueryStateObject();
+ }
+
+ // ********** open **********
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(this.getTitle());
+ }
+
+ @Override
+ protected String getTitle() {
+ return JptUiMappingsMessages.AddQueryDialog_title;
+ }
+
+ @Override
+ protected String getDescriptionTitle() {
+ return JptUiMappingsMessages.AddQueryDialog_descriptionTitle;
+ }
+
+ @Override
+ protected String getDescription() {
+ return JptUiMappingsMessages.AddQueryDialog_description;
+ }
+
+ @Override
+ protected DialogPane<AddQueryStateObject> buildLayout(Composite container) {
+ return new QueryDialogPane(container);
+ }
+
+ @Override
+ public void create() {
+ super.create();
+
+ QueryDialogPane pane = (QueryDialogPane) getPane();
+ pane.selectAll();
+
+ getButton(OK).setEnabled(false);
+ }
+
+
+ // ********** public API **********
+
+ /**
+ * Return the data value set in the text widget.
+ */
+ public String getName() {
+ return getSubject().getName();
+ }
+
+ /**
+ * Return the object value set in the text widget.
+ */
+ public String getQueryType() {
+ return getSubject().getQueryType();
+ }
+
+ private class QueryDialogPane extends DialogPane<AddQueryStateObject> {
+
+ private Text nameText;
+
+ QueryDialogPane(Composite parent) {
+ super(HibernateAddQueryDialog.this.getSubjectHolder(), parent);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ this.nameText = addLabeledText(
+ container,
+ JptUiMappingsMessages.AddQueryDialog_name,
+ buildNameHolder()
+ );
+
+ addLabeledCombo(
+ container,
+ JptUiMappingsMessages.AddQueryDialog_queryType,
+ buildQueryTypeListHolder(),
+ buildQueryTypeHolder(),
+ buildStringConverter(),
+ null);
+ }
+
+ protected ListValueModel<String> buildQueryTypeListHolder() {
+ List<String> queryTypes = new ArrayList<String>();
+ queryTypes.add(Query.NAMED_QUERY);
+ queryTypes.add(Query.NAMED_NATIVE_QUERY);
+ queryTypes.add(HibernateNamedQuery.HIBERNATE_NAMED_QUERY);
+
+ return new StaticListValueModel<String>(queryTypes);
+ }
+
+ private StringConverter<String> buildStringConverter() {
+ return new StringConverter<String>() {
+ public String convertToString(String value) {
+ if (value == Query.NAMED_QUERY) {
+ return JptUiMappingsMessages.AddQueryDialog_namedQuery;
+ }
+ if (value == Query.NAMED_NATIVE_QUERY) {
+ return JptUiMappingsMessages.AddQueryDialog_namedNativeQuery;
+ }
+ if (value == HibernateNamedQuery.HIBERNATE_NAMED_QUERY) {
+ return HibernateUIMappingMessages.HibernateAddQueryDialog_hibernateNamedQuery;
+ }
+ return value;
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildNameHolder() {
+ return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.NAME_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getName();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ this.subject.setName(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildQueryTypeHolder() {
+ return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.QUERY_TYPE_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getQueryType();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ this.subject.setQueryType(value);
+ }
+ };
+ }
+
+ void selectAll() {
+ this.nameText.selectAll();
+ }
+ }
+}
+
+final class AddQueryStateObject extends AbstractNode
+{
+ /**
+ * The initial name or <code>null</code>
+ */
+ private String name;
+
+ /**
+ * The initial queryType or <code>null</code>
+ */
+ private String queryType;
+
+ /**
+ * The <code>Validator</code> used to validate this state object.
+ */
+ private Validator validator;
+
+ /**
+ * Notifies a change in the data value property.
+ */
+ static final String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
+
+ /**
+ * Notifies a change in the query type property.
+ */
+ static final String QUERY_TYPE_PROPERTY = "queryTypeProperty"; //$NON-NLS-1$
+
+ /**
+ * Creates a new <code>NewNameStateObject</code>.
+ *
+ * @param name The initial input or <code>null</code> if no initial value can
+ * be specified
+ * @param names The collection of names that can't be used or an empty
+ * collection if none are available
+ */
+ AddQueryStateObject() {
+ super(null);
+
+ }
+
+ private void addNameProblemsTo(List<Problem> currentProblems) {
+ if (StringTools.stringIsEmpty(this.name)) {
+ currentProblems.add(buildProblem(JptUiMappingsMessages.QueryStateObject_nameMustBeSpecified));
+ }
+ }
+
+ private void addQueryTypeProblemsTo(List<Problem> currentProblems) {
+ if (StringTools.stringIsEmpty(this.queryType)) {
+ currentProblems.add(buildProblem(JptUiMappingsMessages.QueryStateObject_typeMustBeSpecified));
+ }
+ }
+
+ @Override
+ protected void addProblemsTo(List<Problem> currentProblems) {
+ super.addProblemsTo(currentProblems);
+ addNameProblemsTo(currentProblems);
+ addQueryTypeProblemsTo(currentProblems);
+ }
+
+ @Override
+ protected void checkParent(Node parentNode) {
+ //no parent
+ }
+
+ public String displayString() {
+ return null;
+ }
+
+ String getName() {
+ return this.name;
+ }
+
+ String getQueryType() {
+ return this.queryType;
+ }
+
+ public void setName(String newName) {
+ String oldName = this.name;
+ this.name = newName;
+ firePropertyChanged(NAME_PROPERTY, oldName, newName);
+ }
+
+ public void setQueryType(String newQueryType) {
+ String old = this.queryType;
+ this.queryType = newQueryType;
+ firePropertyChanged(QUERY_TYPE_PROPERTY, old, newQueryType);
+ }
+
+ @Override
+ public void setValidator(Validator validator) {
+ this.validator = validator;
+ }
+
+ @Override
+ public Validator getValidator() {
+ return this.validator;
+ }
+}
+
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedQueryPropertyComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedQueryPropertyComposite.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedQueryPropertyComposite.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,490 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.mapping.details;
+
+import java.util.Collection;
+
+import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
+import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
+import org.eclipse.jpt.ui.internal.util.LabeledControlUpdater;
+import org.eclipse.jpt.ui.internal.util.LabeledLabel;
+import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.CacheModeType;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.FlushModeType;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQuery;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateNamedQueryPropertyComposite extends Pane<HibernateNamedQuery> {
+
+ /**
+ * Creates a new <code>HibernateNamedQueryPropertyComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of this pane's subject
+ * @param parent The parent container
+ */
+ public HibernateNamedQueryPropertyComposite(Pane<?> parentPane,
+ PropertyValueModel<? extends HibernateNamedQuery> subjectHolder,
+ Composite parent) {
+
+ super(parentPane, subjectHolder, parent);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ addLabeledText(
+ container,
+ JptUiMappingsMessages.NamedQueryComposite_nameTextLabel,
+ buildNameTextHolder());
+
+ // Query text area
+ addLabeledMultiLineText(
+ container,
+ JptUiMappingsMessages.NamedQueryPropertyComposite_query,
+ buildQueryHolder(),
+ 4,
+ null
+ );
+
+ // ReadOnly tri-state check box
+ addTriStateCheckBoxWithDefault(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_readOnly,
+ buildReadOnlyHolder(),
+ buildReadOnlyStringHolder(),
+ null//TODO help
+ );
+
+ //Flush Mode combobox
+ addLabeledComposite(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_flushMode,
+ addFlushModeTypeCombo(container),
+ null//TODO help
+ );
+
+ // Cacheable tri-state check box
+ addTriStateCheckBoxWithDefault(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_cacheable,
+ buildCacheableHolder(),
+ buildCacheableStringHolder(),
+ null//TODO help
+ );
+
+ //Cache Mode combobox
+ addLabeledComposite(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_cacheMode,
+ addCacheModeTypeCombo(container),
+ null//TODO help
+ );
+
+ addLabeledText(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_cacheRegion,
+ buildCacheRegionTextHolder());
+
+ // Fetch size widgets
+ Spinner fetchSizeSpinner = addLabeledSpinner(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_fetchSize,
+ buildFetchSizeHolder(),
+ -1,
+ -1,
+ Integer.MAX_VALUE,
+ addDefaultFetchSizeLabel(container),
+ JpaHelpContextIds.MAPPING_COLUMN_LENGTH
+ );
+
+ updateGridData(container, fetchSizeSpinner);
+
+ // Timeout size widgets
+ Spinner timeoutSpinner = addLabeledSpinner(
+ container,
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_timeout,
+ buildTimeoutHolder(),
+ -1,
+ -1,
+ Integer.MAX_VALUE,
+ addDefaultFetchSizeLabel(container),
+ JpaHelpContextIds.MAPPING_COLUMN_LENGTH
+ );
+
+ updateGridData(container, timeoutSpinner);
+
+ }
+
+ private Control addDefaultFetchSizeLabel(Composite container) {
+
+ Label label = addLabel(
+ container,
+ JptUiMappingsMessages.DefaultEmpty
+ );
+
+ new LabeledControlUpdater(
+ new LabeledLabel(label),
+ buildDefaultFetchSizeLabelHolder()
+ );
+
+ return label;
+ }
+
+ private PropertyValueModel<String> buildDefaultFetchSizeLabelHolder() {
+
+ return new TransformationPropertyValueModel<Integer, String>(buildDefaultFetchSizeHolder()) {
+
+ @Override
+ protected String transform(Integer value) {
+
+ int defaultValue = (getSubject() != null) ? getSubject().getDefaultFetchSize() :
+ HibernateNamedQuery.DEFAULT_FETCH_SIZE;
+
+ return NLS.bind(
+ JptUiMappingsMessages.DefaultWithOneParam,
+ Integer.valueOf(defaultValue)
+ );
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Integer> buildDefaultFetchSizeHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, Integer>(getSubjectHolder(), HibernateNamedQuery.DEFAULT_FETCH_SIZE_PROPERTY) {
+ @Override
+ protected Integer buildValue_() {
+ return Integer.valueOf(this.subject.getDefaultFetchSize());
+ }
+
+ @Override
+ protected synchronized void subjectChanged() {
+ Object oldValue = this.getValue();
+ super.subjectChanged();
+ Object newValue = this.getValue();
+
+ // Make sure the default value is appended to the text
+ if (oldValue == newValue && newValue == null) {
+ this.fireAspectChange(Integer.MIN_VALUE, newValue);
+ }
+ }
+ };
+ }
+
+ protected WritablePropertyValueModel<String> buildNameTextHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, String>(
+ getSubjectHolder(), HibernateNamedQuery.NAME_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getName();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setName(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildQueryHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, String>(getSubjectHolder(), HibernateNamedQuery.QUERY_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getQuery();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ this.subject.setQuery(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Boolean> buildCacheableHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, Boolean>(
+ getSubjectHolder(),
+ HibernateNamedQuery.DEFAULT_CACHEABLE_PROPERTY,
+ HibernateNamedQuery.SPECIFIED_CACHEABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getSpecifiedCacheable();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setSpecifiedCacheable(value);
+ }
+
+ @Override
+ protected synchronized void subjectChanged() {
+ Object oldValue = this.getValue();
+ super.subjectChanged();
+ Object newValue = this.getValue();
+
+ // Make sure the default value is appended to the text
+ if (oldValue == newValue && newValue == null) {
+ this.fireAspectChange(Boolean.TRUE, newValue);
+ }
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildCacheableStringHolder() {
+
+ return new TransformationPropertyValueModel<Boolean, String>(buildCacheableHolder()) {
+
+ @Override
+ protected String transform(Boolean value) {
+
+ if ((getSubject() != null) && (value == null)) {
+ boolean defaultValue = getSubject().isDefaultCacheable();
+
+ String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
+ JptUiMappingsMessages.Boolean_False;
+
+ return NLS.bind(
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_cacheableWithDefault,
+ defaultStringValue
+ );
+ }
+
+ return HibernateUIMappingMessages.NamedQueryPropertyComposite_cacheable;
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Boolean> buildReadOnlyHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, Boolean>(
+ getSubjectHolder(),
+ HibernateNamedQuery.DEFAULT_READ_ONLY_PROPERTY,
+ HibernateNamedQuery.SPECIFIED_READ_ONLY_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getSpecifiedReadOnly();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setSpecifiedReadOnly(value);
+ }
+
+ @Override
+ protected synchronized void subjectChanged() {
+ Object oldValue = this.getValue();
+ super.subjectChanged();
+ Object newValue = this.getValue();
+
+ // Make sure the default value is appended to the text
+ if (oldValue == newValue && newValue == null) {
+ this.fireAspectChange(Boolean.TRUE, newValue);
+ }
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildReadOnlyStringHolder() {
+
+ return new TransformationPropertyValueModel<Boolean, String>(buildReadOnlyHolder()) {
+
+ @Override
+ protected String transform(Boolean value) {
+
+ if ((getSubject() != null) && (value == null)) {
+ boolean defaultValue = getSubject().isDefaultReadOnly();
+
+ String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
+ JptUiMappingsMessages.Boolean_False;
+
+ return NLS.bind(
+ HibernateUIMappingMessages.NamedQueryPropertyComposite_readOnlyWithDefault,
+ defaultStringValue
+ );
+ }
+
+ return HibernateUIMappingMessages.NamedQueryPropertyComposite_readOnly;
+ }
+ };
+ }
+
+ private EnumFormComboViewer<HibernateNamedQuery, FlushModeType> addFlushModeTypeCombo(Composite container) {
+
+ return new EnumFormComboViewer<HibernateNamedQuery, FlushModeType>(this, container) {
+
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(HibernateNamedQuery.DEFAULT_FLUSH_MODE_PROPERTY);
+ propertyNames.add(HibernateNamedQuery.SPECIFIED_FLUSH_MODE_PROPERTY);
+ }
+
+ @Override
+ protected FlushModeType[] getChoices() {
+ return FlushModeType.values();
+ }
+
+ @Override
+ protected FlushModeType getDefaultValue() {
+ return getSubject().getDefaultFlushMode();
+ }
+
+ @Override
+ protected String displayString(FlushModeType value) {
+ return value.toString();
+
+ }
+
+ @Override
+ protected FlushModeType getValue() {
+ return getSubject().getSpecifiedFlushMode();
+ }
+
+ @Override
+ protected void setValue(FlushModeType value) {
+ getSubject().setSpecifiedFlushMode(value);
+ }
+ };
+ }
+
+ private EnumFormComboViewer<HibernateNamedQuery, CacheModeType> addCacheModeTypeCombo(Composite container) {
+
+ return new EnumFormComboViewer<HibernateNamedQuery, CacheModeType>(this, container) {
+
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(HibernateNamedQuery.DEFAULT_CACHE_MODE_PROPERTY);
+ propertyNames.add(HibernateNamedQuery.SPECIFIED_CACHE_MODE_PROPERTY);
+ }
+
+ @Override
+ protected CacheModeType[] getChoices() {
+ return CacheModeType.values();
+ }
+
+ @Override
+ protected CacheModeType getDefaultValue() {
+ return getSubject().getDefaultCacheMode();
+ }
+
+ @Override
+ protected String displayString(CacheModeType value) {
+ return value.toString();
+
+ }
+
+ @Override
+ protected CacheModeType getValue() {
+ return getSubject().getSpecifiedCacheMode();
+ }
+
+ @Override
+ protected void setValue(CacheModeType value) {
+ getSubject().setSpecifiedCacheMode(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildCacheRegionTextHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, String>(
+ getSubjectHolder(),
+ HibernateNamedQuery.DEFAULT_CACHE_REGION_PROPERTY,
+ HibernateNamedQuery.SPECIFIED_CACHE_REGION_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getSpecifiedCacheRegion();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setSpecifiedCacheRegion(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Integer> buildFetchSizeHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, Integer>(getSubjectHolder(), HibernateNamedQuery.SPECIFIED_FETCH_SIZE_PROPERTY) {
+ @Override
+ protected Integer buildValue_() {
+ return this.subject.getSpecifiedFetchSize();
+ }
+
+ @Override
+ protected void setValue_(Integer value) {
+ if (value.intValue() == -1) {
+ value = null;
+ }
+ this.subject.setSpecifiedFetchSize(value);
+ }
+ };
+ }
+
+
+
+ private WritablePropertyValueModel<Integer> buildTimeoutHolder() {
+ return new PropertyAspectAdapter<HibernateNamedQuery, Integer>(getSubjectHolder(), HibernateNamedQuery.SPECIFIED_TIMEOUT_PROPERTY) {
+ @Override
+ protected Integer buildValue_() {
+ return this.subject.getSpecifiedTimeout();
+ }
+
+ @Override
+ protected void setValue_(Integer value) {
+ if (value.intValue() == -1) {
+ value = null;
+ }
+ this.subject.setSpecifiedTimeout(value);
+ }
+ };
+ }
+
+ private void updateGridData(Composite container, Spinner spinner) {
+
+ // It is possible the spinner's parent is not the container of the
+ // label, spinner and right control (a pane is sometimes required for
+ // painting the spinner's border)
+ Composite paneContainer = spinner.getParent();
+
+ while (container != paneContainer.getParent()) {
+ paneContainer = paneContainer.getParent();
+ }
+
+ Control[] controls = paneContainer.getChildren();
+
+ GridData gridData = new GridData();
+ gridData.grabExcessHorizontalSpace = false;
+ gridData.horizontalAlignment = GridData.BEGINNING;
+ controls[1].setLayoutData(gridData);
+
+ controls[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeAlignRight(controls[2]);
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedQueryPropertyComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -0,0 +1,336 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.mapping.details;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jpt.core.context.NamedNativeQuery;
+import org.eclipse.jpt.core.context.NamedQuery;
+import org.eclipse.jpt.core.context.Query;
+import org.eclipse.jpt.core.context.QueryContainer;
+import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
+import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
+import org.eclipse.jpt.ui.internal.mappings.details.NamedNativeQueryPropertyComposite;
+import org.eclipse.jpt.ui.internal.mappings.details.NamedQueryPropertyComposite;
+import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
+import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.Transformer;
+import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
+import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
+import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
+import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.PageBook;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQuery;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateQueryContainer;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateQueriesComposite extends Pane<QueryContainer> {
+
+ private AddRemoveListPane<QueryContainer> listPane;
+ private NamedNativeQueryPropertyComposite namedNativeQueryPane;
+ private NamedQueryPropertyComposite namedQueryPane;
+ private HibernateNamedQueryPropertyComposite hibernateNamedQueryPane;
+ private WritablePropertyValueModel<Query> queryHolder;
+
+ /**
+ * Creates a new <code>QueriesComposite</code>.
+ *
+ * @param parentPane The parent controller of this one
+ * @param parent The parent container
+ */
+ public HibernateQueriesComposite(Pane<? extends QueryContainer> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent, false);
+ }
+
+ private void addQuery() {
+ addQueryFromDialog(buildAddQueryDialog());
+ }
+
+ protected HibernateAddQueryDialog buildAddQueryDialog() {
+ return new HibernateAddQueryDialog(getControl().getShell());
+ }
+
+ protected void addQueryFromDialog(HibernateAddQueryDialog hibernateAddQueryDialog) {
+ if (hibernateAddQueryDialog.open() != Window.OK) {
+ return;
+ }
+ String queryType = hibernateAddQueryDialog.getQueryType();
+ Query query;
+ HibernateQueryContainer subj = (HibernateQueryContainer)this.getSubject();
+ if (queryType == Query.NAMED_QUERY) {
+ query = this.getSubject().addNamedQuery(getSubject().namedQueriesSize());
+ }
+ else if (queryType == Query.NAMED_NATIVE_QUERY) {
+ query = subj.addNamedNativeQuery(subj.namedNativeQueriesSize());
+ }
+ else if (queryType == HibernateNamedQuery.HIBERNATE_NAMED_QUERY) {
+ query = subj.addHibernateNamedQuery(subj.hibernateNamedQueriesSize());
+ }
+ else {
+ throw new IllegalArgumentException();
+ }
+ query.setName(hibernateAddQueryDialog.getName());
+ this.queryHolder.setValue(query);//so that it gets selected in the List for the user to edit
+ }
+
+ private ListValueModel<Query> buildDisplayableQueriesListHolder() {
+ return new ItemPropertyListValueModelAdapter<Query>(
+ buildQueriesListHolder(),
+ Query.NAME_PROPERTY
+ );
+ }
+
+ private AddRemoveListPane<QueryContainer> addListPane(Composite container) {
+
+ return new AddRemoveListPane<QueryContainer>(
+ this,
+ container,
+ buildQueriesAdapter(),
+ buildDisplayableQueriesListHolder(),
+ this.queryHolder,
+ buildQueriesListLabelProvider(),
+ JpaHelpContextIds.MAPPING_NAMED_QUERIES
+ );
+ }
+
+ private ListValueModel<NamedNativeQuery> buildNamedNativeQueriesListHolder() {
+ return new ListAspectAdapter<QueryContainer, NamedNativeQuery>(
+ getSubjectHolder(),
+ QueryContainer.NAMED_NATIVE_QUERIES_LIST)
+ {
+ @Override
+ protected ListIterator<NamedNativeQuery> listIterator_() {
+ return this.subject.namedNativeQueries();
+ }
+
+ @Override
+ protected int size_() {
+ return this.subject.namedNativeQueriesSize();
+ }
+ };
+ }
+
+ private PropertyValueModel<NamedNativeQuery> buildNamedNativeQueryHolder() {
+ return new TransformationPropertyValueModel<Query, NamedNativeQuery>(this.queryHolder) {
+ @Override
+ protected NamedNativeQuery transform_(Query value) {
+ return (value instanceof NamedNativeQuery) ? (NamedNativeQuery) value : null;
+ }
+ };
+ }
+
+ private ListValueModel<HibernateNamedQuery> buildHibernateNamedQueriesListHolder() {
+ return new ListAspectAdapter<QueryContainer, HibernateNamedQuery>(
+ getSubjectHolder(),
+ HibernateQueryContainer.HIBERNATE_NAMED_QUERIES_LIST)
+ {
+ @Override
+ protected ListIterator<HibernateNamedQuery> listIterator_() {
+ return ((HibernateQueryContainer)this.subject).hibernateNamedQueries();
+ }
+
+ @Override
+ protected int size_() {
+ return ((HibernateQueryContainer)this.subject).hibernateNamedQueriesSize();
+ }
+ };
+ }
+
+ private ListValueModel<NamedQuery> buildNamedQueriesListHolder() {
+ return new ListAspectAdapter<QueryContainer, NamedQuery>(
+ getSubjectHolder(),
+ QueryContainer.NAMED_QUERIES_LIST)
+ {
+ @Override
+ protected ListIterator<NamedQuery> listIterator_() {
+ return this.subject.namedQueries();
+ }
+
+ @Override
+ protected int size_() {
+ return this.subject.namedQueriesSize();
+ }
+ };
+ }
+
+ private PropertyValueModel<NamedQuery> buildNamedQueryHolder() {
+ return new TransformationPropertyValueModel<Query, NamedQuery>(this.queryHolder) {
+ @Override
+ protected NamedQuery transform_(Query value) {
+ return (value instanceof NamedQuery) ? (NamedQuery) value : null;
+ }
+ };
+ }
+
+ private PropertyValueModel<HibernateNamedQuery> buildHibernateNamedQueryHolder() {
+ return new TransformationPropertyValueModel<Query, HibernateNamedQuery>(this.queryHolder) {
+ @Override
+ protected HibernateNamedQuery transform_(Query value) {
+ return (value instanceof HibernateNamedQuery) ? (HibernateNamedQuery) value : null;
+ }
+ };
+ }
+
+ private Transformer<Query, Control> buildPaneTransformer() {
+ return new Transformer<Query, Control>() {
+ public Control transform(Query query) {
+
+ if (query == null) {
+ return null;
+ }
+
+ if (query instanceof HibernateNamedQuery) {
+ return HibernateQueriesComposite.this.hibernateNamedQueryPane.getControl();
+ }
+
+ if (query instanceof NamedNativeQuery) {
+ return HibernateQueriesComposite.this.namedNativeQueryPane.getControl();
+ }
+
+ return HibernateQueriesComposite.this.namedQueryPane.getControl();
+ }
+ };
+ }
+
+ private Adapter buildQueriesAdapter() {
+
+ return new AddRemoveListPane.AbstractAdapter() {
+
+ public void addNewItem(ObjectListSelectionModel listSelectionModel) {
+ addQuery();
+ }
+
+ public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
+ for (Object item : listSelectionModel.selectedValues()) {
+ if (item instanceof HibernateNamedQuery) {
+ ((HibernateQueryContainer)getSubject()).removeHibernateNamedQuery((HibernateNamedQuery)item);
+ } else if (item instanceof NamedQuery) {
+ getSubject().removeNamedQuery((NamedQuery) item);
+ } else {
+ getSubject().removeNamedNativeQuery((NamedNativeQuery) item);
+ }
+ }
+ }
+ };
+ }
+
+ private ListValueModel<Query> buildQueriesListHolder() {
+ List<ListValueModel<? extends Query>> list = new ArrayList<ListValueModel<? extends Query>>();
+ list.add(buildHibernateNamedQueriesListHolder());
+ list.add(buildNamedQueriesListHolder());
+ list.add(buildNamedNativeQueriesListHolder());
+ return new CompositeListValueModel<ListValueModel<? extends Query>, Query>(list);
+ }
+
+ private ILabelProvider buildQueriesListLabelProvider() {
+ return new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ Query query = (Query) element;
+ String name = query.getName();
+
+ if (name == null) {
+ int index = -1;
+
+ if (query instanceof HibernateNamedQuery) {
+ index = CollectionTools.indexOf(((HibernateQueryContainer)getSubject()).hibernateNamedQueries(), query);
+ } else if (query instanceof NamedQuery) {
+ index = CollectionTools.indexOf(getSubject().namedQueries(), query);
+ } else {
+ index = CollectionTools.indexOf(getSubject().namedNativeQueries(), query);
+ }
+
+ name = NLS.bind(JptUiMappingsMessages.QueriesComposite_displayString, index);
+ }
+
+ return name;
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Query> buildQueryHolder() {
+ return new SimplePropertyValueModel<Query>();
+ }
+
+ @Override
+ public void enableWidgets(boolean enabled) {
+ super.enableWidgets(enabled);
+ this.listPane.enableWidgets(enabled);
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ this.queryHolder = buildQueryHolder();
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ // List pane
+ this.listPane = addListPane(container);
+
+ // Property pane
+ PageBook pageBook = new PageBook(container, SWT.NULL);
+ pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Named Query property pane
+ this.hibernateNamedQueryPane = new HibernateNamedQueryPropertyComposite(
+ this,
+ buildHibernateNamedQueryHolder(),
+ pageBook
+ );
+
+ // Named Query property pane
+ this.namedQueryPane = new NamedQueryPropertyComposite(
+ this,
+ buildNamedQueryHolder(),
+ pageBook
+ );
+
+ // Named Native Query property pane
+ this.namedNativeQueryPane = new NamedNativeQueryPropertyComposite(
+ this,
+ buildNamedNativeQueryHolder(),
+ pageBook
+ );
+
+ installPaneSwitcher(pageBook);
+ }
+
+ private void installPaneSwitcher(PageBook pageBook) {
+ new ControlSwitcher(this.queryHolder, buildPaneTransformer(), pageBook);
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -18,13 +18,24 @@
*/
public class HibernateUIMappingMessages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.messages"; //$NON-NLS-1$
+
public static String GenericGeneratorComposite_name;
public static String GenericGeneratorComposite_strategy;
-
public static String HibernateGeneratorsComposite_CheckBoxLabel;
-
public static String HibernateGeneratorsComposite_SectionLabel;
+ public static String NamedQueryPropertyComposite_cacheable;
+ public static String NamedQueryPropertyComposite_cacheableWithDefault;
+ public static String NamedQueryPropertyComposite_flushMode;
+ public static String NamedQueryPropertyComposite_cacheMode;
+ public static String NamedQueryPropertyComposite_readOnly;
+ public static String NamedQueryPropertyComposite_readOnlyWithDefault;
+ public static String NamedQueryPropertyComposite_cacheRegion;
+ public static String NamedQueryPropertyComposite_fetchSize;
+ public static String NamedQueryPropertyComposite_timeout;
+ public static String HibernateAddQueryDialog_hibernateNamedQuery;
+ public static String HibernateAddQueryDialog_hibernateNamedNativeQuery;
+
private HibernateUIMappingMessages() {}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties 2009-07-09 13:37:41 UTC (rev 16518)
@@ -2,3 +2,14 @@
GenericGeneratorComposite_name=Name:
HibernateGeneratorsComposite_CheckBoxLabel=Generic generator
HibernateGeneratorsComposite_SectionLabel=Generic Generator
+NamedQueryPropertyComposite_cacheable=Cacheable
+NamedQueryPropertyComposite_cacheableWithDefault=Cacheable ({0})
+NamedQueryPropertyComposite_readOnly=Read Only
+NamedQueryPropertyComposite_readOnlyWithDefault=Read Only ({0})
+NamedQueryPropertyComposite_flushMode=Flush Mode
+NamedQueryPropertyComposite_cacheMode=Cache Mode
+NamedQueryPropertyComposite_cacheRegion=Cache Region
+NamedQueryPropertyComposite_fetchSize=Fetch Size
+NamedQueryPropertyComposite_timeout=Timeout
+HibernateAddQueryDialog_hibernateNamedQuery=Named Query (hibernate)
+HibernateAddQueryDialog_hibernateNamedNativeQuery=Named Native Query (hibernate)
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-07-09 12:40:41 UTC (rev 16517)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-07-09 13:37:41 UTC (rev 16518)
@@ -317,7 +317,7 @@
}
public String getHelpID() {
- // TODO Auto-generated method stub
+ // TODO help
return null;
}
16 years, 9 months
JBoss Tools SVN: r16517 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 08:40:41 -0400 (Thu, 09 Jul 2009)
New Revision: 16517
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4561
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-07-09 12:14:24 UTC (rev 16516)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-07-09 12:40:41 UTC (rev 16517)
@@ -180,13 +180,11 @@
BijectedAttribute att = createBijectedAttribute(types);
Annotation in = as.get(BijectedAttributeType.IN);
- if(in != null) {
- ValueInfo _in = new ValueInfo();
- _in.setValue(IN_ANNOTATION_TYPE);
- _in.valueStartPosition = in.getStartPosition();
- _in.valueLength = in.getLength();
- att.addAttribute(IN_ANNOTATION_TYPE, _in);
- }
+ Annotation out = as.get(BijectedAttributeType.OUT);
+ Annotation data = as.get(BijectedAttributeType.DATA_BINDER);
+ addLocation(att, in, IN_ANNOTATION_TYPE);
+ addLocation(att, out, OUT_ANNOTATION_TYPE);
+ addLocation(att, data, DATA_MODEL_ANNOTATION_TYPE);
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
@@ -198,6 +196,8 @@
name.setValue(m.getName().getIdentifier());
if(in != null) {
name.setValue(toPropertyName(name.getValue(), "set"));
+ } else if(out != null || data != null) {
+ name.setValue(toPropertyName(name.getValue(), "get"));
}
}
16 years, 9 months
JBoss Tools SVN: r16516 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 08:14:24 -0400 (Thu, 09 Jul 2009)
New Revision: 16516
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/SaveEditorSpecialWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4573
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/SaveEditorSpecialWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/SaveEditorSpecialWizard.java 2009-07-09 11:04:47 UTC (rev 16515)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/SaveEditorSpecialWizard.java 2009-07-09 12:14:24 UTC (rev 16516)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.objecteditor;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.*;
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.model.XModelObject;
@@ -26,7 +27,14 @@
}
public int execute() {
- IWorkbenchPage workbenchPage = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if(Display.getCurrent() == null) {
+ return 1;
+ }
+ IWorkbenchWindow window = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if(window == null) {
+ return 1;
+ }
+ IWorkbenchPage workbenchPage = window.getActivePage();
IModelObjectEditorInput input = XModelObjectEditorInput.createInstance(o);
if(input == null) return 1;
IEditorPart editor = workbenchPage.findEditor(input);
16 years, 9 months
JBoss Tools SVN: r16515 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 07:04:47 -0400 (Thu, 09 Jul 2009)
New Revision: 16515
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4560
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-07-09 10:44:57 UTC (rev 16514)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-07-09 11:04:47 UTC (rev 16515)
@@ -221,14 +221,9 @@
BijectedAttribute att = createBijectedAttribute(types);
- Annotation in = as.get(BijectedAttributeType.IN);
- if(in != null) {
- ValueInfo _in = new ValueInfo();
- _in.setValue(IN_ANNOTATION_TYPE);
- _in.valueStartPosition = in.getStartPosition();
- _in.valueLength = in.getLength();
- att.addAttribute(IN_ANNOTATION_TYPE, _in);
- }
+ addLocation(att, as.get(BijectedAttributeType.IN), IN_ANNOTATION_TYPE);
+ addLocation(att, as.get(BijectedAttributeType.OUT), OUT_ANNOTATION_TYPE);
+ addLocation(att, as.get(BijectedAttributeType.DATA_BINDER), DATA_MODEL_ANNOTATION_TYPE);
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
@@ -274,6 +269,15 @@
return att;
}
+ private void addLocation(BijectedAttribute att, Annotation a, String name) {
+ if(a != null) {
+ ValueInfo _a = new ValueInfo();
+ _a.setValue(name);
+ _a.valueStartPosition = a.getStartPosition();
+ _a.valueLength = a.getLength();
+ att.addAttribute(name, _a);
+ }
+ }
void processComponentMethods() {
for (AnnotatedASTNode<MethodDeclaration> n: annotatedMethods) {
16 years, 9 months
JBoss Tools SVN: r16514 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 06:44:57 -0400 (Thu, 09 Jul 2009)
New Revision: 16514
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4542
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2009-07-09 10:26:52 UTC (rev 16513)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2009-07-09 10:44:57 UTC (rev 16514)
@@ -168,7 +168,9 @@
// } catch (URISyntaxException e) {
// ModelUIPlugin.getPluginLog().logError(e);
// }
- IFile file = EclipseResourceUtil.getFile(dropData.getMimeData());
+ boolean isWorkspaceFile = dropData.getMimeData() != null && dropData.getMimeData().startsWith("L/");
+ IFile file = isWorkspaceFile ? ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(dropData.getMimeData()).removeFirstSegments(1))
+ : EclipseResourceUtil.getFile(dropData.getMimeData());
if (file == null || !file.exists()) {
URL newUrl = null;
16 years, 9 months
JBoss Tools SVN: r16513 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 06:26:52 -0400 (Thu, 09 Jul 2009)
New Revision: 16513
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4556
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java 2009-07-09 10:19:50 UTC (rev 16512)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java 2009-07-09 10:26:52 UTC (rev 16513)
@@ -223,11 +223,12 @@
editorDialog.getShell().setText(title);
adapter.setStoreLocked(true);
int i = editorDialog.open();
- adapter.setStoreLocked(false);
if (PropertyEditorDialog.OK == i) {
+ adapter.setStoreLocked(false);
adapter.store();
} else {
adapter.load();
+ adapter.setStoreLocked(false);
}
return valueProvider.getStringValue(false);
} else {
16 years, 9 months
JBoss Tools SVN: r16512 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-09 06:19:50 -0400 (Thu, 09 Jul 2009)
New Revision: 16512
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/handlers/ImportTLDToPaletteSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4556
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/handlers/ImportTLDToPaletteSupport.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/handlers/ImportTLDToPaletteSupport.java 2009-07-09 09:41:36 UTC (rev 16511)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/handlers/ImportTLDToPaletteSupport.java 2009-07-09 10:19:50 UTC (rev 16512)
@@ -33,6 +33,10 @@
import org.jboss.tools.jst.web.tld.model.helpers.TLDToPaletteHelper;
public class ImportTLDToPaletteSupport extends SpecialWizardSupport {
+ static String NAME = "name"; //$NON-NLS-1$
+ static String TLD = "tld"; //$NON-NLS-1$
+ static String PARENT_GROUP = "parent group"; //$NON-NLS-1$
+
Map<String,XModelObject> groups;
XModelObject palette;
AllTldsTree tree = new AllTldsTree();
@@ -43,7 +47,7 @@
tree.getChildren(tree.getRoot());
selectedFile = (XModelObject)getProperties().get("initialSelection"); //$NON-NLS-1$
if(selectedFile != null) {
- setAttributeValue(0, "tld", "" + tree.getValue(selectedFile)); //$NON-NLS-1$ //$NON-NLS-2$
+ setAttributeValue(0, TLD, "" + tree.getValue(selectedFile)); //$NON-NLS-1$
onPathModified();
}
}
@@ -55,9 +59,9 @@
collectParents(palette);
XModelObject t = (XModelObject)getProperties().get("target"); //$NON-NLS-1$
if(t != null && t != target) {
- String g = t.getAttributeValue("name"); //$NON-NLS-1$
+ String g = t.getAttributeValue(NAME);
if(g != null && groups.containsKey(g)) {
- getProperties().setProperty("parent group", g); //$NON-NLS-1$
+ getProperties().setProperty(PARENT_GROUP, g);
}
}
@@ -68,7 +72,7 @@
for (int i = 0; i < cs.length; i++) {
String kind = cs[i].getAttributeValue("element type"); //$NON-NLS-1$
if(!"group".equals(kind) && !"sub-group".equals(kind)) continue; //$NON-NLS-1$ //$NON-NLS-2$
- String name = cs[i].getAttributeValue("name"); //$NON-NLS-1$
+ String name = cs[i].getAttributeValue(NAME);
groups.put(name, cs[i]);
}
getProperties().put("groups", groups.keySet().toArray(new String[0])); //$NON-NLS-1$
@@ -85,20 +89,20 @@
protected void execute() throws XModelException {
Properties p0 = extractStepData(0);
- String name = p0.getProperty("name"); //$NON-NLS-1$
- String path = p0.getProperty("tld"); //$NON-NLS-1$
+ String name = p0.getProperty(NAME);
+ String path = p0.getProperty(TLD);
XModelObject tld = getSelectedResource(path);
- String parentName = getProperties().getProperty("parent group"); //$NON-NLS-1$
+ String parentName = getProperties().getProperty(PARENT_GROUP);
XModelObject parent = groups.get(parentName);
if(parent == null) {
Properties p = new Properties();
- p.setProperty("name", parentName); //$NON-NLS-1$
+ p.setProperty(NAME, parentName);
parent = getTarget().getModel().createModelObject("SharablePageTabHTML", p); //$NON-NLS-1$
DefaultCreateHandler.addCreatedObject(palette, parent, getProperties());
}
TLDToPaletteHelper h = new TLDToPaletteHelper();
XModelObject added = h.createGroupByTLD(tld, getTarget().getModel());
- added.setAttributeValue("name", name); //$NON-NLS-1$
+ added.setAttributeValue(NAME, name);
added.setAttributeValue(URIConstants.LIBRARY_URI, getAttributeValue(0, URIConstants.LIBRARY_URI));
added.setAttributeValue(URIConstants.DEFAULT_PREFIX, getAttributeValue(0, URIConstants.DEFAULT_PREFIX));
PaletteAdopt.add(parent, getTarget(), added);
@@ -125,7 +129,7 @@
if(selectedFile == null) return;
String name = selectedFile.getAttributeValue("display-name"); //$NON-NLS-1$
if(name == null || name.length() == 0) name = selectedFile.getAttributeValue("shortname"); //$NON-NLS-1$
- setAttributeValue(0, "name", name); //$NON-NLS-1$
+ setAttributeValue(0, NAME, name);
String pref = TLDToPaletteHelper.getTldName(selectedFile);
setAttributeValue(0, URIConstants.DEFAULT_PREFIX, pref);
String uri = selectedFile.getAttributeValue("uri"); //$NON-NLS-1$
@@ -142,17 +146,17 @@
class ImportTLDValidator extends DefaultWizardDataValidator {
public void validate(Properties data) {
message = null;
- String tld = data.getProperty("tld");
+ String tld = data.getProperty(TLD);
IStatus status = ResourcesPlugin.getWorkspace().validatePath(tld, IResource.FILE);
if(status != null && !status.isOK()) {
message = status.getMessage();
return;
}
- XModelObject s = getSelectedResource(tld); //$NON-NLS-1$
+ XModelObject s = getSelectedResource(tld);
super.validate(data);
if(message != null) return;
- String name = data.getProperty("name"); //$NON-NLS-1$
- String parentName = getProperties().getProperty("parent group"); //$NON-NLS-1$
+ String name = data.getProperty(NAME);
+ String parentName = getProperties().getProperty(PARENT_GROUP);
if(parentName == null || parentName.length() == 0) {
message = WebUIMessages.PARENT_GROUP_MUST_BE_SPECIFIED;
return;
16 years, 9 months