JBoss Tools SVN: r23508 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 18:30:18 -0400 (Fri, 16 Jul 2010)
New Revision: 23508
Added:
trunk/build/aggregate/site/aggregateSite.jbosstools.properties
Removed:
trunk/build/aggregate/site/associate.sites.jbosstools.properties
Log:
refactor and remove values that are defaulted
Copied: trunk/build/aggregate/site/aggregateSite.jbosstools.properties (from rev 23507, trunk/build/aggregate/site/associate.sites.jbosstools.properties)
===================================================================
--- trunk/build/aggregate/site/aggregateSite.jbosstools.properties (rev 0)
+++ trunk/build/aggregate/site/aggregateSite.jbosstools.properties 2010-07-16 22:30:18 UTC (rev 23508)
@@ -0,0 +1,17 @@
+# options: Nightly Build (default), Development Milestone, Stable Release
+#update.site.description=Nightly Build
+#update.site.description=Development Milestone
+#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/helios/,\
+http://download.eclipse.org/eclipse/updates/3.6/,\
+http://download.eclipse.org/birt/update-site/2.6/,\
+http://download.eclipse.org/tptp/updates/galileo/,\
+http://m2eclipse.sonatype.org/sites/m2e/,\
+http://m2eclipse.sonatype.org/sites/m2e-extras/,\
+http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/updateSite/,\
+http://download.eclipse.org/rt/ecf/3.2/3.6/site.p2,\
+http://subclipse.tigris.org/update_1.6.x/,\
+http://download.eclipse.org/technology/subversive/0.7/update-site/,\
+http://community.polarion.com/projects/subversive/download/eclipse/2.0/update-site/
Property changes on: trunk/build/aggregate/site/aggregateSite.jbosstools.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/build/aggregate/site/associate.sites.jbosstools.properties
===================================================================
--- trunk/build/aggregate/site/associate.sites.jbosstools.properties 2010-07-16 19:54:29 UTC (rev 23507)
+++ trunk/build/aggregate/site/associate.sites.jbosstools.properties 2010-07-16 22:30:18 UTC (rev 23508)
@@ -1,12 +0,0 @@
-# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/helios/,\
-http://download.eclipse.org/eclipse/updates/3.6/,\
-http://download.eclipse.org/birt/update-site/2.6/,\
-http://download.eclipse.org/tptp/updates/galileo/,\
-http://m2eclipse.sonatype.org/sites/m2e/,\
-http://m2eclipse.sonatype.org/sites/m2e-extras/,\
-http://subclipse.tigris.org/update_1.6.x/,\
-http://download.eclipse.org/technology/subversive/0.7/update-site/,\
-http://community.polarion.com/projects/subversive/download/eclipse/2.0/update-site/,\
-http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/updateSite/,\
-http://download.eclipse.org/rt/ecf/3.2/3.6/site.p2
15 years, 9 months
JBoss Tools SVN: r23507 - in trunk/build/aggregate/site: web and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 15:54:29 -0400 (Fri, 16 Jul 2010)
New Revision: 23507
Added:
trunk/build/aggregate/site/associate.sites.jbosstools.properties
trunk/build/aggregate/site/build.xml
trunk/build/aggregate/site/index.html
trunk/build/aggregate/site/web/
trunk/build/aggregate/site/web/site.css
Log:
update site needs html, css, and p2 metadata needs associate sites
Added: trunk/build/aggregate/site/associate.sites.jbosstools.properties
===================================================================
--- trunk/build/aggregate/site/associate.sites.jbosstools.properties (rev 0)
+++ trunk/build/aggregate/site/associate.sites.jbosstools.properties 2010-07-16 19:54:29 UTC (rev 23507)
@@ -0,0 +1,12 @@
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/helios/,\
+http://download.eclipse.org/eclipse/updates/3.6/,\
+http://download.eclipse.org/birt/update-site/2.6/,\
+http://download.eclipse.org/tptp/updates/galileo/,\
+http://m2eclipse.sonatype.org/sites/m2e/,\
+http://m2eclipse.sonatype.org/sites/m2e-extras/,\
+http://subclipse.tigris.org/update_1.6.x/,\
+http://download.eclipse.org/technology/subversive/0.7/update-site/,\
+http://community.polarion.com/projects/subversive/download/eclipse/2.0/update-site/,\
+http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/updateSite/,\
+http://download.eclipse.org/rt/ecf/3.2/3.6/site.p2
Property changes on: trunk/build/aggregate/site/associate.sites.jbosstools.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/aggregate/site/build.xml
===================================================================
--- trunk/build/aggregate/site/build.xml (rev 0)
+++ trunk/build/aggregate/site/build.xml 2010-07-16 19:54:29 UTC (rev 23507)
@@ -0,0 +1,124 @@
+<project default="custom.build" name="jbosstools aggregate site build.xml">
+
+ <!-- should be set by script or in Hudson -->
+ <property name="ZIPSUFFIX" value="SNAPSHOT" />
+
+ <!-- should be set by Hudson -->
+ <!-- <property name="JOB_NAME" value="jbosstools-3.2.0.M2.continuous" /> -->
+
+ <!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here. -->
+ <condition property="output.dir" value="${WORKSPACE}/results" else="${basedir}">
+ <available file="${WORKSPACE}/results" />
+ </condition>
+
+ <condition property="COMMON_TOOLS" value="/home/hudson/static_build_env/jbds/tools" else="${java.io.tmpdir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ </condition>
+ <mkdir dir="${COMMON_TOOLS}" />
+
+ <condition property="build.xml" value="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml">
+ <available file="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml" type="file" />
+ </condition>
+ <condition property="build.xml" value="${basedir}/../../build/build.xml">
+ <available file="${basedir}/../../build/build.xml" type="file" />
+ </condition>
+ <condition property="build.xml" value="${basedir}/../../build.xml">
+ <available file="${basedir}/../../build.xml" type="file" />
+ </condition>
+ <!-- if can't calculate where build/build.xml is located, must pass in path from parent when calling this script -->
+
+ <property name="update.site.source.dir" value="${output.dir}/target/site" />
+
+ <target name="init">
+ <ant antfile="${build.xml}" target="init" />
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
+ </target>
+
+ <target name="add.associate.sites">
+ <if>
+ <and>
+ <not>
+ <isset property="associate.sites" />
+ </not>
+ </and>
+ <then>
+ <!-- load associate sites from default (or alternate) properties file -->
+ <property name="associate.sites.properties" value="associate.sites.jbosstools.properties" />
+ <property file="${associate.sites.properties}" />
+ </then>
+ </if>
+
+ <if>
+ <and>
+ <isset property="associate.sites" />
+ <not>
+ <equals arg1="${associate.sites}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <if>
+ <available file="${update.site.source.dir}/content.jar" type="file" />
+ <then>
+ <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
+ <delete file="${update.site.source.dir}/content.jar" />
+ </then>
+ </if>
+ <!-- counter variable -->
+ <var name="associate.sites.0" value="" />
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <var name="associate.sites.0" value="${associate.sites.0}00" />
+ </sequential>
+ </for>
+ <length property="associate.sites.length" string="${associate.sites.0}" />
+
+ <loadfile srcfile="${update.site.source.dir}/content.xml" property="content.xml">
+ <filterchain>
+ <tailfilter lines="-1" skip="1" />
+ </filterchain>
+ </loadfile>
+ <echo file="${update.site.source.dir}/content.xml" message="${content.xml}" />
+ <echo file="${update.site.source.dir}/content.xml" append="true"> <references size='${associate.sites.length}'>
+</echo>
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <!-- insert into content.xml -->
+ <echo file="${update.site.source.dir}/content.xml" append="true"> <repository uri='@{associate.site}' url='@{associate.site}' type='0' options='1'/>
+ <repository uri='@{associate.site}' url='@{associate.site}' type='1' options='1'/>
+</echo>
+ </sequential>
+ </for>
+ <echo file="${update.site.source.dir}/content.xml" append="true"> </references>
+</repository>
+</echo>
+ <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
+ <delete file="${update.site.source.dir}/content.xml" />
+ </then>
+ </if>
+ </target>
+
+ <target name="unpack.zip">
+ <unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
+ </target>
+
+ <target name="pack.zip">
+ <zip destfile="${output.dir}/target/site_assembly.zip" update="true" basedir="${update.site.source.dir}" includes="content.* index.html, web/*.css" />
+ </target>
+
+ <target name="add.web.content">
+ <!-- TODO generate correct variables in index.html -->
+ <copy todir="${update.site.source.dir}">
+ <fileset dir="${output.dir}" includes="index.html, **/*.css" />
+ </copy>
+ </target>
+
+ <!-- <target name="custom.build" description="aggregate update site extras" depends="init,unpack.zip,add.associate.sites,add.web.content,pack.zip,cleanup" /> -->
+ <target name="custom.build" description="aggregate update site extras" depends="init,add.associate.sites,add.web.content,pack.zip" />
+
+</project>
Property changes on: trunk/build/aggregate/site/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/aggregate/site/index.html
===================================================================
--- trunk/build/aggregate/site/index.html (rev 0)
+++ trunk/build/aggregate/site/index.html 2010-07-16 19:54:29 UTC (rev 23507)
@@ -0,0 +1,136 @@
+<html>
+<head>
+<title>JBoss Tools ${update.site.description} Update Site: ${product.versionTag}</title>
+<style>
+@import url("web/site.css");
+</style>
+</head>
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"
+ cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2"><img
+ src="https://www.jboss.org/dms/tools/images/tools-banner.png" /></td>
+ </tr>
+ <tr>
+ <td>  </td>
+ </tr>
+ <tr>
+ <td>  </td>
+ <td>
+ <h2 class="title">JBoss Tools ${update.site.description} Update Site</h2>
+ <table width="100%">
+ <tr class="header">
+ <td class="sub-header" width="100%"><span>Latest Build:
+ ${product.versionTag}</span></td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">This is the <b>${update.site.description}</b>
+ Update Site for JBoss Tools. See <a class="link"
+ href="http://www.jboss.org/tools/download/update">Installation
+ Instructions</a>.</p>
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 90px">
+ <td class="bodyText">
+ <p class="bodyText"><b class="bodyText" style="color: red;">NOTE:</b> Some
+ features (such as BIRT and Maven) require additional third-party
+ prerequisites not available from Eclipse.org or JBoss.org. These can
+ be installed from the following update sites, which may already be
+ listed - but not enabled - in your Eclipse's list of Available
+ Software Sites:</p>
+ <ul>
+ <li><a class="link" href="http://download.eclipse.org/birt/update-site/2.6/">BIRT 2.6 Update Site</a></li>
+ <li><a href="http://m2eclipse.sonatype.org/sites/m2e/">m2eclipse 0.10 Release</a></li>
+ <li><a href="http://m2eclipse.sonatype.org/sites/m2e-extras/">m2eclipse Extras 0.10 Release</a></li>
+ </ul>
+ </td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">You can also download JBoss Tools as
+ individual zips for offline installation. See <a class="link"
+ href="http://www.jboss.org/tools/download">JBoss Tools
+ Downloads</a>.</p>
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">For more information, see <a
+ href="http://www.jboss.org/tools/download/installation">Installation
+ methods</a>.</p>
+ </td>
+ </tr>
+ <tr>
+ <td class="spacer"><br />
+ </td>
+ <td class="spacer"><br />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <table width="100%">
+ <tr class="header">
+ <td class="sub-header" width="100%"><span> Installation
+ Types</span></td>
+ </tr>
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">Depending on how close to the bleeding edge
+ you like to be, there are several types of releases available.</p>
+ <br />
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Stable Releases</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/stable.html">Stable
+ releases</a> are - as indicated by their name - stable.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Development Milestones</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/dev.html">Development
+ builds</a>, released once per milestone and only a few times a year, are
+ fairly stable, but there may be some things which do not yet work.
+ If you would like to try one of these milestones, we'd greatly
+ appreciate the assistance in testing and <a
+ href="https://jira.jboss.org/jira/browse/JBIDE">reporting of
+ issues in our issue tracker</a>.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Nightly Builds</h4>
+
+ <p>The <a
+ href="https://www.jboss.org/tools/download/nightly.html">bleeding
+ edge</a> contains the latest and greatest new features, but nothing is
+ stable or guaranteed - yet. If you're using a Milestone and need a
+ fix, you can update to the latest Nightly, or wait for the next
+ Milestone.</p><br/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</html>
Property changes on: trunk/build/aggregate/site/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/aggregate/site/web/site.css
===================================================================
--- trunk/build/aggregate/site/web/site.css (rev 0)
+++ trunk/build/aggregate/site/web/site.css 2010-07-16 19:54:29 UTC (rev 23507)
@@ -0,0 +1,66 @@
+<
+STYLE type ="text/css">td.spacer {
+ padding-bottom: 10px;
+ padding-top: 10px;
+}
+
+.title {
+ font-family: sans-serif;
+ color: #1778be;
+}
+
+.bodyText {
+ font-family: sans-serif;
+ font-size: 9pt;
+ color: #000000;
+}
+
+.sub-header {
+ font-family: sans-serif;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 9pt;
+ color: white;
+}
+
+.log-text {
+ font-family: sans-serif;
+ font-style: normal;
+ font-weight: lighter;
+ font-size: 8pt;
+ color: black;
+}
+
+.big-header {
+ font-family: sans-serif;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 9pt;
+ color: white;
+ border-top: 10px solid white;
+}
+
+.light-row {
+ background: #FFFFFF
+}
+
+.dark-row {
+ background: #EEEEEE
+}
+
+.header {
+ background: #445562
+}
+
+#indent {
+ word-wrap: break-word;
+ width: 300px;
+ text-indent: 10px;
+}
+
+.link {
+ color: #187dc6;
+}
+</
+STYLE
+>
\ No newline at end of file
Property changes on: trunk/build/aggregate/site/web/site.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23504 - trunk/vpe/features/org.jboss.tools.xulrunner.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 13:45:13 -0400 (Fri, 16 Jul 2010)
New Revision: 23504
Modified:
trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml
Log:
upversion feature from 1.9.1.2 to 1.9.12.qualifier so that suffix will increment correctly
Modified: trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml
===================================================================
--- trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml 2010-07-16 17:44:53 UTC (rev 23503)
+++ trunk/vpe/features/org.jboss.tools.xulrunner.feature/pom.xml 2010-07-16 17:45:13 UTC (rev 23504)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools.vpe.features</groupId>
<artifactId>org.jboss.tools.xulrunner.feature</artifactId>
- <version>1.9.1.2</version>
+ <version>1.9.12.qualifier</version>
<packaging>eclipse-feature</packaging>
</project>
15 years, 9 months
JBoss Tools SVN: r23503 - trunk/vpe/features/org.jboss.tools.xulrunner.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 13:44:53 -0400 (Fri, 16 Jul 2010)
New Revision: 23503
Modified:
trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml
Log:
upversion feature from 1.9.1.2 to 1.9.12.qualifier so that suffix will increment correctly
Modified: trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml
===================================================================
--- trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml 2010-07-16 15:42:47 UTC (rev 23502)
+++ trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml 2010-07-16 17:44:53 UTC (rev 23503)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.xulrunner.feature"
label="%featureName"
- version="1.9.1.2"
+ version="1.9.12.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.xulrunner">
15 years, 9 months
JBoss Tools SVN: r23502 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 11:42:47 -0400 (Fri, 16 Jul 2010)
New Revision: 23502
Modified:
trunk/build/publish.sh
Log:
support option to pass in cmdline param 'trunk' to push update site into standard location
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-07-16 15:21:27 UTC (rev 23501)
+++ trunk/build/publish.sh 2010-07-16 15:42:47 UTC (rev 23502)
@@ -20,7 +20,7 @@
# define suffix to use for additional update sites
SUFFNAME="-Update-${ZIPSUFFIX}.zip"
-if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools/builds/nightly/3.2.helios"; fi
+if [[ $DESTINATION == "" ]]; then DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
# cleanup from last time
rm -fr ${WORKSPACE}/results; mkdir -p ${STAGINGDIR}
@@ -135,15 +135,23 @@
# publish to download.jboss.org, unless errors found - avoid destroying last-good update site
if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
-date
# publish update site dir
if [[ -d ${STAGINGDIR} ]]; then
- rsync -arzq --delete ${STAGINGDIR} $DESTINATION/
+ date; rsync -arzq --delete ${STAGINGDIR} $DESTINATION/builds/nightly/3.2.helios/
fi
# publish update site zip
if [[ -f ${WORKSPACE}/results/${SNAPNAME} ]]; then
- rsync -arzq --delete ${WORKSPACE}/results/${SNAPNAME} $DESTINATION/
+ date; rsync -arzq --delete ${WORKSPACE}/results/${SNAPNAME} $DESTINATION/builds/nightly/3.2.helios/
fi
+
+ # extra publish step for aggregate update sites ONLY
+ if [[ ${JOB_NAME/.aggregate} != ${JOB_NAME} ]]; then
+ if [[ $1 == "trunk" ]]; then
+ date; rsync -arzq --delete ${STAGINGDIR}/all/repo/* $DESTINATION/updates/nightly/trunk/
+ else
+ date; rsync -arzq --delete ${STAGINGDIR}/all/repo/* $DESTINATION/updates/nightly/${JOB_NAME/.aggregate}/
+ fi
+ fi
fi
date
15 years, 9 months
JBoss Tools SVN: r23501 - branches/jbosstools-3.2.0.M1/build/results.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-16 11:21:27 -0400 (Fri, 16 Jul 2010)
New Revision: 23501
Modified:
branches/jbosstools-3.2.0.M1/build/results/build.xml
Log:
port from trunk
Modified: branches/jbosstools-3.2.0.M1/build/results/build.xml
===================================================================
--- branches/jbosstools-3.2.0.M1/build/results/build.xml 2010-07-16 15:04:31 UTC (rev 23500)
+++ branches/jbosstools-3.2.0.M1/build/results/build.xml 2010-07-16 15:21:27 UTC (rev 23501)
@@ -11,15 +11,12 @@
<available file="${WORKSPACE}/results" />
</condition>
- <!-- <condition property="WORKINGDIR" value="/home/hudson/static_build_env/jbds/tools/sources" else="${basedir}/../..">
- <available file="/home/hudson/static_build_env/jbds" type="dir" />
- </condition> -->
<condition property="WORKINGDIR" value="${WORKSPACE}/sources" else="${basedir}/../..">
<available file="${WORKSPACE}/sources" type="dir" />
</condition>
+ <property name="input.dir" value="${WORKINGDIR}" />
<mkdir dir="${WORKINGDIR}" />
- <echo level="info">WORKINGDIR = ${WORKINGDIR}</echo>
<condition property="COMMON_TOOLS" value="/home/hudson/static_build_env/jbds/tools">
<available file="/home/hudson/static_build_env/jbds" type="dir" />
@@ -28,7 +25,6 @@
<available file="${WORKINGDIR}/../tools" type="dir" />
</condition>
<mkdir dir="${COMMON_TOOLS}" />
- <echo level="info">COMMON_TOOLS = ${COMMON_TOOLS}</echo>
<condition property="build.xml" value="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml">
<available file="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml" type="file" />
@@ -91,11 +87,16 @@
3. manually copy the contents of this file into a page under
http://www.jboss.org/tools/downloads/
-->
+ <echo level="info">ZIPSUFFIX = ${ZIPSUFFIX}
+WORKINGDIR = ${WORKINGDIR}
+COMMON_TOOLS = ${COMMON_TOOLS}
+input.dir = ${input.dir}
+output.dir = ${output.dir}</echo>
<for param="UPDATEZIP">
<path>
- <fileset dir="${WORKINGDIR}/site">
- <include name="*-Update-${ZIPSUFFIX}.zip" />
- <include name="*-Sources-${ZIPSUFFIX}.zip" />
+ <fileset dir="${input.dir}">
+ <include name="**/*-Update-${ZIPSUFFIX}.zip" />
+ <include name="**/*-Sources-${ZIPSUFFIX}.zip" />
</fileset>
</path>
<sequential>
@@ -145,14 +146,11 @@
<property name="${COMPONENT}-filename" value="${filename}" />
<get.size file="@{UPDATEZIP}" property="${COMPONENT}-filesize" />
-
- <!--
<var name="filesize" unset="true" />
<propertycopy from="${COMPONENT}-filesize" property="filesize" override="true" silent="true" />
<echo level="info">filesize = ${filesize}</echo>
<echo level="info">filename = ${filename}</echo>
<var name="filesize" unset="true" />
- -->
<var name="filename" unset="true" />
</sequential>
</for>
15 years, 9 months
JBoss Tools SVN: r23500 - in trunk: common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-16 11:04:31 -0400 (Fri, 16 Jul 2010)
New Revision: 23500
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMessagePropertyWizard.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyRefactoring.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableRefactoring.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
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/el/refactoring/ELRefactorContributionFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -27,6 +27,7 @@
public static String EL_RENAME_PROCESSOR_ERROR_PHANTOM_FILE;
public static String EL_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
public static String RENAME_EL_VARIABLE_PROCESSOR_TITLE;
+ public static String RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE;
public static String RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE;
static {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2010-07-16 15:04:31 UTC (rev 23500)
@@ -20,5 +20,6 @@
EL_RENAME_PROCESSOR_ERROR_PHANTOM_FILE=Cannot change phantom file: ''{0}''.
EL_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
RENAME_EL_VARIABLE_PROCESSOR_TITLE=Rename EL Variable
+RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE=Rename Resource Bundle Message
RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE=Can not find EL Variable: ''{0}''.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -77,7 +77,7 @@
public List<ELSegment> findSegmentsByMessageProperty(String baseName, String propertyName) {
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
- if(segment instanceof MessagePropertyELSegment){
+ if(segment instanceof MessagePropertyELSegment && ((MessagePropertyELSegment)segment).getBaseName() != null){
if(((MessagePropertyELSegment)segment).getBaseName().equals(baseName) && segment.getToken().getText().equals(propertyName))
list.add(segment);
}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableRefactoring.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableRefactoring.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableRefactoring.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -1,24 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2008 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.el.refactoring;
-
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-
-/**
- * @author Alexey Kazakov
- */
-public class RenameELVariableRefactoring extends RenameRefactoring {
-
- public RenameELVariableRefactoring(RenameProcessor processor) {
- super(processor);
- }
-}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -0,0 +1,199 @@
+ /*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.el.refactoring;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.jboss.tools.common.el.core.ELReference;
+import org.jboss.tools.common.el.core.ElCoreMessages;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegment;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameMessagePropertyProcessor extends ELRenameProcessor {
+ IFile file;
+ MessagePropertyELSegment segment;
+ MessagePropertySearcher searcher;
+
+ /**
+ * @param file where refactor was called
+ */
+ public RenameMessagePropertyProcessor(IFile file, MessagePropertyELSegment segment) {
+ super(file, segment.getToken().getText());
+ this.file = file;
+ this.segment = segment;
+ setOldName(segment.getToken().getText());
+ searcher = new MessagePropertySearcher(file, segment.getToken().getText());
+ }
+
+ protected RefactorSearcher getSearcher(){
+ return searcher;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws CoreException,
+ OperationCanceledException {
+ status = new RefactoringStatus();
+
+ rootChange = new CompositeChange(ElCoreMessages.RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE);
+
+ renameELVariable(pm, file);
+
+ return status;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+ throws CoreException, OperationCanceledException {
+ RefactoringStatus result = new RefactoringStatus();
+
+ //if(findManagedBean(file, getOldName()) == null)
+ //result.addFatalError(Messages.format(ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE, getOldName()));
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+
+ return rootChange;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+ */
+ @Override
+ public Object[] getElements() {
+ return new String[]{getNewName()};
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
+ */
+ @Override
+ public String getIdentifier() {
+ return getClass().getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
+ */
+ @Override
+ public String getProcessorName() {
+ return ElCoreMessages.RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+ */
+ @Override
+ public boolean isApplicable() throws CoreException {
+ return getNewName()!=null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
+ */
+ @Override
+ public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
+ SharableParticipants sharedParticipants) throws CoreException {
+ return EMPTY_REF_PARTICIPANT;
+ }
+
+ private void renameELVariable(IProgressMonitor pm, IFile file){
+ TextFileChange change = getChange((IFile)segment.getMessageBundleResource());
+ TextEdit edit = new ReplaceEdit(segment.getMessagePropertySourceReference().getStartPosition(), segment.getMessagePropertySourceReference().getLength(), getNewName());
+ change.addEdit(edit);
+ getSearcher().findELReferences();
+ }
+
+ class MessagePropertySearcher extends ELSearcher{
+
+ public MessagePropertySearcher(IFile file, String oldName) {
+ super(file, oldName);
+ }
+
+ protected void searchInCach(IFile file){
+ ELContext context = PageContextFactory.createPageContext(file);
+
+ if(context == null)
+ return;
+
+ ELReference[] references = context.getELReferences();
+ ELResolver[] resolvers = context.getElResolvers();
+
+ for(ELReference reference : references){
+ int offset = reference.getStartPosition();
+ for(ELExpression operand : reference.getEl()){
+ for (ELResolver resolver : resolvers) {
+ if (!(resolver instanceof ELCompletionEngine))
+ continue;
+
+ ELResolution resolution = resolver.resolve(context, operand, offset);
+
+ if(resolution == null)
+ continue;
+
+ List<ELSegment> segments = resolution.findSegmentsByMessageProperty(segment.getBaseName(), propertyName);
+
+ for(ELSegment segment : segments){
+ match(file, offset+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyRefactoring.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyRefactoring.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyRefactoring.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -0,0 +1,24 @@
+ /*******************************************************************************
+ * Copyright (c) 2008 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.el.refactoring;
+
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameMessagePropertyRefactoring extends RenameRefactoring {
+
+ public RenameMessagePropertyRefactoring(RenameProcessor processor) {
+ super(processor);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyRefactoring.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -455,6 +455,8 @@
}
private void processMessagePropertySegment(ELInvocationExpression expr, MessagePropertyELSegmentImpl segment, List<Variable> variables){
+ if(segment.getToken() == null)
+ return;
for(Variable variable : variables){
if(expr.getFirstToken().getText().equals(variable.name)){
@@ -471,7 +473,7 @@
if(propFile == null)
return;
segment.setMessageBundleResource(propFile);
- XModelObject property = properties.getChildByPath(expr.getText());
+ XModelObject property = properties.getChildByPath(segment.getToken().getText());
if(property != null){
try {
String content = FileUtil.readStream(propFile);
@@ -491,9 +493,7 @@
String nvs = property.getAttributeValue("name-value-separator"); //$NON-NLS-1$
int i = content.indexOf(name + nvs);
if(i < 0) return false;
- int j = content.indexOf('\n', i);
- if(j < 0) j = content.length();
- segment.setMessagePropertySourceReference(i, j - i);
+ segment.setMessagePropertySourceReference(i, name.length());
return true;
}
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-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -27,8 +27,10 @@
public static String REFACTOR_CONTRIBUTOR_MAIN_MENU;
public static String REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE;
+ public static String REFACTOR_CONTRIBUTOR_RENAME_MESSAGE_PROPERTY;
public static String EL_REFACTOR_RENAME_HANDLER_ERROR;
public static String RENAME_EL_VARIABLE_WIZARD_EL_VARIABLE_NAME;
+ public static String RENAME_MESSAGE_PROPERTY_WIZARD_PROPERTY_NAME;
public static String IS_JSF_CHECK_NEED;
public static String IS_KB_NATURE_CHECK_NEED;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -11,6 +11,7 @@
package org.jboss.tools.jsf.ui.el.refactoring;
import java.io.IOException;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -29,6 +30,7 @@
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
@@ -47,19 +49,30 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.jboss.tools.common.el.core.ELReference;
+import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.ELSegmentImpl;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
+import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegment;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.propertieseditor.PropertiesCompoundEditor;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jsf.el.refactoring.RenameELVariableProcessor;
-import org.jboss.tools.jsf.el.refactoring.RenameELVariableRefactoring;
+import org.jboss.tools.jsf.el.refactoring.RenameMessagePropertyProcessor;
import org.jboss.tools.jsf.ui.JsfUIMessages;
import org.jboss.tools.jsf.ui.JsfUiPlugin;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.ui.editors.WebCompoundEditor;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -158,16 +171,69 @@
status = checkContextVariableInDOM(editorFile, fileContent, selection);
else if(PROPERTIES_EXT.equalsIgnoreCase(ext))
status = checkContextVariableInProperties(editorFile, fileContent, selection);
+
+ MessagePropertyELSegment messageSegment = checkMessageProperty(editorFile, selection);
+ if(messageSegment != null){
+ mm.add(new RenameMessagePropertyAction(messageSegment));
+ if(!separatorIsAdded){
+ additions.addContributionItem(new Separator(), null);
+ separatorIsAdded = true;
+ }
+ }
+
if(status){
mm.add(new RenameELVariableAction());
- if(!separatorIsAdded)
+ if(!separatorIsAdded){
additions.addContributionItem(new Separator(), null);
+ separatorIsAdded = true;
+ }
+ }
+ if(mm.getSize() > 0)
additions.addContributionItem(mm, null);
+ }
+ }
+ }
+
+ private MessagePropertyELSegment checkMessageProperty(IFile file, TextSelection selection){
+ ELContext context = PageContextFactory.createPageContext(file);
+
+ if(context == null)
+ return null;
+
+ ELReference[] references = context.getELReferences();
+ ELResolver[] resolvers = context.getElResolvers();
+
+ for(ELReference reference : references){
+ for(ELExpression operand : reference.getEl()){
+ for (ELResolver resolver : resolvers) {
+ if (!(resolver instanceof ELCompletionEngine))
+ continue;
+
+ ELResolution resolution = resolver.resolve(context, operand, selection.getOffset());
+
+ if(resolution == null)
+ continue;
+
+ List<ELSegment> segments = resolution.getSegments();
+
+ for(ELSegment segment : segments){
+ if(!segment.isResolved())
+ continue;
+
+ if(segment instanceof MessagePropertyELSegment &&
+ selection.getOffset() <= reference.getStartPosition()+segment.getSourceReference().getStartPosition() &&
+ selection.getOffset()+selection.getLength() >= reference.getStartPosition()+segment.getSourceReference().getStartPosition()+segment.getSourceReference().getLength()){
+ MessagePropertyELSegment messageSegment = (MessagePropertyELSegment)segment;
+ return messageSegment;
+ }
+ }
+
}
}
}
+ return null;
}
private boolean checkContextVariableInJava(IFile file, String content, TextSelection selection){
@@ -302,18 +368,6 @@
return scanString(file, content, 0, selection);
}
- private String getPropertyName(IMethod method){
- String name = method.getElementName();
-
- if(name.startsWith(GET) || name.startsWith(SET))
- return name.substring(3).toLowerCase();
-
- if(name.startsWith(IS))
- return name.substring(2).toLowerCase();
-
- return name.toLowerCase();
- }
-
private static void saveAndBuild(){
if(!JsfUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
return;
@@ -329,7 +383,7 @@
saveAndBuild();
RenameELVariableProcessor processor = new RenameELVariableProcessor(editorFile, selectedText);
- RenameELVariableRefactoring refactoring = new RenameELVariableRefactoring(processor);
+ RenameRefactoring refactoring = new RenameRefactoring(processor);
RenameELVariableWizard wizard = new RenameELVariableWizard(refactoring, editorFile);
RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
try {
@@ -339,6 +393,21 @@
// operation was canceled
}
}
+
+ public static void invokeRenameMessagePropertyWizard(MessagePropertyELSegment segment, Shell activeShell) {
+ saveAndBuild();
+
+ RenameMessagePropertyProcessor processor = new RenameMessagePropertyProcessor(editorFile, segment);
+ RenameRefactoring refactoring = new RenameRefactoring(processor);
+ RenameMessagePropertyWizard wizard = new RenameMessagePropertyWizard(refactoring, editorFile);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ try {
+ String titleForFailedChecks = JsfUIMessages.EL_REFACTOR_RENAME_HANDLER_ERROR;
+ op.run(activeShell, titleForFailedChecks);
+ } catch (final InterruptedException irex) {
+ // operation was canceled
+ }
+ }
class RenameELVariableAction extends Action{
public RenameELVariableAction(){
@@ -350,5 +419,18 @@
invokeRenameELVariableWizard(selectedText, shell);
}
}
+
+ class RenameMessagePropertyAction extends Action{
+ MessagePropertyELSegment segment;
+ public RenameMessagePropertyAction(MessagePropertyELSegment segment){
+ super(JsfUIMessages.REFACTOR_CONTRIBUTOR_RENAME_MESSAGE_PROPERTY);
+ this.segment = segment;
+ }
+ public void run(){
+ saveAndBuild();
+
+ invokeRenameMessagePropertyWizard(segment, shell);
+ }
+ }
}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMessagePropertyWizard.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMessagePropertyWizard.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMessagePropertyWizard.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -0,0 +1,110 @@
+ /*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.el.refactoring;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.jsf.el.refactoring.RenameELVariableProcessor;
+import org.jboss.tools.jsf.el.refactoring.RenameMessagePropertyProcessor;
+import org.jboss.tools.jsf.ui.JsfUIMessages;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameMessagePropertyWizard extends RefactoringWizard {
+
+ private String propertyName;
+ private IFieldEditor editor;
+
+ public RenameMessagePropertyWizard(Refactoring refactoring, IFile editorFile) {
+ super(refactoring, WIZARD_BASED_USER_INTERFACE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#addUserInputPages()
+ */
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+ RenameMessagePropertyProcessor processor= (RenameMessagePropertyProcessor) getRefactoring().getAdapter(RenameMessagePropertyProcessor.class);
+ addPage(new RenameMessagePropertyWizardPage(processor));
+ }
+
+ class RenameMessagePropertyWizardPage extends UserInputWizardPage{
+ private RenameMessagePropertyProcessor processor;
+
+ public RenameMessagePropertyWizardPage(RenameMessagePropertyProcessor processor){
+ super("");
+ this.processor = processor;
+ propertyName = processor.getOldName();
+ }
+
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 2;
+
+ String defaultName = propertyName;
+ editor = FieldEditorFactory.createTextEditor(propertyName, JsfUIMessages.RENAME_MESSAGE_PROPERTY_WIZARD_PROPERTY_NAME, defaultName);
+ editor.doFillIntoGrid(container);
+
+ ((CompositeEditor)editor).addPropertyChangeListener(new PropertyChangeListener(){
+ public void propertyChange(PropertyChangeEvent evt){
+ validatePage();
+ }
+ });
+ setControl(container);
+ setPageComplete(false);
+ }
+
+ protected final void validatePage() {
+ RefactoringStatus status= new RefactoringStatus();
+ setPageComplete(status);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.UserInputWizardPage#performFinish()
+ */
+ protected boolean performFinish() {
+
+ initializeRefactoring();
+ return super.performFinish();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.UserInputWizardPage#getNextPage()
+ */
+ public IWizardPage getNextPage() {
+ initializeRefactoring();
+ return super.getNextPage();
+ }
+
+ private void initializeRefactoring() {
+ processor.setNewName(editor.getValueAsString());
+ }
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMessagePropertyWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-07-16 15:04:31 UTC (rev 23500)
@@ -20,7 +20,9 @@
RESOURCE_BUNDLES_RENAME_PARTICIPANT_UPDATE_BUNDLE_REFERENCES=Update bundle references in EL
REFACTOR_CONTRIBUTOR_MAIN_MENU=EL Refactor
REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE=Rename EL Variable
+REFACTOR_CONTRIBUTOR_RENAME_MESSAGE_PROPERTY=Rename Resource Bundle Message
RENAME_EL_VARIABLE_WIZARD_EL_VARIABLE_NAME=EL Variable name:
+RENAME_MESSAGE_PROPERTY_WIZARD_PROPERTY_NAME=Resource Bundle Message:
IS_JSF_CHECK_NEED=Is JSF check
IS_KB_NATURE_CHECK_NEED=Is KB natures check
IS_JSF_NATURE_CHECK_NEED=Is JSF natures check
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-07-16 13:46:47 UTC (rev 23499)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-07-16 15:04:31 UTC (rev 23500)
@@ -190,7 +190,7 @@
}
}
- private void searchInCach(IFile file){
+ protected void searchInCach(IFile file){
ELContext context = PageContextFactory.createPageContext(file);
if(context == null)
15 years, 9 months
JBoss Tools SVN: r23499 - branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-16 09:46:47 -0400 (Fri, 16 Jul 2010)
New Revision: 23499
Modified:
branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
Log:
https://jira.jboss.org/browse/JBIDE-6555
Modified: branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java
===================================================================
--- branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2010-07-16 13:41:48 UTC (rev 23498)
+++ branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/EncodedProperties.java 2010-07-16 13:46:47 UTC (rev 23499)
@@ -100,9 +100,13 @@
}
valueStart++;
}
+ try {
String key = loadConvert(lr.lineBuf, 0, keyLen, convtBuf);
String value = loadConvert(lr.lineBuf, valueStart, limit - valueStart, convtBuf);
put(key, value);
+ } catch (IllegalArgumentException e) {
+ //TODO create object for error marker
+ }
}
}
@@ -272,6 +276,7 @@
value = (value << 4) + 10 + aChar - 'A';
break;
default:
+ //TODO create object for error marker
throw new IllegalArgumentException(
"Malformed \\uxxxx encoding."); //$NON-NLS-1$
}
@@ -403,4 +408,4 @@
p.list(System.out);
}
-}
+}
\ No newline at end of file
Modified: branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-07-16 13:41:48 UTC (rev 23498)
+++ branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-07-16 13:46:47 UTC (rev 23499)
@@ -269,6 +269,8 @@
p.load(sr);
} catch (IOException e) {
//ignore
+ } catch (IllegalArgumentException e1) {
+ return null;
}
return p.getProperty("a");
}
@@ -357,4 +359,4 @@
return s.length();
}
-}
+}
\ No newline at end of file
15 years, 9 months