You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: David C. <dc...@us...> - 2005-12-24 01:43:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29292/src/org/rubypeople/rdt/internal/core/builder Modified Files: TC_RubyCodeAnalyzer.java TC_IndexUpdater.java Log Message: Incorporate current JRuby head. Fixed bug in RubySourceFileCollectionVisitor.java that caused NullPointerException. Fixed bug where UT Failures open up class not method. Index: TC_IndexUpdater.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IndexUpdater.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TC_IndexUpdater.java 13 Nov 2005 13:05:07 -0000 1.7 --- TC_IndexUpdater.java 24 Dec 2005 01:43:07 -0000 1.8 *************** *** 20,25 **** import org.jruby.ast.Node; import org.jruby.ast.TrueNode; import org.rubypeople.eclipse.shams.resources.ShamFile; - import org.rubypeople.rdt.internal.core.parser.RdtPosition; import org.rubypeople.rdt.internal.core.parser.RubyParser; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; --- 20,26 ---- import org.jruby.ast.Node; import org.jruby.ast.TrueNode; + import org.jruby.lexer.yacc.ISourcePosition; + import org.jruby.lexer.yacc.SourcePosition; import org.rubypeople.eclipse.shams.resources.ShamFile; import org.rubypeople.rdt.internal.core.parser.RubyParser; import org.rubypeople.rdt.internal.core.symbols.ClassSymbol; *************** *** 27,31 **** public class TC_IndexUpdater extends TestCase { ! private static final RdtPosition POSITION_1 = new RdtPosition(1,2,3); private static final String TEST_CLASS_NAME = "TestClassName"; --- 28,32 ---- public class TC_IndexUpdater extends TestCase { ! private static final ISourcePosition POSITION_1 = createPosition(1,1,2,3); private static final String TEST_CLASS_NAME = "TestClassName"; *************** *** 73,77 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo"), file, new RdtPosition(1, 2, 14, 15)); } --- 74,78 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo"), file, createPosition(1, 1, 11, 14)); } *************** *** 82,86 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, new RdtPosition(1, 2, 16, 20)); } --- 83,87 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, createPosition(1, 1, 11, 19)); } *************** *** 91,95 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("X::Foo::Bar"), file, new RdtPosition(1, 2, 19, 23)); } --- 92,96 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("X::Foo::Bar"), file, createPosition(1, 1, 11, 21)); } *************** *** 100,104 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, new RdtPosition(2, 3, 25, 26)); } --- 101,105 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar"), file, createPosition(2, 2, 22, 25)); } *************** *** 109,113 **** symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar::InnerBar"), file, new RdtPosition(2, 3, 35, 36)); } --- 110,114 ---- symbolIndex.assertFlushed(file); ! symbolIndex.assertAdded(new ClassSymbol("Foo::Bar::InnerBar"), file, createPosition(2, 2, 27, 35)); } *************** *** 117,121 **** updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("method"), file, new RdtPosition(0, 1, 3, 12)); } --- 118,122 ---- updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("method"), file, createPosition(0, 1, 0, 14)); } *************** *** 125,129 **** updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, new RdtPosition(1, 2, 13, 24)); } --- 126,130 ---- updater.update(file,node, false); ! symbolIndex.assertAdded(new MethodSymbol("Foo::method"), file, createPosition(1, 2, 10, 24)); } *************** *** 134,136 **** --- 135,143 ---- return new RubyParser().parse(file, reader); } + + private static ISourcePosition createPosition(int startLine, int endLine, int startOffset, int endOffset) { + return new SourcePosition("TestFile.rb", startLine, endLine, startOffset, endOffset); + } + + } \ No newline at end of file Index: TC_RubyCodeAnalyzer.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_RubyCodeAnalyzer.java 13 Nov 2005 13:05:07 -0000 1.2 --- TC_RubyCodeAnalyzer.java 24 Dec 2005 01:43:07 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- import org.jruby.ast.Node; import org.jruby.ast.visitor.NodeVisitor; + import org.jruby.evaluator.Instruction; import org.jruby.lexer.yacc.SyntaxException; import org.rubypeople.eclipse.shams.resources.ShamFile; *************** *** 37,41 **** rootNode = new Node(null) { ! public void accept(NodeVisitor visitor) { } --- 38,43 ---- rootNode = new Node(null) { ! public Instruction accept(NodeVisitor visitor) { ! return null; } |
|
From: David C. <dc...@us...> - 2005-12-24 01:43:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29292/src/org/rubypeople/rdt/internal/core/parser Modified Files: ShamNode.java Log Message: Incorporate current JRuby head. Fixed bug in RubySourceFileCollectionVisitor.java that caused NullPointerException. Fixed bug where UT Failures open up class not method. Index: ShamNode.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/ShamNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShamNode.java 16 Oct 2005 17:29:17 -0000 1.1 --- ShamNode.java 24 Dec 2005 01:43:07 -0000 1.2 *************** *** 15,18 **** --- 15,19 ---- import org.jruby.ast.Node; import org.jruby.ast.visitor.NodeVisitor; + import org.jruby.evaluator.Instruction; public class ShamNode extends Node { *************** *** 22,26 **** } ! public void accept(NodeVisitor visitor) { } --- 23,28 ---- } ! public Instruction accept(NodeVisitor visitor) { ! return null; } |
|
From: Markus B. <mba...@us...> - 2005-12-22 23:16:12
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/bootstrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19319/bootstrap Removed Files: run.sh customTargets.xml Tag: build_0_6_0 build.properties No tag README run.bat Log Message: customTargets.xml and build.properties have been moved to the cruiseControl directory. The other files are not needed anymore: the functionality of run.sh has been ported to ant and can be found in customTargets.xml and build-RDT.xml --- run.sh DELETED --- --- customTargets.xml DELETED --- --- run.bat DELETED --- --- build.properties DELETED --- --- README DELETED --- |
|
From: Markus B. <mba...@us...> - 2005-12-22 23:13:30
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18405/cruiseControl Added Files: build.properties customTargets.xml config.xml build-RDT.xml build-RDT.properties Log Message: config.xml is a cruiseControl config file, build-RDT.properties and build-RDT.xml are used from config.xml and for building integration and release builds, customTargets.xml and build.properties are slightly adapted and moved from the bootstrap directory --- NEW FILE: build-RDT.properties --- rdtBuildHome=/home/bma # buildDirectory is the directory into which the source are checked out and # where the build takes place buildDirectory=${rdtBuildHome}/cruiseControlWorkspace/checkout/RDT # the eclipse instance used for build eclipseDir=${rdtBuildHome}/eclipse/eclipse-3.1 # the pdeBuildPluginVersion is needed in order to construct the directory # where the pde build scripts are located pdeBuildPluginVersion=3.1.0 buildfile=${eclipseDir}/plugins/org.eclipse.pde.build_${pdeBuildPluginVersion}/scripts/build.xml # customTargets.xml and a corresponding build.properties are found in the the builderDirectory builderDirectory=${rdtBuildHome}/cruiseControlWorkspace # Make Ant verbose #verboseAnt=-verbose verboseAnt= eclipseAutomatedTestHome=${rdtBuildHome}/rdt/eclipse-testing rubyInterpreter=/usr/bin/ruby1.6 docbookRoot=${rdtBuildHome}/rdt/docbook os=linux ws=gtk arch=x86 usePserver=-DDontusePserver=true # the default is to clean up before testing, it can be avoided by defining noclean #testNoclean=-Dnoclean=true testNoclean=-Dxx=true #dontRunTests=-DdontRunTests=true dontRunTests=-Dxxx=true # buildTarget can be one of the build targets defined in $buildfile: # main, preBuild, fetch, generate, process, assemble, package, postBuild, clean buildTarget=main #buildTarget=postBuild extraArgs=-DnoExtraArgs --- NEW FILE: customTargets.xml --- <project name="Build specific targets and properties" default="noDefault" > <condition property="isNightlyBuild"> <equals arg1="${buildType}" arg2="N"/> </condition> <condition property="isNightlyOrIntegrationBuild"> <or> <equals arg1="${buildType}" arg2="N"/> <equals arg1="${buildType}" arg2="I"/> </or> </condition> <echo message="BuildType: ${buildType}"/> <property file="${buildDirectory}/version.properties"/> <property name="buildLabel" value="${buildType}-${featureVersion}"/> <property name="buildId" value="${featureVersion}"/> <!-- ===================================================================== --> <!-- Run a given ${target} on all elements being built --> <!-- Add on <ant> task for each top level element being built. --> <!-- ===================================================================== --> <target name="allElements"> <ant antfile="${genericTargets}" target="${target}" > <property name="type" value="feature" /> <property name="id" value="org.rubypeople.rdt" /> </ant> <ant antfile="${genericTargets}" target="${target}" > <property name="type" value="feature" /> <property name="id" value="org.rubypeople.rdt-tests" /> </ant> </target> <!-- ===================================================================== --> <!-- Targets to assemble the built elements for particular configurations --> <!-- These generally call the generated assemble scripts (named in --> <!-- ${assembleScriptName}) but may also add pre and post processing --> <!-- Add one target for each root element and each configuration --> <!-- ===================================================================== --> <target name="assemble.org.rubypeople.rdt"> <ant antfile="${assembleScriptName}" dir="${buildDirectory}"> <property name="zipargs" value="" /> </ant> </target> <target name="assemble.org.rubypeople.rdt-tests"> <ant antfile="${assembleScriptName}" dir="${buildDirectory}"> <property name="zipargs" value="" /> </ant> </target> <!-- ===================================================================== --> <!-- Check out map files from correct repository --> <!-- Replace values for cvsRoot, package and mapVersionTag as desired. --> <!-- ===================================================================== --> <target name="getMapFiles"> <antcall target="getMapFilesWithExtMethod"/> <antcall target="getMapFilesWithPserverMethod"/> </target> <target name="getMapFilesWithExtMethod" unless="usePserver"> <property name="cvsRoot" value=":ext:cvs.sf.net:/cvsroot/rubyeclipse" /> <cvs cvsroot="${cvsRoot}" dest="${buildDirectory}/maps" command="export -r ${mapVersionTag} org.rubypeople.rdt.build/map" /> </target> <target name="getMapFilesWithPserverMethod" if="usePserver"> <property name="cvsRoot" value=":pserver:ano...@cv...:/cvsroot/rubyeclipse" /> <cvs cvsroot="${cvsRoot}" dest="${buildDirectory}/maps" command="export -r ${mapVersionTag} org.rubypeople.rdt.build/map" /> <replace dir="${buildDirectory}/maps" value=":pserver:anonymous@"> <include name="**/*.map"/> <replacetoken>:ext:</replacetoken> </replace> </target> <!-- ===================================================================== --> <!-- Steps to do before setup --> <!-- ===================================================================== --> <target name="preSetup" unless="featureVersion"> <tstamp> <!-- unfortunately one "y" in the pattern pads with 0, so 2005 will be displayed as 05 --> <format property="build.tstamp" pattern="5MMddhhmm"/> </tstamp> <condition property="featureVersion" value="${nightlyBuildFeatureVersionPrefix}${build.tstamp}NGT"> <equals arg1="${buildType}" arg2="N"/> </condition> <condition property="featureVersion" value="${nightlyBuildFeatureVersionPrefix}${build.tstamp}INT"> <equals arg1="${buildType}" arg2="I"/> </condition> <fail unless="featureVersion" message="Property featureVersion must be set. Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix."/> <echo message="Using featureVersion: ${featureVersion}."/> <echo file="${buildDirectory}/version.properties" message="featureVersion=${featureVersion}"/> </target> <!-- ===================================================================== --> <!-- Steps to do after setup but before starting the build proper --> <!-- ===================================================================== --> <target name="postSetup"> </target> <!-- ===================================================================== --> <!-- Steps to do before fetching the build elements --> <!-- ===================================================================== --> <target name="preFetch"> </target> <!-- ===================================================================== --> <!-- Steps to do after fetching the build elements --> <!-- ===================================================================== --> <target name="postFetch"> <antcall target="replaceVersions"/> <replace file="${buildDirectory}/features/org.rubypeople.rdt/feature.xml"> <replacefilter token="<!--@@INCLUDES@@-->" value="<includes id="org.rubypeople.rdt.source" version="${featureVersion}"/>"/> </replace> <replace file="${buildDirectory}/features/org.rubypeople.rdt/build.properties"> <replacefilter token="#generate.feature" value="generate.feature" /> </replace> </target> <target name="replaceVersions" if="baseFeatureVersion"> <condition property="updateSiteUrl" value="${nightlyBuildUpdateSiteURL}" else="${integrationBuildUpdateSiteURL}"> <isset property="isNightlyBuild"/> </condition> <echo message="Nightly or integration build: replacing version ${baseFeatureVersion} with ${featureVersion}"/> <echo message="Setting update-site URL: ${updateSiteUrl}"/> <replace dir="${buildDirectory}/features"> <include name="org.rubypeople.*/feature.xml"/> <replacefilter token="${baseFeatureVersion}" value="${featureVersion}" /> <replacefilter token="${releaseUpdateSiteURL}" value="${updateSiteUrl}" /> </replace> <replace dir="${buildDirectory}/plugins"> <include name="org.rubypeople.*/plugin.xml"/> <replacefilter token="${baseFeatureVersion}" value="${featureVersion}" /> </replace> <replace dir="${buildDirectory}/plugins"> <include name="org.rubypeople.*/META-INF/MANIFEST.MF"/> <replacefilter token="Bundle-Version: ${baseFeatureVersion}" value="Bundle-Version: ${featureVersion}" /> </replace> </target> <!-- ===================================================================== --> <!-- Steps to do before generating the build scripts. --> <!-- ===================================================================== --> <target name="preGenerate"> <fail unless="featureVersion" message="Property featureVersion must be set. Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix."/> </target> <!-- ===================================================================== --> <!-- Steps to do after generating the build scripts. --> <!-- ===================================================================== --> <target name="postGenerate"> </target> <!-- ===================================================================== --> <!-- Steps to do before running the build.xmls for the elements being built. --> <!-- ===================================================================== --> <target name="preProcess"> </target> <!-- ===================================================================== --> <!-- Steps to do after running the build.xmls for the elements being built. --> <!-- ===================================================================== --> <target name="postProcess"> </target> <!-- ===================================================================== --> <!-- Steps to do before running assemble. --> <!-- ===================================================================== --> <target name="preAssemble"> </target> <!-- ===================================================================== --> <!-- Steps to do after running assemble. --> <!-- ===================================================================== --> <target name="postAssemble"> </target> <!-- ===================================================================== --> <!-- Steps to do after the build is done. --> <!-- ===================================================================== --> <target name="postBuild"> <property name="UpdateSiteStagingLocation" value="${buildDirectory}/updateSite"/> <property name="sitePackagePrefix" value="org.rubypeople.updatesite"/> <antcall target="generateUpdateSite"/> <antcall target="test"/> <antcall target="package"/> </target> <!-- ===================================================================== --> <!-- Steps to test the build results --> <!-- ===================================================================== --> <target name="test" unless="dontRunTests"> <echo message="Setting up tests in ${eclipseAutomatedTestHome}"/> <delete> <fileset dir="${eclipseAutomatedTestHome}" includes="**/*RDT*.zip"/> </delete> <copy file="${buildDirectory}/${buildLabel}/org.rubypeople.rdt-${buildId}.zip" tofile="${eclipseAutomatedTestHome}/eclipse-SDK-RDT-${buildId}.zip" /> <copy file="${buildDirectory}/${buildLabel}/org.rubypeople.rdt-tests-${buildId}.zip" tofile="${eclipseAutomatedTestHome}/eclipse-junit-tests-RDT-${buildId}.zip" /> <ant antfile="${eclipseAutomatedTestHome}/test.xml" target="runtests" dir="${eclipseAutomatedTestHome}"> <property name="os" value="${baseos}" /> <property name="ws" value="${basews}" /> <property name="arch" value="${basearch}" /> <property name="testPlugin" value="org.rubypeople.rdt.tests.all_${featureVersion}" /> <property name="report" value="org.rubypeople.rdt.tests.all" /> </ant> </target> <!--======================================================--> <!-- UpdateSite Export target --> <!-- ==================================================== --> <target name="updateSiteExport"> <ant antfile="build.xml" dir="${buildDirectory}/features/${id}/" target="build.update.jar"> <property name="feature.destination" value="${UpdateSiteStagingLocation}/features"/> <property name="plugin.destination" value="${UpdateSiteStagingLocation}/plugins"/> </ant> </target> <target name="generateUpdateSite"> <!-- Create the directory structure --> <mkdir dir="${UpdateSiteStagingLocation}"/> <mkdir dir="${UpdateSiteStagingLocation}/features"/> <mkdir dir="${UpdateSiteStagingLocation}/plugins"/> <!-- Build the jar files --> <antcall target="allElements"> <param name="genericTargets" value="${builder}/customTargets.xml"/> <param name="target" value="updateSiteExport"/> </antcall> <antcall target="copySiteXmlFromCvs"/> <antcall target="createNightlyBuildSiteXml"/> <delete dir="${buildDirectory}/temp.updatesite"/> </target> <target name="copySiteXmlFromCvs" unless="isNightlyBuild"> <!-- Grab the rest of the site out of CVS --> <mkdir dir="${buildDirectory}/temp.updatesite"/> <property name="cvsRoot" value=":ext:cvs.sf.net:/cvsroot/rubyeclipse" /> <cvs cvsroot="${cvsRoot}" package="${sitePackagePrefix}" dest="${buildDirectory}/temp.updatesite" tag="${fetchTag}"/> <!-- Copy to staging area --> <copy todir="${UpdateSiteStagingLocation}"> <fileset file="${buildDirectory}/temp.updatesite/${sitePackagePrefix}/site.xml"/> </copy> </target> <target name="createNightlyBuildSiteXml" if="isNightlyOrIntegrationBuild"> <echo file="${UpdateSiteStagingLocation}/site.xml"><?xml version="1.0" encoding="UTF-8"?> <site> <description url="http://rubyeclipse.sourceforge.net/nightlyBuild/updateSite/"> The Ruby Development Tools update site. </description> <feature url="features/org.rubypeople.rdt_${featureVersion}.jar" id="org.rubypeople.rdt" version="${featureVersion}"> <category name="RubyEclipseNightlyBuild"/> </feature> <category-def name="RubyEclipseNightlyBuild" label="RDT Nigthly Build"> </category-def> </site> </echo> </target> <target name="package"> <echo message="Creating and filling ${buildResultsDirectory}" /> <mkdir dir="${buildResultsDirectory}"/> <mkdir dir="${buildResultsDirectory}/logs"/> <copy todir="${buildResultsDirectory}/logs" flatten="true"> <fileset dir="${buildDirectory}"> <include name="**/*.log"/> </fileset> </copy> <copy todir="${buildResultsDirectory}" flatten="true"> <fileset dir="${buildDirectory}"> <include name="**/org.rubypeople.rdt-*.zip"/> <include name="**/Changelog.txt"/> <!-- exclude the org.rubypeople.rdt-tests-*.zip file --> <exclude name="**/*-tests-*"/> </fileset> <fileset dir="${eclipseAutomatedTestHome}/results/html"> <include name="*.html"/> </fileset> </copy> <copy file="${buildDirectory}/workspace-rdt-tests/.metadata/.log" tofile="${buildResultsDirectory}/logs/testsWorkspace.log"/> <mkdir dir="${buildResultsDirectory}/updateSite"/> <copy todir="${buildResultsDirectory}/updateSite"> <fileset dir="${buildDirectory}/updateSite"/> </copy> <mkdir dir="${buildResultsDirectory}/doc"/> <copy todir="${buildResultsDirectory}/doc"> <fileset dir="${buildDirectory}/plugins/org.rubypeople.rdt.doc.user"> <include name="html/**/*"/> <include name="images/**/*"/> </fileset> </copy> </target> <!-- ===================================================================== --> <!-- Steps to do to publish the build results --> <!-- ===================================================================== --> <target name="publish"> </target> <!-- ===================================================================== --> <!-- Default target --> <!-- ===================================================================== --> <target name="noDefault"> <echo message="You must specify a target when invoking this file" /> </target> </project> --- NEW FILE: build-RDT.xml --- <!-- Delegating build script, used by cruisecontrol to build MY_PROJECT_1. Note that the basedir is set to the checked out project --> <project name="build-RDT" default="build"> <!-- basedir="/home/markus/java/cruiseControlWorkingArea/checkout/RDT"> --> <target name="propertiesCCBuild"> <property file="build-RDT.properties" /> </target> <target name="clean"> <echo message="Cleaning directory ${buildDirectory}"/> <delete dir="${buildDirectory}"/> <mkdir dir="${buildDirectory}"/> </target> <target name="featureVersion"> <!-- use the label provided from the EclipseLableProvider --> <!-- <echo message="Using feature version ${label}"/> --> <echo file="${buildDirectory}/version.properties" message="featureVersion=${label}"/> </target> <target name="build"> <java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true" jvmargs="${extraArgs}"> <arg value="-ws" /> <arg value="${ws}" /> <arg value="-os" /> <arg value="${os}" /> <arg value="-application" /> <arg value="org.eclipse.ant.core.antRunner" /> <arg value="-buildfile" /> <arg value="${buildfile}" /> <arg value="${buildTarget}" /> <arg value="-data" /> <arg value="${buildDirectory}/workspace" /> <arg value="${verboseAnt}" /> <jvmarg value="${usePserver}" /> <jvmarg value="${dontRunTests}" /> <jvmarg value="-Dbasews=${ws}" /> <jvmarg value="-Dbaseos=${os}" /> <jvmarg value="-Dbasearch=${arch}" /> <jvmarg value="-Dbuilder=${builderDirectory}" /> <jvmarg value="${testNoclean}"/> <jvmarg value="-DjavacFailOnError=true"/> <jvmarg value="-DbuildDirectory=${buildDirectory}"/> <jvmarg value="-DbaseLocation=${eclipseDir}"/> <jvmarg value="-DeclipseAutomatedTestHome=${eclipseAutomatedTestHome}"/> <jvmarg value="-Drdt.rubyInterpreter=${rubyInterpreter}" /> <jvmarg value="-Drdt-tests-workspace=${buildDirectory}/workspace-rdt-tests" /> <jvmarg value="-Ddocbook.root=${docbookRoot}" /> <!--<jvmarg value="${extraArgs}"/>--> <classpath> <pathelement location="${eclipseDir}/startup.jar" /> </classpath> </java> </target> <target name="dist" depends="propertiesCCBuild,clean,featureVersion,build"> </target> <target name="0.7.0.RC1"> <property name="cvsLabel" value="R2005-12-22_0-7-0_RC1"/> <property name="label" value="0.7.0.512222200RC1"/> <antcall target="integration"/> </target> <target name="integration"> <!-- the only difference to a nightly build is the buildType which leads to setting a differnt updateSiteUrl in feature.xml --> <property name="buildDirectory" value="/tmp/rdt-I"/> <!-- properties which should override the values of org.rubypeople.rdt/bootstrap/build.properties must be specified via -D arguments for the call to eclipseRunner --> <property name="extraArgs" value="-DbuildType='I' -DfetchTag=${cvsLabel}"/> <property file="build-RDT.properties" /> <antcall target="clean"/> <antcall target="featureVersion"/> <antcall target="build"/> </target> <target name="deploy"> <scp todir="mbarchfe:${deployTargetPassword}@shell.sf.net:/home/bma/"> <fileset dir="${buildDirectory}/dist"/> </scp> </target> </project> --- NEW FILE: build.properties --- ############################################################################### # Copyright (c) 2003, 2004 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Common Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/cpl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### ##################### # Parameters describing how and where to execute the build. # Typical users need only update the following properties: # baseLocation - where things you are building against are installed # bootclasspath - The base jars to compile against (typicaly rt.jar) # configs - the list of {os, ws, arch} configurations to build. # # Of course any of the settings here can be overridden by spec'ing # them on the command line (e.g., -DbaseLocation=d:/eclipse ############# CVS CONTROL ################ # The CVS tag to use when fetching the map files from the repository mapVersionTag=HEAD # The CVS tag to use when fetching elements to build. By default the # builder will use whatever is in the maps. Use this value to override # for example, when doing a nightly build out of HEAD fetchTag=HEAD ############## BUILD / GENERATION CONTROL ################ # The directory into which the build elements will be fetched and where # the build will take place. # Do not enter relative paths, because otherwise the directory.txt file # won't be found # If relative , the directory would be relative to the $builder directory #buildDirectory=D:\\Temp\\buildresult3 # Type of build. Used in naming the build output. Typically this value is # one of I, N, M, S, ... # If you change this, please also see the featureVersion and baseFeatureVersion properties below buildType=N # ID of the build. Used in naming the build output. (the zip file) # buildId is set in customTargets.xml in order to consider a dynamic featureVersion for nightlyBuild #buildId=${featureVersion} # Label for the build. Used in naming the build output (the directory) # buildLabel is set in customTargets.xml in order to consider a dynamic featureVersion for nightlyBuild #buildLabel=${featureVersion} # Timestamp for the build. Used in naming the build output #timestamp=007 # Base location for anything the build needs to compile against. For example, # when building GEF, the baseLocation should be the location of a previously # installed Eclipse against which the GEF code will be compiled. #baseLocation=D:\\eclipse-3.0 #Os/Ws/Arch/nl of the eclipse specified by baseLocation #baseos #basews #basearch #basenl # The location underwhich all of the build output will be collected. # This is a subdirectory of $buildDirectory # Set collectingFolder and archivePrefix to . if you want to create archives without # trailing eclipse in the paths of the included files collectingFolder=. # The prefix that will be used in the generated archive. # Does not make sense to use a different archivePrefix than collectingFolder, # because zip wouldn't find any files to include into the target zip otherwise archivePrefix=. # The list of {os, ws, arch} configurations to build. This # value is a '&' separated list of ',' separate triples. For example, # configs=win32,win32,x86 & linux,motif,x86 # By default the value is *,*,* #configs=*,*,* #Arguments to send to the zip executable # Doesn't work #zipArgs=-z "RDT: extract into eclipse-installation directory" ############# JAVA COMPILER OPTIONS ############## # The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE #bootclasspath=d:/ibm1.3.1/jre/lib/rt.jar #bootclasspath=D:\\java\\j2sdk1.4.2_05\\jre\\lib\\rt.jar # Whether or not to include debug info in the output jars javacDebugInfo=true # Whether or not to fail the build if there are compiler errors javacFailOnError=true # The version of the source code javacSource=1.4 # The version of the byte code targeted #javacTarget=1.1 #collPlace=eclipse #collBase=. #collectingFolder=eclipse #archivePrefix=eclipse # Depending on the build type, define either baseFeatureVersion or featureVersion # A) Nightly Build # In the case of a nightly build the property featureVersion will be created in # customTargets.xml. It will include a timestamp in the minor version number. # The baseFeatureVersion must be set, because it is used to replace the version in the # feature.xml files of the rdt feature.xml and the test feature.xml with the created featureVersion baseFeatureVersion=0.6.0 # B) Every other Build type # featureVersion is used for setting the version of org.rubypeople.rdt.doc.user/plugin.xml # and for calling the appropriate test suite in customTargets.xml # #featureVersion=0.6.0 # if the buildType is N a property featureVersion will be created in # customTargets.xml. The featureVersion consists of the nightlyBuildFeatureVersionPrefix # concatenated with a timestamp in the format yyyyMMddhhmm nightlyBuildFeatureVersionPrefix=0.7.0. # the buildResultsDirectory specifies a directory into which the build results are copied # after a successful build buildResultsDirectory=${buildDirectory}/dist # There are three update site URLs for three streams of RDT builds: releases, integration # and nightly builds. For each build the appropriate URL must be placed into feature.xml # The feature.xml file contains the release update site by default releaseUpdateSiteURL=http://rubyeclipse.sourceforge.net/updatesite # in case of a nightly or integration build the releaseUpdateSiteURL in feature.xml is # replaced with one of the following entries nightlyBuildUpdateSiteURL=http://rubyeclipse.sourceforge.net/nightlyBuild/updateSite integrationBuildUpdateSiteURL=http://updatesite.rubypeople.org/rdt/integration --- NEW FILE: config.xml --- <cruisecontrol> <plugin name="labelincrementer" prefix="0.5"/> <project name="RDT" buildafterfailed="true"> <plugin name="labelincrementer" classname="org.rubypeople.rdt.cruisecontrol.plugin.EclipsePluginLabelProvider"/> <!-- Defines where cruise looks for changes, to decide whether to run the build --> <modificationset quietperiod="10"> <cvs cvsroot=":ext:mba...@cv...:/cvsroot/rubyeclipse" module="rdt-all"/> </modificationset> <!-- Configures the actual build loop, how often and which build file/target --> <schedule interval="60"> <ant antscript="/home/bma/apache-ant-1.6.5/bin/ant" buildfile="build-RDT.xml" target="dist" uselogger="true" usedebug="false"/> </schedule> <log dir="logs/RDT"> <merge dir="/home/bma/rdt/eclipse-testing/results/xml"/> </log> <!-- more recent versions of CC should use the listener below, instead of the currentbuildstatusbootstrapper, currentbuildstatuspublisher combination. NOTE: Must match filename in CC reporting/jsp - override.properties: user.build.status.file --> <listeners> <currentbuildstatuslistener file="logs/RDT/buildstatus.txt"/> </listeners> <!-- Publishers are run *after* a build completes --> <publishers> <onsuccess> <artifactspublisher dir="checkout/RDT/dist" dest="artifacts/RDT"/> <execute command="/home/bma/dispatchRdtBuildResultsNightly.sh"/> </onsuccess> <email mailhost="mail.sf.net" returnaddress="mba...@us..." buildresultsurl="http://213.239.199.113:8080/cruisecontrol/buildresults/RDT" skipusers="false" spamwhilebroken="false"> <always address="rub...@li..."/> </email> </publishers> </project> </cruisecontrol> |
|
From: Markus B. <mba...@us...> - 2005-12-22 23:13:19
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18346/cruiseControl Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl added to the repository |
|
From: Markus B. <mba...@us...> - 2005-12-22 20:07:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9430/src/org/rubypeople/rdt/internal/ui/text/ruby/hover Modified Files: RiDocHoverProvider.java Log Message: added patch from murphee: removed "RI: " prefix, shows 15 instead of 3 lines of RI result, uses a different flag for RI which shows less cluttered formatting Index: RiDocHoverProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RiDocHoverProvider.java 12 Dec 2005 20:00:49 -0000 1.2 --- RiDocHoverProvider.java 22 Dec 2005 20:07:10 -0000 1.3 *************** *** 25,28 **** --- 25,33 ---- List args = new ArrayList(); args.add(0, riPath.toString()); + // these will get rid of some of the overhead formatting + args.add("-f"); + args.add("simple"); + args.add("--no-pager"); + BufferedReader br = null; try { *************** *** 34,40 **** br = new BufferedReader(new InputStreamReader(p.getInputStream())); // TODO: format the documentation that was fetched from RI ! // for now: read the first 3 lines (at most) and show them StringBuffer buf = new StringBuffer(); ! for(int i = 0; i < 3; i++){ String line = br.readLine(); if(line != null){ --- 39,45 ---- br = new BufferedReader(new InputStreamReader(p.getInputStream())); // TODO: format the documentation that was fetched from RI ! // for now: read the first 15 lines so StringBuffer buf = new StringBuffer(); ! for(int i = 0; i < 15; i++){ String line = br.readLine(); if(line != null){ *************** *** 47,51 **** // If ambiguous, return nothing if (buf.indexOf("More than one method matched your request") > -1) return null; ! return "RI: " + buf.toString(); } catch (BadLocationException e) { RubyPlugin.log(e); --- 52,56 ---- // If ambiguous, return nothing if (buf.indexOf("More than one method matched your request") > -1) return null; ! return "" + buf.toString(); } catch (BadLocationException e) { RubyPlugin.log(e); |
|
From: Markus B. <mba...@us...> - 2005-12-22 20:07:18
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9430/src/org/rubypeople/rdt/ui/extensions Modified Files: ITextHoverProvider.java Log Message: added patch from murphee: removed "RI: " prefix, shows 15 instead of 3 lines of RI result, uses a different flag for RI which shows less cluttered formatting Index: ITextHoverProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/extensions/ITextHoverProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ITextHoverProvider.java 9 Dec 2005 02:05:06 -0000 1.1 --- ITextHoverProvider.java 22 Dec 2005 20:07:10 -0000 1.2 *************** *** 12,15 **** --- 12,21 ---- */ public interface ITextHoverProvider { + /** + * + * @param textViewer the ITextViewer that shows this hover + * @param hoverRegion the region that was preselected by the Ruby Hover system + * @return the hover text OR null if no text was found + */ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion); } |
|
From: Markus B. <mba...@us...> - 2005-12-22 20:05:32
|
Update of /cvsroot/rubyeclipse/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8992 Modified Files: users Log Message: completed developer list Index: users =================================================================== RCS file: /cvsroot/rubyeclipse/CVSROOT/users,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** users 20 Dec 2005 23:23:46 -0000 1.1 --- users 22 Dec 2005 20:05:16 -0000 1.2 *************** *** 1,3 **** # config file for cruise control ! mbarchfe:Mar...@gm... ! cawilliams:cwi...@ro... \ No newline at end of file --- 1,9 ---- # config file for cruise control ! awilliams:awi...@us... ! cawilliams:caw...@us... ! dcorbin:dc...@us... ! kyleshank:kyl...@us... ! mbarchfe:mba...@us... ! michaelhale:mic...@us... ! terraalien:ter...@us... ! zdennis:zd...@us... \ No newline at end of file |
|
From: Markus B. <mba...@us...> - 2005-12-20 23:50:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/bootstrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6717/bootstrap Modified Files: README Log Message: just a test to trigger a build Index: README =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/bootstrap/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 9 Nov 2004 22:01:27 -0000 1.2 --- README 20 Dec 2005 23:50:08 -0000 1.3 *************** *** 55,61 **** - - - 4) Run the Script run.sh or run. --- 55,58 ---- |
|
From: Markus B. <mba...@us...> - 2005-12-20 23:23:54
|
Update of /cvsroot/rubyeclipse/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv786 Added Files: users Log Message: file for mapping CVS user names to email addresses for cruise control email notifications --- NEW FILE: users --- # config file for cruise control mbarchfe:Mar...@gm... cawilliams:cwi...@ro... |
|
From: Markus B. <mba...@us...> - 2005-12-20 22:36:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21932/src/org/rubypeople/rdt/debug/core/tests Modified Files: FTC_DebuggerLaunch.java Log Message: Do nut use the default interpreter but specify "RubyInterpreter" instead Index: FTC_DebuggerLaunch.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FTC_DebuggerLaunch.java 3 Dec 2005 04:03:57 -0000 1.3 --- FTC_DebuggerLaunch.java 20 Dec 2005 22:36:50 -0000 1.4 *************** *** 70,74 **** wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, rubyFile.getProjectRelativePath().toString()); //wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, RubyApplicationShortcut.getDefaultWorkingDirectory(rubyFile.getProject())); ! wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, RubyRuntime.getDefault().getSelectedInterpreter().getName()); ILaunchConfiguration lc = wc.doSave() ; --- 70,74 ---- wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, rubyFile.getProjectRelativePath().toString()); //wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, RubyApplicationShortcut.getDefaultWorkingDirectory(rubyFile.getProject())); ! wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "RubyInterpreter"); ILaunchConfiguration lc = wc.doSave() ; |
|
From: Christopher W. <caw...@us...> - 2005-12-20 20:10:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23236 Modified Files: plugin.xml Log Message: add *.rake files as ruby source files Index: plugin.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/plugin.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** plugin.xml 21 Sep 2005 21:59:05 -0000 1.35 --- plugin.xml 20 Dec 2005 20:10:04 -0000 1.36 *************** *** 94,98 **** <content-type base-type="org.eclipse.core.runtime.text" ! file-extensions="rb,rbw,cgi,fcgi" file-names="Rakefile,generate,profiler,console,destroy,benchmarker,breakpointer,runner,server,rails,tracker,update,listener,breakpointer_for_gem,switchtower,switchtower_for_gem" id="rubySource" --- 94,98 ---- <content-type base-type="org.eclipse.core.runtime.text" ! file-extensions="rb,rbw,cgi,fcgi,rake" file-names="Rakefile,generate,profiler,console,destroy,benchmarker,breakpointer,runner,server,rails,tracker,update,listener,breakpointer_for_gem,switchtower,switchtower_for_gem" id="rubySource" |
|
From: Christopher W. <caw...@us...> - 2005-12-20 20:09:18
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22962/src/org/rubypeople/rdt/internal/core/builder Modified Files: RubySourceFileCollectingVisitor.java Log Message: Don't just check for normal ruby extensions, use content types to determine if we should include a file as ruby source file Index: RubySourceFileCollectingVisitor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubySourceFileCollectingVisitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubySourceFileCollectingVisitor.java 16 Oct 2005 17:29:21 -0000 1.1 --- RubySourceFileCollectingVisitor.java 20 Dec 2005 20:09:06 -0000 1.2 *************** *** 14,23 **** --- 14,27 ---- import java.util.List; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceProxy; import org.eclipse.core.resources.IResourceProxyVisitor; import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.content.IContentType; public final class RubySourceFileCollectingVisitor implements IResourceProxyVisitor { + + private static final String RUBY_SOURCE_CONTENT_TYPE_ID = "org.rubypeople.rdt.core.rubySource"; private final List files; *************** *** 34,46 **** files.add(resource); } return false; } return true; } ! public boolean equals(Object obj) { return obj.getClass().equals(getClass()); } ! public int hashCode() { return 0; --- 38,56 ---- files.add(resource); } + // Check for Ruby Source content type + resource = proxy.requestResource(); + IFile file = (IFile) resource; + IContentType type = file.getContentDescription().getContentType(); + if (type == null) return false; + if (type.getId().equals(RUBY_SOURCE_CONTENT_TYPE_ID)) files.add(resource); return false; } return true; } ! public boolean equals(Object obj) { return obj.getClass().equals(getClass()); } ! public int hashCode() { return 0; |
|
From: Matt K. <me...@us...> - 2005-12-20 18:49:49
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5516/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: TextEditorPreferencePage2.java Log Message: removed unnecessary text editor preference widgets Index: TextEditorPreferencePage2.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TextEditorPreferencePage2.java 20 Dec 2005 04:05:57 -0000 1.20 --- TextEditorPreferencePage2.java 20 Dec 2005 18:49:40 -0000 1.21 *************** *** 20,24 **** import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.preference.ColorFieldEditor; - import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; --- 20,23 ---- *************** *** 26,32 **** import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; - import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Point; - import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; --- 25,29 ---- *************** *** 37,41 **** import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Link; - import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.TabFolder; --- 34,37 ---- *************** *** 47,51 **** import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; import org.eclipse.ui.help.WorkbenchHelp; - import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyUIMessages; --- 43,46 ---- *************** *** 63,71 **** public class TextEditorPreferencePage2 extends RubyAbstractPreferencePage implements IWorkbenchPreferencePage { - private final String[][] fAppearanceColorListModel = new String[][] { { RubyUIMessages.getString("TextEditorPreferencePage.lineNumberForegroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR}, //$NON-NLS-1$ - { RubyUIMessages.getString("TextEditorPreferencePage.currentLineHighlighColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR}, //$NON-NLS-1$ - { RubyUIMessages.getString("TextEditorPreferencePage.printMarginColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR}, //$NON-NLS-1$ - }; - protected TextPropertyWidget[] textPropertyWidgets; protected Text indentationWidget; --- 58,61 ---- *************** *** 81,86 **** IRubyColorConstants.RUBY_DEFAULT }; - //private final String[][] fAnnotationColorListModel; - private ModifyListener fTextFieldListener = new ModifyListener() { --- 71,74 ---- *************** *** 99,105 **** }; - private List fAppearanceColorList; - private ColorEditor fAppearanceColorEditor; - private org.rubypeople.rdt.internal.ui.preferences.FoldingConfigurationBlock fFoldingConfigurationBlock; --- 87,90 ---- *************** *** 115,136 **** ArrayList overlayKeys = new ArrayList(); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE)); - - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.FORMAT_INDENTATION)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.FORMAT_USE_TAB)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN)); - - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN)); - - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER)); - - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER)); - OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); --- 100,106 ---- *************** *** 151,161 **** } - private void handleAppearanceColorListSelection() { - int i = fAppearanceColorList.getSelectionIndex(); - String key = fAppearanceColorListModel[i][1]; - RGB rgb = PreferenceConverter.getColor(fOverlayStore, key); - fAppearanceColorEditor.setColorValue(rgb); - } - private Control createAppearancePage(Composite parent) { --- 121,124 ---- *************** *** 165,257 **** appearanceComposite.setLayout(layout); - String label = RubyUIMessages.getString("TextEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$ - addTextField(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true); - - label = RubyUIMessages.getString("TextEditorPreferencePage.printMarginColumn"); //$NON-NLS-1$ - addTextField(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 3, 0, true); - - label = RubyUIMessages.getString("TextEditorPreferencePage.showOverviewRuler"); //$NON-NLS-1$ - addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER, 0); - - label = RubyUIMessages.getString("TextEditorPreferencePage.showLineNumbers"); //$NON-NLS-1$ - addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0); - - label = RubyUIMessages.getString("TextEditorPreferencePage.highlightCurrentLine"); //$NON-NLS-1$ - addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, 0); - - label = RubyUIMessages.getString("TextEditorPreferencePage.showPrintMargin"); //$NON-NLS-1$ - addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0); - - Label l = new Label(appearanceComposite, SWT.LEFT); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - gd.heightHint = convertHeightInCharsToPixels(1) / 2; - l.setLayoutData(gd); - - l = new Label(appearanceComposite, SWT.LEFT); - l.setText(RubyUIMessages.getString("TextEditorPreferencePage.appearanceOptions")); //$NON-NLS-1$ - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - l.setLayoutData(gd); - - Composite editorComposite = new Composite(appearanceComposite, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 0; - editorComposite.setLayout(layout); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); - gd.horizontalSpan = 2; - editorComposite.setLayoutData(gd); - - fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER); - gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL); - gd.heightHint = convertHeightInCharsToPixels(3); - fAppearanceColorList.setLayoutData(gd); - - Composite stylesComposite = new Composite(editorComposite, SWT.NONE); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - stylesComposite.setLayout(layout); - stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - l = new Label(stylesComposite, SWT.LEFT); - l.setText(RubyUIMessages.getString("TextEditorPreferencePage.color")); //$NON-NLS-1$ - gd = new GridData(); - gd.horizontalAlignment = GridData.BEGINNING; - l.setLayoutData(gd); - - fAppearanceColorEditor = new ColorEditor(stylesComposite); - Button foregroundColorButton = fAppearanceColorEditor.getButton(); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - foregroundColorButton.setLayoutData(gd); - - fAppearanceColorList.addSelectionListener(new SelectionListener() { - - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - handleAppearanceColorListSelection(); - } - }); - foregroundColorButton.addSelectionListener(new SelectionListener() { - - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - int i = fAppearanceColorList.getSelectionIndex(); - String key = fAppearanceColorListModel[i][1]; - - PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue()); - } - }); - final Shell shell= appearanceComposite.getShell(); String text= PreferencesMessages.getString("RubyEditorPreferencePage.link"); --- 128,131 ---- *************** *** 388,403 **** initializeFields(); - - for (int i = 0; i < fAppearanceColorListModel.length; i++) - fAppearanceColorList.add(fAppearanceColorListModel[i][0]); - fAppearanceColorList.getDisplay().asyncExec(new Runnable() { - - public void run() { - if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) { - fAppearanceColorList.select(0); - handleAppearanceColorListSelection(); - } - } - }); fFoldingConfigurationBlock.initialize(); --- 262,265 ---- *************** *** 433,437 **** } - handleAppearanceColorListSelection(); fFoldingConfigurationBlock.performDefaults(); --- 295,298 ---- |
|
From: Matt K. <me...@us...> - 2005-12-20 18:24:03
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates Modified Files: RubyTemplateAccess.java Log Message: quick bug fix (added null check) Index: RubyTemplateAccess.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates/RubyTemplateAccess.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyTemplateAccess.java 13 Dec 2005 15:19:21 -0000 1.3 --- RubyTemplateAccess.java 20 Dec 2005 18:23:53 -0000 1.4 *************** *** 74,79 **** // Load extension templates TemplatePersistenceData[] tempData = getExtensionTemplateData(); ! for(int i = 0; i < tempData.length; i++) { ! fStore.add(tempData[i]); } } --- 74,81 ---- // Load extension templates TemplatePersistenceData[] tempData = getExtensionTemplateData(); ! if(tempData != null) { ! for(int i = 0; i < tempData.length; i++) { ! fStore.add(tempData[i]); ! } } } |
|
From: Christopher W. <caw...@us...> - 2005-12-20 15:35:49
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18326/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: SymbolRule.java SingleCharacterPrefixRule.java Log Message: fix symbol rule to not highlight namespaced classes/modules (like Test::Unit::TestCase) Index: SingleCharacterPrefixRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SingleCharacterPrefixRule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SingleCharacterPrefixRule.java 2 Dec 2005 16:18:11 -0000 1.1 --- SingleCharacterPrefixRule.java 20 Dec 2005 15:35:41 -0000 1.2 *************** *** 39,43 **** while (true) { c = scanner.read(); ! if (c == ICharacterScanner.EOF || Character.isWhitespace((char) c)) { scanner.unread(); if (!lengthInRange(length)) return Token.UNDEFINED; --- 39,43 ---- while (true) { c = scanner.read(); ! if (!isValidCharacter(c, length)) { scanner.unread(); if (!lengthInRange(length)) return Token.UNDEFINED; *************** *** 53,56 **** --- 53,69 ---- /** + * Determine if the current character is valid for the rule. Return false if + * the character is not a part of the token. This is not applied to the + * single character prefix. + * + * @param c + * @param index + * @return + */ + protected boolean isValidCharacter(int c, int index) { + return c != ICharacterScanner.EOF && !Character.isWhitespace((char) c); + } + + /** * Determine if the length of the token is valid. * Index: SymbolRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SymbolRule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SymbolRule.java 2 Dec 2005 16:18:11 -0000 1.1 --- SymbolRule.java 20 Dec 2005 15:35:41 -0000 1.2 *************** *** 16,19 **** --- 16,25 ---- super(PREFIX, token, 2, Integer.MAX_VALUE); } + + protected boolean isValidCharacter(int c, int index) { + if (!super.isValidCharacter(c, index)) return false; + if (((char)c) == ':') return false; // other than first character (prefix) symbols can't contain another colon + return true; + } } |
|
From: Matt K. <me...@us...> - 2005-12-20 04:06:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18882/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: TextEditorPreferencePage2.java PreferencesMessages.properties Log Message: added link to text editor preference page Index: PreferencesMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PreferencesMessages.properties 18 Sep 2005 15:54:36 -0000 1.4 --- PreferencesMessages.properties 20 Dec 2005 04:05:57 -0000 1.5 *************** *** 10,13 **** --- 10,15 ---- ############################################################################### + RubyEditorPreferencePage.link=General text editor preferences can be set on the <a>Text Editors</a> page. + RubyEditorPreferencePage.link.tooltip=Show the shared text editor preferences BuildPathsPropertyPage.error.message=An error occurred while setting the build path BuildPathsPropertyPage.error.title=Error Setting Build Path Index: TextEditorPreferencePage2.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TextEditorPreferencePage2.java 2 Dec 2005 16:18:11 -0000 1.19 --- TextEditorPreferencePage2.java 20 Dec 2005 04:05:57 -0000 1.20 *************** *** 24,27 **** --- 24,28 ---- import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; + import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; *************** *** 35,39 **** --- 36,42 ---- import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; + import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.List; + import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; *************** *** 41,44 **** --- 44,48 ---- import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; + import org.eclipse.ui.dialogs.PreferencesUtil; import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; import org.eclipse.ui.help.WorkbenchHelp; *************** *** 249,252 **** --- 253,267 ---- } }); + + final Shell shell= appearanceComposite.getShell(); + String text= PreferencesMessages.getString("RubyEditorPreferencePage.link"); + Link link= new Link(appearanceComposite, SWT.NONE); + link.setText(text); + link.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + PreferencesUtil.createPreferenceDialogOn(shell, "org.eclipse.ui.preferencePages.GeneralTextEditor", null, null); //$NON-NLS-1$ + } + }); + link.setToolTipText(PreferencesMessages.getString("RubyEditorPreferencePage.link.tooltip")); return appearanceComposite; |
|
From: Matt K. <me...@us...> - 2005-12-19 22:41:52
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9049/src/org/rubypeople/rdt/internal/ui Modified Files: RubyPlugin.java Log Message: Removed TextEditor default preferences from the RubyPlugin preference store. Changes to the TextEditor preferences (such as background color) will now propagate to the Ruby editor. Index: RubyPlugin.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RubyPlugin.java 2 Dec 2005 16:18:11 -0000 1.20 --- RubyPlugin.java 19 Dec 2005 22:41:44 -0000 1.21 *************** *** 34,38 **** import org.eclipse.ui.PlatformUI; import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.progress.WorkbenchJob; --- 34,37 ---- *************** *** 308,312 **** PreferenceConverter.setDefault(store, RUBY_CONTENT_ASSISTANT_BACKGROUND, new RGB(150, 150, 0)); PreferenceConstants.initializeDefaultValues(store); - TextEditorPreferenceConstants.initializeDefaultValues(store); } --- 307,310 ---- |
|
From: Christopher W. <caw...@us...> - 2005-12-14 03:03:37
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11246/src/org/rubypeople/rdt/internal/core Modified Files: RubyModelManager.java Log Message: add dependency on jface.text, fix reference to nonexistant class Index: RubyModelManager.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubyModelManager.java 13 Dec 2005 19:58:55 -0000 1.5 --- RubyModelManager.java 14 Dec 2005 03:03:29 -0000 1.6 *************** *** 34,38 **** import org.rubypeople.rdt.internal.core.buffer.BufferManager; import org.rubypeople.rdt.internal.core.builder.RubyBuilder; - import org.rubypeople.rdt.internal.formatter.DefaultCodeFormatter; /** --- 34,37 ---- *************** *** 652,659 **** RubyModelOperation.POST_ACTION_VERBOSE = option.equalsIgnoreCase("true"); //$NON-NLS-1$ - option = Platform.getDebugOption(ENABLE_NEW_FORMATTER); - if (option != null) - DefaultCodeFormatter.USE_NEW_FORMATTER = option.equalsIgnoreCase("true"); //$NON-NLS-1$ - // configure performance options if (PerformanceStats.ENABLED) { --- 651,654 ---- |
|
From: Christopher W. <caw...@us...> - 2005-12-14 03:03:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11246/META-INF Modified Files: MANIFEST.MF Log Message: add dependency on jface.text, fix reference to nonexistant class Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/META-INF/MANIFEST.MF,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MANIFEST.MF 9 Oct 2005 22:14:06 -0000 1.6 --- MANIFEST.MF 14 Dec 2005 03:03:29 -0000 1.7 *************** *** 48,51 **** Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, ! org.eclipse.team.core Eclipse-AutoStart: true --- 48,52 ---- Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, ! org.eclipse.team.core, ! org.eclipse.jface.text Eclipse-AutoStart: true |
|
From: Christopher W. <caw...@us...> - 2005-12-13 21:10:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24867/src/org/rubypeople/rdt/internal/debug/ui/launcher Modified Files: RubyEnvironmentTab.java LoadPathEntryLabelProvider.java Log Message: implement Ticket #46 (Update code folding on current working copy/editor) Index: RubyEnvironmentTab.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RubyEnvironmentTab.java 12 Jul 2005 22:10:56 -0000 1.21 --- RubyEnvironmentTab.java 13 Dec 2005 21:10:44 -0000 1.22 *************** *** 27,31 **** import org.eclipse.swt.widgets.TabItem; import org.rubypeople.rdt.core.RubyCore; ! import org.rubypeople.rdt.internal.core.LoadPathEntry; import org.rubypeople.rdt.internal.core.RubyProject; import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages; --- 27,31 ---- import org.eclipse.swt.widgets.TabItem; import org.rubypeople.rdt.core.RubyCore; ! import org.rubypeople.rdt.internal.core.LoadpathEntry; import org.rubypeople.rdt.internal.core.RubyProject; import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages; *************** *** 223,227 **** List loadPathStrings = new ArrayList(); for (Iterator iterator = loadPathEntries.iterator(); iterator.hasNext();) { ! LoadPathEntry entry = (LoadPathEntry) iterator.next(); loadPathStrings.add(entry.getPath().toString()); } --- 223,227 ---- List loadPathStrings = new ArrayList(); for (Iterator iterator = loadPathEntries.iterator(); iterator.hasNext();) { ! LoadpathEntry entry = (LoadpathEntry) iterator.next(); loadPathStrings.add(entry.getPath().toString()); } Index: LoadPathEntryLabelProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LoadPathEntryLabelProvider.java 29 Aug 2005 16:06:49 -0000 1.5 --- LoadPathEntryLabelProvider.java 13 Dec 2005 21:10:44 -0000 1.6 *************** *** 5,9 **** import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.swt.graphics.Image; ! import org.rubypeople.rdt.internal.core.LoadPathEntry; import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin; --- 5,9 ---- import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.swt.graphics.Image; ! import org.rubypeople.rdt.internal.core.LoadpathEntry; import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin; *************** *** 27,32 **** */ public String getText(Object element) { ! if (element != null && element.getClass() == LoadPathEntry.class) { ! IProject project = ((LoadPathEntry) element).getProject() ; if (project.isAccessible()) { return project.getLocation().toOSString() ; --- 27,32 ---- */ public String getText(Object element) { ! if (element != null && element.getClass() == LoadpathEntry.class) { ! IProject project = ((LoadpathEntry) element).getProject() ; if (project.isAccessible()) { return project.getLocation().toOSString() ; |
|
From: Christopher W. <caw...@us...> - 2005-12-13 21:04:57
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23467 Modified Files: Changelog.txt Log Message: Add info about more changes we've made Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Changelog.txt 2 Dec 2005 16:19:17 -0000 1.19 --- Changelog.txt 13 Dec 2005 21:04:45 -0000 1.20 *************** *** 9,20 **** * The catchpoint dialog allows to add a ruby exception breakpoint * There can be at most one exception breakpoint; the breakpoint can be enabled, disabled and removed in the breakpoint view - * Added outline support for aliasing methods using the format 'alias :new_method :old_method' - * Fixed bug where current visibility was never reset when opening a new class * Ruby Search - * Fixed arguments in alias template to refer to methods in ocrrect order (first arg is new name, second is old) * Syntax Highlighting * Added ability to distinctly color characters * Added ability to distinctly color Fixnums (numbers) * Added ability to distinctly color Symbols Changes merged from SRB 0.6.1: * SRB_0-6-1_1: Enable/Disable breakpoints, move breakpoints --- 9,37 ---- * The catchpoint dialog allows to add a ruby exception breakpoint * There can be at most one exception breakpoint; the breakpoint can be enabled, disabled and removed in the breakpoint view * Ruby Search * Syntax Highlighting * Added ability to distinctly color characters * Added ability to distinctly color Fixnums (numbers) * Added ability to distinctly color Symbols + * Code completion + * Fixed arguments in alias template to refer to methods in ocrrect order (first arg is new name, second is old) + * Always suggests Kernel methods (unless user has typed text which would eliminate all of them as possibilities) + * Suggest Class and Module names from current project and any projects referenced by it + * Ruby Model / AST + * Added outline support for aliasing methods using the format 'alias :new_method :old_method' + * Fixed bug where current visibility was never reset when opening a new class + * Fix broken link between RubyProjects and RubyScripts. RubyProjects didn't properly find and add all RubyScripts as children. + It should do so now (according to RubyFileMatcher's behavior). + * Started to implement ElementChangeListeners/RubyDelta/RubyModelOperation core model machinery + * Editor + * Code Folding + * Now allows folding of class methods (self.method) + * Now updates code folding points as user edits the ruby script + * Double-click now selects text more logically (Try double-clicking a method call or variable in a method chain. + It used to select until it hit a space or bracket. Now it will stop at periods as well [and more characters too]) + * Extension Points + * New extension point for template proposals + * NEw extension point for text hovers + Changes merged from SRB 0.6.1: * SRB_0-6-1_1: Enable/Disable breakpoints, move breakpoints |
|
From: Christopher W. <caw...@us...> - 2005-12-13 20:08:00
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9905/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: implement Ticket #46 (Update code folding on current working copy/editor) Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** RubyCore.java 20 Nov 2005 02:23:11 -0000 1.27 --- RubyCore.java 13 Dec 2005 20:07:47 -0000 1.28 *************** *** 14,19 **** --- 14,21 ---- import java.util.ArrayList; import java.util.Arrays; + import java.util.Hashtable; import java.util.List; + import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; *************** [...972 lines suppressed...] ! * listener is not registered. ! * ! * @param listener ! * the listener ! */ ! public static void removeElementChangedListener(IElementChangedListener listener) { ! RubyModelManager.getRubyModelManager().deltaState.removeElementChangedListener(listener); ! } ! ! /** ! * Returns the single instance of the Ruby core plug-in runtime class. ! * Equivalent to <code>(RubyCore) getPlugin()</code>. ! * ! * @return the single instance of the Ruby core plug-in runtime class ! */ ! public static RubyCore getRubyCore() { ! return (RubyCore) getPlugin(); ! } } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2005-12-13 20:02:56
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8583/src/org/rubypeople/rdt/internal/core/builder Modified Files: RubyBuilder.java Log Message: implement Ticket #46 (Update code folding on current working copy/editor) Index: RubyBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyBuilder.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RubyBuilder.java 12 Nov 2005 19:15:58 -0000 1.16 --- RubyBuilder.java 13 Dec 2005 20:02:45 -0000 1.17 *************** *** 25,29 **** public class RubyBuilder extends IncrementalProjectBuilder { ! private static boolean verbose; private IProject currentProject; --- 25,29 ---- public class RubyBuilder extends IncrementalProjectBuilder { ! public static boolean DEBUG; private IProject currentProject; *************** *** 34,38 **** return null; ! if (verbose) RubyCore.trace("Started " + buildType(kind) + " build of " + buildDescription()); //$NON-NLS-1$ --- 34,38 ---- return null; ! if (DEBUG) RubyCore.trace("Started " + buildType(kind) + " build of " + buildDescription()); //$NON-NLS-1$ *************** *** 40,44 **** compiler.compile(monitor); ! if (verbose) RubyCore.trace("Finished build of " + buildDescription()); //$NON-NLS-1$ return null; --- 40,44 ---- compiler.compile(monitor); ! if (DEBUG) RubyCore.trace("Finished build of " + buildDescription()); //$NON-NLS-1$ return null; *************** *** 65,69 **** public static void setVerbose(boolean verbose) { ! RubyBuilder.verbose = verbose; } } --- 65,69 ---- public static void setVerbose(boolean verbose) { ! RubyBuilder.DEBUG = verbose; } } |
|
From: Christopher W. <caw...@us...> - 2005-12-13 20:02:14
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8352/src/org/rubypeople/rdt/internal/ui/text/folding Modified Files: DefaultRubyFoldingStructureProvider.java Log Message: implement Ticket #46 (Update code folding on current working copy/editor) Index: DefaultRubyFoldingStructureProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding/DefaultRubyFoldingStructureProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DefaultRubyFoldingStructureProvider.java 13 Dec 2005 14:58:17 -0000 1.4 --- DefaultRubyFoldingStructureProvider.java 13 Dec 2005 20:02:03 -0000 1.5 *************** *** 5,13 **** --- 5,19 ---- import java.util.ArrayList; + import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; import java.util.HashMap; + import java.util.Iterator; + import java.util.LinkedList; import java.util.List; import java.util.Map; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.text.Assert; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; *************** *** 15,19 **** --- 21,28 ---- import org.eclipse.jface.text.Position; import org.eclipse.jface.text.Region; + import org.eclipse.jface.text.source.Annotation; + import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.IProjectionListener; + import org.eclipse.jface.text.source.projection.IProjectionPosition; import org.eclipse.jface.text.source.projection.ProjectionAnnotation; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; *************** *** 21,30 **** import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; import org.rubypeople.rdt.core.IParent; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IRubyScript; - import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.ISourceRange; import org.rubypeople.rdt.core.ISourceReference; import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; --- 30,44 ---- import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; + import org.rubypeople.rdt.core.ElementChangedEvent; + import org.rubypeople.rdt.core.IElementChangedListener; + import org.rubypeople.rdt.core.IMember; import org.rubypeople.rdt.core.IParent; import org.rubypeople.rdt.core.IRubyElement; + import org.rubypeople.rdt.core.IRubyElementDelta; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.core.ISourceRange; import org.rubypeople.rdt.core.ISourceReference; + import org.rubypeople.rdt.core.IType; + import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; *************** *** 38,307 **** * @author cawilliams */ ! public class DefaultRubyFoldingStructureProvider implements IProjectionListener, IRubyFoldingStructureProvider { ! private ITextEditor fEditor; ! private ProjectionViewer fViewer; ! private IDocument fCachedDocument; ! private boolean fAllowCollapsing; ! private IRubyElement fInput; ! private boolean fCollapseInnerTypes; ! private boolean fCollapseRubydoc; ! private boolean fCollapseMethods; ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#install(org.eclipse.ui.texteditor.ITextEditor, ! * org.eclipse.jface.text.source.projection.ProjectionViewer) ! */ ! public void install(ITextEditor editor, ProjectionViewer viewer) { ! if (editor instanceof RubyAbstractEditor) { ! fEditor = editor; ! fViewer = viewer; ! fViewer.addProjectionListener(this); ! } ! } ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#uninstall() ! */ ! public void uninstall() { ! if (isInstalled()) { ! projectionDisabled(); ! fViewer.removeProjectionListener(this); ! fViewer = null; ! fEditor = null; ! } ! } ! protected boolean isInstalled() { ! return fEditor != null; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#initialize() ! */ ! public void initialize() { ! if (!isInstalled()) return; ! initializePreferences(); ! try { ! IDocumentProvider provider = fEditor.getDocumentProvider(); ! fCachedDocument = provider.getDocument(fEditor.getEditorInput()); ! fAllowCollapsing = true; ! if (fEditor instanceof RubyEditor) { ! IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager(); ! fInput = manager.getWorkingCopy(fEditor.getEditorInput()); ! } ! if (fInput != null) { ! ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class); ! if (model != null) { ! if (fInput instanceof IRubyScript) { ! IRubyScript unit = (IRubyScript) fInput; ! synchronized (unit) { ! try { ! unit.reconcile(); ! } catch (RubyModelException e) {} ! } ! } ! Map additions = computeAdditions((IParent) fInput); ! model.removeAllAnnotations(); ! model.replaceAnnotations(null, additions); ! } ! } ! } finally { ! fCachedDocument = null; ! fAllowCollapsing = false; ! } ! } ! /** ! * @param input ! * @return ! */ ! private Map computeAdditions(IParent parent) { ! Map map = new HashMap(); ! try { ! computeAdditions(parent.getChildren(), map); ! } catch (RubyModelException x) { ! RubyPlugin.log(x); ! } ! return map; ! } ! private void computeAdditions(IRubyElement[] elements, Map map) throws RubyModelException { ! for (int i = 0; i < elements.length; i++) { ! IRubyElement element = elements[i]; ! computeAdditions(element, map); ! if (element instanceof IParent) { ! IParent parent = (IParent) element; ! computeAdditions(parent.getChildren(), map); ! } ! } ! } ! /** ! * @param element ! * @param map ! */ ! private void computeAdditions(IRubyElement element, Map map) { ! boolean createProjection = false; ! boolean collapse = false; ! switch (element.getElementType()) { ! case IRubyElement.TYPE: ! collapse = fAllowCollapsing && fCollapseInnerTypes && isInnerType((IType) element); ! createProjection = true; ! break; ! case IRubyElement.METHOD: case IRubyElement.SINGLETON_METHOD: ! collapse = fAllowCollapsing && fCollapseMethods; ! createProjection = true; ! break; ! } ! if (createProjection) { ! IRegion[] regions = computeProjectionRanges(element); ! if (regions != null) { ! // comments ! for (int i = 0; i < regions.length - 1; i++) { ! Position position = createProjectionPosition(regions[i]); ! if (position != null) map.put(new RubyProjectionAnnotation(element, fAllowCollapsing && fCollapseRubydoc, true), position); ! } ! // code ! Position position = createProjectionPosition(regions[regions.length - 1]); ! if (position != null) map.put(new RubyProjectionAnnotation(element, collapse, false), position); ! } ! } ! } ! private void initializePreferences() { ! IPreferenceStore store = RubyPlugin.getDefault().getPreferenceStore(); ! fCollapseInnerTypes = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_INNERTYPES); ! fCollapseRubydoc = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_RDOC); ! fCollapseMethods = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_METHODS); ! } ! private boolean isInnerType(IType type) { ! IRubyElement parent = type.getParent(); ! if (parent != null) { ! int parentType = parent.getElementType(); ! return (parentType != IRubyElement.SCRIPT); ! } ! return false; ! } ! private IRegion[] computeProjectionRanges(IRubyElement element) { ! try { ! if (element instanceof ISourceReference) { ! ISourceReference reference = (ISourceReference) element; ! ISourceRange range = reference.getSourceRange(); ! // TODO Uncomment when getSource is set up right! ! // String contents = reference.getSource(); ! // if (contents == null) return null; ! List regions = new ArrayList(); ! int shift = range.getOffset(); ! int start = shift; ! regions.add(new Region(start, range.getOffset() + range.getLength() - start)); ! if (regions.size() > 0) { ! IRegion[] result = new IRegion[regions.size()]; ! regions.toArray(result); ! return result; ! } ! } ! } catch (RubyModelException e) {} ! return null; ! } ! private Position createProjectionPosition(IRegion region) { ! if (fCachedDocument == null) return null; ! try { ! int start = fCachedDocument.getLineOfOffset(region.getOffset()); ! int end = fCachedDocument.getLineOfOffset(region.getOffset() + region.getLength()); ! if (start != end) { ! int offset = fCachedDocument.getLineOffset(start); ! int endOffset = fCachedDocument.getLineOffset(end + 1); ! return new Position(offset, endOffset - offset); ! } ! } catch (BadLocationException x) {} ! return null; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled() ! */ ! public void projectionEnabled() { ! // http://home.ott.oti.com/teams/wswb/anon/out/vms/index.html ! // projectionEnabled messages are not always paired with ! // projectionDisabled ! // i.e. multiple enabled messages may be sent out. ! // we have to make sure that we disable first when getting an enable ! // message. ! projectionDisabled(); ! if (fEditor instanceof RubyAbstractEditor) { ! initialize(); ! // TODO Uncomment so we can react to changes! ! // fElementListener = new ElementChangedListener(); ! // RubyPlugin.addElementChangedListener(fElementListener); ! } ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled() ! */ ! public void projectionDisabled() { ! fCachedDocument = null; ! // TODO Uncomment so we can react to changes! ! // if (fElementListener != null) { ! // RubyPlugin.removeElementChangedListener(fElementListener); ! // fElementListener = null; ! // } ! } ! private static class RubyProjectionAnnotation extends ProjectionAnnotation { ! private IRubyElement fRubyElement; ! private boolean fIsComment; ! public RubyProjectionAnnotation(IRubyElement element, boolean isCollapsed, boolean isComment) { ! super(isCollapsed); ! fRubyElement = element; ! fIsComment = isComment; ! } ! public IRubyElement getElement() { ! return fRubyElement; ! } ! public void setElement(IRubyElement element) { ! fRubyElement = element; ! } ! public boolean isComment() { ! return fIsComment; ! } ! public void setIsComment(boolean isComment) { ! fIsComment = isComment; ! } ! } } --- 52,682 ---- * @author cawilliams */ ! public class DefaultRubyFoldingStructureProvider implements IProjectionListener, ! IRubyFoldingStructureProvider { ! private ITextEditor fEditor; ! private ProjectionViewer fViewer; ! private IDocument fCachedDocument; ! private ProjectionAnnotationModel fCachedModel; ! private boolean fAllowCollapsing; ! private IRubyElement fInput; ! private IElementChangedListener fElementListener; ! private boolean fCollapseInnerTypes; ! private boolean fCollapseRubydoc; ! private boolean fCollapseMethods; ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#install(org.eclipse.ui.texteditor.ITextEditor, ! * org.eclipse.jface.text.source.projection.ProjectionViewer) ! */ ! public void install(ITextEditor editor, ProjectionViewer viewer) { ! if (editor instanceof RubyAbstractEditor) { ! fEditor = editor; ! fViewer = viewer; ! fViewer.addProjectionListener(this); ! } ! } ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#uninstall() ! */ ! public void uninstall() { ! if (isInstalled()) { ! projectionDisabled(); ! fViewer.removeProjectionListener(this); ! fViewer = null; ! fEditor = null; ! } ! } ! protected boolean isInstalled() { ! return fEditor != null; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider#initialize() ! */ ! public void initialize() { ! if (!isInstalled()) return; ! initializePreferences(); ! try { ! IDocumentProvider provider = fEditor.getDocumentProvider(); ! fCachedDocument = provider.getDocument(fEditor.getEditorInput()); ! fAllowCollapsing = true; ! if (fEditor instanceof RubyEditor) { ! IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager(); ! fInput = manager.getWorkingCopy(fEditor.getEditorInput()); ! } ! if (fInput != null) { ! ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor ! .getAdapter(ProjectionAnnotationModel.class); ! if (model != null) { ! fCachedModel = model; ! if (fInput instanceof IRubyScript) { ! IRubyScript unit = (IRubyScript) fInput; ! synchronized (unit) { ! try { ! unit.reconcile(); ! } catch (RubyModelException e) { ! } ! } ! } ! Map additions = computeAdditions((IParent) fInput); ! /* ! * Minimize the events being sent out - as this happens in ! * the UI thread merge everything into one call. ! */ ! List removals = new LinkedList(); ! Iterator existing = model.getAnnotationIterator(); ! while (existing.hasNext()) ! removals.add(existing.next()); ! model.replaceAnnotations((Annotation[]) removals ! .toArray(new Annotation[removals.size()]), additions); ! } ! } ! } finally { ! fCachedDocument = null; ! fAllowCollapsing = false; ! fCachedModel = null; ! } ! } ! /** ! * @param input ! * @return ! */ ! private Map computeAdditions(IParent parent) { ! Map map = new HashMap(); ! try { ! computeAdditions(parent.getChildren(), map); ! } catch (RubyModelException x) { ! RubyPlugin.log(x); ! } ! return map; ! } ! private void computeAdditions(IRubyElement[] elements, Map map) throws RubyModelException { ! for (int i = 0; i < elements.length; i++) { ! IRubyElement element = elements[i]; ! computeAdditions(element, map); ! if (element instanceof IParent) { ! IParent parent = (IParent) element; ! computeAdditions(parent.getChildren(), map); ! } ! } ! } ! /** ! * @param element ! * @param map ! */ ! private void computeAdditions(IRubyElement element, Map map) { ! boolean createProjection = false; ! boolean collapse = false; ! switch (element.getElementType()) { ! case IRubyElement.TYPE: ! collapse = fAllowCollapsing && fCollapseInnerTypes && isInnerType((IType) element); ! createProjection = true; ! break; ! case IRubyElement.METHOD: case IRubyElement.SINGLETON_METHOD: ! collapse = fAllowCollapsing && fCollapseMethods; ! createProjection = true; ! break; ! } ! if (createProjection) { ! IRegion[] regions = computeProjectionRanges(element); ! if (regions != null) { ! // comments ! for (int i = 0; i < regions.length - 1; i++) { ! Position position = createProjectionPosition(regions[i]); ! if (position != null) ! map.put(new RubyProjectionAnnotation(element, fAllowCollapsing ! && fCollapseRubydoc, true), position); ! } ! // code ! Position position = createProjectionPosition(regions[regions.length - 1]); ! if (position != null) ! map.put(new RubyProjectionAnnotation(element, collapse, false), position); ! } ! } ! } ! private void initializePreferences() { ! IPreferenceStore store = RubyPlugin.getDefault().getPreferenceStore(); ! fCollapseInnerTypes = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_INNERTYPES); ! fCollapseRubydoc = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_RDOC); ! fCollapseMethods = store.getBoolean(PreferenceConstants.EDITOR_FOLDING_METHODS); ! } ! private boolean isInnerType(IType type) { ! IRubyElement parent = type.getParent(); ! if (parent != null) { ! int parentType = parent.getElementType(); ! return (parentType != IRubyElement.SCRIPT); ! } ! return false; ! } ! private IRegion[] computeProjectionRanges(IRubyElement element) { ! try { ! if (element instanceof ISourceReference) { ! ISourceReference reference = (ISourceReference) element; ! ISourceRange range = reference.getSourceRange(); ! // TODO Uncomment when getSource is set up right! ! // String contents = reference.getSource(); ! // if (contents == null) return null; ! List regions = new ArrayList(); ! int shift = range.getOffset(); ! int start = shift; ! regions.add(new Region(start, range.getOffset() + range.getLength() - start)); ! if (regions.size() > 0) { ! IRegion[] result = new IRegion[regions.size()]; ! regions.toArray(result); ! return result; ! } ! } ! } catch (RubyModelException e) { ! } ! return null; ! } ! private Position createProjectionPosition(IRegion region) { ! if (fCachedDocument == null) return null; ! try { ! int start = fCachedDocument.getLineOfOffset(region.getOffset()); ! int end = fCachedDocument.getLineOfOffset(region.getOffset() + region.getLength()); ! if (start != end) { ! int offset = fCachedDocument.getLineOffset(start); ! int endOffset = fCachedDocument.getLineOffset(end + 1); ! return new Position(offset, endOffset - offset); ! } ! } catch (BadLocationException x) { ! } ! return null; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled() ! */ ! public void projectionEnabled() { ! // http://home.ott.oti.com/teams/wswb/anon/out/vms/index.html ! // projectionEnabled messages are not always paired with ! // projectionDisabled ! // i.e. multiple enabled messages may be sent out. ! // we have to make sure that we disable first when getting an enable ! // message. ! projectionDisabled(); ! if (fEditor instanceof RubyAbstractEditor) { ! initialize(); ! fElementListener = new ElementChangedListener(); ! RubyCore.addElementChangedListener(fElementListener); ! } ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled() ! */ ! public void projectionDisabled() { ! fCachedDocument = null; ! if (fElementListener != null) { ! RubyCore.removeElementChangedListener(fElementListener); ! fElementListener = null; ! } ! } ! protected void processDelta(IRubyElementDelta delta) { ! if (!isInstalled()) return; ! if ((delta.getFlags() & (IRubyElementDelta.F_CONTENT | IRubyElementDelta.F_CHILDREN)) == 0) ! return; ! ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor ! .getAdapter(ProjectionAnnotationModel.class); ! if (model == null) return; ! try { ! IDocumentProvider provider = fEditor.getDocumentProvider(); ! fCachedDocument = provider.getDocument(fEditor.getEditorInput()); ! fCachedModel = model; ! fAllowCollapsing = false; ! Map additions = new HashMap(); ! List deletions = new ArrayList(); ! List updates = new ArrayList(); ! ! Map updated = computeAdditions((IParent) fInput); ! Map previous = createAnnotationMap(model); ! ! Iterator e = updated.keySet().iterator(); ! while (e.hasNext()) { ! RubyProjectionAnnotation newAnnotation = (RubyProjectionAnnotation) e.next(); ! IRubyElement element = newAnnotation.getElement(); ! Position newPosition = (Position) updated.get(newAnnotation); ! ! List annotations = (List) previous.get(element); ! if (annotations == null) { ! ! additions.put(newAnnotation, newPosition); ! ! } else { ! Iterator x = annotations.iterator(); ! boolean matched = false; ! while (x.hasNext()) { ! Tuple tuple = (Tuple) x.next(); ! RubyProjectionAnnotation existingAnnotation = tuple.annotation; ! Position existingPosition = tuple.position; ! if (newAnnotation.isComment() == existingAnnotation.isComment()) { ! if (existingPosition != null && (!newPosition.equals(existingPosition))) { ! existingPosition.setOffset(newPosition.getOffset()); ! existingPosition.setLength(newPosition.getLength()); ! updates.add(existingAnnotation); ! } ! matched = true; ! x.remove(); ! break; ! } ! } ! if (!matched) additions.put(newAnnotation, newPosition); ! ! if (annotations.isEmpty()) previous.remove(element); ! } ! } ! ! e = previous.values().iterator(); ! while (e.hasNext()) { ! List list = (List) e.next(); ! int size = list.size(); ! for (int i = 0; i < size; i++) ! deletions.add(((Tuple) list.get(i)).annotation); ! } ! ! match(deletions, additions, updates); ! ! Annotation[] removals = new Annotation[deletions.size()]; ! deletions.toArray(removals); ! Annotation[] changes = new Annotation[updates.size()]; ! updates.toArray(changes); ! model.modifyAnnotations(removals, additions, changes); ! ! } finally { ! fCachedDocument = null; ! fAllowCollapsing = true; ! fCachedModel = null; ! } ! } ! ! private Map createAnnotationMap(IAnnotationModel model) { ! Map map = new HashMap(); ! Iterator e = model.getAnnotationIterator(); ! while (e.hasNext()) { ! Object annotation = e.next(); ! if (annotation instanceof RubyProjectionAnnotation) { ! RubyProjectionAnnotation ruby = (RubyProjectionAnnotation) annotation; ! Position position = model.getPosition(ruby); ! Assert.isNotNull(position); ! List list = (List) map.get(ruby.getElement()); ! if (list == null) { ! list = new ArrayList(2); ! map.put(ruby.getElement(), list); ! } ! list.add(new Tuple(ruby, position)); ! } ! } ! ! Comparator comparator = new Comparator() { ! ! public int compare(Object o1, Object o2) { ! return ((Tuple) o1).position.getOffset() - ((Tuple) o2).position.getOffset(); ! } ! }; ! for (Iterator it = map.values().iterator(); it.hasNext();) { ! List list = (List) it.next(); ! Collections.sort(list, comparator); ! } ! return map; ! } ! ! /** ! * Matches deleted annotations to changed or added ones. A deleted ! * annotation/position tuple that has a matching addition / change is ! * updated and marked as changed. The matching tuple is not added (for ! * additions) or marked as deletion instead (for changes). The result is ! * that more annotations are changed and fewer get deleted/re-added. ! */ ! private void match(List deletions, Map additions, List changes) { ! if (deletions.isEmpty() || (additions.isEmpty() && changes.isEmpty())) return; ! ! List newDeletions = new ArrayList(); ! List newChanges = new ArrayList(); ! ! Iterator deletionIterator = deletions.iterator(); ! while (deletionIterator.hasNext()) { ! RubyProjectionAnnotation deleted = (RubyProjectionAnnotation) deletionIterator.next(); ! Position deletedPosition = fCachedModel.getPosition(deleted); ! if (deletedPosition == null) continue; ! ! Tuple deletedTuple = new Tuple(deleted, deletedPosition); ! ! Tuple match = findMatch(deletedTuple, changes, null); ! boolean addToDeletions = true; ! if (match == null) { ! match = findMatch(deletedTuple, additions.keySet(), additions); ! addToDeletions = false; ! } ! ! if (match != null) { ! IRubyElement element = match.annotation.getElement(); ! deleted.setElement(element); ! deletedPosition.setLength(match.position.getLength()); ! if (deletedPosition instanceof RubyElementPosition && element instanceof IMember) { ! RubyElementPosition jep = (RubyElementPosition) deletedPosition; ! jep.setMember((IMember) element); ! } ! ! deletionIterator.remove(); ! newChanges.add(deleted); ! ! if (addToDeletions) newDeletions.add(match.annotation); ! } ! } ! ! deletions.addAll(newDeletions); ! changes.addAll(newChanges); ! } ! ! /** ! * Finds a match for <code>tuple</code> in a collection of annotations. ! * The positions for the <code>JavaProjectionAnnotation</code> instances ! * in <code>annotations</code> can be found in the passed ! * <code>positionMap</code> or <code>fCachedModel</code> if ! * <code>positionMap</code> is <code>null</code>. ! * <p> ! * A tuple is said to match another if their annotations have the same ! * comment flag and their position offsets are equal. ! * </p> ! * <p> ! * If a match is found, the annotation gets removed from ! * <code>annotations</code>. ! * </p> ! * ! * @param tuple ! * the tuple for which we want to find a match ! * @param annotations ! * collection of <code>JavaProjectionAnnotation</code> ! * @param positionMap ! * a <code>Map<Annotation, Position></code> or ! * <code>null</code> ! * @return a matching tuple or <code>null</code> for no match ! */ ! private Tuple findMatch(Tuple tuple, Collection annotations, Map positionMap) { ! Iterator it = annotations.iterator(); ! while (it.hasNext()) { ! RubyProjectionAnnotation annotation = (RubyProjectionAnnotation) it.next(); ! if (tuple.annotation.isComment() == annotation.isComment()) { ! Position position = positionMap == null ? fCachedModel.getPosition(annotation) ! : (Position) positionMap.get(annotation); ! if (position == null) continue; ! ! if (tuple.position.getOffset() == position.getOffset()) { ! it.remove(); ! return new Tuple(annotation, position); ! } ! } ! } ! ! return null; ! } ! ! private static final class Tuple { ! ! RubyProjectionAnnotation annotation; ! Position position; ! ! Tuple(RubyProjectionAnnotation annotation, Position position) { ! this.annotation = annotation; ! this.position = position; ! } ! } ! ! private class ElementChangedListener implements IElementChangedListener { ! ! /* ! * @see org.eclipse.jdt.core.IElementChangedListener#elementChanged(org.eclipse.jdt.core.ElementChangedEvent) ! */ ! public void elementChanged(ElementChangedEvent e) { ! IRubyElementDelta delta = findElement(fInput, e.getDelta()); ! if (delta != null) processDelta(delta); ! } ! ! private IRubyElementDelta findElement(IRubyElement target, IRubyElementDelta delta) { ! ! if (delta == null || target == null) return null; ! ! IRubyElement element = delta.getElement(); ! ! if (element.getElementType() > IRubyElement.SCRIPT) return null; ! ! if (target.equals(element)) return delta; ! ! IRubyElementDelta[] children = delta.getAffectedChildren(); ! ! for (int i = 0; i < children.length; i++) { ! IRubyElementDelta d = findElement(target, children[i]); ! if (d != null) return d; ! } ! ! return null; ! } ! } ! ! private static class RubyProjectionAnnotation extends ProjectionAnnotation { ! ! private IRubyElement fRubyElement; ! private boolean fIsComment; ! ! public RubyProjectionAnnotation(IRubyElement element, boolean isCollapsed, boolean isComment) { ! super(isCollapsed); ! fRubyElement = element; ! fIsComment = isComment; ! } ! ! public IRubyElement getElement() { ! return fRubyElement; ! } ! ! public void setElement(IRubyElement element) { ! fRubyElement = element; ! } ! ! public boolean isComment() { ! return fIsComment; ! } ! ! public void setIsComment(boolean isComment) { ! fIsComment = isComment; ! } ! } ! ! /** ! * Projection position that will return two foldable regions: one folding ! * away the lines before the one containing the simple name of the ruby ! * element, one folding away any lines after the caption. ! * ! * @since 0.7.0 ! */ ! private static final class RubyElementPosition extends Position implements IProjectionPosition { ! ! private IMember fMember; ! ! public RubyElementPosition(int offset, int length, IMember member) { ! super(offset, length); ! Assert.isNotNull(member); ! fMember = member; ! } ! ! public void setMember(IMember member) { ! Assert.isNotNull(member); ! fMember = member; ! } ! ! /* ! * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeFoldingRegions(org.eclipse.jface.text.IDocument) ! */ ! public IRegion[] computeProjectionRegions(IDocument document) throws BadLocationException { ! int nameStart = offset; ! try { ! /* ! * The member's name range may not be correct. However, ! * reconciling would trigger another element delta which would ! * lead to reentrant situations. Therefore, we optimistically ! * assume that the name range is correct, but double check the ! * received lines below. ! */ ! ISourceRange nameRange = fMember.getNameRange(); ! if (nameRange != null) nameStart = nameRange.getOffset(); ! ! } catch (RubyModelException e) { ! // ignore and use default ! } ! ! int firstLine = document.getLineOfOffset(offset); ! int captionLine = document.getLineOfOffset(nameStart); ! int lastLine = document.getLineOfOffset(offset + length); ! ! /* ! * see comment above - adjust the caption line to be inside the ! * entire folded region, and rely on later element deltas to correct ! * the name range. ! */ ! if (captionLine < firstLine) captionLine = firstLine; ! if (captionLine > lastLine) captionLine = lastLine; ! ! IRegion preRegion; ! if (firstLine < captionLine) { ! int preOffset = document.getLineOffset(firstLine); ! IRegion preEndLineInfo = document.getLineInformation(captionLine); ! int preEnd = preEndLineInfo.getOffset(); ! preRegion = new Region(preOffset, preEnd - preOffset); ! } else { ! preRegion = null; ! } ! ! if (captionLine < lastLine) { ! int postOffset = document.getLineOffset(captionLine + 1); ! IRegion postRegion = new Region(postOffset, offset + length - postOffset); ! ! if (preRegion == null) return new IRegion[] { postRegion}; ! ! return new IRegion[] { preRegion, postRegion}; ! } ! ! if (preRegion != null) return new IRegion[] { preRegion}; ! ! return null; ! } ! ! /* ! * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeCaptionOffset(org.eclipse.jface.text.IDocument) ! */ ! public int computeCaptionOffset(IDocument document) throws BadLocationException { ! int nameStart = offset; ! try { ! // need a reconcile here? ! ISourceRange nameRange = fMember.getNameRange(); ! if (nameRange != null) nameStart = nameRange.getOffset(); ! } catch (RubyModelException e) { ! // ignore and use default ! } ! ! return nameStart - offset; ! } ! ! } } |