JBoss Tools SVN: r21355 - branches/modular_build/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-08 12:15:16 -0400 (Thu, 08 Apr 2010)
New Revision: 21355
Modified:
branches/modular_build/bpel/releng/testing.properties
Log:
add extraVMargs for bpel on 64-bit slaves
Modified: branches/modular_build/bpel/releng/testing.properties
===================================================================
--- branches/modular_build/bpel/releng/testing.properties 2010-04-08 15:57:56 UTC (rev 21354)
+++ branches/modular_build/bpel/releng/testing.properties 2010-04-08 16:15:16 UTC (rev 21355)
@@ -8,3 +8,4 @@
# could also add things like: -Xbootclasspath/a:/path/to/emma.jar ?
Xflags= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
+extraVMargs= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
14 years, 9 months
JBoss Tools SVN: r21354 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-08 11:57:56 -0400 (Thu, 08 Apr 2010)
New Revision: 21354
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5803 - fixed.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-04-08 15:55:56 UTC (rev 21353)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-04-08 15:57:56 UTC (rev 21354)
@@ -12,6 +12,8 @@
import java.util.HashSet;
import java.util.Set;
+
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
@@ -103,22 +105,19 @@
.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED));
isKBNaturesCheck = Boolean.parseBoolean(project
.getPersistentProperty(IS_KB_NATURES_CHECK_NEED));
- if (isJSFCheck) {
- String missingNature = checkMissingNatures(project);
- if (missingNature != null) {
- KbProject.checkKBBuilderInstalled(project);
- ProjectNaturesInfoDialog dialog = null;
- if (KbProject.NATURE_ID.equals(missingNature)
- && isKBNaturesCheck) {
- dialog = new KBNaturesInfoDialog(project);
- } else if (WebProject.JSF_NATURE_ID.equals(missingNature)
- && isJSFNaturesCheck) {
- dialog = new JSFNaturesInfoDialog(project);
- }
- if (dialog != null) {
- dialog.open();
- }
+ KbProject.checkKBBuilderInstalled(project);
+ String missingNature = checkMissingNatures(project);
+ if (missingNature != null) {
+ ProjectNaturesInfoDialog dialog = null;
+ if (KbProject.NATURE_ID.equals(missingNature) && isKBNaturesCheck) {
+ dialog = new KBNaturesInfoDialog(project);
+ } else if (WebProject.JSF_NATURE_ID.equals(missingNature)
+ && isJSFNaturesCheck && isJSFCheck) {
+ dialog = new JSFNaturesInfoDialog(project);
}
+ if (dialog != null) {
+ dialog.open();
+ }
}
}
@@ -129,7 +128,7 @@
if (project.getNature(WebProject.JSF_NATURE_ID) == null) {
return WebProject.JSF_NATURE_ID;
}
- if (project.getNature(IKbProject.NATURE_ID) == null) {
+ if (getKBProblemMarker(project) != null) {
return IKbProject.NATURE_ID;
}
return null;
@@ -233,4 +232,22 @@
}
}
+ private IMarker getKBProblemMarker(IProject project) {
+ IMarker kbProblemMarker = null;
+ try {
+ IMarker[] markers = project.findMarkers(null, false, 1);
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ String _type = marker.getType();
+ if (_type != null
+ && _type.equals(KbProject.KB_PROBLEM_MARKER_TYPE)) {
+ kbProblemMarker = marker;
+ break;
+ }
+ }
+ } catch (CoreException e) {
+ }
+ return kbProblemMarker;
+ }
+
}
14 years, 9 months
JBoss Tools SVN: r21353 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-08 11:55:56 -0400 (Thu, 08 Apr 2010)
New Revision: 21353
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6145 - patch was applied to trunk
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2010-04-08 15:51:51 UTC (rev 21352)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2010-04-08 15:55:56 UTC (rev 21353)
@@ -1056,12 +1056,15 @@
IHandlerService handlerService = (IHandlerService) workbench
.getService(IHandlerService.class);
if (handlerService != null) {
+ if(sourceActivation != null) handlerService.deactivateHandler(sourceActivation);
sourceActivation = handlerService.activateHandler(
VPE_SOURCE_MAXMIN,
sourceMaxmin);
+ if(visualActivation != null) handlerService.deactivateHandler(visualActivation);
visualActivation = handlerService.activateHandler(
VPE_VISUAL_MAXMIN,
visualMaxmin);
+ if(jumpingActivation != null) handlerService.deactivateHandler(jumpingActivation);
jumpingActivation = handlerService.activateHandler(
VPE_JUMPING,
jumping);
14 years, 9 months
JBoss Tools SVN: r21352 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-08 11:51:51 -0400 (Thu, 08 Apr 2010)
New Revision: 21352
Modified:
branches/modular_build/genpom.xml
Log:
add tag file checker to genpom.xml, which will fix up manifests if mismatch found
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-08 14:57:10 UTC (rev 21351)
+++ branches/modular_build/genpom.xml 2010-04-08 15:51:51 UTC (rev 21352)
@@ -16,8 +16,8 @@
cd /home/nboldt/workspace36/jbosstools-modular_build; ant -f genpom.xml -q
or, to build a specific module only:
cd /home/nboldt/workspace36/jbosstools-modular_build; \
- ant -f genpom.xml -q -DWORKINGDIR=/home/nboldt/workspace36/jbosstools-modular_build/jbpm \
- -DpathToParentPom=../
+ ant -f genpom.xml -q -DpathToParentPom=../ -DWORKINGDIR=/home/nboldt/workspace36/jbosstools-modular_build/as
+
-->
<target name="get.ant-contrib" unless="ant-contrib.jar.exists">
@@ -307,7 +307,7 @@
/>
<echo>Aggregated: ${artifactIdAgg}</echo>
-
+
<var name="artifactIdAgg" unset="true" />
</else>
</if>
@@ -354,6 +354,21 @@
</then>
</if>
+ <!-- if set, compare values in tags file to values found in manifests and report discrepancies -->
+ <var name="tagsFile"
+ value="/home/nboldt/eclipse/workspace-jboss/devstudio-trunk/releng/org.jboss.ide.eclipse.releng/builders/product/versionTags/jbosstools/3.1.0.GA.tags"
+ />
+
+ <if>
+ <and>
+ <isset property="tagsFile" />
+ <available file="${tagsFile}" type="file" />
+ </and>
+ <then>
+ <property file="${tagsFile}" prefix="tagsFile" />
+ </then>
+ </if>
+
<!-- counter variables -->
<var name="aggregatorcountstring" value="" />
<var name="modulecountstring" value="" />
@@ -426,6 +441,31 @@
casesensitive="true"
override="true"
/>
+
+ <!-- compare tags file to current manifests -->
+ <antcallback target="checkArtifactVersionAgainstTagFile" return="artifactVersion.from.tag" />
+ <if>
+ <not>
+ <equals arg1="${artifactVersion.from.tag}" arg2="${artifactVersion}" />
+ </not>
+ <then>
+ <loadfile property="manifest.file" srcfile="${dir}/META-INF/MANIFEST.MF">
+ <filterchain>
+ <tokenfilter>
+ <replaceregex pattern="Bundle-Version:( +)${artifactVersion}"
+ replace="Bundle-Version: ${artifactVersion.from.tag}"
+ flags=""
+ />
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <echo message="${manifest.file}" file="${dir}/META-INF/MANIFEST.MF" />
+ <var name="manifest.file" unset="true" />
+ </then>
+ </if>
+ <var name="artifactVersion.from.tag" unset="true" />
+
+ <!-- now, switch to Maven style (s/.qualifier/-SNAPSHOT/) -->
<propertyregex property="artifactVersion"
input="${artifactVersion}"
defaultvalue="${artifactVersion}"
@@ -441,15 +481,40 @@
<!-- get <feature version=""> -->
<xmlproperty file="${dir}/feature.xml" collapseAttributes="true" />
<var name="artifactVersion" value="${feature.version}" />
+
+ <!-- compare tags file to current manifests -->
+ <antcallback target="checkArtifactVersionAgainstTagFile" return="artifactVersion.from.tag" />
+ <if>
+ <not>
+ <equals arg1="${artifactVersion.from.tag}" arg2="${artifactVersion}" />
+ </not>
+ <then>
+ <var name="feature.version" unset="true" />
+ <loadfile property="manifest.file" srcfile="${dir}/feature.xml">
+ <filterchain>
+ <tokenfilter>
+ <replaceregex pattern="version="${artifactVersion}""
+ replace="version="${artifactVersion.from.tag}""
+ flags=""
+ />
+ </tokenfilter>
+ </filterchain>
+ </loadfile>
+ <echo message="${manifest.file}" file="${dir}/feature.xml" />
+ <var name="manifest.file" unset="true" />
+ </then>
+ </if>
+ <var name="artifactVersion.from.tag" unset="true" />
+
+ <!-- now, switch to Maven style (s/.qualifier/-SNAPSHOT/) -->
<propertyregex property="artifactVersion"
- input="${artifactVersion}"
- defaultvalue="${artifactVersion}"
+ input="${artifactVersion.from.tag}"
+ defaultvalue="${artifactVersion.from.tag}"
regexp="(.+).qualifier"
replace="\1-SNAPSHOT"
casesensitive="true"
override="true"
/>
- <var name="feature.version" unset="true" />
</then>
</elseif>
<else>
@@ -459,6 +524,44 @@
</if>
</target>
+ <target name="checkArtifactVersionAgainstTagFile">
+ <dirname property="this.dir" file="${dir}" />
+ <dirname property="parent.dir.path" file="${this.dir}" />
+ <basename property="parent.dir" file="${parent.dir.path}" />
+ <var name="this.dir" unset="true" />
+ <var name="parent.dir.path" unset="true" />
+ <if>
+ <isset property="tagsFile.${parent.dir}" />
+ <then>
+ <propertycopy from="tagsFile.${parent.dir}" property="artifactVersion.from.tag" />
+ <propertyregex property="artifactVersion.from.tag"
+ input="${artifactVersion.from.tag}"
+ defaultvalue="${artifactVersion.from.tag}"
+ regexp="(.+).GA"
+ replace="\1.qualifier"
+ casesensitive="true"
+ override="true"
+ />
+ </then>
+ </if>
+ <if>
+ <and>
+ <isset property="tagsFile.${parent.dir}" />
+ <not>
+ <equals arg1="${artifactVersion}" arg2="${artifactVersion.from.tag}" />
+ </not>
+ </and>
+ <then>
+ <basename file="${dir}" property="this.dir" />
+ <echo>For ${this.dir}, got ${artifactVersion}; should be ${artifactVersion.from.tag}</echo>
+ </then>
+ <else>
+ <var name="artifactVersion.from.tag" value="${artifactVersion}" />
+ </else>
+ </if>
+ <var name="parent.dir" unset="true" />
+ </target>
+
<target name="getArtifactId">
<property name="dir" value="." />
<!-- echo>${dir}</echo -->
14 years, 9 months
JBoss Tools SVN: r21351 - in trunk/maven/docs/maven_reference_guide/en-US: images and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-04-08 10:57:10 -0400 (Thu, 08 Apr 2010)
New Revision: 21351
Added:
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAFacet.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAProjectWithMavenizedHibernate.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/createJPAProject.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/jbossM2CapabilitiesPage.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/projectFacets.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossM2CapabilitiesPage.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossPortletCapabilitiesPage.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/mavenIntegrationFacet.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/newPortletProject.png
trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/portletProjectWithMavenIntegration.png
Modified:
trunk/maven/docs/maven_reference_guide/en-US/tasks.xml
Log:
JBDS-1121 Maven Integration Guide - more info and screens are added
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAFacet.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAFacet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAProjectWithMavenizedHibernate.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/JPAProjectWithMavenizedHibernate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/createJPAProject.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/createJPAProject.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/jbossM2CapabilitiesPage.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/jbossM2CapabilitiesPage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/projectFacets.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_jpa_with_mavenized_hibernate/projectFacets.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossM2CapabilitiesPage.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossM2CapabilitiesPage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossPortletCapabilitiesPage.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/jbossPortletCapabilitiesPage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/mavenIntegrationFacet.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/mavenIntegrationFacet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/newPortletProject.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/newPortletProject.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/portletProjectWithMavenIntegration.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/create_mavenized_portlet/portletProjectWithMavenIntegration.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/maven/docs/maven_reference_guide/en-US/tasks.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/tasks.xml 2010-04-08 14:49:05 UTC (rev 21350)
+++ trunk/maven/docs/maven_reference_guide/en-US/tasks.xml 2010-04-08 14:57:10 UTC (rev 21351)
@@ -1,22 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<chapter id="tasks">
<?dbhtml filename="tasks.html"?>
<chapterinfo>
<keywordset>
-
-
- <keyword>Eclipse</keyword>
- <keyword>JBoss</keyword>
- <keyword>JBoss Tools</keyword>
- <keyword>Maven</keyword>
- <keyword>Seam</keyword>
-
+ <keyword>Eclipse</keyword>
+ <keyword>JBoss</keyword>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Maven</keyword>
+ <keyword>Seam</keyword>
</keywordset>
</chapterinfo>
-
<title>Tasks</title>
- <para>This chapter will provide you with the information on how to create mavenized projects and import already existing maven project with JBoss Maven Tool.</para>
+ <para>This chapter will provide you with the information on how to create mavenized projects and
+ import already existing maven project with JBoss Maven Tool.</para>
<section id="create_mavenized_project">
<title>Creating Maven ready Seam project</title>
<para>Maven Integration makes the Seam Wizard capable of creating Maven ready projects to
@@ -25,7 +21,7 @@
<itemizedlist>
<listitem>
<para>Navigate to <emphasis>
- <property>File > New Seam Project</property>.</emphasis> Give the project
+ <property>File > New Seam Project</property>.</emphasis> Give the project
a meaningful name, specify a target runtime and server and select the proper
configuration for your Seam project:</para>
<figure>
@@ -41,7 +37,7 @@
</listitem>
<listitem>
<para>Click the <emphasis>
- <property>Modify</property></emphasis> button to enable the <emphasis>
+ <property>Modify</property></emphasis> button to enable the <emphasis>
<property>Jboss Maven Integration</property></emphasis> facet:</para>
<figure>
<title>Enabling the Jboss Maven Integration Facet</title>
@@ -114,12 +110,131 @@
</mediaobject>
</figure>
</section>
+ <section id="mavenized_portlet">
+ <title>Create new mavenized Dynamic Web Project with Portlets</title>
+ <para>Select in main <property>Eclipse</property> menu <emphasis><property>File > New >
+ Other</property></emphasis>. Then click <emphasis><property>Web > Dynamic Web Project</property></emphasis>. The <property>New Dynamic
+ Web Project</property> wizard appears. In this wizard you should specify <property>Project name</property>, <property>Target
+ Runtime</property> and <property>Dynamic Web Module</property>. More about creating Web project with Portlets you can
+ find <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jboss_portal_tools_r...">here</ulink>. </para>
+ <figure>
+ <title>New Dynamic Web Project wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_portlet/newPortletProject.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Then you should to configure <property>Project Facets</property>, for that you need click <emphasis><property>Modify</property></emphasis> in
+ <property>Configuration</property> area. In <property>Project Facets</property> dialog check <property>JBoss Core Portlet Facet</property> and <property>JBoss Maven Integration Facet</property>, press <emphasis><property>OK</property></emphasis>.</para>
+ <figure>
+ <title>Project Facets</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_portlet/mavenIntegrationFacet.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the <property>JBoss M2 capabilities</property> page you will be able to add the following <property>Maven</property>
+ properties: <property>groupId</property>, <property>artifactId</property>, <property>version</property>, <property>type of packaging</property>, <property>name</property> and <property>description</property>.</para>
+ <figure>
+ <title>JBoss M2 capabilities page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_mavenized_portlet/jbossM2CapabilitiesPage.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the <property>JBoss Portlet Capabilities</property> page configure <property>Portlet Implementation Library</property>.
+ Select <property>Maven Portlet 2.0 Libraries</property> provided by <property>JBoss Maven Integration Tool</property>. Then you
+ can configure <property>Dependencies</property> and <property>Exclusions</property>. </para>
+ <figure>
+ <title>JBoss Portlet Capabilities page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_portlet/jbossPortletCapabilitiesPage.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Thereafter click <emphasis><property>Finished</property></emphasis> and you will get a mavenized <property>Dynamic Web Project</property> with
+ <property>Portlets</property>. In the same way you can create <property>JSF</property> and <property>Seam Project</property> with <property>JBoss Portlet</property>. </para>
+ <figure>
+ <title>JBoss Portlet Capabilities page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_mavenized_portlet/portletProjectWithMavenIntegration.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section>
+ <title>Create new JPA project with mavenized Hibernate support</title>
+ <para>To create new <property>JPA</property> project select in main Eclipse menu <emphasis><property>File > New > Other</property></emphasis>. Then choose
+ <emphasis><property>JPA > JPA Project</property></emphasis>. At the first wizard page enter <property>Project name</property>, select <property>Target Runtime</property>.To add Maven Integration you need to configure <property>Project Facets</property>, for that click <emphasis><property>Modify</property></emphasis> button.</para>
+ <figure>
+ <title>New JPA project wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_jpa_with_mavenized_hibernate/createJPAProject.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the <property>Project Facets</property> page check <property>JBoss Maven Integration Facet</property> .</para>
+ <figure>
+ <title>Project Facets</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_jpa_with_mavenized_hibernate/projectFacets.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the <property>JBoss M2 capabilities</property> page you need specify <property>groupId</property>, <property>artifactId</property>, <property>version</property>, <property>type
+ of packaging</property>, <property>name</property> and <property>description</property> <property>Maven</property> properties. </para>
+ <figure>
+ <title>JBoss M2 capabilities page</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_jpa_with_mavenized_hibernate/jbossM2CapabilitiesPage.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On the <property>JPA Facet </property>page you need select <property>Hibernate</property> as <property>Target Platform</property> and <property>Hibernate 3.3.2 Library</property> as <property>JPA Implementation Type</property>. After that you can <property>Add</property> or <property>Remove</property> <property>Dependencies</property> and <property>Exclusions</property>. At the end you need to choose <property>Database Connection</property> and configuring its options. </para>
+ <figure>
+ <title>Configuring JPA Facet for mavenized Hibernate support</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_jpa_with_mavenized_hibernate/JPAFacet.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click <emphasis><property>Finish</property></emphasis> and you will see mavenized <property>JPA</property> project with <property>Hibernate</property> support. <property>Hibernate</property>
+ and other libraries used with <property>JPA</property> are managed by <property>Maven Integration Tools</property> and aren't
+ included in <property>Build Path</property>. </para>
+ <figure>
+ <title>Configuring JPA Facet for mavenized Hibernate support</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/create_jpa_with_mavenized_hibernate/JPAProjectWithMavenizedHibernate.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
<section id="import_maven_project">
<title>Existing Maven Projects Import</title>
<para>Maven Integration includes the Seam Maven configurator which is called when importing
a project, changing <emphasis>
<property>pom.xml</property></emphasis> and/or calling <emphasis>
- <property>Maven > Update Project Configuration</property>.</emphasis> When
+ <property>Maven > Update Project Configuration</property>.</emphasis> When
importing a Maven Seam project, the Seam Maven configurator picks up the settings set up
in <emphasis>
<property>pom.xml</property></emphasis> and adds to the project the
@@ -140,10 +255,10 @@
</listitem>
</itemizedlist>
<para>If the Seam version from <emphasis>
- <property>pom.xml</property></emphasis> matches a version of a Seam runtime
+ <property>pom.xml</property></emphasis> matches a version of a Seam runtime
configured in the workspace, Seam configurator will set that runtime, otherwise no Seam
- runtime will be set and you'll have to set it manually under <link
- linkend="project_pref">Seam Settings in the project preferences</link>.</para>
+ runtime will be set and you'll have to set it manually under Seam Settings in the
+ project preferences.</para>
<para>Seam configurator recognizes the Seam artifacts in the following way: the view folder
is a web content folder from the WAR project, the source folder is the first Eclipse
source folder. If there is a folder containing "hot" in the name, it will be
@@ -151,7 +266,7 @@
doesn't have any subpackage. </para>
<para>Configuring the Seam when importing a Maven project as well as a Seam Runtime, Seam
artifacts and some facets could be suspended in the JBoss Maven Integration preferences
- (<emphasis>
+ (<emphasis>
<property>Window > Preferences > JBoss Tools > JBoss Maven
Integration</property></emphasis>).</para>
<figure>
@@ -164,8 +279,4 @@
</mediaobject>
</figure>
</section>
-
-
-
-
</chapter>
14 years, 9 months
JBoss Tools SVN: r21350 - branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-08 10:49:05 -0400 (Thu, 08 Apr 2010)
New Revision: 21350
Modified:
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
Log:
fix id in feature.xml
Modified: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml 2010-04-08 14:45:03 UTC (rev 21349)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml 2010-04-08 14:49:05 UTC (rev 21350)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
- id="org.jboss.tools.modeshape.rest.test.feature"
+ id="org.jboss.tools.modeshape.rest.test.sdk.feature"
label="ModeShape Tests SDK Feature"
version="1.0.0"
provider-name="JBoss by Red Hat">
14 years, 9 months
JBoss Tools SVN: r21349 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-04-08 10:45:03 -0400 (Thu, 08 Apr 2010)
New Revision: 21349
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLTemplatesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5946 , https://jira.jboss.org/jira/browse/JBIDE-6131
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLTemplatesWizardPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLTemplatesWizardPage.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLTemplatesWizardPage.java 2010-04-08 14:45:03 UTC (rev 21349)
@@ -0,0 +1,512 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.ui.wizard.newfile;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
+import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
+import org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeIdsXHTML;
+
+/**
+ * Copied from NewHTMLTemplatesWizardPage, because the class is internal and not provide possibility
+ * to inherit from this
+ *
+ *
+ * @author mareshkau
+ *
+ */
+public class NewXHTMLTemplatesWizardPage extends WizardPage {
+ /**
+ * Content provider for templates
+ */
+ private class TemplateContentProvider implements IStructuredContentProvider {
+ /** The template store. */
+ private TemplateStore fStore;
+
+ /*
+ * @see IContentProvider#dispose()
+ */
+ public void dispose() {
+ this.fStore = null;
+ }
+
+ /*
+ * @see IStructuredContentProvider#getElements(Object)
+ */
+ public Object[] getElements(Object input) {
+ return this.fStore.getTemplates(TemplateContextTypeIdsXHTML.NEW);
+ }
+
+ /*
+ * @see IContentProvider#inputChanged(Viewer, Object, Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.fStore = (TemplateStore) newInput;
+ }
+ }
+
+ /**
+ * Label provider for templates.
+ */
+ private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ /*
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
+ * int)
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
+ * int)
+ */
+ public String getColumnText(Object element, int columnIndex) {
+ Template template = (Template) element;
+
+ switch (columnIndex) {
+ case 0 :
+ return template.getName();
+ case 1 :
+ return template.getDescription();
+ default :
+ return ""; //$NON-NLS-1$
+ }
+ }
+ }
+
+ /** Last selected template name */
+ private String fLastSelectedTemplateName;
+ /** The viewer displays the pattern of selected template. */
+ private SourceViewer fPatternViewer;
+ /** The table presenting the templates. */
+ private TableViewer fTableViewer;
+ /** Template store used by this wizard page */
+ private TemplateStore fTemplateStore;
+ /** Checkbox for using templates. */
+ private Button fUseTemplateButton;
+
+ public NewXHTMLTemplatesWizardPage() {
+ super("NewXHTMLTemplatesWizardPage", JsfUIMessages.NewXHTMLTemplatesWizardPage_0, null); //$NON-NLS-1$
+ setDescription(JsfUIMessages.NewXHTMLTemplatesWizardPage_0);
+ }
+
+ /**
+ * Correctly resizes the table so no phantom columns appear
+ *
+ * @param parent
+ * the parent control
+ * @param buttons
+ * the buttons
+ * @param table
+ * the table
+ * @param column1
+ * the first column
+ * @param column2
+ * the second column
+ * @param column3
+ * the third column
+ */
+ private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
+ parent.addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ Rectangle area = parent.getClientArea();
+ Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int width = area.width - 2 * table.getBorderWidth();
+ if (preferredSize.y > area.height) {
+ // Subtract the scrollbar width from the total column
+ // width
+ // if a vertical scrollbar will be required
+ Point vBarSize = table.getVerticalBar().getSize();
+ width -= vBarSize.x;
+ }
+
+ Point oldSize = table.getSize();
+ if (oldSize.x > width) {
+ // table is getting smaller so make the columns
+ // smaller first and then resize the table to
+ // match the client area width
+ column1.setWidth(width / 2);
+ column2.setWidth(width / 2);
+ table.setSize(width, area.height);
+ }
+ else {
+ // table is getting bigger so make the table
+ // bigger first and then make the columns wider
+ // to match the client area width
+ table.setSize(width, area.height);
+ column1.setWidth(width / 2);
+ column2.setWidth(width / 2);
+ }
+ }
+ });
+ }
+
+ public void createControl(Composite ancestor) {
+ Composite parent = new Composite(ancestor, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ parent.setLayout(layout);
+
+ // create checkbox for user to use HTML Template
+ fUseTemplateButton = new Button(parent, SWT.CHECK);
+ fUseTemplateButton.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_4);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+ fUseTemplateButton.setLayoutData(data);
+ fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ enableTemplates();
+ }
+ });
+
+ // create composite for Templates table
+ Composite innerParent = new Composite(parent, SWT.NONE);
+ GridLayout innerLayout = new GridLayout();
+ innerLayout.numColumns = 2;
+ innerLayout.marginHeight = 0;
+ innerLayout.marginWidth = 0;
+ innerParent.setLayout(innerLayout);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ innerParent.setLayoutData(gd);
+
+ Label label = new Label(innerParent, SWT.NONE);
+ label.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_7);
+ data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
+ label.setLayoutData(data);
+
+ // create table that displays templates
+ Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
+
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = convertWidthInCharsToPixels(2);
+ data.heightHint = convertHeightInCharsToPixels(10);
+ data.horizontalSpan = 2;
+ table.setLayoutData(data);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ TableLayout tableLayout = new TableLayout();
+ table.setLayout(tableLayout);
+
+ TableColumn column1 = new TableColumn(table, SWT.NONE);
+ column1.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_2);
+
+ TableColumn column2 = new TableColumn(table, SWT.NONE);
+ column2.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_3);
+
+ fTableViewer = new TableViewer(table);
+ fTableViewer.setLabelProvider(new TemplateLabelProvider());
+ fTableViewer.setContentProvider(new TemplateContentProvider());
+
+ fTableViewer.setSorter(new ViewerSorter() {
+ public int compare(Viewer viewer, Object object1, Object object2) {
+ if ((object1 instanceof Template) && (object2 instanceof Template)) {
+ Template left = (Template) object1;
+ Template right = (Template) object2;
+ int result = left.getName().compareToIgnoreCase(right.getName());
+ if (result != 0)
+ return result;
+ return left.getDescription().compareToIgnoreCase(right.getDescription());
+ }
+ return super.compare(viewer, object1, object2);
+ }
+
+ public boolean isSorterProperty(Object element, String property) {
+ return true;
+ }
+ });
+
+ fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent e) {
+ updateViewerInput();
+ }
+ });
+
+ // create viewer that displays currently selected template's contents
+ fPatternViewer = doCreateViewer(parent);
+
+ fTemplateStore = JsfUiPlugin.getDefault().getTemplateStore();
+ fTableViewer.setInput(fTemplateStore);
+
+ // Create linked text to just to templates preference page
+ Link link = new Link(parent, SWT.NONE);
+ link.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_6);
+ data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+ link.setLayoutData(data);
+ link.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ linkClicked();
+ }
+ });
+
+ configureTableResizing(innerParent, table, column1, column2);
+ loadLastSavedPreferences();
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.HTML_NEWWIZARD_TEMPLATE_HELPID);
+ Dialog.applyDialogFont(parent);
+ setControl(parent);
+ }
+
+ /**
+ * Creates, configures and returns a source viewer to present the template
+ * pattern on the preference page. Clients may override to provide a
+ * custom source viewer featuring e.g. syntax coloring.
+ *
+ * @param parent
+ * the parent control
+ * @return a configured source viewer
+ */
+ private SourceViewer createViewer(Composite parent) {
+ SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+ StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationHTML();
+
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ return baseConfiguration.getConfiguredContentTypes(sourceViewer);
+ }
+
+ public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
+ return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
+ }
+ };
+ SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+ IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor("org.eclipse.wst.html.core.htmlsource");
+ IDocument document = scratchModel.getStructuredDocument();
+ viewer.configure(sourceViewerConfiguration);
+ viewer.setDocument(document);
+ return viewer;
+ }
+
+ private SourceViewer doCreateViewer(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText(JsfUIMessages.NewXHTMLTemplatesWizardPage_5);
+ GridData data = new GridData();
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ SourceViewer viewer = createViewer(parent);
+ viewer.setEditable(false);
+
+ Control control = viewer.getControl();
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 2;
+ data.heightHint = convertHeightInCharsToPixels(5);
+ // [261274] - source viewer was growing to fit the max line width of the template
+ data.widthHint = convertWidthInCharsToPixels(2);
+ control.setLayoutData(data);
+
+ return viewer;
+ }
+
+ /**
+ * Enable/disable controls in page based on fUseTemplateButton's current
+ * state.
+ */
+ void enableTemplates() {
+ boolean enabled = fUseTemplateButton.getSelection();
+
+ if (!enabled) {
+ // save last selected template
+ Template template = getSelectedTemplate();
+ if (template != null)
+ fLastSelectedTemplateName = template.getName();
+ else
+ fLastSelectedTemplateName = ""; //$NON-NLS-1$
+
+ fTableViewer.setSelection(null);
+ }
+ else {
+ setSelectedTemplate(fLastSelectedTemplateName);
+ }
+
+ fTableViewer.getControl().setEnabled(enabled);
+ fPatternViewer.getControl().setEnabled(enabled);
+ }
+
+ /**
+ * Return the template preference page id
+ *
+ * @return
+ */
+ private String getPreferencePageId() {
+ return "org.jboss.tools.jsf.ui.editor.pref.template"; //$NON-NLS-1$
+ }
+
+ /**
+ * Get the currently selected template.
+ *
+ * @return
+ */
+ private Template getSelectedTemplate() {
+ Template template = null;
+ IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
+
+ if (selection.size() == 1) {
+ template = (Template) selection.getFirstElement();
+ }
+ return template;
+ }
+
+ /**
+ * Returns template string to insert.
+ *
+ * @return String to insert or null if none is to be inserted
+ */
+ String getTemplateString() {
+ String templateString = null;
+
+ Template template = getSelectedTemplate();
+ if (template != null) {
+ TemplateContextType contextType = JsfUiPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsXHTML.NEW);
+ IDocument document = new Document();
+ TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
+ try {
+ TemplateBuffer buffer = context.evaluate(template);
+ templateString = buffer.getString();
+ }
+ catch (Exception e) {
+ JsfUiPlugin.getDefault().logWarning("Could not create template for new html", e); //$NON-NLS-1$
+ }
+ }
+
+ return templateString;
+ }
+
+ void linkClicked() {
+ String pageId = getPreferencePageId();
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
+ dialog.open();
+ fTableViewer.refresh();
+ }
+
+ /**
+ * Load the last template name used in New HTML File wizard.
+ */
+ private void loadLastSavedPreferences() {
+ String templateName = JsfUiPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
+ if (templateName == null || templateName.length() == 0) {
+ fLastSelectedTemplateName = ""; //$NON-NLS-1$
+ fUseTemplateButton.setSelection(false);
+ }
+ else {
+ fLastSelectedTemplateName = templateName;
+ fUseTemplateButton.setSelection(true);
+ }
+ enableTemplates();
+ }
+
+ /**
+ * Save template name used for next call to New HTML File wizard.
+ */
+ void saveLastSavedPreferences() {
+ String templateName = ""; //$NON-NLS-1$
+
+ Template template = getSelectedTemplate();
+ if (template != null) {
+ templateName = template.getName();
+ }
+
+ JsfUiPlugin.getDefault().getPreferenceStore().setValue(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+ JsfUiPlugin.getDefault().savePluginPreferences();
+ }
+
+ /**
+ * Select a template in the table viewer given the template name. If
+ * template name cannot be found or templateName is null, just select
+ * first item in table. If no items in table select nothing.
+ *
+ * @param templateName
+ */
+ private void setSelectedTemplate(String templateName) {
+ Object template = null;
+
+ if (templateName != null && templateName.length() > 0) {
+ // pick the last used template
+ template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsXHTML.NEW);
+ }
+
+ // no record of last used template so just pick first element
+ if (template == null) {
+ // just pick first element
+ template = fTableViewer.getElementAt(0);
+ }
+
+ if (template != null) {
+ IStructuredSelection selection = new StructuredSelection(template);
+ fTableViewer.setSelection(selection, true);
+ }
+ }
+
+ /**
+ * Updates the pattern viewer.
+ */
+ void updateViewerInput() {
+ Template template = getSelectedTemplate();
+ if (template != null) {
+ fPatternViewer.getDocument().set(template.getPattern());
+ }
+ else {
+ fPatternViewer.getDocument().set(""); //$NON-NLS-1$
+ }
+ }
+}
14 years, 9 months
JBoss Tools SVN: r21348 - branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-08 10:40:02 -0400 (Thu, 08 Apr 2010)
New Revision: 21348
Modified:
branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
Log:
typo
Modified: branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml
===================================================================
--- branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml 2010-04-08 14:33:47 UTC (rev 21347)
+++ branches/modular_build/modeshape/features/org.jboss.tools.modeshape.rest.test.sdk.feature/feature.xml 2010-04-08 14:40:02 UTC (rev 21348)
@@ -18,7 +18,7 @@
</license>
<includes
- id="org.jboss.tools.modeshapre.rest.test.feature"
+ id="org.jboss.tools.modeshape.rest.test.feature"
version="0.0.0"/>
<plugin
14 years, 9 months
JBoss Tools SVN: r21347 - in trunk: jsf/plugins/org.jboss.tools.jsf.ui/META-INF and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-04-08 10:33:47 -0400 (Thu, 08 Apr 2010)
New Revision: 21347
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeIdsXHTML.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeXHTML.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/VPETemplatePreferencePage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5946 , https://jira.jboss.org/jira/browse/JBIDE-6131
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/META-INF/MANIFEST.MF 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/META-INF/MANIFEST.MF 2010-04-08 14:33:47 UTC (rev 21347)
@@ -52,7 +52,8 @@
org.eclipse.ltk.ui.refactoring;bundle-version="3.4.100",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
org.eclipse.search;bundle-version="3.5.0",
- org.jboss.tools.common.el.core;bundle-version="2.0.0"
+ org.jboss.tools.common.el.core;bundle-version="2.0.0",
+ org.eclipse.wst.html.ui;bundle-version="1.0.401"
Bundle-Version: 2.0.0
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.properties 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.properties 2010-04-08 14:33:47 UTC (rev 21347)
@@ -25,6 +25,7 @@
PreferencePage_JSFFlowTabbed=JSF Flow Diagram
PreferencePage_Validator=Validator
PreferencePage_JSFValidator=JSF Validator
+VPE_Templates=Templates
NewWizardCat_JBossTools=JBoss Tools
NewWizardCat_JSF=JSF
@@ -37,3 +38,12 @@
ImportWizardCat_Struts=Struts
ImportWizardDescription_JSFProject=Create a new Project from a JSF project in the file system. This does not copy the project to the workspace.
ImportWizardDescription_JSFWar=Create a new Project from a JSF project in a WAR file. The content of WAR file will be copied to the workspace.
+
+All_XHTML_context_type_Extension_Element.name=All XHTML
+XHTML_New_context_type_Extension_Element.name=New XHTML
+XHTML_Tag_context_type_Extension_Element.name=XHTML Tag
+XHTML_Attribute_context_type_Extension_Element.name=XHTML Attribute
+XHTML_Attribute_value_context_type_Extension_Element.name=XHTML Attribute value
+
+NewXHTMLPage = XHTML Page
+NewXHTMLPageDescription = Create a New XHTML Page
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2010-04-08 14:33:47 UTC (rev 21347)
@@ -8,6 +8,13 @@
id="org.jboss.tools.jsf.ui"
name="%PreferencePage_JSF">
</page>
+ <page
+ name="%VPE_Templates"
+ category="org.jboss.tools.vpe.editor"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.VPETemplatePreferencePage"
+ id="org.jboss.tools.jsf.ui.editor.pref.template">
+ <keywordReference id="org.eclipse.wst.html.ui.templates"/>
+ </page>
<page category="org.jboss.tools.jsf.ui"
class="org.jboss.tools.jsf.ui.preferences.JSFProjectPreferencesPage"
id="org.jboss.tools.jsf.ui.project"
@@ -129,6 +136,20 @@
</wizard>
<wizard
category="org.jboss.tools.jst.web/org.jboss.tools.jsf"
+ class="org.jboss.tools.jsf.ui.wizard.newfile.NewXHTMLWizard"
+ finalPerspective="org.jboss.tools.jsf.ui.wizard.project.NewProjectWizard"
+ icon="$nl$/images/xstudio/wizards/new_html_file.gif"
+ id="org.jboss.tools.jsf.ui.wizard.newfile.NewXHTMLWizard"
+ name="%NewXHTMLPage"
+ project="false">
+ <description>
+ %NewXHTMLPageDescription
+ </description>
+ <selection class="org.eclipse.core.resources.IResource">
+ </selection>
+ </wizard>
+ <wizard
+ category="org.jboss.tools.jst.web/org.jboss.tools.jsf"
class="org.jboss.tools.jsf.ui.wizard.project.NewProjectWizard"
finalPerspective="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
icon="$nl$/images/xstudio/wizards/new_jsf_project.gif"
@@ -450,6 +471,44 @@
class="org.jboss.tools.jsf.ui.el.refactoring.ELRefactorContributionFactory"
locationURI="popup:org.eclipse.ui.popup.any?after=save">
</menuContribution>
- </extension>
-
+ <menuContribution
+ locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=paste">
+ <dynamic
+ class="org.jboss.tools.jsf.ui.editor.menu.JSF2CompositionComponentContrubutionItem"
+ id="org.jboss.tools.jsf.ui.editor.menu.JSF2CompositionComponentContrubutionItem">
+ </dynamic>
+ </menuContribution>
+ </extension>
+ <!-- Templates -->
+ <extension point="org.eclipse.ui.editors.templates">
+ <contextType
+ name="%All_XHTML_context_type_Extension_Element.name"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeXHTML"
+ id="xhtml_all">
+ </contextType>
+ <contextType
+ name="%XHTML_New_context_type_Extension_Element.name"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeXHTML"
+ id="xhtml_new">
+ </contextType>
+ <contextType
+ name="%XHTML_Tag_context_type_Extension_Element.name"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeXHTML"
+ id="xhtml_tag">
+ </contextType>
+ <contextType
+ name="%XHTML_Attribute_context_type_Extension_Element.name"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeXHTML"
+ id="xhtml_attribute">
+ </contextType>
+ <contextType
+ name="%XHTML_Attribute_value_context_type_Extension_Element.name"
+ class="org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeXHTML"
+ id="xhtml_attribute_value">
+ </contextType>
+ <include
+ file="src/templates/xhtmldefault-templates.xml"
+ translations="src/templates/xhtmldefault-templates.properties">
+ </include>
+ </extension>
</plugin>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -29,6 +29,17 @@
public static String REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE;
public static String EL_REFACTOR_RENAME_HANDLER_ERROR;
public static String RENAME_EL_VARIABLE_WIZARD_EL_VARIABLE_NAME;
+ public static String UI_WIZARD_XHTML_NEW_TITLE;
+ public static String UI_WIZARD_XHTML_NEW_Description;
+
+ public static String NewXHTMLTemplatesWizardPage_0;
+ public static String NewXHTMLTemplatesWizardPage_1;
+ public static String NewXHTMLTemplatesWizardPage_2;
+ public static String NewXHTMLTemplatesWizardPage_3;
+ public static String NewXHTMLTemplatesWizardPage_4;
+ public static String NewXHTMLTemplatesWizardPage_5;
+ public static String NewXHTMLTemplatesWizardPage_6;
+ public static String NewXHTMLTemplatesWizardPage_7;
static {
// initialize resource bundle
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -10,16 +10,33 @@
******************************************************************************/
package org.jboss.tools.jsf.ui;
+import java.io.IOException;
+
+
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.jsf.ui.editor.check.ProjectNaturesChecker;
+import org.jboss.tools.jsf.ui.editor.pref.template.TemplateContextTypeIdsXHTML;
import org.osgi.framework.BundleContext;
public class JsfUiPlugin extends BaseUIPlugin {
public static String PLUGIN_ID = "org.jboss.tools.jsf.ui"; //$NON-NLS-1$
+
+ /**
+ * The template store for the html editor.
+ */
+ private TemplateStore fTemplateStore;
+ /**
+ * The template context type registry for the html editor.
+ */
+ private ContextTypeRegistry fContextTypeRegistry;
public JsfUiPlugin() {
}
@@ -56,5 +73,37 @@
public void stop(BundleContext context) throws Exception {
super.stop(context);
}
+
+ public TemplateStore getTemplateStore() {
+ if (this.fTemplateStore == null) {
+ this.fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "org.jboss.tools.jsf.ui.custom_templates");
+
+ try {
+ this.fTemplateStore.load();
+ } catch (IOException e) {
+ this.logError(e);
+ }
+ }
+ return this.fTemplateStore;
+ }
+ /**
+ * Returns the template context type registry for the html plugin.
+ *
+ * @return the template context type registry for the html plugin
+ */
+ public ContextTypeRegistry getTemplateContextRegistry() {
+ if (this.fContextTypeRegistry == null) {
+ ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
+ registry.addContextType(TemplateContextTypeIdsXHTML.ALL);
+ registry.addContextType(TemplateContextTypeIdsXHTML.NEW);
+ registry.addContextType(TemplateContextTypeIdsXHTML.TAG);
+ registry.addContextType(TemplateContextTypeIdsXHTML.ATTRIBUTE);
+ registry.addContextType(TemplateContextTypeIdsXHTML.ATTRIBUTE_VALUE);
+
+ this.fContextTypeRegistry = registry;
+ }
+
+ return this.fContextTypeRegistry;
+ }
}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeIdsXHTML.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeIdsXHTML.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeIdsXHTML.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.ui.editor.pref.template;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class TemplateContextTypeIdsXHTML {
+ public static final String ALL = getAll();
+
+ public static final String ATTRIBUTE = getAttribute();
+
+ public static final String ATTRIBUTE_VALUE = getAttributeValue();
+
+ public static final String NEW = getNew();
+
+ public static final String TAG = getTag();
+
+ private static String getAll() {
+ return getPrefix() + "_all"; //$NON-NLS-1$
+ }
+
+ private static String getAttribute() {
+ return getPrefix() + "_attribute"; //$NON-NLS-1$
+ }
+
+ private static String getAttributeValue() {
+ return getPrefix() + "_attribute_value"; //$NON-NLS-1$
+ }
+
+ private static String getNew() {
+ return getPrefix() + "_new"; //$NON-NLS-1$
+ }
+
+ private static String getTag() {
+ return getPrefix() + "_tag"; //$NON-NLS-1$
+ }
+
+ private static String getPrefix() {
+ return "xhtml"; //$NON-NLS-1$
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeXHTML.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeXHTML.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/TemplateContextTypeXHTML.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.ui.editor.pref.template;
+
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class TemplateContextTypeXHTML extends TemplateContextTypeHTML {
+
+ public TemplateContextTypeXHTML() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/VPETemplatePreferencePage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/VPETemplatePreferencePage.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/pref/template/VPETemplatePreferencePage.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.ui.editor.pref.template;
+
+import org.eclipse.wst.html.ui.internal.preferences.ui.HTMLTemplatePreferencePage;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VPETemplatePreferencePage extends HTMLTemplatePreferencePage {
+
+ public VPETemplatePreferencePage() {
+ JsfUiPlugin jsfUiPlugin = JsfUiPlugin.getDefault();
+ setPreferenceStore(jsfUiPlugin.getPreferenceStore());
+ setTemplateStore(jsfUiPlugin.getTemplateStore());
+ setContextTypeRegistry(jsfUiPlugin.getTemplateContextRegistry());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ boolean ok = super.performOk();
+ JsfUiPlugin.getDefault().savePluginPreferences();
+ return ok;
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-04-08 14:33:47 UTC (rev 21347)
@@ -20,4 +20,14 @@
REFACTOR_CONTRIBUTOR_MAIN_MENU=EL Refactor
REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE=Rename EL Variable
RENAME_EL_VARIABLE_WIZARD_EL_VARIABLE_NAME=Seam component name:
+UI_WIZARD_XHTML_NEW_TITLE=New XHTML Page
+UI_WIZARD_XHTML_NEW_Description=Create New XHTML Page
+NewXHTMLTemplatesWizardPage_0=Select XHTML Template
+NewXHTMLTemplatesWizardPage_1=Select a template as initial content in theX HTML page.
+NewXHTMLTemplatesWizardPage_2=Name
+NewXHTMLTemplatesWizardPage_3=Description
+NewXHTMLTemplatesWizardPage_4=&Use XHTML Template
+NewXHTMLTemplatesWizardPage_5=&Preview:
+NewXHTMLTemplatesWizardPage_6=Templates are 'New XHTML' templates found in the <a>XHTML Templates</a> preference page.
+NewXHTMLTemplatesWizardPage_7=&Templates:
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/newfile/NewXHTMLWizard.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.ui.wizard.newfile;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class NewXHTMLWizard extends NewHTMLWizard{
+
+ private static final String HTMLWizardNewFileCreationPage = "HTMLWizardNewFileCreationPage"; //$NON-NLS-1$
+ private static final String NewHTMLTemplatesWizardPage = "NewHTMLTemplatesWizardPage"; //$NON-NLS-1$
+
+ private WizardNewFileCreationPage fNewFilePage;
+ private NewXHTMLTemplatesWizardPage fNewFileTemplatesPage;
+
+
+
+ @Override
+ public void addPages() {
+ super.addPages();
+
+ this.fNewFilePage = (WizardNewFileCreationPage) getPage(NewXHTMLWizard.HTMLWizardNewFileCreationPage);
+ this.fNewFilePage.setTitle(JsfUIMessages.UI_WIZARD_XHTML_NEW_TITLE);
+ this.fNewFilePage.setDescription(JsfUIMessages.UI_WIZARD_XHTML_NEW_Description);
+
+ this.fNewFileTemplatesPage = new NewXHTMLTemplatesWizardPage();
+ addPage(this.fNewFileTemplatesPage);
+ }
+ @Override
+ public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
+ super.init(aWorkbench, aSelection);
+ setWindowTitle(JsfUIMessages.UI_WIZARD_XHTML_NEW_TITLE);
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPage(org.eclipse.jface.wizard.IWizardPage)
+ */
+ @Override
+ public void addPage(IWizardPage page) {
+ if(!NewXHTMLWizard.NewHTMLTemplatesWizardPage.equalsIgnoreCase(page.getName())){
+ super.addPage(page);
+ }
+ }
+ @Override
+ public boolean performFinish() {
+ boolean performedOK = false;
+ // save user options for next use
+ fNewFileTemplatesPage.saveLastSavedPreferences();
+
+ // no file extension specified so add default extension
+ String fileName = fNewFilePage.getFileName();
+ if (fileName.lastIndexOf('.') == -1) {
+ String newFileName = fileName+".xthml"; //$NON-NLS-1$
+ fNewFilePage.setFileName(newFileName);
+ }
+
+ // create a new empty file
+ IFile file = fNewFilePage.createNewFile();
+
+ // if there was problem with creating file, it will be null, so make
+ // sure to check
+ if (file != null) {
+ // put template contents into file
+ String templateString = fNewFileTemplatesPage.getTemplateString();
+ if (templateString != null) {
+ templateString = applyLineDelimiter(file, templateString);
+ // determine the encoding for the new file
+ Preferences preference = JsfUiPlugin.getDefault().getPluginPreferences();
+ String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+
+ try {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ OutputStreamWriter outputStreamWriter = null;
+ if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
+ // just use default encoding
+ outputStreamWriter = new OutputStreamWriter(outputStream);
+ }
+ else {
+ outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
+ }
+ outputStreamWriter.write(templateString);
+ outputStreamWriter.flush();
+ outputStreamWriter.close();
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
+ file.setContents(inputStream, true, false, null);
+ inputStream.close();
+ }
+ catch (Exception e) {
+ JsfUiPlugin.getDefault().logWarning("Could not create contents for new HTML file", e); //$NON-NLS-1$
+ }
+ }
+
+ // open the file in editor
+ openEditor(file);
+
+ // everything's fine
+ performedOK = true;
+ }
+ return performedOK;
+ }
+ private String applyLineDelimiter(IFile file, String text) {
+ String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
+ String convertedText = StringUtils.replace(text, "\r\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ convertedText = StringUtils.replace(convertedText, "\r", "\n"); //$NON-NLS-1$//$NON-NLS-2$
+ convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter); //$NON-NLS-1$
+ return convertedText;
+ }
+ private void openEditor(final IFile file) {
+ if (file != null) {
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IDE.openEditor(page, file, true);
+ }
+ catch (PartInitException e) {
+ JsfUiPlugin.getDefault().logError(e.getMessage(), e);
+ }
+ }
+ });
+ }
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.properties (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.properties 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,19 @@
+Templates.xhtml.blank = Blank XHTML Page
+Templates.xhtml.blank.desc = XHTML Blank Page Template
+Templates.xhtml.blank.content =
+
+Templates.xhtml.blank.facelet = Blank Facelet Page
+Templates.xhtml.blank.facelet.desc = XHTML Blank Facelet Page Template
+Templates.xhtml.facelet.blank.content =<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"\n xmlns:ui="http://java.sun.com/jsf/facelets"\n xmlns:f="http://java.sun.com/jsf/core"\n xmlns:h="http://java.sun.com/jsf/html">\n\n <ui:composition template="">\n </ui:composition>\n</html>
+
+Templates.xhtml.facelet.common = Common Facelet Page
+Templates.xhtml.facelet.common.desc = Common Facelet Page Template
+Templates.xhtml.facelet.commont.content = <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"\n xmlns:ui="http://java.sun.com/jsf/facelets"\n xmlns:h="http://java.sun.com/jsf/html"\n xmlns:f="http://java.sun.com/jsf/core">\n \n <f:loadBundle basename="resources" var="msg" />\n <head>\n <title><ui:insert name="pageTitle">Page Title</ui:insert></title>\n <style type="text/css">\n body {\n font-family: Verdana, Arial, Helvetica, sans-serif;\n font-size: 14px;\n }\n .header {\n font-family: Verdana, Arial, Helvetica, sans-serif;\n font-size: 18px;\n }\n .bottom {\n font-family: Verdana, Arial, Helvetica, sans-serif;\n font-size: 9px;\n text-align: center;\n vertical-align: middle;\n color: #8E969D;\n }\n </style>\n </head>\n\n<body bgcolor="#ffffff">\n<table style="border:1px solid!
#CAD6E0" align="center" cellpadding="0" cellspacing="0" border="0" width="400">\n<tbody>\n\n <tr>\n <td class="header" height="42" align="center" valign="middle" width="100%" bgcolor="#E4EBEB">\n <ui:insert name="pageHeader">Page Header</ui:insert>\n </td>\n </tr>\n <tr>\n <td height="1" width="100%" bgcolor="#CAD6E0"></td>\n </tr> \n\n <tr>\n <td width="100%" colspan="2">\n <table width="100%" style="height:150px" align="left" cellpadding="0" cellspacing="0" border="0">\n <tbody>\n <tr>\n <td align="center" width="100%" valign="middle">\n \n <ui:insert name="body">Page Body</ui:insert>\n \n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr> \n \n <tr>\n <td colspan="2" valign="bottom" height="1" width="100%" bgcolor="#CAD6E0"></td>\n </tr>\n</tbody>\n</table>\n</body>\n \n</html>
+
+Templates.xhtml.facelet.form = Form Facelet Page
+Templates.xhtml.facelet.form.desc = Form Facelet Page Template
+Templates.xhtml.facelet.form.content = <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"\n xmlns:ui="http://java.sun.com/jsf/facelets"\n xmlns:f="http://java.sun.com/jsf/core"\n xmlns:h="http://java.sun.com/jsf/html">\n\n <!-- \n Replace path to template, title, header and body\n with actual data.\n -->\n <ui:composition template="/templates/common.xhtml">\n <ui:define name="pageTitle">Title</ui:define>\n <ui:define name="pageHeader">Header</ui:define>\n <ui:define name="body">\n <form jsfc="h:form" id="Form">\n \n </form>\n </ui:define>\n </ui:composition>\n\n</html>
+
+Templates.xhtml.jsf2.composite.component = JSF Composite Component
+Templates.xhtml.jsf2.composite.component.desc = New JSF Composite Component Template
+Templates.xhtml.jsf2.composite.component.content = <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"\nxmlns:h="http://java.sun.com/jsf/html"\nxmlns:f="http://java.sun.com/jsf/core"\nxmlns:ui="http://java.sun.com/jsf/facelets"\nxmlns:composite="http://java.sun.com/jsf/composite">\n<head>\n<title>Not present in rendered output</title>\n</head>\n<body>\n<composite:interface>\n\n</composite:interface>\n<composite:implementation>\n\n</composite:implementation>\n</body>\n</html>
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.xml (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/templates/xhtmldefault-templates.xml 2010-04-08 14:33:47 UTC (rev 21347)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates>
+<template name="%Templates.xhtml.blank" description="%Templates.xhtml.blank.desc" id="org.jboss.tools.jsf.ui.xhtml.blank" context="xhtml_new" enabled="true">%Templates.xhtml.blank.content</template>
+
+<template name="%Templates.xhtml.blank.facelet" description="%Templates.xhtml.blank.facelet.desc" id="org.jboss.tools.jsf.ui.xhtml.facelet.blank" context="xhtml_new" enabled="true">%Templates.xhtml.facelet.blank.content</template>
+
+<template name="%Templates.xhtml.facelet.common" description="%Templates.xhtml.facelet.common.desc" id="org.jboss.tools.jsf.ui.xhtml.facelet.common" context="xhtml_new" enabled="true">%Templates.xhtml.facelet.commont.content</template>
+
+<template name="%Templates.xhtml.facelet.form" description="%Templates.xhtml.facelet.form.desc" id="org.jboss.tools.jsf.ui.xhtml.facelet.form" context="xhtml_new" enabled="true">%Templates.xhtml.facelet.form.content</template>
+
+<template name="%Templates.xhtml.jsf2.composite.component" description="%Templates.xhtml.jsf2.composite.component.desc" id="org.jboss.tools.jsf.ui.xhtml.jsf2.composite.component" context="xhtml_new" enabled="true">%Templates.xhtml.jsf2.composite.component.content</template>
+
+</templates>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -15,10 +15,7 @@
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.common.model.XModelObject;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java 2010-04-08 14:18:02 UTC (rev 21346)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java 2010-04-08 14:33:47 UTC (rev 21347)
@@ -14,9 +14,7 @@
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
14 years, 9 months
JBoss Tools SVN: r21346 - in branches/hibernatetools-multiversion/hibernatetools/plugins: org.hibernate.mediator/src/org/hibernate/mediator/base and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-04-08 10:18:02 -0400 (Thu, 08 Apr 2010)
New Revision: 21346
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - create/invoke by string name - for all classes 2
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -458,7 +458,15 @@
//HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
}
}
- return configStub.getHQLCodeAssist();
+ HQLCodeAssistStub res = (HQLCodeAssistStub)execute(new ExecutionContext.Command() {
+ public Object execute() {
+ if (configStub != null) {
+ return configStub.getHQLCodeAssist();
+ }
+ return null;
+ }
+ } );
+ return res;
}
public void buildMappings() {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -111,13 +111,30 @@
return invokeStaticMethod(className, methodName, new HObject[] { ho(param0) });
}
- public static Object invokeStaticMethod(final String className, final String methodName, Object param0, Object param1) {
+ public static Object invokeStaticMethod(final String className, final String methodName, Object param0,
+ Object param1) {
return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1) });
}
- public static Object invokeStaticMethod(final String className, final String methodName, Object param0, Object param1, Object param2) {
+ public static Object invokeStaticMethod(final String className, final String methodName, Object param0,
+ Object param1, Object param2) {
return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1), ho(param2) });
}
+
+ public static Object invokeStaticMethod(final String className, final String methodName, Object param0,
+ Object param1, Object param2, Object param3) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1), ho(param2), ho(param3) });
+ }
+
+ public static Object invokeStaticMethod(final String className, final String methodName, Object param0,
+ Object param1, Object param2, Object param3, Object param4) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1), ho(param2), ho(param3), ho(param4) });
+ }
+
+ public static Object invokeStaticMethod(final String className, final String methodName, Object param0,
+ Object param1, Object param2, Object param3, Object param4, Object param5) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1), ho(param2), ho(param3), ho(param4), ho(param5) });
+ }
public static Object invokeStaticMethod(final String className, final String methodName, HObject[] params ) {
Class<?>[] signature = new Class<?>[params.length];
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -18,6 +18,6 @@
}
public void codeComplete(String query, int position, IHQLCompletionRequestorStub requestor) {
- invoke(mn(), query, position, requestor);
+ invoke(mn(), query, position, requestor.hqlCompletionRequestor);
}
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -1,30 +1,38 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.tool.ide.completion.IHQLCompletionRequestor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+
public abstract class IHQLCompletionRequestorStub {
- public static final String CL = "org.hibernate.tool.ide.completion.HQLCompletionProposal"; //$NON-NLS-1$
+ public static final String CL = "org.hibernate.tool.ide.completion.IHQLCompletionRequestor"; //$NON-NLS-1$
- protected IHQLCompletionRequestor hqlCompletionRequestor;
-
+ protected Object hqlCompletionRequestor;
+
public IHQLCompletionRequestorStub() {
- }
- /** /
- protected IHQLCompletionRequestorStub() {
- hqlCompletionRequestor = new IHQLCompletionRequestor() {
-
- public boolean accept(HQLCompletionProposal proposal) {
- return IHQLCompletionRequestorStub.this.accept(new HQLCompletionProposalStub(proposal));
+ Class<?> clazz;
+ try {
+ clazz = ReflectHelper.classForName(CL);
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ InvocationHandler handler = new InvocationHandler() {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ if ("accept".equals(method.getName())) { //$NON-NLS-1$
+ return IHQLCompletionRequestorStub.this.accept(new HQLCompletionProposalStub(args[0]));
+ } else if ("completionFailure".equals(method.getName())) { //$NON-NLS-1$
+ IHQLCompletionRequestorStub.this.completionFailure(args[0].toString());
+ }
+ return null;
}
-
- public void completionFailure(String errorMessage) {
- IHQLCompletionRequestorStub.this.completionFailure(errorMessage);
- }
-
};
+ hqlCompletionRequestor = Proxy.newProxyInstance(clazz.getClassLoader(),
+ new Class[] { clazz }, handler);
}
- /**/
-
+
public abstract boolean accept(HQLCompletionProposalStub proposal);
+
public abstract void completionFailure(String errorMessage);
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -1,27 +1,26 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
+import org.hibernate.mediator.base.HObject;
-// TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public class JDBCToHibernateTypeHelperStub {
public static final String CL = "org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper"; //$NON-NLS-1$
public static String getJDBCTypeName(int intValue) {
- return JDBCToHibernateTypeHelper.getJDBCTypeName(intValue);
+ return (String)HObject.invokeStaticMethod(CL, "getJDBCTypeName", (Integer)intValue); //$NON-NLS-1$
}
public static String getPreferredHibernateType(int intValue, int length, int precision,
int scale, boolean nullability, boolean b) {
- return JDBCToHibernateTypeHelper.getPreferredHibernateType(intValue,
- length, precision, scale, nullability, b);
+ return (String)HObject.invokeStaticMethod(CL, "getPreferredHibernateType", (Integer)intValue, //$NON-NLS-1$
+ (Integer)length, (Integer)precision, (Integer)scale, (Boolean)nullability, (Boolean)b);
}
public static boolean typeHasLength(int intValue) {
- return JDBCToHibernateTypeHelper.typeHasLength(intValue);
+ return (Boolean)HObject.invokeStaticMethod(CL, "typeHasLength", (Integer)intValue); //$NON-NLS-1$
}
public static boolean typeHasScaleAndPrecision(int intValue) {
- return JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(intValue);
+ return (Boolean)HObject.invokeStaticMethod(CL, "typeHasScaleAndPrecision", (Integer)intValue); //$NON-NLS-1$
}
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -1,20 +1,33 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.ProgressListener;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
-//TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+
public abstract class ProgressListenerStub {
public static final String CL = "org.hibernate.cfg.reveng.ProgressListener"; //$NON-NLS-1$
- protected ProgressListener progressListener = new ProgressListener() {
-
- public void startSubTask(String name) {
- ProgressListenerStub.this.startSubTask(name);
- }
-
- };
+ protected Object progressListener;
protected ProgressListenerStub() {
+ Class<?> clazz;
+ try {
+ clazz = ReflectHelper.classForName(CL);
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ InvocationHandler handler = new InvocationHandler() {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ if ("startSubTask".equals(method.getName())) { //$NON-NLS-1$
+ ProgressListenerStub.this.startSubTask(args[0].toString());
+ }
+ return null;
+ }
+ };
+ progressListener = Proxy.newProxyInstance(clazz.getClassLoader(),
+ new Class[] { clazz }, handler);
}
public abstract void startSubTask(String name);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-04-08 14:09:46 UTC (rev 21345)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-04-08 14:18:02 UTC (rev 21346)
@@ -29,6 +29,7 @@
import bsh.EvalError;
import bsh.Interpreter;
+// TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public class SessionStub extends HObject {
public static final String CL = "org.hibernate.Session"; //$NON-NLS-1$
14 years, 9 months