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: Christopher W. <caw...@us...> - 2006-02-10 20:12:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/icons/full/dlcl16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18295/icons/full/dlcl16 Added Files: gointo_toplevel_type.gif filter_ps.gif public_co.gif localtypes_co.gif static_co.gif synced.gif fields_co.gif alphab_sort_co.gif Log Message: new icons for UI --- NEW FILE: synced.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: public_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: localtypes_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: static_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fields_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: alphab_sort_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: gointo_toplevel_type.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: filter_ps.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:00:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13555/src/org/rubypeople/rdt/internal/launching Modified Files: TC_RunnerLaunching.java TC_RubyRuntime.java Log Message: try to fix tests to run with new code changes Index: TC_RubyRuntime.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_RubyRuntime.java 22 Nov 2005 01:23:50 -0000 1.2 --- TC_RubyRuntime.java 10 Feb 2006 19:59:59 -0000 1.3 *************** *** 357,360 **** --- 357,375 ---- } + public void createLink(URI location, int updateFlags, IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } + + public URI getRawLocationURI() { + // TODO Auto-generated method stub + return null; + } + + public boolean isLinked(int options) { + // TODO Auto-generated method stub + return false; + } + } Index: TC_RunnerLaunching.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TC_RunnerLaunching.java 13 Oct 2005 18:59:46 -0000 1.4 --- TC_RunnerLaunching.java 10 Feb 2006 19:59:59 -0000 1.5 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; + import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; *************** *** 232,235 **** --- 233,251 ---- return null; } + + public IResource[] getMappedResources() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isMigrationCandidate() throws CoreException { + // TODO Auto-generated method stub + return false; + } + + public void migrate() throws CoreException { + // TODO Auto-generated method stub + + } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:00:07
|
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-serv13520/src/org/rubypeople/rdt/internal/core/parser Modified Files: TC_TaskParser.java Log Message: try to fix tests to run with new code changes Index: TC_TaskParser.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/TC_TaskParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_TaskParser.java 6 Aug 2005 22:57:29 -0000 1.1 --- TC_TaskParser.java 10 Feb 2006 19:59:55 -0000 1.2 *************** *** 3,12 **** import java.io.StringReader; import java.util.List; import junit.framework.TestCase; import org.eclipse.core.resources.IMarker; - import org.rubypeople.eclipse.shams.runtime.ShamPreferences; import org.rubypeople.rdt.core.RubyCore; --- 3,13 ---- import java.io.StringReader; + import java.util.HashMap; import java.util.List; + import java.util.Map; import junit.framework.TestCase; import org.eclipse.core.resources.IMarker; import org.rubypeople.rdt.core.RubyCore; *************** *** 15,23 **** private static final String BASIC_MESSAGE = "TASK test"; private static final String ALTERNATE_MESSAGE = "CHORE test"; ! private ShamPreferences preferences; private TaskParser parser; public void setUp() { ! preferences = new ShamPreferences(); preferences.put(RubyCore.COMPILER_TASK_TAGS, "TASK"); --- 16,24 ---- private static final String BASIC_MESSAGE = "TASK test"; private static final String ALTERNATE_MESSAGE = "CHORE test"; ! private Map preferences; private TaskParser parser; public void setUp() { ! preferences = new HashMap(); preferences.put(RubyCore.COMPILER_TASK_TAGS, "TASK"); |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:00:07
|
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-serv13520/src/org/rubypeople/rdt/internal/core/builder Modified Files: TC_TaskCompiler.java Log Message: try to fix tests to run with new code changes Index: TC_TaskCompiler.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_TaskCompiler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_TaskCompiler.java 1 Oct 2005 23:00:54 -0000 1.1 --- TC_TaskCompiler.java 10 Feb 2006 19:59:55 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- import java.util.ArrayList; import java.util.Collections; + import java.util.HashMap; import java.util.List; *************** *** 10,14 **** import org.rubypeople.eclipse.shams.resources.ShamFile; - import org.rubypeople.eclipse.shams.runtime.ShamPreferences; import org.rubypeople.rdt.internal.core.parser.TaskParser; import org.rubypeople.rdt.internal.core.parser.TaskTag; --- 11,14 ---- *************** *** 27,31 **** public ShamTaskParser() { ! super(new ShamPreferences()); } --- 27,31 ---- public ShamTaskParser() { ! super(new HashMap()); } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:00:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13520/src/org/rubypeople/rdt/internal/formatter Modified Files: TC_CodeFormatter.java FormatTestData.xml Log Message: try to fix tests to run with new code changes Index: FormatTestData.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FormatTestData.xml 18 Jan 2005 22:15:19 -0000 1.3 --- FormatTestData.xml 10 Feb 2006 19:59:55 -0000 1.4 *************** *** 18,28 **** <formatted> class xx ! **def xx() ! ****if bla() then ! ******bla ! ****else ! ******arg ! ****end ! **end end </formatted> --- 18,28 ---- <formatted> class xx ! def xx() ! if bla() then ! bla ! else ! arg ! end ! end end </formatted> *************** *** 44,54 **** <formatted> if(true) ! **while(true)do ! ****if/test/=~"test" then ! ******puts "TEST MATCHES" ; ! ****elsif/test/=~"abc" ! ******puts "ABC MATCHES"; ! ****end ! **end end </formatted> --- 44,54 ---- <formatted> if(true) ! while(true)do ! if/test/=~"test" then ! puts "TEST MATCHES" ; ! elsif/test/=~"abc" ! puts "ABC MATCHES"; ! end ! end end </formatted> *************** *** 94,103 **** </unformatted> <formatted> ! *# comment ! *def firstMethod ! ***if a ! *****b ! ***end ! *end </formatted> </test> --- 94,103 ---- </unformatted> <formatted> ! # comment ! def firstMethod ! if a ! b ! end ! end </formatted> </test> *************** *** 115,121 **** <formatted> a.each { | x | ! **if a ! ****b ! **end } </formatted> --- 115,121 ---- <formatted> a.each { | x | ! if a ! b ! end } </formatted> *************** *** 132,136 **** a.each { | x | ! **test } </formatted> --- 132,136 ---- a.each { | x | ! test } </formatted> *************** *** 151,157 **** <formatted> begin ! **x rescue ! **y end </formatted> --- 151,157 ---- <formatted> begin ! x rescue ! y end </formatted> *************** *** 179,186 **** <formatted> while (a) do ! **test end x = 5 ; until x do ! **test end </formatted> --- 179,186 ---- <formatted> while (a) do ! test end x = 5 ; until x do ! test end </formatted> *************** *** 199,206 **** <formatted> 3.timeswhile do ! **test end while (a) x end ; 2.times do ! **test end </formatted> --- 199,206 ---- <formatted> 3.timeswhile do ! test end while (a) x end ; 2.times do ! test end </formatted> *************** *** 239,246 **** <formatted> a = 0 ; if a != 0 ! **test end a = if a != 0 ! **5 end </formatted> --- 239,246 ---- <formatted> a = 0 ; if a != 0 ! test end a = if a != 0 ! 5 end </formatted> *************** *** 257,261 **** <formatted> begin ! **i+=1 end until i == 5 test --- 257,261 ---- <formatted> begin ! i+=1 end until i == 5 test *************** *** 285,290 **** <formatted> class A ! **def a ! **end;end class B end; </formatted> --- 285,290 ---- <formatted> class A ! def a ! end;end class B end; </formatted> *************** *** 300,304 **** <formatted> def a;if 0 then puts "X" ! **end; end; </formatted> --- 300,304 ---- <formatted> def a;if 0 then puts "X" ! end; end; </formatted> *************** *** 318,322 **** <formatted> def x(a, b) ! **y end </formatted> --- 318,322 ---- <formatted> def x(a, b) ! y end </formatted> *************** *** 334,339 **** def x(a ! ******b) ! **x end </formatted> --- 334,339 ---- def x(a ! b) ! x end </formatted> *************** *** 349,354 **** <formatted> def x(a,b) ! **object.method(arg1, ! ****************arg2) end </formatted> --- 349,354 ---- <formatted> def x(a,b) ! object.method(arg1, ! arg2) end </formatted> *************** *** 371,382 **** </unformatted> <formatted> ! *puts "def x(a, b)" ! *puts "" ! *if a ! ***b ! *end ! *puts "if{" ! *b ! *puts "end" </formatted> </part> --- 371,382 ---- </unformatted> <formatted> ! puts "def x(a, b)" ! puts "" ! if a ! b ! end ! puts "if{" ! b ! puts "end" </formatted> </part> *************** *** 391,398 **** </unformatted> <formatted> ! *puts "Bla class" ! *puts "def method" ! *puts "end" </formatted> </part> --- 391,398 ---- </unformatted> <formatted> ! puts "Bla class" ! puts "def method" ! puts "end" </formatted> </part> *************** *** 408,416 **** </unformatted> <formatted> ! *puts "\"{" ! *puts "xx" ! *puts "class \\" ! *if ! ***b </formatted> </part> --- 408,416 ---- </unformatted> <formatted> ! puts "\"{" ! puts "xx" ! puts "class \\" ! if ! b </formatted> </part> *************** *** 424,430 **** </unformatted> <formatted> ! *puts 'def x(a, b)' ! *puts 'if{' ! *puts 'end' </formatted> </part> --- 424,430 ---- </unformatted> <formatted> ! puts 'def x(a, b)' ! puts 'if{' ! puts 'end' </formatted> </part> *************** *** 439,443 **** <formatted> if $' ! **o.m end </formatted> --- 439,443 ---- <formatted> if $' ! o.m end </formatted> *************** *** 452,458 **** </unformatted> <formatted> ! *puts '"def" if x(a, b)' ! *puts 'if{' ! *puts 'end' </formatted> </part> --- 452,458 ---- </unformatted> <formatted> ! puts '"def" if x(a, b)' ! puts 'if{' ! puts 'end' </formatted> </part> *************** *** 476,480 **** =end if ! **b end </formatted> --- 476,480 ---- =end if ! b end </formatted> *************** *** 533,537 **** v =~ / { \/ { \\/ if ! **o.m() end v =~ /{/ --- 533,537 ---- v =~ / { \/ { \\/ if ! o.m() end v =~ /{/ *************** *** 555,560 **** <formatted> if /abc ! **/ =~ "\ndef" then ! **puts 'matched def' ; end </formatted> --- 555,560 ---- <formatted> if /abc ! / =~ "\ndef" then ! puts 'matched def' ; end </formatted> *************** *** 575,583 **** <formatted> def a ! **if true ! ****1/2 ! **else ! ****1/4 ! **end end </formatted> --- 575,583 ---- <formatted> def a ! if true ! 1/2 ! else ! 1/4 ! end end </formatted> *************** *** 605,609 **** puts %Q{ def class #{class} { if } class} if ! **puts "" </formatted> </part> --- 605,609 ---- puts %Q{ def class #{class} { if } class} if ! puts "" </formatted> </part> Index: TC_CodeFormatter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TC_CodeFormatter.java 2 Jun 2004 21:58:41 -0000 1.3 --- TC_CodeFormatter.java 10 Feb 2006 19:59:55 -0000 1.4 *************** *** 9,13 **** import javax.xml.parsers.ParserConfigurationException; ! import org.rubypeople.rdt.internal.formatter.CodeFormatter; import org.w3c.dom.Document; import org.w3c.dom.Node; --- 9,15 ---- import javax.xml.parsers.ParserConfigurationException; ! import junit.framework.Assert; ! import junit.framework.TestCase; ! import org.w3c.dom.Document; import org.w3c.dom.Node; *************** *** 15,21 **** import org.xml.sax.SAXException; - import junit.framework.Assert; - import junit.framework.TestCase; - public class TC_CodeFormatter extends TestCase { --- 17,20 ---- *************** *** 84,89 **** ArrayList partList = (ArrayList) testMap.get(name); for (int i = 0; i < partList.size(); i++) { ! TestData data = (TestData) partList.get(i); ! String formatted = new CodeFormatter('*', true).formatString(data.unformattedText); System.out.println("---------- " + data.assertionMessage + " --------") ; System.out.println(data.unformattedText) ; --- 83,88 ---- ArrayList partList = (ArrayList) testMap.get(name); for (int i = 0; i < partList.size(); i++) { ! TestData data = (TestData) partList.get(i); ! String formatted = new OldCodeFormatter().formatString(data.unformattedText); System.out.println("---------- " + data.assertionMessage + " --------") ; System.out.println(data.unformattedText) ; |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:59:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13477/src/org/rubypeople/eclipse/shams/resources Modified Files: ShamFile.java ShamFolder.java ShamResource.java Log Message: try to fix tests to run with new code changes Index: ShamFolder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFolder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ShamFolder.java 12 Nov 2005 19:16:08 -0000 1.6 --- ShamFolder.java 10 Feb 2006 19:59:51 -0000 1.7 *************** *** 2,5 **** --- 2,7 ---- + import java.net.URI; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; *************** *** 56,58 **** --- 58,65 ---- throw new RuntimeException("Sham needs to implement"); } + + public void createLink(URI location, int updateFlags, IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } } Index: ShamFile.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ShamFile.java 24 Dec 2005 01:43:03 -0000 1.15 --- ShamFile.java 10 Feb 2006 19:59:51 -0000 1.16 *************** *** 7,10 **** --- 7,11 ---- import java.io.InputStream; import java.io.Reader; + import java.net.URI; import junit.framework.Assert; *************** *** 392,394 **** --- 393,410 ---- } + public void createLink(URI location, int updateFlags, IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } + + public URI getRawLocationURI() { + // TODO Auto-generated method stub + return null; + } + + public boolean isLinked(int options) { + // TODO Auto-generated method stub + return false; + } + } Index: ShamResource.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamResource.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ShamResource.java 24 Dec 2005 01:43:04 -0000 1.12 --- ShamResource.java 10 Feb 2006 19:59:51 -0000 1.13 *************** *** 285,287 **** --- 285,297 ---- } + public URI getRawLocationURI() { + // TODO Auto-generated method stub + return null; + } + + public boolean isLinked(int options) { + // TODO Auto-generated method stub + return false; + } + } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:59:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13477/src/org/rubypeople/eclipse/shams/debug/core Modified Files: ShamLaunchConfiguration.java ShamLaunchConfigurationWorkingCopy.java ShamLaunchManager.java Log Message: try to fix tests to run with new code changes Index: ShamLaunchManager.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/debug/core/ShamLaunchManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ShamLaunchManager.java 13 Jul 2005 14:29:45 -0000 1.10 --- ShamLaunchManager.java 10 Feb 2006 19:59:51 -0000 1.11 *************** *** 205,207 **** --- 205,212 ---- } + public ILaunchConfiguration[] getMigrationCandidates() throws CoreException { + // TODO Auto-generated method stub + return null; + } + } Index: ShamLaunchConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/debug/core/ShamLaunchConfiguration.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShamLaunchConfiguration.java 2 Mar 2005 00:52:41 -0000 1.4 --- ShamLaunchConfiguration.java 10 Feb 2006 19:59:51 -0000 1.5 *************** *** 5,8 **** --- 5,9 ---- import org.eclipse.core.resources.IFile; + import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; *************** *** 120,122 **** --- 121,138 ---- throw new RuntimeException("Need to implement on sham."); } + + public IResource[] getMappedResources() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isMigrationCandidate() throws CoreException { + // TODO Auto-generated method stub + return false; + } + + public void migrate() throws CoreException { + // TODO Auto-generated method stub + + } } Index: ShamLaunchConfigurationWorkingCopy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/debug/core/ShamLaunchConfigurationWorkingCopy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ShamLaunchConfigurationWorkingCopy.java 2 Mar 2005 00:52:41 -0000 1.5 --- ShamLaunchConfigurationWorkingCopy.java 10 Feb 2006 19:59:51 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; + import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; *************** *** 168,170 **** --- 169,191 ---- throw new RuntimeException("Need to implement on sham."); } + + public void setMappedResources(IResource[] resources) { + // TODO Auto-generated method stub + + } + + public IResource[] getMappedResources() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isMigrationCandidate() throws CoreException { + // TODO Auto-generated method stub + return false; + } + + public void migrate() throws CoreException { + // TODO Auto-generated method stub + + } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:59:55
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13453/src/org/rubypeople/rdt/internal/debug/ui Modified Files: TC_RubySourceLocator.java Log Message: try to fix tests to run with new code changes Index: TC_RubySourceLocator.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/TC_RubySourceLocator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TC_RubySourceLocator.java 16 Oct 2005 23:52:59 -0000 1.1 --- TC_RubySourceLocator.java 10 Feb 2006 19:59:47 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.core.internal.resources.Workspace; import org.eclipse.core.resources.IFile; + import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; *************** *** 207,210 **** --- 208,226 ---- return null; } + + public IResource[] getMappedResources() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isMigrationCandidate() throws CoreException { + // TODO Auto-generated method stub + return false; + } + + public void migrate() throws CoreException { + // TODO Auto-generated method stub + + } } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:59:23
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/comment In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13340/src/org/rubypeople/rdt/internal/ui/text/comment Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/comment added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:58:39
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13010/src/org/rubypeople/rdt/internal/ui/actions Added Files: SelectionConverter.java ActionMessages.java ActionMessages.properties AbstractToggleLinkingAction.java Log Message: toggle linking to editor from outline view --- NEW FILE: ActionMessages.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.actions; import org.eclipse.osgi.util.NLS; public final class ActionMessages extends NLS { private static final String BUNDLE_NAME= ActionMessages.class.getName();//$NON-NLS-1$ private ActionMessages() { // Do not instantiate } public static String ToggleLinkingAction_label; public static String ToggleLinkingAction_tooltip; public static String ToggleLinkingAction_description; public static String MemberFilterActionGroup_hide_fields_label; public static String MemberFilterActionGroup_hide_fields_tooltip; public static String MemberFilterActionGroup_hide_fields_description; public static String MemberFilterActionGroup_hide_static_label; public static String MemberFilterActionGroup_hide_static_tooltip; public static String MemberFilterActionGroup_hide_static_description; public static String MemberFilterActionGroup_hide_nonpublic_label; public static String MemberFilterActionGroup_hide_nonpublic_tooltip; public static String MemberFilterActionGroup_hide_nonpublic_description; public static String MemberFilterActionGroup_hide_localtypes_label; public static String MemberFilterActionGroup_hide_localtypes_tooltip; public static String MemberFilterActionGroup_hide_localtypes_description; static { NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class); } } --- NEW FILE: AbstractToggleLinkingAction.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.actions; import org.eclipse.jface.action.Action; import org.eclipse.ui.PlatformUI; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPluginImages; /** * This is an action template for actions that toggle whether * it links its selection to the active editor. * * @since 3.0 */ public abstract class AbstractToggleLinkingAction extends Action { /** * Constructs a new action. */ public AbstractToggleLinkingAction() { super(ActionMessages.ToggleLinkingAction_label); setDescription(ActionMessages.ToggleLinkingAction_description); setToolTipText(ActionMessages.ToggleLinkingAction_tooltip); RubyPluginImages.setLocalImageDescriptors(this, "synced.gif"); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.LINK_EDITOR_ACTION); } /** * Runs the action. */ public abstract void run(); } --- NEW FILE: ActionMessages.properties --- ############################################################################### # Copyright (c) 2000, 2005 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation # Sebastian Davids <sd...@gm...> - Bug 114276 ############################################################################### OpenWithMenu_label=Open Wit&h RefactorMenu_label=Refac&tor SourceMenu_label=&Source BuildPath_label=&Build Path BuildAction_label=&Build Project RebuildAction_label=Rebuild Pro&ject SelectionConverter_codeResolveOrInput_failed=Could not convert text selection into a Java element SelectionConverter_codeResolve_failed=Could not convert text selection into a Java element OpenAction_label=&Open OpenAction_tooltip=Open an Editor on the Selected Element OpenAction_description=Open an editor on the selected element OpenAction_declaration_label=&Open Declaration OpenAction_select_element=&Select or enter the element to open: OpenAction_error_title=Open OpenAction_error_message=Cannot open default editor. OpenAction_error_messageArgs=Cannot open default editor on {0}. {1} OpenAction_error_messageProblems=Problems Opening Editor OpenAction_error_messageBadSelection=Current text selection does not resolve to a Java element OpenSuperImplementationAction_label=Open S&uper Implementation OpenSuperImplementationAction_tooltip=Open the Implementation in the Super Type OpenSuperImplementationAction_description=Open the Implementation in the Super Type OpenSuperImplementationAction_error_title=Open Super Implementation OpenSuperImplementationAction_error_message=Opening the super implementation failed. Check log for details. OpenSuperImplementationAction_not_applicable=The operation is not applicable to the current selection. Select an overriding method. OpenSuperImplementationAction_no_super_implementation=The super implementation of method ''{0}'' does not exist. OpenTypeHierarchyAction_label=Open Type Hi&erarchy OpenNewClassWizardAction_text=Class OpenNewEnumWizardAction_text=Enum OpenTypeHierarchyAction_tooltip=Open a Type Hierarchy on the Selected Element OpenTypeHierarchyAction_description=Open a type hierarchy on the selected element OpenTypeHierarchyAction_dialog_title=Open Type Hierarchy OpenTypeHierarchyAction_messages_title=Cannot create type hierarchy OpenTypeHierarchyAction_messages_no_java_element=A Java element must be selected. OpenTypeHierarchyAction_messages_no_java_resources=The selected package does not contain any Java resource. OpenTypeHierarchyAction_messages_no_types=The selected compilation unit does not contain a type. OpenNewAnnotationWizardAction_description=Opens the new annotation type wizard OpenNewJavaProjectWizardAction_description=Opens the new Java project wizard OpenNewSourceFolderWizardAction_description=Opens the new Java source folder wizard OpenNewInterfaceWizardAction_description=Opens the new interface wizard OpenTypeHierarchyAction_messages_no_valid_java_element=A valid Java element must be selected. OpenTypeHierarchyAction_messages_unknown_import_decl=The selected import declaration can not be resolved. ShowInPackageViewAction_label=Show in Pac&kage Explorer ShowInPackageViewAction_description=Show the selected element in Package Explorer ShowInPackageViewAction_tooltip=Show in Package Explorer ShowInPackageViewAction_dialog_title=Show In Package Explorer ShowInPackageViewAction_error_message=An internal error occurred. Please see log for details. ShowInNavigatorView_label=Show in &Navigator View ShowInNavigatorView_dialog_title=Show in Navigator View ShowInNavigatorView_dialog_message=Select the element to be opened in the navigator view: ShowInNavigatorView_error_activation_failed=Cannot activate Resource Navigator OverrideMethodsAction_label=O&verride/Implement Methods... OverrideMethodsAction_description=Override or Implement Methods from super types. OverrideMethodsAction_tooltip=Override/Implement Methods OverrideMethodsAction_error_actionfailed=Cannot create methods OverrideMethodsAction_error_title=Override/Implement Methods OverrideMethodsAction_error_nothing_found=No methods to override found for this type. OverrideMethodsAction_error_type_removed_in_editor=Input type has been removed in editor. OverrideMethodsAction_not_applicable=The operation is not applicable to the current selection. Select a class. OverrideMethodsAction_interface_not_applicable=The Override Methods operation is not applicable to interfaces. OverrideMethodsAction_annotation_not_applicable=The Override Methods operation is not applicable to annotations. AddGetterSetterAction_label=Gene&rate Getters and Setters... AddGetterSetterAction_description=Generate Getter and Setter methods for type's fields AddGetterSetterAction_tooltip=Generate Getter and Setter Methods for the Type's Fields AddGetterSetterAction_error_duplicate_methods=Possible duplicate method(s) selected AddGetterSetterAction_no_primary_type_title=Add Setter and Getter AddGetterSetterAction_no_primary_type_message=No primary type found. AddGetterSetterAction_error_title=Generate Getters and Setters AddGetterSetterAction_error_actionfailed=Generating Getters and Setters Failed. AddGetterSetterAction_not_applicable=The operation is not applicable to the current selection. Select a field which is not declared as type variable or a type that declares such fields. AddGetterSetterAction_interface_not_applicable=The Generate Getters and Setters operation is not applicable to interfaces. AddGetterSetterAction_annotation_not_applicable=The Generate Getters and Setters operation is not applicable to annotations. AddGetterSetterAction_QueryDialog_title=Generate Getters and Setters AddGetterSetterAction_SkipSetterForFinalDialog_message=Field ''{0}'' is final.\nDo you want to skip the creation of the setter method? AddGetterSetterAction_SkipExistingDialog_message=Method ''{0}'' already exists.\nSkip creation? AddGetterSetterAction_SkipExistingDialog_skip_label=&Skip AddGetterSetterAction_SkipExistingDialog_replace_label=&Replace AddGetterSetterAction_SkipExistingDialog_skipAll_label=Skip &All AddGetterSetterAction_dialog_label=&Select getters and setters to create: AddGetterSetterAction_methods_selected={0} of {1} selected. AddGettSetterAction_typeContainsNoFields_message=The type contains no fields or all fields have getters/setters already. GetterSetterTreeSelectionDialog_select_getters=Select &Getters GetterSetterTreeSelectionDialog_select_setters=Se&lect Setters GetterSetterTreeSelectionDialog_alpha_pair_sort=Fields in getter/setter pairs GetterSetterTreeSelectionDialog_alpha_method_sort=First getters, then setters GetterSetterTreeSelectionDialog_sort_label=S&ort by: SourceActionDialog_enterAt_label=&Insertion point: SourceActionDialog_modifier_group=Access modifier SourceActionDialog_modifier_public=&public SourceActionDialog_modifier_protected=protec&ted SourceActionDialog_modifier_default=d&efault SourceActionDialog_modifier_private=pri&vate SourceActionDialog_modifier_synchronized=s&ynchronized SourceActionDialog_modifier_final=&final SourceActionDialog_first_method=First method SourceActionDialog_last_method=Last method SourceActionDialog_cursor=Cursor position SourceActionDialog_after=After ''{0}'' SourceActionDialog_createMethodComment=Generate method &comments SourceActionDialog_createMethodAnnotation=Generate '@Override' a&nnotations SourceActionDialog_no_entries=No methods available. SourceActionDialog_createConstructorComment=Generate constructor &comments AddUnimplementedConstructorsAction_label=Add &Constructors from Superclass... AddUnimplementedConstructorsAction_description=Add constructors from superclass AddUnimplementedConstructorsAction_tooltip=Add Constructors from Superclass AddUnimplementedConstructorsAction_error_title=Add Constructors from Superclass AddUnimplementedConstructorsAction_error_type_removed_in_editor=Input type has been removed in editor. AddUnimplementedConstructorsAction_not_applicable=The operation is not applicable to the current selection. Select a class. AddUnimplementedConstructorsAction_interface_not_applicable=The Add Constructors from Superclass operation is not applicable to interfaces. AddUnimplementedConstructorsAction_enum_not_applicable=The Add Constructors from Superclass operation is not applicable to enums. AddUnimplementedConstructorsAction_annotation_not_applicable=The Add Constructors from Superclass operation is not applicable to annotations. AddUnimplementedConstructorsAction_methods_selected={0} of {1} selected. AddUnimplementedConstructorsAction_error_nothing_found=There are no constructors from the superclass which may be added. AddUnimplementedConstructorsAction_dialog_title=Add Constructors from Superclass AddUnimplementedConstructorsAction_dialog_label=&Select constructors to implement: AddUnimplementedConstructorsDialog_omit_super=&Omit call to default constructor super() GenerateConstructorUsingFieldsAction_label=Generate C&onstructor using Fields... GenerateConstructorUsingFieldsAction_description=Generate Constructor using fields GenerateConstructorUsingFieldsAction_tooltip=Generate Constructor Using Fields GenerateConstructorUsingFieldsAction_error_title=Generate Constructor using Fields GenerateConstructorUsingFieldsAction_not_applicable=The operation is not applicable to the current selection. Select a class. GenerateConstructorUsingFieldsAction_fields_selected={0} of {1} selected. GenerateConstructorUsingFieldsAction_error_duplicate_constructor=The constructor to be created is possibly a duplicate GenerateConstructorUsingFieldsAction_error_nothing_found=There are no constructors from the superclass which may be used. GenerateConstructorUsingFieldsAction_dialog_title=Generate Constructor using Fields GenerateConstructorUsingFieldsAction_dialog_label=&Select fields to initialize: GenerateConstructorUsingFieldsAction_interface_not_applicable=The Generate Constructor using Fields operation is not applicable to interfaces. GenerateConstructorUsingFieldsAction_enum_not_applicable=The Generate Constructor using Fields operation is not applicable to enums. GenerateConstructorUsingFieldsAction_annotation_not_applicable=The Generate Constructor using Fields operation is not applicable to annotations. GenerateConstructorUsingFieldsAction_typeContainsNoFields_message=The type contains no fields which may be set. GenerateConstructorUsingFieldsAction_error_actionfailed=Unexpected error while creating constructors. See log for details. GenerateConstructorUsingFieldsAction_error_anonymous_class=Anonymous classes cannot contain explicitely declared constructors. GenerateConstructorUsingFieldsSelectionDialog_up_button=&Up GenerateConstructorUsingFieldsSelectionDialog_down_button=Do&wn GenerateConstructorUsingFieldsSelectionDialog_sort_constructor_choices_label=Select super constructor to invo&ke: GenerateConstructorUsingFieldsSelectionDialog_omit_super=&Omit call to default constructor super() AddJavaDocStubAction_label=Add Commen&t AddJavaDocStubAction_description=Add a comment stub to the member element AddJavaDocStubAction_tooltip=Add a Comment Stub to the Member Element AddJavaDocStubsAction_error_dialogTitle=Add Comment AddJavaDocStubsAction_error_actionFailed=Error while adding comment AddJavaDocStubsAction_not_applicable=The operation is not applicable to the current selection. Select a type or method. ExternalizeStringsAction_label= &Externalize Strings... ExternalizeStringsAction_dialog_title= Externalize Strings ExternalizeStringsAction_dialog_message=Could not open Externalize String Wizard FindStringsToExternalizeAction_label= Find Strings to Externali&ze... FindStringsToExternalizeAction_dialog_title= Find Strings to Externalize FindStringsToExternalizeAction_error_message= Unexpected Exception. See log. FindStringsToExternalizeAction_error_cannotBeParsed= Compilation unit ''{0}'' can not be parsed. FindStringsToExternalizeAction_foundStrings= {0} in {1} FindStringsToExternalizeAction_noStrings= No non-externalized strings found. FindStringsToExternalizeAction_non_externalized= {0} &non-externalized string(s) found. FindStringsToExternalizeAction_button_label= &Externalize... FindStringsToExternalizeAction_find_strings= Finding non-externalized strings... OpenExternalJavadocAction_label=Open E&xternal Javadoc OpenExternalJavadocAction_description=Opens the Javadoc of the selected element in an external browser OpenExternalJavadocAction_tooltip=Opens the Javadoc of the Selected Element in an External Browser OpenExternalJavadocAction_select_element=&Select or enter the element to open: OpenExternalJavadocAction_libraries_no_location=The documentation location for ''{0}'' has not been configured. For elements from libraries specify the Javadoc location URL on the properties page of the parent JAR (''{1}'') OpenExternalJavadocAction_source_no_location=The documentation location for ''{0}'' has not been configured. For elements from source specify the Javadoc location URL on the properties page of the parent project (''{1}'') OpenExternalJavadocAction_no_entry=The documentation does not contain an entry for ''{0}''.\n(File ''{1}'' does not exist.) OpenExternalJavadocAction_opening_failed=Opening Javadoc failed. See log for details OpenExternalJavadocAction_dialog_title=Open External Javadoc OpenExternalJavadocAction_code_resolve_failed=Could not convert text selection into a Java element SelfEncapsulateFieldAction_label=Encap&sulate Field... SelfEncapsulateFieldAction_dialog_title=Encapsulate Field SelfEncapsulateFieldAction_dialog_unavailable=The operation is not applicable to the current selection. Select a field of a class or enum. SelfEncapsulateFieldAction_dialog_cannot_perform=Cannot perform refactoring. See log for more details. OrganizeImportsAction_label=Or&ganize Imports OrganizeImportsAction_tooltip=Evaluate All Required Imports and Replace the Current Imports OrganizeImportsAction_description=Evaluate all required imports and replace the current imports CleanUpAction_label=Clean &Up... CleanUpAction_tooltip=Solve Problems and Improve Code Style on Selected Resources CleanUpAction_description=Solve problems and improve code style on selected resources CleanUpAction_ErrorDialogTitle=Clean Up CleanUpAction_MultiStateErrorTitle=Problems while cleaning up some compilation units. See 'Details' for more information. CleanUpAction_UnexpectedErrorMessage={0}: Unexpected error. See log for details. CleanUpAction_CUNotOnBuildpathMessage={0}: Compilation unit not on build path. No changes applied. OrganizeImportsAction_multi_op_description=Organizing imports... OrganizeImportsAction_multi_error_parse={0}: Compilation unit has parse errors. No changes applied. OrganizeImportsAction_multi_error_unresolvable={0}: Compilation unit contains ambiguous references. User interaction required. OrganizeImportsAction_multi_error_unexpected={0}: Unexpected error. See log for details. OrganizeImportsAction_multi_error_notoncp={0}: Compilation unit not on build path. No changes applied. OrganizeImportsAction_selectiondialog_title=Organize Imports OrganizeImportsAction_selectiondialog_message=&Choose type to import: OrganizeImportsAction_error_title=Organize Imports OrganizeImportsAction_error_message=Unexpected error in organize imports. See log for details. OrganizeImportsAction_single_error_parse=Compilation unit has parse errors: ''{0}''. No changes applied. OrganizeImportsAction_summary_added={0} import(s) added. OrganizeImportsAction_summary_removed={0} import(s) removed. OrganizeImportsAction_multi_status_title=Organize Imports OrganizeImportsAction_multi_status_description=Problems while organizing imports on some compilation units. See 'Details' for more information. FormatAllAction_label=Format FormatAllAction_tooltip=Format all selected Java files FormatAllAction_description=Format all selected Java files FormatAllAction_status_description=Problems while formatting some compilation units. See 'Details' for more information. FormatAllAction_multi_status_title=Format FormatAllAction_error_title=Format FormatAllAction_error_message=Unexpected error while formatting. See log for details. FormatAllAction_operation_description=Formatting... FormatAllAction_failedvalidateedit_title=Format FormatAllAction_failedvalidateedit_message=Problems while accessing selected files. FormatAllAction_noundo_title=Format FormatAllAction_noundo_message='Undo' is not supported by this operation. Do you want to continue? SortMembersAction_label=Sort &Members SortMembersAction_tooltip=Sorts all Members using the Member Order Preference SortMembersAction_description=Sorts all members using the member order preference SortMembersAction_dialog_title=Sort Members SortMembersAction_not_applicable=Operation not applicable to current text editor. SortMembersAction_containsmarkers=Markers like bookmarks, breakpoints, or user defined tasks in a reordered member will be lost. OK to continue? SortMembersAction_no_members=There are not enough members in this type to sort. OpenBrowserUtil_help_not_available=Help support not available OpenNewAnnotationWizardAction_text=Annotation OpenNewPackageWizardAction_tooltip=Opens the new Java package wizard OpenNewClassWizardAction_tooltip=Opens the new class wizard OpenNewInterfaceWizardAction_text=Interface OpenNewEnumWizardAction_tooltip=Opens the new enum type wizard OpenNewPackageWizardAction_text=Package MemberFilterActionGroup_hide_fields_label=Hide Fiel&ds MemberFilterActionGroup_hide_fields_tooltip=Hide Fields MemberFilterActionGroup_hide_fields_description=Toggles the visibility of fields MemberFilterActionGroup_hide_static_label=Hide &Static Fields and Methods MemberFilterActionGroup_hide_static_tooltip=Hide Static Fields and Methods MemberFilterActionGroup_hide_static_description=Toggles the visibility of static fields and methods MemberFilterActionGroup_hide_nonpublic_label=Hide Non-&Public Members MemberFilterActionGroup_hide_nonpublic_tooltip=Hide Non-Public Members MemberFilterActionGroup_hide_nonpublic_description=Toggles the visibility of non-public members MemberFilterActionGroup_hide_localtypes_label=Hide Local &Types MemberFilterActionGroup_hide_localtypes_tooltip=Hide Local Types MemberFilterActionGroup_hide_localtypes_description=Toggles the visibility of local types NewWizardsActionGroup_new=Ne&w OpenProjectAction_dialog_title=Open Project OpenProjectAction_dialog_message=Select project(s) to be opened OpenProjectAction_error_message=Problems while opening projects OpenJavaPerspectiveAction_dialog_title=Open Java Perspective OpenJavaPerspectiveAction_error_open_failed=Could not open Java perspective OpenJavaBrowsingPerspectiveAction_dialog_title=Open Java Browsing Perspective OpenJavaBrowsingPerspectiveAction_error_open_failed=Could not open Java browsing perspective OpenTypeInHierarchyAction_label=Open Type in Hierarchy... OpenTypeInHierarchyAction_description=Open a type in a type hierarchy OpenTypeInHierarchyAction_tooltip=Open a Type in a Type Hierarchy OpenTypeInHierarchyAction_dialogMessage=&Choose a type (? = any character, * = any string): OpenTypeInHierarchyAction_dialogTitle=Open Type in Hierarchy OpenNewAnnotationWizardAction_tooltip=Opens the new annotation type wizard OpenNewJavaProjectWizardAction_tooltip=Opens the new Java project wizard OpenNewPackageWizardAction_description=Opens the new Java package wizard OpenNewSourceFolderWizardAction_tooltip=Opens the new Java source folder wizard OpenNewClassWizardAction_description=Opens the new class wizard OpenNewInterfaceWizardAction_tooltip=Opens the new interface wizard OpenNewSourceFolderWizardAction_text=Source Folder OpenNewEnumWizardAction_description=Opens the new enum type wizard OpenNewJavaProjectWizardAction_text=Java Project RefreshAction_label= Re&fresh RefreshAction_toolTip= Refresh RefreshAction_progressMessage= Refreshing... RefreshAction_error_title= Refresh Problems RefreshAction_error_message= Problems occurred refreshing the selected resources. RefreshAction_locationDeleted_title= Project location has been deleted RefreshAction_locationDeleted_message= The location for project {0} ({1}) has been deleted.\n Delete {0} from the workspace? ModifyParameterAction_problem_title=Refactoring ModifyParameterAction_problem_message=Cannot perform operation. ActionUtil_notOnBuildPath_title=Cannot Perform Operation ActionUtil_notOnBuildPath_message=The resource is not on the build path of a Java project. ActionUtil_notOnBuildPath_resource_message=The resource ''{0}'' is not on the build path of a Java project. ActionUtil_not_possible=Cannot Perform Operation ActionUtil_no_linked=This operation is unavailable on linked packages and package fragment roots. SelectAllAction_label= Select A&ll SelectAllAction_tooltip= Select All AddToClasspathAction_label=Add to &Build Path AddToClasspathAction_toolTip=Add JAR to the Java Build Path AddToClasspathAction_progressMessage=Adding to build path... AddToClasspathAction_error_title=Add to Build Path AddToClasspathAction_error_message=Problems occurred while adding to the build path. RemoveFromClasspathAction_Remove=Remove from &Build Path RemoveFromClasspathAction_tooltip=Remove Package Fragment Root from the Java Build Path RemoveFromClasspathAction_Removing=Removing from build path... RemoveFromClasspathAction_exception_dialog_title=Remove From Build Path RemoveFromClasspathAction_Problems_occurred=Problems occurred while removing from the build path. AddDelegateMethodsAction_error_title=Generate Delegate Methods AddDelegateMethodsAction_error_actionfailed=Generating delegate methods failed. AddDelegateMethodsAction_label=Generate Delegate &Methods... AddDelegateMethodsAction_description=Adds delegate methods for a type's fields AddDelegateMethodsAction_tooltip=Adds Delegates Methods for a Type's Fields AddDelegateMethodsAction_not_applicable=The operation is not applicable to the current selection. Select a field which is not declared as type variable or a type that declares such fields. AddDelegateMethodsAction_annotation_not_applicable=The Generate Delegate Methods operation is not applicable to annotations. AddDelegateMethodsAction_interface_not_applicable=The Generate Delegate Methods operation is not applicable to interfaces. AddDelegateMethodsAction_duplicate_methods=Duplicate method(s) selected AddDelegateMethodsAction_title=Generate Delegate Methods AddDelegateMethodsAction_message=Select &methods to create delegates for: AddDelegateMethodsAction_selectioninfo_more={0} of {1} selected. AddDelegateMethodsOperation_monitor_message=Adding delegate methods... ToggleLinkingAction_label=Lin&k With Editor ToggleLinkingAction_tooltip=Link with Editor ToggleLinkingAction_description=Link with active editor ConfigureContainerAction_error_title=Configure Classpath Container ConfigureContainerAction_error_creationfailed_message=Configuration of the classpath container failed. ConfigureContainerAction_error_applyingfailed_message=Application of the classpath container changes failed. FindExceptionOccurrences_text= Throwing E&xception FindExceptionOccurrences_toolTip= Find All Occurrences Throwing this Exception FindImplementOccurrencesAction_text= I&mplementing Methods FindImplementOccurrencesAction_toolTip= Find All Methods Implementing or Overriding the Selected Type # The first parameter is the menu text and the second parameter is the shortcut string QuickMenuAction_menuTextWithShortcut= {0}\t{1} --- NEW FILE: SelectionConverter.java --- package org.rubypeople.rdt.internal.ui.actions; import org.eclipse.ui.IEditorInput; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor; import org.rubypeople.rdt.ui.IWorkingCopyManager; public class SelectionConverter { public static IRubyScript getInputAsRubyScript(RubyEditor editor) { Object editorInput = SelectionConverter.getInput(editor); if (editorInput instanceof IRubyScript) return (IRubyScript) editorInput; else return null; } public static IRubyElement getInput(RubyEditor editor) { if (editor == null) return null; IEditorInput input= editor.getEditorInput(); IWorkingCopyManager manager= RubyPlugin.getDefault().getWorkingCopyManager(); return manager.getWorkingCopy(input); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:58:21
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/filters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12888/src/org/rubypeople/rdt/internal/ui/filters Added Files: FilterDescriptor.java FilterMessages.properties NamePatternFilter.java FilterMessages.java CustomFiltersDialog.java Log Message: filtering for Outline view --- NEW FILE: CustomFiltersDialog.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.filters; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.Stack; import java.util.StringTokenizer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.SelectionDialog; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.util.SWTUtil; public class CustomFiltersDialog extends SelectionDialog { private static final String SEPARATOR= ","; //$NON-NLS-1$ private String fViewId; private boolean fEnablePatterns; private String[] fPatterns; private String[] fEnabledFilterIds; private FilterDescriptor[] fBuiltInFilters; private CheckboxTableViewer fCheckBoxList; private Button fEnableUserDefinedPatterns; private Text fUserDefinedPatterns; private Stack fFilterDescriptorChangeHistory; /** * Creates a dialog to customize Ruby element filters. * * @param shell the parent shell * @param viewId the id of the view * @param enablePatterns <code>true</code> if pattern filters are enabled * @param patterns the filter patterns * @param enabledFilterIds the Ids of the enabled filters */ public CustomFiltersDialog( Shell shell, String viewId, boolean enablePatterns, String[] patterns, String[] enabledFilterIds) { super(shell); Assert.isNotNull(viewId); Assert.isNotNull(patterns); Assert.isNotNull(enabledFilterIds); fViewId= viewId; fPatterns= patterns; fEnablePatterns= enablePatterns; fEnabledFilterIds= enabledFilterIds; fBuiltInFilters= FilterDescriptor.getFilterDescriptors(fViewId); fFilterDescriptorChangeHistory= new Stack(); setShellStyle(getShellStyle() | SWT.RESIZE); } protected void configureShell(Shell shell) { setTitle(FilterMessages.CustomFiltersDialog_title); setMessage(FilterMessages.CustomFiltersDialog_filterList_label); super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IRubyHelpContextIds.CUSTOM_FILTERS_DIALOG); } /** * Overrides method in Dialog * * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite) */ protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); // create a composite with standard margins and spacing Composite composite= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); Composite group= composite; // Checkbox fEnableUserDefinedPatterns= new Button(group, SWT.CHECK); fEnableUserDefinedPatterns.setFocus(); fEnableUserDefinedPatterns.setText(FilterMessages.CustomFiltersDialog_enableUserDefinedPattern); // Pattern field fUserDefinedPatterns= new Text(group, SWT.SINGLE | SWT.BORDER); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint= convertWidthInCharsToPixels(59); fUserDefinedPatterns.setLayoutData(data); String patterns= convertToString(fPatterns, SEPARATOR); fUserDefinedPatterns.setText(patterns); // Info text final Label info= new Label(group, SWT.LEFT); info.setText(FilterMessages.CustomFiltersDialog_patternInfo); // Enabling / disabling of pattern group fEnableUserDefinedPatterns.setSelection(fEnablePatterns); fUserDefinedPatterns.setEnabled(fEnablePatterns); info.setEnabled(fEnablePatterns); fEnableUserDefinedPatterns.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { boolean state= fEnableUserDefinedPatterns.getSelection(); fUserDefinedPatterns.setEnabled(state); info.setEnabled(fEnableUserDefinedPatterns.getSelection()); if (state) fUserDefinedPatterns.setFocus(); } }); // Filters provided by extension point if (fBuiltInFilters.length > 0) createCheckBoxList(group); applyDialogFont(parent); return parent; } private void createCheckBoxList(Composite parent) { // Filler new Label(parent, SWT.NONE); Label info= new Label(parent, SWT.LEFT); info.setText(FilterMessages.CustomFiltersDialog_filterList_label); fCheckBoxList= CheckboxTableViewer.newCheckList(parent, SWT.BORDER); GridData data= new GridData(GridData.FILL_BOTH); data.heightHint= fCheckBoxList.getTable().getItemHeight() * 10; fCheckBoxList.getTable().setLayoutData(data); fCheckBoxList.setLabelProvider(createLabelPrivder()); fCheckBoxList.setContentProvider(new ArrayContentProvider()); Arrays.sort(fBuiltInFilters); fCheckBoxList.setInput(fBuiltInFilters); setInitialSelections(getEnabledFilterDescriptors()); List initialSelection= getInitialElementSelections(); if (initialSelection != null && !initialSelection.isEmpty()) checkInitialSelections(); // Description info= new Label(parent, SWT.LEFT); info.setText(FilterMessages.CustomFiltersDialog_description_label); final Text description= new Text(parent, SWT.LEFT | SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL); data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint= convertHeightInCharsToPixels(3); description.setLayoutData(data); fCheckBoxList.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { ISelection selection= event.getSelection(); if (selection instanceof IStructuredSelection) { Object selectedElement= ((IStructuredSelection)selection).getFirstElement(); if (selectedElement instanceof FilterDescriptor) description.setText(((FilterDescriptor)selectedElement).getDescription()); } } }); fCheckBoxList.addCheckStateListener(new ICheckStateListener() { /* * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) */ public void checkStateChanged(CheckStateChangedEvent event) { Object element= event.getElement(); if (element instanceof FilterDescriptor) { // renew if already touched if (fFilterDescriptorChangeHistory.contains(element)) fFilterDescriptorChangeHistory.remove(element); fFilterDescriptorChangeHistory.push(element); } }}); addSelectionButtons(parent); } private void addSelectionButtons(Composite composite) { Composite buttonComposite= new Composite(composite, SWT.RIGHT); GridLayout layout= new GridLayout(); layout.numColumns= 2; buttonComposite.setLayout(layout); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace= true; composite.setData(data); // Select All button String label= FilterMessages.CustomFiltersDialog_SelectAllButton_label; Button selectButton= createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, label, false); SWTUtil.setButtonDimensionHint(selectButton); SelectionListener listener= new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fCheckBoxList.setAllChecked(true); fFilterDescriptorChangeHistory.clear(); for (int i= 0; i < fBuiltInFilters.length; i++) fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]); } }; selectButton.addSelectionListener(listener); // De-select All button label= FilterMessages.CustomFiltersDialog_DeselectAllButton_label; Button deselectButton= createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, label, false); SWTUtil.setButtonDimensionHint(deselectButton); listener= new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fCheckBoxList.setAllChecked(false); fFilterDescriptorChangeHistory.clear(); for (int i= 0; i < fBuiltInFilters.length; i++) fFilterDescriptorChangeHistory.push(fBuiltInFilters[i]); } }; deselectButton.addSelectionListener(listener); } private void checkInitialSelections() { Iterator itemsToCheck= getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) fCheckBoxList.setChecked(itemsToCheck.next(),true); } protected void okPressed() { if (fBuiltInFilters != null) { ArrayList result= new ArrayList(); for (int i= 0; i < fBuiltInFilters.length; ++i) { if (fCheckBoxList.getChecked(fBuiltInFilters[i])) result.add(fBuiltInFilters[i]); } setResult(result); } super.okPressed(); } private ILabelProvider createLabelPrivder() { return new LabelProvider() { public Image getImage(Object element) { return null; } public String getText(Object element) { if (element instanceof FilterDescriptor) return ((FilterDescriptor)element).getName(); else return null; } }; } // ---------- result handling ---------- protected void setResult(List newResult) { super.setResult(newResult); if (fUserDefinedPatterns.getText().length() > 0) { fEnablePatterns= fEnableUserDefinedPatterns.getSelection(); fPatterns= convertFromString(fUserDefinedPatterns.getText(), SEPARATOR); } else { fEnablePatterns= false; fPatterns= new String[0]; } } /** * @return the patterns which have been entered by the user */ public String[] getUserDefinedPatterns() { return fPatterns; } /** * @return the Ids of the enabled built-in filters */ public String[] getEnabledFilterIds() { Object[] result= getResult(); Set enabledIds= new HashSet(result.length); for (int i= 0; i < result.length; i++) enabledIds.add(((FilterDescriptor)result[i]).getId()); return (String[]) enabledIds.toArray(new String[enabledIds.size()]); } /** * @return <code>true</code> if the user-defined patterns are disabled */ public boolean areUserDefinedPatternsEnabled() { return fEnablePatterns; } /** * @return a stack with the filter descriptor check history * @since 3.0 */ public Stack getFilterDescriptorChangeHistory() { return fFilterDescriptorChangeHistory; } private FilterDescriptor[] getEnabledFilterDescriptors() { FilterDescriptor[] filterDescs= fBuiltInFilters; List result= new ArrayList(filterDescs.length); List enabledFilterIds= Arrays.asList(fEnabledFilterIds); for (int i= 0; i < filterDescs.length; i++) { String id= filterDescs[i].getId(); if (enabledFilterIds.contains(id)) result.add(filterDescs[i]); } return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]); } public static String[] convertFromString(String patterns, String separator) { StringTokenizer tokenizer= new StringTokenizer(patterns, separator, true); int tokenCount= tokenizer.countTokens(); List result= new ArrayList(tokenCount); boolean escape= false; boolean append= false; while (tokenizer.hasMoreTokens()) { String token= tokenizer.nextToken().trim(); if (separator.equals(token)) { if (!escape) escape= true; else { addPattern(result, separator); append= true; } } else { if (!append) result.add(token); else addPattern(result, token); append= false; escape= false; } } return (String[])result.toArray(new String[result.size()]); } private static void addPattern(List list, String pattern) { if (list.isEmpty()) list.add(pattern); else { int index= list.size() - 1; list.set(index, ((String)list.get(index)) + pattern); } } public static String convertToString(String[] patterns, String separator) { int length= patterns.length; StringBuffer strBuf= new StringBuffer(); if (length > 0) strBuf.append(escapeSeparator(patterns[0], separator)); else return ""; //$NON-NLS-1$ int i= 1; while (i < length) { strBuf.append(separator); strBuf.append(" "); //$NON-NLS-1$ strBuf.append(escapeSeparator(patterns[i++], separator)); } return strBuf.toString(); } private static String escapeSeparator(String pattern, String separator) { int length= pattern.length(); StringBuffer buf= new StringBuffer(length); for (int i= 0; i < length; i++) { char ch= pattern.charAt(i); if (separator.equals(String.valueOf(ch))) buf.append(ch); buf.append(ch); } return buf.toString(); } } --- NEW FILE: FilterMessages.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.filters; import org.eclipse.osgi.util.NLS; public final class FilterMessages extends NLS { private static final String BUNDLE_NAME= FilterMessages.class.getName(); private FilterMessages() { // Do not instantiate } public static String CustomFiltersDialog_title; public static String CustomFiltersDialog_patternInfo; public static String CustomFiltersDialog_enableUserDefinedPattern; public static String CustomFiltersDialog_filterList_label; public static String CustomFiltersDialog_description_label; public static String CustomFiltersDialog_SelectAllButton_label; public static String CustomFiltersDialog_DeselectAllButton_label; public static String OpenCustomFiltersDialogAction_text; public static String FilterDescriptor_filterDescriptionCreationError_message; public static String FilterDescriptor_filterCreationError_title; public static String FilterDescriptor_filterCreationError_message; static { NLS.initializeMessages(BUNDLE_NAME, FilterMessages.class); } } --- NEW FILE: FilterDescriptor.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.filters; import java.text.Collator; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.util.Assert; import org.eclipse.jface.util.SafeRunnable; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.ui.IPluginContribution; import org.eclipse.ui.activities.WorkbenchActivityHelper; import org.rubypeople.rdt.internal.corext.util.Messages; import org.rubypeople.rdt.ui.RubyUI; /** * Represents a custom filter which is provided by the * "org.eclipse.jdt.ui.javaElementFilters" extension point. * * since 2.0 */ public class FilterDescriptor implements Comparable, IPluginContribution { private static String PATTERN_FILTER_ID_PREFIX= "_patternFilterId_"; //$NON-NLS-1$ private static final String EXTENSION_POINT_NAME= "rubyElementFilters"; //$NON-NLS-1$ private static final String FILTER_TAG= "filter"; //$NON-NLS-1$ private static final String PATTERN_ATTRIBUTE= "pattern"; //$NON-NLS-1$ private static final String ID_ATTRIBUTE= "id"; //$NON-NLS-1$ /** * @deprecated as of 3.0 use {@link FilterDescriptor#TARGET_ID_ATTRIBUTE} */ private static final String VIEW_ID_ATTRIBUTE= "viewId"; //$NON-NLS-1$ private static final String TARGET_ID_ATTRIBUTE= "targetId"; //$NON-NLS-1$ private static final String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$ private static final String NAME_ATTRIBUTE= "name"; //$NON-NLS-1$ private static final String ENABLED_ATTRIBUTE= "enabled"; //$NON-NLS-1$ private static final String DESCRIPTION_ATTRIBUTE= "description"; //$NON-NLS-1$ /** * @deprecated use "enabled" instead */ private static final String SELECTED_ATTRIBUTE= "selected"; //$NON-NLS-1$ private static FilterDescriptor[] fgFilterDescriptors; private IConfigurationElement fElement; /** * Returns all contributed Java element filters. */ public static FilterDescriptor[] getFilterDescriptors() { if (fgFilterDescriptors == null) { IExtensionRegistry registry= Platform.getExtensionRegistry(); IConfigurationElement[] elements= registry.getConfigurationElementsFor(RubyUI.ID_PLUGIN, EXTENSION_POINT_NAME); fgFilterDescriptors= createFilterDescriptors(elements); } return fgFilterDescriptors; } /** * Returns all Java element filters which * are contributed to the given view. */ public static FilterDescriptor[] getFilterDescriptors(String targetId) { FilterDescriptor[] filterDescs= FilterDescriptor.getFilterDescriptors(); List result= new ArrayList(filterDescs.length); for (int i= 0; i < filterDescs.length; i++) { String tid= filterDescs[i].getTargetId(); if (WorkbenchActivityHelper.filterItem(filterDescs[i])) continue; if (tid == null || tid.equals(targetId)) result.add(filterDescs[i]); } return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]); } /** * Creates a new filter descriptor for the given configuration element. */ private FilterDescriptor(IConfigurationElement element) { fElement= element; // it is either a pattern filter or a custom filter Assert.isTrue(isPatternFilter() ^ isCustomFilter(), "An extension for extension-point org.eclipse.jdt.ui.javaElementFilters does not specify a correct filter"); //$NON-NLS-1$ Assert.isNotNull(getId(), "An extension for extension-point org.eclipse.jdt.ui.javaElementFilters does not provide a valid ID"); //$NON-NLS-1$ Assert.isNotNull(getName(), "An extension for extension-point org.eclipse.jdt.ui.javaElementFilters does not provide a valid name"); //$NON-NLS-1$ } /** * Creates a new <code>ViewerFilter</code>. * This method is only valid for viewer filters. */ public ViewerFilter createViewerFilter() { if (!isCustomFilter()) return null; final ViewerFilter[] result= new ViewerFilter[1]; String message= Messages.format(FilterMessages.FilterDescriptor_filterCreationError_message, getId()); ISafeRunnable code= new SafeRunnable(message) { /* * @see org.eclipse.core.runtime.ISafeRunnable#run() */ public void run() throws Exception { result[0]= (ViewerFilter)fElement.createExecutableExtension(CLASS_ATTRIBUTE); } }; Platform.run(code); return result[0]; } //---- XML Attribute accessors --------------------------------------------- /** * Returns the filter's id. * <p> * This attribute is mandatory for custom filters. * The ID for pattern filters is * PATTERN_FILTER_ID_PREFIX plus the pattern itself. * </p> */ public String getId() { if (isPatternFilter()) { String targetId= getTargetId(); if (targetId == null) return PATTERN_FILTER_ID_PREFIX + getPattern(); else return targetId + PATTERN_FILTER_ID_PREFIX + getPattern(); } else return fElement.getAttribute(ID_ATTRIBUTE); } /** * Returns the filter's name. * <p> * If the name of a pattern filter is missing * then the pattern is used as its name. * </p> */ public String getName() { String name= fElement.getAttribute(NAME_ATTRIBUTE); if (name == null && isPatternFilter()) name= getPattern(); return name; } /** * Returns the filter's pattern. * * @return the pattern string or <code>null</code> if it's not a pattern filter */ public String getPattern() { return fElement.getAttribute(PATTERN_ATTRIBUTE); } /** * Returns the filter's viewId. * * @return the view ID or <code>null</code> if the filter is for all views * @since 3.0 */ public String getTargetId() { String tid= fElement.getAttribute(TARGET_ID_ATTRIBUTE); if (tid != null) return tid; // Backwards compatibility code return fElement.getAttribute(VIEW_ID_ATTRIBUTE); } /** * Returns the filter's description. * * @return the description or <code>null</code> if no description is provided */ public String getDescription() { String description= fElement.getAttribute(DESCRIPTION_ATTRIBUTE); if (description == null) description= ""; //$NON-NLS-1$ return description; } /** * @return <code>true</code> if this filter is a custom filter. */ public boolean isPatternFilter() { return getPattern() != null; } /** * @return <code>true</code> if this filter is a pattern filter. */ public boolean isCustomFilter() { return fElement.getAttribute(CLASS_ATTRIBUTE) != null; } /** * Returns <code>true</code> if the filter * is initially enabled. * * This attribute is optional and defaults to <code>true</code>. */ public boolean isEnabled() { String strVal= fElement.getAttribute(ENABLED_ATTRIBUTE); if (strVal == null) // backward compatibility strVal= fElement.getAttribute(SELECTED_ATTRIBUTE); return strVal == null || Boolean.valueOf(strVal).booleanValue(); } /* * Implements a method from IComparable */ public int compareTo(Object o) { if (o instanceof FilterDescriptor) return Collator.getInstance().compare(getName(), ((FilterDescriptor)o).getName()); else return Integer.MIN_VALUE; } //---- initialization --------------------------------------------------- /** * Creates the filter descriptors. */ private static FilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) { List result= new ArrayList(5); Set descIds= new HashSet(5); for (int i= 0; i < elements.length; i++) { final IConfigurationElement element= elements[i]; if (FILTER_TAG.equals(element.getName())) { final FilterDescriptor[] desc= new FilterDescriptor[1]; Platform.run(new SafeRunnable(FilterMessages.FilterDescriptor_filterDescriptionCreationError_message) { public void run() throws Exception { desc[0]= new FilterDescriptor(element); } }); if (desc[0] != null && !descIds.contains(desc[0].getId())) { result.add(desc[0]); descIds.add(desc[0].getId()); } } } return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]); } public String getLocalId() { return fElement.getAttribute(ID_ATTRIBUTE); } public String getPluginId() { return fElement.getNamespace(); } } --- NEW FILE: NamePatternFilter.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.filters; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.internal.ui.util.StringMatcher; /** * The NamePatternFilter selects the elements which * match the given string patterns. * <p> * The following characters have special meaning: * ? => any character * * => any string * </p> * * @since 2.0 */ public class NamePatternFilter extends ViewerFilter { private String[] fPatterns; private StringMatcher[] fMatchers; /** * Return the currently configured StringMatchers. */ private StringMatcher[] getMatchers() { return fMatchers; } /** * Gets the patterns for the receiver. */ public String[] getPatterns() { return fPatterns; } /* (non-Rubydoc) * Method declared on ViewerFilter. */ public boolean select(Viewer viewer, Object parentElement, Object element) { String matchName= null; if (element instanceof IRubyElement) { matchName= ((IRubyElement) element).getElementName(); } else if (element instanceof IAdaptable) { IAdaptable adaptable= (IAdaptable) element; IRubyElement javaElement= (IRubyElement)adaptable.getAdapter(IRubyElement.class); if (javaElement != null) matchName= javaElement.getElementName(); else { IResource resource= (IResource)adaptable.getAdapter(IResource.class); if (resource != null) matchName= resource.getName(); } } if (matchName != null) { StringMatcher[] testMatchers= getMatchers(); for (int i = 0; i < testMatchers.length; i++) { if (testMatchers[i].match(matchName)) return false; } return true; } return true; } /** * Sets the patterns to filter out for the receiver. * <p> * The following characters have special meaning: * ? => any character * * => any string * </p> */ public void setPatterns(String[] newPatterns) { fPatterns = newPatterns; fMatchers = new StringMatcher[newPatterns.length]; for (int i = 0; i < newPatterns.length; i++) { //Reset the matchers to prevent constructor overhead fMatchers[i]= new StringMatcher(newPatterns[i], true, false); } } } --- NEW FILE: FilterMessages.properties --- ############################################################################### # Copyright (c) 2000, 2005 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### CustomFiltersDialog_title= Ruby Element Filters CustomFiltersDialog_patternInfo= The patterns are separated by comma, where\n* = any string, ? = any character, ,, = , CustomFiltersDialog_enableUserDefinedPattern= &Name filter patterns (matching names will be hidden): CustomFiltersDialog_filterList_label= S&elect the elements to exclude from the view: CustomFiltersDialog_description_label= Filter description: CustomFiltersDialog_SelectAllButton_label= &Select All CustomFiltersDialog_DeselectAllButton_label= &Deselect All OpenCustomFiltersDialogAction_text= &Filters... FilterDescriptor_filterDescriptionCreationError_message= One of the extensions for extension-point org.eclipse.jdt.ui.javaElementFilters is incorrect. FilterDescriptor_filterCreationError_title= Filter Creation Error FilterDescriptor_filterCreationError_message= The org.rubypeople.rdt.ui.rubyElementFilters plug-in extension "{0}" specifies a viewer filter class which does not exist. |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:58:20
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/filters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12821/src/org/rubypeople/rdt/internal/ui/filters Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/filters added to the repository |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12688/src/org/rubypeople/rdt/internal/ui/preferences/formatter Added Files: CommentsTabPage.java CreateProfileDialog.java ProfileManager.java FormatterMessages.properties RubyPreview.java IndentationTabPage.java ModifyDialogTabPage.java CodeFormatterConfigurationBlock.java RenameProfileDialog.java RubyScriptPreview.java ModifyDialog.java ProfileVersioner.java AlreadyExistsDialog.java FormatterMessages.java ProfileStore.java Log Message: new code for new code formatting preferences --- NEW FILE: CommentsTabPage.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences.formatter; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Observable; import java.util.Observer; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; /** * Tab page for the comment formatter settings. */ public class CommentsTabPage extends ModifyDialogTabPage { private final static class Controller implements Observer { private final Collection fMasters; private final Collection fSlaves; public Controller(Collection masters, Collection slaves) { fMasters = masters; fSlaves = slaves; for (final Iterator iter = fMasters.iterator(); iter.hasNext();) { ((CheckboxPreference) iter.next()).addObserver(this); } update(null, null); } public void update(Observable o, Object arg) { boolean enabled = true; for (final Iterator iter = fMasters.iterator(); iter.hasNext();) { enabled &= ((CheckboxPreference) iter.next()).getChecked(); } for (final Iterator iter = fSlaves.iterator(); iter.hasNext();) { final Object obj = iter.next(); if (obj instanceof Preference) { ((Preference) obj).setEnabled(enabled); } else if (obj instanceof Control) { ((Group) obj).setEnabled(enabled); } } } } private final static String PREVIEW = createPreviewHeader("An example for comment formatting. This example is meant to illustrate the various possibilities offered by <i>Eclipse</i> in order to format comments.") + //$NON-NLS-1$ "require 'open-uri'\n" + //$NON-NLS-1$ "#\n" + //$NON-NLS-1$ "# This is the comment for the example module.\n" + //$NON-NLS-1$ "#\n" + //$NON-NLS-1$ " module Example\n" + //$NON-NLS-1$ " #\n" + //$NON-NLS-1$ " #\n" + //$NON-NLS-1$ " # These possibilities include:\n" + //$NON-NLS-1$ " # * Formatting of header comments. * Formatting of Rdoc tags\n" + //$NON-NLS-1$ " #\n" + //$NON-NLS-1$ " def self.bar; puts 'hello bar'; end\n" + //$NON-NLS-1$ " #\n" + //$NON-NLS-1$ " # The following is some sample code which illustrates source formatting within Rdoc comments:\n" + //$NON-NLS-1$ " # <tt>class Example\n# @a= 1\n# @b= true\n# end</tt>\n" + //$NON-NLS-1$ " #\n" + //$NON-NLS-1$ " def foo(a, b); puts a + b; end\n" + //$NON-NLS-1$ "end"; //$NON-NLS-1$ private RubyScriptPreview fPreview; public CommentsTabPage(ModifyDialog modifyDialog, Map workingValues) { super(modifyDialog, workingValues); } protected void doCreatePreferences(Composite composite, int numColumns) { // global group final Group globalGroup = createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group1_title); final CheckboxPreference global = createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT); final CheckboxPreference header = createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER); // blank lines group final Group settingsGroup = createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group2_title); final CheckboxPreference blankComments = createPrefTrueFalse(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_clear_blank_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES); final Group widthGroup = createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group3_title); final NumberPreference lineWidth = createNumberPref(widthGroup, numColumns, FormatterMessages.CommentsTabPage_line_width, DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, 0, 9999); Collection masters, slaves; masters = new ArrayList(); masters.add(global); slaves = new ArrayList(); slaves.add(settingsGroup); slaves.add(header); slaves.add(blankComments); slaves.add(lineWidth); new Controller(masters, slaves); masters = new ArrayList(); masters.add(global); slaves = new ArrayList(); new Controller(masters, slaves); } protected void initializePage() { fPreview.setPreviewText(PREVIEW); } /* * (non-Javadoc) * * @see org.eclipse.jdt.internal.ui.preferences.formatter.ModifyDialogTabPage#doCreateJavaPreview(org.eclipse.swt.widgets.Composite) */ protected RubyPreview doCreateRubyPreview(Composite parent) { fPreview = new RubyScriptPreview(fWorkingValues, parent); return fPreview; } /* * (non-Javadoc) * * @see org.eclipse.jdt.internal.ui.preferences.formatter.ModifyDialogTabPage#doUpdatePreview() */ protected void doUpdatePreview() { fPreview.update(); } private CheckboxPreference createPrefTrueFalse(Composite composite, int numColumns, String text, String key) { return createCheckboxPref(composite, numColumns, text, key, FALSE_TRUE); } } --- NEW FILE: ProfileStore.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences.formatter; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IScopeContext; import org.osgi.service.prefs.BackingStoreException; import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyUIException; import org.rubypeople.rdt.internal.ui.RubyUIStatus; import org.rubypeople.rdt.internal.ui.preferences.PreferencesAccess; import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile; import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager.Profile; import org.rubypeople.rdt.ui.RubyUI; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class ProfileStore { /** * A SAX event handler to parse the xml format for profiles. */ private final static class ProfileDefaultHandler extends DefaultHandler { private List fProfiles; private int fVersion; private String fName; private Map fSettings; public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals(XML_NODE_SETTING)) { final String key= attributes.getValue(XML_ATTRIBUTE_ID); final String value= attributes.getValue(XML_ATTRIBUTE_VALUE); fSettings.put(key, value); } else if (qName.equals(XML_NODE_PROFILE)) { fName= attributes.getValue(XML_ATTRIBUTE_NAME); fSettings= new HashMap(200); } else if (qName.equals(XML_NODE_ROOT)) { fProfiles= new ArrayList(); try { fVersion= Integer.parseInt(attributes.getValue(XML_ATTRIBUTE_VERSION)); } catch (NumberFormatException ex) { throw new SAXException(ex); } } } public void endElement(String uri, String localName, String qName) { if (qName.equals(XML_NODE_PROFILE)) { fProfiles.add(new CustomProfile(fName, fSettings, fVersion)); fName= null; fSettings= null; } } public List getProfiles() { return fProfiles; } } /** * Preference key where all profiles are stored */ private static final String PREF_FORMATTER_PROFILES= "org.eclipse.jdt.ui.formatterprofiles"; //$NON-NLS-1$ /** * Preference key where all profiles are stored */ private static final String PREF_FORMATTER_PROFILES_VERSION= "org.eclipse.jdt.ui.formatterprofiles.version"; //$NON-NLS-1$ /** * Identifiers for the XML file. */ private final static String XML_NODE_ROOT= "profiles"; //$NON-NLS-1$ private final static String XML_NODE_PROFILE= "profile"; //$NON-NLS-1$ private final static String XML_NODE_SETTING= "setting"; //$NON-NLS-1$ private final static String XML_ATTRIBUTE_VERSION= "version"; //$NON-NLS-1$ private final static String XML_ATTRIBUTE_ID= "id"; //$NON-NLS-1$ private final static String XML_ATTRIBUTE_NAME= "name"; //$NON-NLS-1$ private final static String XML_ATTRIBUTE_VALUE= "value"; //$NON-NLS-1$ private ProfileStore() { } /** * @return Returns the collection of profiles currently stored in the preference store or * <code>null</code> if the loading failed. The elements are of type {@link CustomProfile} * and are all updated to the latest version. * @throws CoreException */ public static List readProfiles(IScopeContext instanceScope) throws CoreException { List res= readProfilesFromPreferences(PREF_FORMATTER_PROFILES, instanceScope); if (res == null) { return readOldForCompatibility(instanceScope); } return res; } public static void writeProfiles(Collection profiles, IScopeContext instanceScope) throws CoreException { ByteArrayOutputStream stream= new ByteArrayOutputStream(2000); try { writeProfilesToStream(profiles, stream); String val; try { val= stream.toString("UTF-8"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { val= stream.toString(); } IEclipsePreferences uiPreferences = instanceScope.getNode(RubyUI.ID_PLUGIN); uiPreferences.put(PREF_FORMATTER_PROFILES, val); uiPreferences.putInt(PREF_FORMATTER_PROFILES_VERSION, ProfileVersioner.CURRENT_VERSION); } finally { try { stream.close(); } catch (IOException e) { /* ignore */ } } } private static List readProfilesFromPreferences(String key, IScopeContext instanceScope) throws CoreException { String string= instanceScope.getNode(RubyUI.ID_PLUGIN).get(key, null); if (string != null && string.length() > 0) { byte[] bytes; try { bytes= string.getBytes("UTF-8"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { bytes= string.getBytes(); } InputStream is= new ByteArrayInputStream(bytes); try { List res= readProfilesFromStream(new InputSource(is)); if (res != null) { for (int i= 0; i < res.size(); i++) { ProfileVersioner.updateAndComplete((CustomProfile) res.get(i)); } } return res; } finally { try { is.close(); } catch (IOException e) { /* ignore */ } } } return null; } /** * Read the available profiles from the internal XML file and return them * as collection. * @return returns a list of <code>CustomProfile</code> or <code>null</code> */ private static List readOldForCompatibility(IScopeContext instanceScope) { // in 3.0 M9 and less the profiles were stored in a file in the plugin's meta data final String STORE_FILE= "code_formatter_profiles.xml"; //$NON-NLS-1$ File file= RubyPlugin.getDefault().getStateLocation().append(STORE_FILE).toFile(); if (!file.exists()) return null; try { // note that it's wrong to use a file reader when XML declares UTF-8: Kept for compatibility final FileReader reader= new FileReader(file); try { List res= readProfilesFromStream(new InputSource(reader)); if (res != null) { for (int i= 0; i < res.size(); i++) { ProfileVersioner.updateAndComplete((CustomProfile) res.get(i)); } writeProfiles(res, instanceScope); } file.delete(); // remove after successful write return res; } finally { reader.close(); } } catch (CoreException e) { RubyPlugin.log(e); // log but ignore } catch (IOException e) { RubyPlugin.log(e); // log but ignore } return null; } /** * Read the available profiles from the internal XML file and return them * as collection or <code>null</code> if the file is not a profile file. * @param file The file to read from * @return returns a list of <code>CustomProfile</code> or <code>null</code> * @throws CoreException */ public static List readProfilesFromFile(File file) throws CoreException { try { final FileInputStream reader= new FileInputStream(file); try { return readProfilesFromStream(new InputSource(reader)); } finally { try { reader.close(); } catch (IOException e) { /* ignore */ } } } catch (IOException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_reading_xml_message); } } /** * Load profiles from a XML stream and add them to a map or <code>null</code> if the source is not a profile store. * @param inputSource The input stream * @return returns a list of <code>CustomProfile</code> or <code>null</code> * @throws CoreException */ private static List readProfilesFromStream(InputSource inputSource) throws CoreException { final ProfileDefaultHandler handler= new ProfileDefaultHandler(); try { final SAXParserFactory factory= SAXParserFactory.newInstance(); final SAXParser parser= factory.newSAXParser(); parser.parse(inputSource, handler); } catch (SAXException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_reading_xml_message); } catch (IOException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_reading_xml_message); } catch (ParserConfigurationException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_reading_xml_message); } return handler.getProfiles(); } /** * Write the available profiles to the internal XML file. * @param profiles List of <code>CustomProfile</code> * @param file File to write * @throws CoreException */ public static void writeProfilesToFile(Collection profiles, File file) throws CoreException { final OutputStream writer; try { writer= new FileOutputStream(file); try { writeProfilesToStream(profiles, writer); } finally { try { writer.close(); } catch (IOException e) { /* ignore */ } } } catch (IOException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_serializing_xml_message); } } /** * Save profiles to an XML stream * @param profiles List of <code>CustomProfile</code> * @param stream Stream to write * @throws CoreException */ private static void writeProfilesToStream(Collection profiles, OutputStream stream) throws CoreException { try { final DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance(); final DocumentBuilder builder= factory.newDocumentBuilder(); final Document document= builder.newDocument(); final Element rootElement = document.createElement(XML_NODE_ROOT); rootElement.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(ProfileVersioner.CURRENT_VERSION)); document.appendChild(rootElement); for(final Iterator iter= profiles.iterator(); iter.hasNext();) { final Profile profile= (Profile)iter.next(); if (profile.isProfileToSave()) { final Element profileElement= createProfileElement(profile, document); rootElement.appendChild(profileElement); } } Transformer transformer=TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ transformer.transform(new DOMSource(document), new StreamResult(stream)); } catch (TransformerException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_serializing_xml_message); } catch (ParserConfigurationException e) { throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_serializing_xml_message); } } /* * Create a new profile element in the specified document. The profile is not added * to the document by this method. */ private static Element createProfileElement(Profile profile, Document document) { final Element element= document.createElement(XML_NODE_PROFILE); element.setAttribute(XML_ATTRIBUTE_NAME, profile.getName()); element.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profile.getVersion())); final Iterator keyIter= ProfileManager.getKeys().iterator(); while (keyIter.hasNext()) { final String key= (String)keyIter.next(); final String value= (String)profile.getSettings().get(key); if (value != null) { final Element setting= document.createElement(XML_NODE_SETTING); setting.setAttribute(XML_ATTRIBUTE_ID, key); setting.setAttribute(XML_ATTRIBUTE_VALUE, value); element.appendChild(setting); } else { RubyPlugin.logErrorMessage("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$ } } return element; } public static void checkCurrentOptionsVersion() { PreferencesAccess access= PreferencesAccess.getOriginalPreferences(); IScopeContext instanceScope= access.getInstanceScope(); IEclipsePreferences uiPreferences= instanceScope.getNode(RubyUI.ID_PLUGIN); int version= uiPreferences.getInt(PREF_FORMATTER_PROFILES_VERSION, 0); if (version >= ProfileVersioner.CURRENT_VERSION) { return; // is up to date } try { List profiles= ProfileStore.readProfiles(instanceScope); if (profiles == null) { profiles= Collections.EMPTY_LIST; } ProfileManager manager= new ProfileManager(profiles, instanceScope, access); if (manager.getSelected() instanceof CustomProfile) { manager.commitChanges(instanceScope); // updates RubyCore options } uiPreferences.putInt(PREF_FORMATTER_PROFILES_VERSION, ProfileVersioner.CURRENT_VERSION); savePreferences(instanceScope); IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i= 0; i < projects.length; i++) { IScopeContext scope= access.getProjectScope(projects[i]); if (ProfileManager.hasProjectSpecificSettings(scope)) { manager= new ProfileManager(profiles, scope, access); manager.commitChanges(scope); // updates RubyCore project options savePreferences(scope); } } } catch (CoreException e) { RubyPlugin.log(e); } catch (BackingStoreException e) { RubyPlugin.log(e); } } private static void savePreferences(final IScopeContext context) throws BackingStoreException { try { context.getNode(RubyUI.ID_PLUGIN).flush(); } finally { context.getNode(RubyCore.PLUGIN_ID).flush(); } } /* * Creates a UI exception for logging purposes */ private static RubyUIException createException(Throwable t, String message) { return new RubyUIException(RubyUIStatus.createError(IStatus.ERROR, message, t)); } } --- NEW FILE: FormatterMessages.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * is...@be... * - 103706 [formatter] indent empty lines *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences.formatter; import org.eclipse.osgi.util.NLS; /** * Helper class to get NLSed messages. */ final class FormatterMessages extends NLS { private static final String BUNDLE_NAME= FormatterMessages.class.getName(); private FormatterMessages() { // Do not instantiate } public static String WhiteSpaceTabPage_assignments; public static String WhiteSpaceTabPage_assignments_before_assignment_operator; public static String WhiteSpaceTabPage_assignments_after_assignment_operator; public static String WhiteSpaceTabPage_operators; public static String WhiteSpaceTabPage_operators_before_binary_operators; public static String WhiteSpaceTabPage_operators_after_binary_operators; public static String WhiteSpaceTabPage_operators_before_unary_operators; public static String WhiteSpaceTabPage_operators_after_unary_operators; public static String WhiteSpaceTabPage_operators_before_prefix_operators; public static String WhiteSpaceTabPage_operators_after_prefix_operators; public static String WhiteSpaceTabPage_operators_before_postfix_operators; public static String WhiteSpaceTabPage_operators_after_postfix_operators; public static String WhiteSpaceTabPage_classes; public static String WhiteSpaceTabPage_classes_before_opening_brace_of_a_class; public static String WhiteSpaceTabPage_classes_before_opening_brace_of_anon_class; public static String WhiteSpaceTabPage_classes_before_comma_implements; public static String WhiteSpaceTabPage_classes_after_comma_implements; public static String WhiteSpaceTabPage_methods; public static String WhiteSpaceTabPage_constructors; public static String WhiteSpaceTabPage_fields; public static String WhiteSpaceTabPage_fields_before_comma; public static String WhiteSpaceTabPage_fields_after_comma; public static String WhiteSpaceTabPage_localvars; public static String WhiteSpaceTabPage_localvars_before_comma; public static String WhiteSpaceTabPage_localvars_after_comma; public static String WhiteSpaceTabPage_arrayinit; public static String WhiteSpaceTabPage_arraydecls; public static String WhiteSpaceTabPage_arrayelem; public static String WhiteSpaceTabPage_arrayalloc; public static String WhiteSpaceTabPage_calls; public static String WhiteSpaceTabPage_calls_before_comma_in_method_args; public static String WhiteSpaceTabPage_calls_after_comma_in_method_args; public static String WhiteSpaceTabPage_calls_before_comma_in_alloc; public static String WhiteSpaceTabPage_calls_after_comma_in_alloc; public static String WhiteSpaceTabPage_calls_before_comma_in_qalloc; public static String WhiteSpaceTabPage_calls_after_comma_in_qalloc; public static String WhiteSpaceTabPage_statements; public static String WhiteSpaceTabPage_blocks; public static String WhiteSpaceTabPage_switch; public static String WhiteSpaceTabPage_switch_before_case_colon; public static String WhiteSpaceTabPage_switch_before_default_colon; public static String WhiteSpaceTabPage_do; public static String WhiteSpaceTabPage_synchronized; public static String WhiteSpaceTabPage_try; public static String WhiteSpaceTabPage_if; public static String WhiteSpaceTabPage_assert; public static String WhiteSpaceTabPage_for; public static String WhiteSpaceTabPage_for_before_comma_init; public static String WhiteSpaceTabPage_for_after_comma_init; public static String WhiteSpaceTabPage_for_before_comma_inc; public static String WhiteSpaceTabPage_for_after_comma_inc; public static String WhiteSpaceTabPage_labels; public static String WhiteSpaceTabPage_annotations; public static String WhiteSpaceTabPage_annotation_types; public static String WhiteSpaceTabPage_enums; public static String WhiteSpaceTabPage_wildcardtype; public static String WhiteSpaceTabPage_param_type_ref; public static String WhiteSpaceTabPage_type_arguments; public static String WhiteSpaceTabPage_type_parameters; public static String WhiteSpaceTabPage_conditionals; public static String WhiteSpaceTabPage_typecasts; public static String WhiteSpaceTabPage_parenexpr; public static String WhiteSpaceTabPage_declarations; public static String WhiteSpaceTabPage_expressions; public static String WhiteSpaceTabPage_arrays; public static String WhiteSpaceTabPage_parameterized_types; public static String WhiteSpaceTabPage_after_opening_brace; public static String WhiteSpaceTabPage_after_closing_brace; public static String WhiteSpaceTabPage_before_opening_brace; public static String WhiteSpaceTabPage_before_closing_brace; public static String WhiteSpaceTabPage_between_empty_braces; public static String WhiteSpaceTabPage_after_opening_paren; public static String WhiteSpaceTabPage_after_closing_paren; public static String WhiteSpaceTabPage_before_opening_paren; public static String WhiteSpaceTabPage_before_closing_paren; public static String WhiteSpaceTabPage_between_empty_parens; public static String WhiteSpaceTabPage_after_opening_bracket; public static String WhiteSpaceTabPage_before_opening_bracket; public static String WhiteSpaceTabPage_before_closing_bracket; public static String WhiteSpaceTabPage_between_empty_brackets; public static String WhiteSpaceTabPage_before_comma_in_params; public static String WhiteSpaceTabPage_after_comma_in_params; public static String WhiteSpaceTabPage_before_comma_in_throws; public static String WhiteSpaceTabPage_after_comma_in_throws; public static String WhiteSpaceTabPage_before_ellipsis; public static String WhiteSpaceTabPage_after_ellipsis; public static String WhiteSpaceTabPage_before_comma; public static String WhiteSpaceTabPage_after_comma; public static String WhiteSpaceTabPage_after_semicolon; public static String WhiteSpaceTabPage_before_semicolon; public static String WhiteSpaceTabPage_before_colon; public static String WhiteSpaceTabPage_after_colon; public static String WhiteSpaceTabPage_before_question; public static String WhiteSpaceTabPage_after_question; public static String WhiteSpaceTabPage_before_at; public static String WhiteSpaceTabPage_after_at; public static String WhiteSpaceTabPage_after_opening_angle_bracket; public static String WhiteSpaceTabPage_after_closing_angle_bracket; public static String WhiteSpaceTabPage_before_opening_angle_bracket; public static String WhiteSpaceTabPage_before_closing_angle_bracket; public static String WhiteSpaceTabPage_before_and_list; public static String WhiteSpaceTabPage_after_and_list; public static String WhiteSpaceTabPage_enum_decl_before_opening_brace; public static String WhiteSpaceTabPage_enum_decl_before_comma; public static String WhiteSpaceTabPage_enum_decl_after_comma; public static String WhiteSpaceTabPage_enum_const_arg_before_opening_paren; public static String WhiteSpaceTabPage_enum_const_arg_after_opening_paren; public static String WhiteSpaceTabPage_enum_const_arg_between_empty_parens; public static String WhiteSpaceTabPage_enum_const_arg_before_comma; public static String WhiteSpaceTabPage_enum_const_arg_after_comma; public static String WhiteSpaceTabPage_enum_const_arg_before_closing_paren; public static String WhiteSpaceTabPage_enum_const_before_opening_brace; public static String WhiteSpaceTabPage_annot_type_method_before_opening_paren; public static String WhiteSpaceTabPage_annot_type_method_between_empty_parens; public static String WhiteSpaceTabPage_before_parenthesized_expressions; public static String WhiteSpaceTabPage_insert_space; public static String WhiteSpaceOptions_return; public static String WhiteSpaceOptions_before; public static String WhiteSpaceOptions_after; public static String WhiteSpaceOptions_operator; public static String WhiteSpaceOptions_assignment_operator; public static String WhiteSpaceOptions_binary_operator; public static String WhiteSpaceOptions_unary_operator; public static String WhiteSpaceOptions_prefix_operator; public static String WhiteSpaceOptions_postfix_operator; public static String WhiteSpaceOptions_opening_paren; public static String WhiteSpaceOptions_catch; public static String WhiteSpaceOptions_for; public static String WhiteSpaceOptions_if; public static String WhiteSpaceOptions_switch; public static String WhiteSpaceOptions_synchronized; public static String WhiteSpaceOptions_while; public static String WhiteSpaceOptions_assert; public static String WhiteSpaceOptions_member_function_declaration; public static String WhiteSpaceOptions_constructor; public static String WhiteSpaceOptions_method; public static String WhiteSpaceOptions_method_call; public static String WhiteSpaceOptions_paren_expr; public static String WhiteSpaceOptions_enum_constant_body; public static String WhiteSpaceOptions_enum_constant_arguments; public static String WhiteSpaceOptions_enum_declaration; public static String WhiteSpaceOptions_annotation_modifier; public static String WhiteSpaceOptions_annotation_modifier_args; public static String WhiteSpaceOptions_annotation_type_member; public static String WhiteSpaceOptions_annotation_type; public static String WhiteSpaceOptions_type_cast; public static String WhiteSpaceOptions_parameterized_type; public static String WhiteSpaceOptions_type_arguments; public static String WhiteSpaceOptions_type_parameters; public static String WhiteSpaceOptions_vararg_parameter; public static String WhiteSpaceOptions_closing_paren; public static String WhiteSpaceOptions_opening_brace; public static String WhiteSpaceOptions_closing_brace; public static String WhiteSpaceOptions_opening_bracket; public static String WhiteSpaceOptions_closing_bracket; public static String WhiteSpaceOptions_class_decl; public static String WhiteSpaceOptions_anon_class_decl; public static String WhiteSpaceOptions_initializer; public static String WhiteSpaceOptions_block; public static String WhiteSpaceOptions_array_decl; public static String WhiteSpaceOptions_array_element_access; public static String WhiteSpaceOptions_array_alloc; public static String WhiteSpaceOptions_array_init; public static String WhiteSpaceOptions_arguments; public static String WhiteSpaceOptions_initialization; public static String WhiteSpaceOptions_incrementation; public static String WhiteSpaceOptions_parameters; public static String WhiteSpaceOptions_explicit_constructor_call; public static String WhiteSpaceOptions_alloc_expr; public static String WhiteSpaceOptions_throws; public static String WhiteSpaceOptions_mult_decls; public static String WhiteSpaceOptions_local_vars; public static String WhiteSpaceOptions_fields; public static String WhiteSpaceOptions_implements_clause; public static String WhiteSpaceOptions_colon; public static String WhiteSpaceOptions_conditional; public static String WhiteSpaceOptions_wildcard; public static String WhiteSpaceOptions_label; public static String WhiteSpaceOptions_comma; public static String WhiteSpaceOptions_semicolon; public static String WhiteSpaceOptions_question_mark; public static String WhiteSpaceOptions_between_empty_parens; public static String WhiteSpaceOptions_between_empty_braces; public static String WhiteSpaceOptions_between_empty_brackets; public static String WhiteSpaceOptions_constructor_decl; public static String WhiteSpaceOptions_method_decl; public static String WhiteSpaceOptions_case; public static String WhiteSpaceOptions_default; public static String WhiteSpaceOptions_statements; public static String WhiteSpaceOptions_before_opening_paren; public static String WhiteSpaceOptions_after_opening_paren; public static String WhiteSpaceOptions_before_closing_paren; public static String WhiteSpaceOptions_after_closing_paren; public static String WhiteSpaceOptions_before_opening_brace; public static String WhiteSpaceOptions_after_opening_brace; public static String WhiteSpaceOptions_after_closing_brace; public static String WhiteSpaceOptions_before_closing_brace; public static String WhiteSpaceOptions_before_opening_bracket; public static String WhiteSpaceOptions_after_opening_bracket; public static String WhiteSpaceOptions_before_closing_bracket; public static String WhiteSpaceOptions_before_opening_angle_bracket; public static String WhiteSpaceOptions_after_opening_angle_bracket; public static String WhiteSpaceOptions_before_closing_angle_bracket; public static String WhiteSpaceOptions_after_closing_angle_bracket; public static String WhiteSpaceOptions_before_operator; public static String WhiteSpaceOptions_after_operator; public static String WhiteSpaceOptions_before_comma; public static String WhiteSpaceOptions_after_comma; public static String WhiteSpaceOptions_after_colon; public static String WhiteSpaceOptions_before_colon; public static String WhiteSpaceOptions_before_semicolon; public static String WhiteSpaceOptions_after_semicolon; public static String WhiteSpaceOptions_before_question_mark; public static String WhiteSpaceOptions_after_question_mark; public static String WhiteSpaceOptions_before_at; public static String WhiteSpaceOptions_after_at; public static String WhiteSpaceOptions_before_and; public static String WhiteSpaceOptions_after_and; public static String WhiteSpaceOptions_before_ellipsis; public static String WhiteSpaceOptions_after_ellipsis; public static String WhiteSpaceOptions_return_with_parenthesized_expression; public static String LineWrappingTabPage_compact_if_else; public static String LineWrappingTabPage_extends_clause; public static String LineWrappingTabPage_enum_constant_arguments; public static String LineWrappingTabPage_enum_constants; public static String LineWrappingTabPage_implements_clause; public static String LineWrappingTabPage_parameters; public static String LineWrappingTabPage_arguments; public static String LineWrappingTabPage_qualified_invocations; public static String LineWrappingTabPage_throws_clause; public static String LineWrappingTabPage_object_allocation; public static String LineWrappingTabPage_qualified_object_allocation; public static String LineWrappingTabPage_array_init; public static String LineWrappingTabPage_explicit_constructor_invocations; public static String LineWrappingTabPage_conditionals; public static String LineWrappingTabPage_binary_exprs; public static String LineWrappingTabPage_indentation_default; public static String LineWrappingTabPage_indentation_on_column; public static String LineWrappingTabPage_indentation_by_one; public static String LineWrappingTabPage_class_decls; public static String LineWrappingTabPage_method_decls; public static String LineWrappingTabPage_constructor_decls; public static String LineWrappingTabPage_function_calls; public static String LineWrappingTabPage_expressions; public static String LineWrappingTabPage_statements; public static String LineWrappingTabPage_enum_decls; public static String LineWrappingTabPage_wrapping_policy_label_text; public static String LineWrappingTabPage_indentation_policy_label_text; public static String LineWrappingTabPage_force_split_checkbox_text; public static String LineWrappingTabPage_force_split_checkbox_multi_text; public static String LineWrappingTabPage_line_width_for_preview_label_text; public static String LineWrappingTabPage_group; public static String LineWrappingTabPage_multi_group; public static String LineWrappingTabPage_multiple_selections; public static String LineWrappingTabPage_occurences; public static String LineWrappingTabPage_splitting_do_not_split; public static String LineWrappingTabPage_splitting_wrap_when_necessary; public static String LineWrappingTabPage_splitting_always_wrap_first_others_when_necessary; public static String LineWrappingTabPage_splitting_wrap_always; public static String LineWrappingTabPage_splitting_wrap_always_indent_all_but_first; public static String LineWrappingTabPage_splitting_wrap_always_except_first_only_if_necessary; public static String LineWrappingTabPage_width_indent; public static String LineWrappingTabPage_width_indent_option_max_line_width; public static String LineWrappingTabPage_width_indent_option_default_indent_wrapped; public static String LineWrappingTabPage_width_indent_option_default_indent_array; public static String LineWrappingTabPage_error_invalid_value; public static String LineWrappingTabPage_enum_superinterfaces; public static String LineWrappingTabPage_assignment_alignment; public static String AlreadyExistsDialog_message_profile_already_exists; public static String AlreadyExistsDialog_message_profile_name_empty; public static String AlreadyExistsDialog_dialog_title; public static String AlreadyExistsDialog_dialog_label; public static String AlreadyExistsDialog_rename_radio_button_desc; public static String AlreadyExistsDialog_overwrite_radio_button_desc; public static String BlankLinesTabPage_preview_header; public static String BlankLinesTabPage_compilation_unit_group_title; public static String BlankLinesTabPage_compilation_unit_option_before_package; public static String BlankLinesTabPage_compilation_unit_option_after_package; public static String BlankLinesTabPage_compilation_unit_option_before_import; public static String BlankLinesTabPage_compilation_unit_option_after_import; public static String BlankLinesTabPage_compilation_unit_option_between_type_declarations; public static String BlankLinesTabPage_class_group_title; public static String BlankLinesTabPage_class_option_before_first_decl; public static String BlankLinesTabPage_class_option_before_decls_of_same_kind; public static String BlankLinesTabPage_class_option_before_member_class_decls; public static String BlankLinesTabPage_class_option_before_field_decls; public static String BlankLinesTabPage_class_option_before_method_decls; public static String BlankLinesTabPage_class_option_at_beginning_of_method_body; public static String BlankLinesTabPage_blank_lines_group_title; public static String BlankLinesTabPage_blank_lines_option_empty_lines_to_preserve; public static String BracesTabPage_preview_header; public static String BracesTabPage_position_same_line; public static String BracesTabPage_position_next_line; public static String BracesTabPage_position_next_line_indented; public static String BracesTabPage_position_next_line_on_wrap; public static String BracesTabPage_group_brace_positions_title; public static String BracesTabPage_option_class_declaration; public static String BracesTabPage_option_anonymous_class_declaration; public static String BracesTabPage_option_method_declaration; public static String BracesTabPage_option_constructor_declaration; public static String BracesTabPage_option_blocks; public static String BracesTabPage_option_blocks_in_case; public static String BracesTabPage_option_switch_case; public static String BracesTabPage_option_array_initializer; public static String BracesTabPage_option_keep_empty_array_initializer_on_one_line; public static String BracesTabPage_option_enum_declaration; public static String BracesTabPage_option_enumconst_declaration; public static String BracesTabPage_option_annotation_type_declaration; public static String CodingStyleConfigurationBlock_save_profile_dialog_title; public static String CodingStyleConfigurationBlock_save_profile_error_title; public static String CodingStyleConfigurationBlock_save_profile_error_message; public static String CodingStyleConfigurationBlock_load_profile_dialog_title; public static String CodingStyleConfigurationBlock_load_profile_error_title; public static String CodingStyleConfigurationBlock_load_profile_error_message; public static String CodingStyleConfigurationBlock_load_profile_error_too_new_title; public static String CodingStyleConfigurationBlock_load_profile_error_too_new_message; public static String CodingStyleConfigurationBlock_preview_title; public static String CodingStyleConfigurationBlock_save_profile_overwrite_title; public static String CodingStyleConfigurationBlock_save_profile_overwrite_message; public static String CodingStyleConfigurationBlock_edit_button_desc; public static String CodingStyleConfigurationBlock_show_button_desc; public static String CodingStyleConfigurationBlock_rename_button_desc; public static String CodingStyleConfigurationBlock_remove_button_desc; public static String CodingStyleConfigurationBlock_new_button_desc; public static String CodingStyleConfigurationBlock_load_button_desc; public static String CodingStyleConfigurationBlock_save_button_desc; public static String CodingStyleConfigurationBlock_preview_label_text; public static String CodingStyleConfigurationBlock_error_reading_xml_message; public static String CodingStyleConfigurationBlock_error_serializing_xml_message; public static String CodingStyleConfigurationBlock_delete_confirmation_title; public static String CodingStyleConfigurationBlock_delete_confirmation_question; public static String CommentsTabPage_group1_title; public static String CommentsTabPage_enable_comment_formatting; public static String CommentsTabPage_format_header; public static String CommentsTabPage_format_html; public static String CommentsTabPage_format_code_snippets; public static String CommentsTabPage_group2_title; public static String CommentsTabPage_clear_blank_lines; public static String CommentsTabPage_blank_line_before_javadoc_tags; public static String CommentsTabPage_indent_javadoc_tags; public static String CommentsTabPage_indent_description_after_param; public static String CommentsTabPage_new_line_after_param_tags; public static String CommentsTabPage_group3_title; public static String CommentsTabPage_line_width; public static String ControlStatementsTabPage_preview_header; public static String ControlStatementsTabPage_general_group_title; public static String ControlStatementsTabPage_general_group_insert_new_line_before_else_statements; public static String ControlStatementsTabPage_general_group_insert_new_line_before_catch_statements; public static String ControlStatementsTabPage_general_group_insert_new_line_before_finally_statements; public static String ControlStatementsTabPage_general_group_insert_new_line_before_while_in_do_statements; public static String ControlStatementsTabPage_if_else_group_title; public static String ControlStatementsTabPage_if_else_group_keep_then_on_same_line; public static String ControlStatementsTabPage_if_else_group_keep_simple_if_on_one_line; public static String ControlStatementsTabPage_if_else_group_keep_else_on_same_line; public static String ControlStatementsTabPage_if_else_group_keep_else_if_on_one_line; public static String ControlStatementsTabPage_if_else_group_keep_guardian_clause_on_one_line; public static String CreateProfileDialog_status_message_profile_with_this_name_already_exists; public static String CreateProfileDialog_status_message_profile_name_is_empty; public static String CreateProfileDialog_dialog_title; public static String CreateProfileDialog_profile_name_label_text; public static String CreateProfileDialog_base_profile_label_text; public static String CreateProfileDialog_open_edit_dialog_checkbox_text; public static String IndentationTabPage_preview_header; public static String IndentationTabPage_general_group_title; public static String IndentationTabPage_general_group_option_tab_policy; public static String IndentationTabPage_general_group_option_tab_policy_SPACE; public static String IndentationTabPage_general_group_option_tab_policy_TAB; public static String IndentationTabPage_general_group_option_tab_policy_MIXED; public static String IndentationTabPage_general_group_option_tab_size; public static String IndentationTabPage_general_group_option_indent_size; public static String IndentationTabPage_indent_group_title; public static String IndentationTabPage_class_group_option_indent_declarations_within_class_body; public static String IndentationTabPage_class_group_option_indent_declarations_within_enum_const; public static String IndentationTabPage_class_group_option_indent_declarations_within_enum_decl; public static String IndentationTabPage_block_group_option_indent_statements_compare_to_body; public static String IndentationTabPage_block_group_option_indent_statements_compare_to_block; public static String IndentationTabPage_switch_group_option_indent_statements_within_switch_body; public static String IndentationTabPage_switch_group_option_indent_statements_within_case_body; public static String IndentationTabPage_switch_group_option_indent_break_statements; public static String IndentationTabPage_indent_empty_lines; public static String IndentationTabPage_use_tabs_only_for_leading_indentations; public static String ModifyDialog_dialog_title; public static String ModifyDialog_apply_button; public static String ModifyDialog_dialog_show_title; public static String ModifyDialog_dialog_show_warning_builtin; public static String ModifyDialog_tabpage_braces_title; public static String ModifyDialog_tabpage_indentation_title; public static String ModifyDialog_tabpage_whitespace_title; public static String ModifyDialog_tabpage_blank_lines_title; public static String ModifyDialog_tabpage_new_lines_title; public static String ModifyDialog_tabpage_control_statements_title; public static String ModifyDialog_tabpage_line_wrapping_title; public static String ModifyDialog_tabpage_comments_title; public static String ModifyDialogTabPage_preview_label_text; public static String NewLinesTabPage_preview_header; public static String NewLinesTabPage_newlines_group_title; public static String NewLinesTabPage_newlines_group_option_empty_class_body; public static String NewLinesTabPage_newlines_group_option_empty_anonymous_class_body; public static String NewLinesTabPage_newlines_group_option_empty_enum_declaration; public static String NewLinesTabPage_newlines_group_option_empty_enum_constant; public static String NewLinesTabPage_newlines_group_option_empty_method_body; public static String NewLinesTabPage_newlines_group_option_empty_block; public static String NewLinesTabPage_newlines_group_option_empty_end_of_file; public static String NewLinesTabPage_empty_statement_group_title; public static String NewLinesTabPage_emtpy_statement_group_option_empty_statement_on_new_line; public static String NewLinesTabPage_arrayInitializer_group_title; public static String NewLinesTabPage_array_group_option_after_opening_brace_of_array_initializer; public static String NewLinesTabPage_array_group_option_before_closing_brace_of_array_initializer; public static String NewLinesTabPage_annotations_group_title; public static String NewLinesTabPage_annotations_group_option_after_annotation; public static String ProfileManager_eclipse_profile_name; public static String ProfileManager_ruby_conventions_profile_name; public static String ProfileManager_unmanaged_profile; public static String ProfileManager_unmanaged_profile_with_name; public static String RenameProfileDialog_status_message_profile_with_this_name_already_exists; public static String RenameProfileDialog_status_message_profile_name_empty; public static String RenameProfileDialog_dialog_title; public static String RenameProfileDialog_dialog_label_enter_a_new_name; public static String ModifyDialogTabPage_error_msg_values_text_unassigned; public static String ModifyDialogTabPage_error_msg_values_items_text_unassigned; public static String ModifyDialogTabPage_NumberPreference_error_invalid_key; public static String ModifyDialogTabPage_NumberPreference_error_invalid_value; public static String RubyPreview_formatter_exception; public static String WhiteSpaceTabPage_sort_by_java_element; public static String WhiteSpaceTabPage_sort_by_syntax_element; static { NLS.initializeMessages(BUNDLE_NAME, FormatterMessages.class); } } --- NEW FILE: CreateProfileDialog.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences.formatter; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.StatusDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo; import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile; import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager.Profile; import org.rubypeople.rdt.ui.RubyUI; /** * The dialog to create a new profile. */ public class CreateProfileDialog extends StatusDialog { private static final String PREF_OPEN_EDIT_DIALOG = RubyUI.ID_PLUGIN + ".codeformatter.create_profile_dialog.open_edit"; //$NON-NLS-1$ private Text fNameText; private Combo fProfileCombo; private Button fEditCheckbox; private final static StatusInfo fOk = new StatusInfo(); private final static StatusInfo fEmpty = new StatusInfo(IStatus.ERROR, FormatterMessages.CreateProfileDialog_status_message_profile_name_is_empty); private final static StatusInfo fDuplicate = new StatusInfo( IStatus.ERROR, FormatterMessages.CreateProfileDialog_status_message_profile_with_this_name_already_exists); private final ProfileManager fProfileManager; private final List fSortedProfiles; private final String[] fSortedNames; private CustomProfile fCreatedProfile; protected boolean fOpenEditDialog; public CreateProfileDialog(Shell parentShell, ProfileManager profileManager) { super(parentShell); fProfileManager = profileManager; fSortedProfiles = fProfileManager.getSortedProfiles(); fSortedNames = fProfileManager.getSortedDisplayNames(); } public void create() { super.create(); setTitle(FormatterMessages.CreateProfileDialog_dialog_title); } public Control createDialogArea(Composite parent) { final int numColumns = 2; GridData gd; final GridLayout layout = new GridLayout(numColumns, false); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); final Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(layout); // Create "Profile name:" label gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; gd.widthHint = convertWidthInCharsToPixels(60); final Label nameLabel = new Label(composite, SWT.WRAP); nameLabel.setText(FormatterMessages.CreateProfileDialog_profile_name_label_text); nameLabel.setLayoutData(gd); // Create text field to enter name gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; fNameText = new Text(composite, SWT.SINGLE | SWT.BORDER); fNameText.setLayoutData(gd); fNameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { doValidation(); } }); // Create "Initialize settings ..." label gd = new GridData(); gd.horizontalSpan = numColumns; Label profileLabel = new Label(composite, SWT.WRAP); profileLabel.setText(FormatterMessages.CreateProfileDialog_base_profile_label_text); profileLabel.setLayoutData(gd); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = numColumns; fProfileCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fProfileCombo.setLayoutData(gd); // "Open the edit dialog now" checkbox gd = new GridData(); gd.horizontalSpan = numColumns; fEditCheckbox = new Button(composite, SWT.CHECK); fEditCheckbox.setText(FormatterMessages.CreateProfileDialog_open_edit_dialog_checkbox_text); fEditCheckbox.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { fOpenEditDialog = ((Button) e.widget).getSelection(); } public void widgetDefaultSelected(SelectionEvent e) { } }); final IDialogSettings dialogSettings = RubyPlugin.getDefault().getDialogSettings();// .get(PREF_OPEN_EDIT_DIALOG); if (dialogSettings.get(PREF_OPEN_EDIT_DIALOG) != null) { fOpenEditDialog = dialogSettings.getBoolean(PREF_OPEN_EDIT_DIALOG); } else { fOpenEditDialog = true; } ... [truncated message content] |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:57:52
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12643/src/org/rubypeople/rdt/internal/ui/preferences/formatter Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/formatter added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:57:37
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12583/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyEditorMessages.java RubyEditorMessages.properties Added Files: ConstructedRubyEditorMessages.properties Log Message: chnage how we do localized strings (use NLS support builtin to Eclipse) Index: RubyEditorMessages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyEditorMessages.java 5 Mar 2005 20:49:48 -0000 1.3 --- RubyEditorMessages.java 10 Feb 2006 19:57:28 -0000 1.4 *************** *** 15,51 **** import java.util.ResourceBundle; ! public class RubyEditorMessages { ! private static final String RESOURCE_BUNDLE= RubyEditorMessages.class.getName(); ! private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); ! private RubyEditorMessages() { ! } ! public static String getString(String key) { ! try { ! return fgResourceBundle.getString(key); ! } catch (MissingResourceException e) { ! return '!' + key + '!'; ! } ! } ! ! public static ResourceBundle getResourceBundle() { ! return fgResourceBundle; ! } - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object arg) { - return MessageFormat.format(getString(key), new Object[] { arg } ); - } } --- 15,80 ---- import java.util.ResourceBundle; ! import org.eclipse.osgi.util.NLS; ! public class RubyEditorMessages extends NLS { ! private static final String BUNDLE_NAME = RubyEditorMessages.class.getName(); ! public static String RubyOutlinePage_Sort_label; ! public static String RubyOutlinePage_Sort_tooltip; ! public static String RubyOutlinePage_Sort_description; ! public static String RubyOutlinePage_GoIntoTopLevelType_label; ! public static String RubyOutlinePage_GoIntoTopLevelType_tooltip; ! public static String RubyOutlinePage_GoIntoTopLevelType_description; ! public static String RubyOutlinePage_error_NoTopLevelType; ! private static ResourceBundle fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); ! ! private static final String BUNDLE_FOR_CONSTRUCTED_KEYS= "org.rubypeople.rdt.internal.ui.rubyeditor.ConstructedRubyEditorMessages";//$NON-NLS-1$ ! private static ResourceBundle fgBundleForConstructedKeys= ResourceBundle.getBundle(BUNDLE_FOR_CONSTRUCTED_KEYS); ! ! /** ! * Returns the message bundle which contains constructed keys. ! * ! * @since 3.1 ! * @return the message bundle ! */ ! public static ResourceBundle getBundleForConstructedKeys() { ! return fgBundleForConstructedKeys; ! } ! ! ! private RubyEditorMessages() { ! } ! ! public static String getString(String key) { ! try { ! return fgResourceBundle.getString(key); ! } catch (MissingResourceException e) { ! return '!' + key + '!'; ! } ! } ! ! public static ResourceBundle getResourceBundle() { ! return fgResourceBundle; ! } ! ! /** ! * Gets a string from the resource bundle and formats it with arguments ! */ ! public static String getFormattedString(String key, Object[] args) { ! return MessageFormat.format(getString(key), args); ! } ! ! /** ! * Gets a string from the resource bundle and formats it with arguments ! */ ! public static String getFormattedString(String key, Object arg) { ! return MessageFormat.format(getString(key), new Object[] { arg}); ! } ! ! static { ! NLS.initializeMessages(BUNDLE_NAME, RubyEditorMessages.class); ! } } Index: RubyEditorMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RubyEditorMessages.properties 12 Mar 2005 16:52:13 -0000 1.4 --- RubyEditorMessages.properties 10 Feb 2006 19:57:28 -0000 1.5 *************** *** 45,57 **** RubyOutlinePage.HideStaticMembers.tooltip.checked=Show Static Members RubyOutlinePage.HideStaticMembers.tooltip.unchecked=Hide Static Members ! RubyOutlinePage.Sort.label=Sort ! RubyOutlinePage.Sort.tooltip=Sort ! RubyOutlinePage.Sort.description=Enable Sorting ! RubyOutlinePage.GoIntoTopLevelType.label=Go Into Top Level Type ! RubyOutlinePage.GoIntoTopLevelType.tooltip=Go Into Top Level Type ! RubyOutlinePage.GoIntoTopLevelType.description=Show children of top level type only RubyOutlinePage.error.ChildrenProvider.getChildren.message1=RubyOutlinePage.ChildrenProvider.getChildren RubyOutlinePage.error.ChildrenProvider.hasChildren.message1=RubyOutlinePage.ChildrenProvider.hasChildren ! RubyOutlinePage.error.NoTopLevelType=Top level type not defined OpenOnSelection.description=Open an editor on the selected element --- 45,57 ---- RubyOutlinePage.HideStaticMembers.tooltip.checked=Show Static Members RubyOutlinePage.HideStaticMembers.tooltip.unchecked=Hide Static Members ! RubyOutlinePage_Sort_label=Sort ! RubyOutlinePage_Sort_tooltip=Sort ! RubyOutlinePage_Sort_description=Enable Sorting ! RubyOutlinePage_GoIntoTopLevelType_label=Go Into Top Level Type ! RubyOutlinePage_GoIntoTopLevelType_tooltip=Go Into Top Level Type ! RubyOutlinePage_GoIntoTopLevelType_description=Show children of top level type only RubyOutlinePage.error.ChildrenProvider.getChildren.message1=RubyOutlinePage.ChildrenProvider.getChildren RubyOutlinePage.error.ChildrenProvider.hasChildren.message1=RubyOutlinePage.ChildrenProvider.hasChildren ! RubyOutlinePage_error_NoTopLevelType=Top level type not defined OpenOnSelection.description=Open an editor on the selected element *************** *** 114,124 **** Uncomment.description=Uncomment the selected Ruby comment lines - ToggleComment.label=Togg&le Comment - ToggleComment.tooltip=Toggle Comment For the Selected Lines - ToggleComment.description=Toggle comment for the selected lines - - ToggleComment.error.title=Toggle Comment - ToggleComment.error.message=An error occurred while toggling comments. - AddBlockComment.label=Add &Block Comment AddBlockComment.tooltip=Enclose the Selection in a Block Comment --- 114,117 ---- --- NEW FILE: ConstructedRubyEditorMessages.properties --- ############################################################################### # Copyright (c) 2000, 2005 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### CompilationUnitEditorActionContributor.ToggleInsertMode.label=Sma&rt Insert Mode CompilationUnitEditorActionContributor.ToggleInsertMode.tooltip=Toggle Smart Insert Mode CompilationUnitEditorActionContributor.ToggleInsertMode.image= CompilationUnitEditorActionContributor.ToggleInsertMode.description= Toggles smart insert mode RubyOutlinePage.ContextMenu.refactoring.label=&Refactor RubyOutlinePage.HideFields.description.checked=Shows Fields RubyOutlinePage.HideFields.description.unchecked=Hides Fields RubyOutlinePage.HideFields.label=Hide Fields RubyOutlinePage.HideFields.tooltip.checked=Show Fields RubyOutlinePage.HideFields.tooltip.unchecked=Hide Fields RubyOutlinePage.HideNonePublicMembers.description.checked=Shows non-public members RubyOutlinePage.HideNonePublicMembers.description.unchecked=Hides non-public members RubyOutlinePage.HideNonePublicMembers.label=Show Public Members Only RubyOutlinePage.HideNonePublicMembers.tooltip.checked=Show Non-Public Members RubyOutlinePage.HideNonePublicMembers.tooltip.unchecked=Hide Non-Public Members RubyOutlinePage.HideStaticMembers.description.checked=Shows static members RubyOutlinePage.HideStaticMembers.description.unchecked=Hides static members RubyOutlinePage.HideStaticMembers.label=Hide Static Members RubyOutlinePage.HideStaticMembers.tooltip.checked=Show Static Members RubyOutlinePage.HideStaticMembers.tooltip.unchecked=Hide Static Members OpenHierarchy.label=Quick Type &Hierarchy OpenHierarchy.dialog.message=&Select the type to open: OpenHierarchy.dialog.title=Open Type Hierarchy OpenHierarchy.tooltip=Show the Quick Type Hierarchy of the Selected Element OpenHierarchy.description=Show the quick type hierarchy of the selected element OpenOnSelection.label=&Open on Selection OpenOnSelection.description=Open an editor on the selected element OpenOnSelection.dialog.message=&Select or enter the element to open: OpenOnSelection.dialog.title=Open On Selection OpenOnSelection.tooltip=Open an Editor on the Selected Element TogglePresentation.label=Show Source of Selected Element Only TogglePresentation.tooltip=Show Source of Selected Element Only ToggleMarkOccurrencesAction.label= Toggle Mark Occurrences ToggleMarkOccurrencesAction.tooltip= Toggle Mark Occurrences ToggleTextHover.label=Show Text Hover ToggleTextHover.tooltip=Show Text Hover ContentAssistProposal.label=Co&ntent Assist ContentAssistProposal.tooltip=Content Assist ContentAssistProposal.description=Content Assist ContentAssistContextInformation.label=Parameter &Hints ContentAssistContextInformation.tooltip=Show Parameter Hints ContentAssistContextInformation.description=Show Method Parameter Hints CorrectionAssistProposal.label=&Quick Fix CorrectionAssistProposal.tooltip=Quick Fix CorrectionAssistProposal.description=Quick Fix ShowRubyDoc.label=Show T&ooltip Description ShowRubyDoc.tooltip=Shows Tooltip Description for Element at Cursor ShowRubyDoc.description=Shows the tooltip description for the element at the cursor ShowOutline.label= Quick Out&line ShowOutline.tooltip= Shows the Quick Outline of Editor Input ShowOutline.description= Shows the quick outline for the editor input OpenStructure.label= Open Stru&cture OpenStructure.tooltip= Opens Structure of Selected Element OpenStructure.description= Opens the structure of the selected element OpenExternalRubydoc.label=Open External Rubydoc OpenExternalRubydoc.tooltip=Opens Rubydoc in an External Browser for the Element at the Cursor Position OpenExternalRubydoc.description=Opens Rubydoc in an external browser for the element at the cursor position Comment.label=Co&mment Comment.tooltip=Comment the Selected Lines Comment.description=Turn the selected lines into Ruby comments Uncomment.label=&Uncomment Uncomment.tooltip=Uncomment the Selected Ruby Comment Lines Uncomment.description=Uncomment the selected Ruby comment lines ToggleComment.label=Togg&le Comment ToggleComment.tooltip=Toggle Comment For the Selected Lines ToggleComment.description=Toggle comment for the selected lines AddBlockComment.label=Add &Block Comment AddBlockComment.tooltip=Enclose the Selection in a Block Comment AddBlockComment.description=Encloses the selection with block comment markers RemoveBlockComment.label=Remove Bloc&k Comment RemoveBlockComment.tooltip=Remove Block Comment Markers Enclosing the Caret RemoveBlockComment.description=Removes any block comment markers enclosing the caret Format.label=&Format Format.tooltip=Format the Selected Text Format.description=Format the selected text ShiftRight.label=&Shift Right ShiftRight.tooltip=Shift Right ShiftRight.description=Shift the selected text to the right ShiftLeft.label=S&hift Left ShiftLeft.tooltip=Shift Left ShiftLeft.description=Shift the selected text to the left Editor.Cut.label=Cu&t Editor.Cut.tooltip=Cut Editor.Cut.image= Editor.Cut.description=Cut Editor.Copy.label=&Copy Editor.Copy.tooltip=Copy Editor.Copy.image= Editor.Copy.description=Copy Editor.Paste.label=&Paste Editor.Paste.tooltip=Paste Editor.Paste.image= Editor.Paste.description=Paste StructureSelectNext.label=&Next Element StructureSelectNext.tooltip=Expand Selection to Include Next Sibling StructureSelectNext.description=Expand selection to include next sibling StructureSelectPrevious.label=&Previous Element StructureSelectPrevious.tooltip=Expand Selection to Include Previous Sibling StructureSelectPrevious.description=Expand selection to include previous sibling StructureSelectEnclosing.label=&Enclosing Element StructureSelectEnclosing.tooltip=Expand Selection to Include Enclosing Element StructureSelectEnclosing.description=Expand selection to include enclosing element StructureSelectHistory.label=&Restore Last Selection StructureSelectHistory.tooltip=Restore Last Selection StructureSelectHistory.description=Restore last selection GotoNextMember.label= N&ext Member GotoNextMember.tooltip=Move the Caret to the Next Member of the Compilation Unit GotoNextMember.description=Move the caret to the next member of the compilation unit GotoPreviousMember.label= Previ&ous Member GotoPreviousMember.tooltip=Move the Caret to the Previous Member of the Compilation Unit GotoPreviousMember.description=Move the caret to the previous member of the compilation unit GotoMatchingBracket.label= Matching &Bracket GotoMatchingBracket.tooltip=Go to Matching Bracket GotoMatchingBracket.description=Go to Matching Bracket SourceAttachmentDialog.title=Attachments For ''{0}'' SourceAttachmentDialog.error.title=Error Attaching Source SourceAttachmentDialog.error.message=An error occurred while associating the source RubySelectAnnotationRulerAction.QuickFix.label= &Quick Fix RubySelectAnnotationRulerAction.QuickFix.tooltip= Quick Fix RubySelectAnnotationRulerAction.QuickFix.description= Runs Quick Fix on the annotation's line RubySelectAnnotationRulerAction.QuickFix.image= RubySelectAnnotationRulerAction.QuickAssist.label= Quick &Assist RubySelectAnnotationRulerAction.QuickAssist.tooltip= Quick Assist RubySelectAnnotationRulerAction.QuickAssist.description= Runs Quick Assist on the annotation's line RubySelectAnnotationRulerAction.QuickAssist.image= RubySelectAnnotationRulerAction.GotoAnnotation.label= &Go to Annotation RubySelectAnnotationRulerAction.GotoAnnotation.tooltip= Go to Annotation RubySelectAnnotationRulerAction.GotoAnnotation.description= Selects the annotation in the editor RubySelectAnnotationRulerAction.GotoAnnotation.image= RubySelectAnnotationRulerAction.OpenSuperImplementation.label= &Open Super Implementation RubySelectAnnotationRulerAction.OpenSuperImplementation.tooltip= Open Super Implementation RubySelectAnnotationRulerAction.OpenSuperImplementation.description= Opens the super implementation RubySelectAnnotationRulerAction.OpenSuperImplementation.image= Editor.ChangeEncodingAction.label= Set Encodin&g... Editor.ChangeEncodingAction.tooltip= Set Encoding Editor.ChangeEncodingAction.image= Editor.ChangeEncodingAction.description= Set Encoding Editor.ChangeEncodingAction.dialog.title= Set Encoding Editor.ConvertLineDelimiters.label=C&onvert Line Delimiters To Editor.ConvertToWindows.label=&Windows Editor.ConvertToWindows.tooltip=Converts Line Delimiters to Windows Editor.ConvertToWindows.image= Editor.ConvertToWindows.description=Converts line delimiters to Windows Editor.ConvertToUNIX.label=&UNIX Editor.ConvertToUNIX.tooltip=Converts Line Delimiters to UNIX Editor.ConvertToUNIX.image= Editor.ConvertToUNIX.description=Converts line delimiters to UNIX Editor.ConvertToMac.label=&Mac Editor.ConvertToMac.tooltip=Converts line delimiters to Mac Editor.ConvertToMac.image= Editor.ConvertToMac.description=Converts line delimiters to Mac Indent.label=Correct &Indentation Indent.tooltip=&Indent Current Line to Correct Indentation Indent.description=&Indents the current line or selection depending on surrounding source code Editor.MoveLinesUp.label=Move Lines Up Editor.MoveLinesUp.tooltip=Move the Selected Lines Up Editor.MoveLinesUp.image= Editor.MoveLinesUp.description=Moves the selected lines up Editor.MoveLinesDown.label=Move Lines Down Editor.MoveLinesDown.tooltip=Move the Selected Lines Down Editor.MoveLinesDown.image= Editor.MoveLinesDown.description=Moves the selected lines down |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:56:43
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12226/src/org/rubypeople/rdt/ui/actions Added Files: CustomFiltersActionGroup.java MemberFilterActionGroup.java Log Message: actions for filtering memebrs in outline view --- NEW FILE: CustomFiltersActionGroup.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.ui.actions; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.Stack; import java.util.StringTokenizer; import java.util.TreeSet; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.ContributionItem; import org.eclipse.jface.action.GroupMarker; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.IContentProvider; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IMemento; import org.eclipse.ui.IViewPart; import org.eclipse.ui.actions.ActionGroup; import org.rubypeople.rdt.core.IRubyModel; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.filters.CustomFiltersDialog; import org.rubypeople.rdt.internal.ui.filters.FilterDescriptor; import org.rubypeople.rdt.internal.ui.filters.FilterMessages; import org.rubypeople.rdt.internal.ui.filters.NamePatternFilter; /** * Action group to add the filter action to a view part's tool bar * menu. * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> * * @since 2.0 */ public class CustomFiltersActionGroup extends ActionGroup { class ShowFilterDialogAction extends Action { ShowFilterDialogAction() { setText(FilterMessages.OpenCustomFiltersDialogAction_text); setImageDescriptor(RubyPluginImages.DESC_ELCL_FILTER); setDisabledImageDescriptor(RubyPluginImages.DESC_DLCL_FILTER); } public void run() { openDialog(); } } /** * Menu contribution item which shows and lets check and uncheck filters. * * @since 3.0 */ class FilterActionMenuContributionItem extends ContributionItem { private int fItemNumber; private boolean fState; private String fFilterId; private String fFilterName; private CustomFiltersActionGroup fActionGroup; /** * Constructor for FilterActionMenuContributionItem. * * @param actionGroup the action group * @param filterId the id of the filter * @param filterName the name of the filter * @param state the initial state of the filter * @param itemNumber the menu item index */ public FilterActionMenuContributionItem(CustomFiltersActionGroup actionGroup, String filterId, String filterName, boolean state, int itemNumber) { super(filterId); Assert.isNotNull(actionGroup); Assert.isNotNull(filterId); Assert.isNotNull(filterName); fActionGroup= actionGroup; fFilterId= filterId; fFilterName= filterName; fState= state; fItemNumber= itemNumber; } /* * Overrides method from ContributionItem. */ public void fill(Menu menu, int index) { MenuItem mi= new MenuItem(menu, SWT.CHECK, index); mi.setText("&" + fItemNumber + " " + fFilterName); //$NON-NLS-1$ //$NON-NLS-2$ /* * XXX: Don't set the image - would look bad because other menu items don't provide image * XXX: Get working set specific image name from XML - would need to cache icons */ // mi.setImage(RubyPluginImages.get(RubyPluginImages.IMG_OBJS_JAVA_WORKING_SET)); mi.setSelection(fState); mi.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fState= !fState; fActionGroup.setFilter(fFilterId, fState); } }); } /* * @see org.eclipse.jface.action.IContributionItem#isDynamic() */ public boolean isDynamic() { return true; } } private static final String TAG_CUSTOM_FILTERS = "customFilters"; //$NON-NLS-1$ private static final String TAG_USER_DEFINED_PATTERNS_ENABLED= "userDefinedPatternsEnabled"; //$NON-NLS-1$ private static final String TAG_USER_DEFINED_PATTERNS= "userDefinedPatterns"; //$NON-NLS-1$ private static final String TAG_XML_DEFINED_FILTERS= "xmlDefinedFilters"; //$NON-NLS-1$ private static final String TAG_LRU_FILTERS = "lastRecentlyUsedFilters"; //$NON-NLS-1$ private static final String TAG_CHILD= "child"; //$NON-NLS-1$ private static final String TAG_PATTERN= "pattern"; //$NON-NLS-1$ private static final String TAG_FILTER_ID= "filterId"; //$NON-NLS-1$ private static final String TAG_IS_ENABLED= "isEnabled"; //$NON-NLS-1$ private static final String SEPARATOR= ","; //$NON-NLS-1$ private static final int MAX_FILTER_MENU_ENTRIES= 3; private static final String RECENT_FILTERS_GROUP_NAME= "recentFiltersGroup"; //$NON-NLS-1$ private StructuredViewer fViewer; private NamePatternFilter fPatternFilter; private Map fInstalledBuiltInFilters; private Map fEnabledFilterIds; private boolean fUserDefinedPatternsEnabled; private String[] fUserDefinedPatterns; private FilterDescriptor[] fCachedFilterDescriptors; /** * Recently changed filter Ids stack with oldest on top (i.e. at the end). * * @since 3.0 */ private Stack fLRUFilterIdsStack; /** * Handle to menu manager to dynamically update * the last recently used filters. * * @since 3.0 */ private IMenuManager fMenuManager; /** * The menu listener which dynamically updates * the last recently used filters. * * @since 3.0 */ private IMenuListener fMenuListener; /** * Filter Ids used in the last view menu invocation. * * @since 3.0 */ private String[] fFilterIdsUsedInLastViewMenu; private HashMap fFilterDescriptorMap; private String fTargetId; /** * Creates a new <code>CustomFiltersActionGroup</code>. * * @param part the view part that owns this action group * @param viewer the viewer to be filtered */ public CustomFiltersActionGroup(IViewPart part, StructuredViewer viewer) { this(part.getViewSite().getId(), viewer); } /** * Creates a new <code>CustomFiltersActionGroup</code>. * * @param ownerId the id of this action group's owner * @param viewer the viewer to be filtered */ public CustomFiltersActionGroup(String ownerId, StructuredViewer viewer) { Assert.isNotNull(ownerId); Assert.isNotNull(viewer); fTargetId= ownerId; fViewer= viewer; fLRUFilterIdsStack= new Stack(); initializeWithPluginContributions(); initializeWithViewDefaults(); installFilters(); } /* * Method declared on ActionGroup. */ public void fillActionBars(IActionBars actionBars) { fillToolBar(actionBars.getToolBarManager()); fillViewMenu(actionBars.getMenuManager()); } /** * Returns a list of currently enabled filters. The filter * is identified by its id. * <p> * This method is for internal use only and should not * be called by clients outside of JDT/UI. * </p> * * @return a list of currently enabled filters * * @since 3.1 */ public String[] internalGetEnabledFilterIds() { Set enabledFilterIds= new HashSet(fEnabledFilterIds.size()); Iterator iter= fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry= (Map.Entry)iter.next(); String id= (String)entry.getKey(); boolean isEnabled= ((Boolean)entry.getValue()).booleanValue(); if (isEnabled) enabledFilterIds.add(id); } return (String[])enabledFilterIds.toArray(new String[enabledFilterIds.size()]); } /** * Removes filters for the given parent and element * * @param parent the parent of the element * @param element the element * @param contentProvider the content provider of the viewer from which * the filters will be removed * * @return the array of new filter ids */ public String[] removeFiltersFor(Object parent, Object element, IContentProvider contentProvider) { String[] enabledFilters= internalGetEnabledFilterIds(); Set newFilters= new HashSet(); for (int i= 0; i < enabledFilters.length; i++) { String filterName= enabledFilters[i]; ViewerFilter filter= (ViewerFilter) fInstalledBuiltInFilters.get(filterName); if (filter == null) newFilters.add(filterName); else if (isSelected(parent, element, contentProvider, filter)) newFilters.add(filterName); } if (newFilters.size() == enabledFilters.length) return new String[0]; return (String[])newFilters.toArray(new String[newFilters.size()]); } /** * Sets the filters to the given array of new filters * * @param newFilters the new filters */ public void setFilters(String[] newFilters) { setEnabledFilterIds(newFilters); updateViewerFilters(true); } private boolean isSelected(Object parent, Object element, IContentProvider contentProvider, ViewerFilter filter) { if (contentProvider instanceof ITreeContentProvider) { // the element and all its parents have to be selected ITreeContentProvider provider = (ITreeContentProvider) contentProvider; while (element != null && !(element instanceof IRubyModel)) { if (!filter.select(fViewer, parent, element)) return false; element= provider.getParent( element); } return true; } return filter.select(fViewer, parent, element); } /** * Sets the enable state of the given filter. * * @param filterId the id of the filter * @param state the filter state */ private void setFilter(String filterId, boolean state) { // Renew filter id in LRU stack fLRUFilterIdsStack.remove(filterId); fLRUFilterIdsStack.add(0, filterId); fEnabledFilterIds.put(filterId, new Boolean(state)); storeViewDefaults(); updateViewerFilters(true); } private void setEnabledFilterIds(String[] enabledIds) { Iterator iter= fEnabledFilterIds.keySet().iterator(); while (iter.hasNext()) { String id= (String)iter.next(); fEnabledFilterIds.put(id, Boolean.FALSE); } for (int i= 0; i < enabledIds.length; i++) fEnabledFilterIds.put(enabledIds[i], Boolean.TRUE); } private void setUserDefinedPatterns(String[] patterns) { fUserDefinedPatterns= patterns; cleanUpPatternDuplicates(); } /** * Sets the recently changed filters. * * @param changeHistory the change history * @since 3.0 */ private void setRecentlyChangedFilters(Stack changeHistory) { Stack oldestFirstStack= new Stack(); int length= Math.min(changeHistory.size(), MAX_FILTER_MENU_ENTRIES); for (int i= 0; i < length; i++) oldestFirstStack.push(((FilterDescriptor)changeHistory.pop()).getId()); length= Math.min(fLRUFilterIdsStack.size(), MAX_FILTER_MENU_ENTRIES - oldestFirstStack.size()); int NEWEST= 0; for (int i= 0; i < length; i++) { Object filter= fLRUFilterIdsStack.remove(NEWEST); if (!oldestFirstStack.contains(filter)) oldestFirstStack.push(filter); } fLRUFilterIdsStack= oldestFirstStack; } private boolean areUserDefinedPatternsEnabled() { return fUserDefinedPatternsEnabled; } private void setUserDefinedPatternsEnabled(boolean state) { fUserDefinedPatternsEnabled= state; } private void fillToolBar(IToolBarManager tooBar) { } /** * Fills the given view menu with the entries managed by the * group. * * @param viewMenu the menu to fill */ public void fillViewMenu(IMenuManager viewMenu) { /* * Don't change the separator group name. * Using this name ensures that other filters * get contributed to the same group. */ viewMenu.add(new Separator("filters")); //$NON-NLS-1$ viewMenu.add(new GroupMarker(RECENT_FILTERS_GROUP_NAME)); viewMenu.add(new ShowFilterDialogAction()); fMenuManager= viewMenu; fMenuListener= new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { removePreviousLRUFilterActions(manager); addLRUFilterActions(manager); } }; fMenuManager.addMenuListener(fMenuListener); } private void removePreviousLRUFilterActions(IMenuManager mm) { if (fFilterIdsUsedInLastViewMenu == null) return; for (int i= 0; i < fFilterIdsUsedInLastViewMenu.length; i++) mm.remove(fFilterIdsUsedInLastViewMenu[i]); } private void addLRUFilterActions(IMenuManager mm) { if (fLRUFilterIdsStack.isEmpty()) { fFilterIdsUsedInLastViewMenu= null; return; } SortedSet sortedFilters= new TreeSet(fLRUFilterIdsStack); String[] recentlyChangedFilterIds= (String[])sortedFilters.toArray(new String[sortedFilters.size()]); fFilterIdsUsedInLastViewMenu= new String[recentlyChangedFilterIds.length]; for (int i= 0; i < recentlyChangedFilterIds.length; i++) { String id= recentlyChangedFilterIds[i]; fFilterIdsUsedInLastViewMenu[i]= id; boolean state= fEnabledFilterIds.containsKey(id) && ((Boolean)fEnabledFilterIds.get(id)).booleanValue(); FilterDescriptor filterDesc= (FilterDescriptor)fFilterDescriptorMap.get(id); if (filterDesc != null) { IContributionItem item= new FilterActionMenuContributionItem(this, id, filterDesc.getName(), state, i+1); mm.insertBefore(RECENT_FILTERS_GROUP_NAME, item); } } } /* * Method declared on ActionGroup. */ public void dispose() { if (fMenuManager != null) fMenuManager.removeMenuListener(fMenuListener); fCachedFilterDescriptors= null; super.dispose(); } private void initializeWithPluginContributions() { fUserDefinedPatterns= new String[0]; fUserDefinedPatternsEnabled= false; FilterDescriptor[] filterDescs= getCachedFilterDescriptors(); fFilterDescriptorMap= new HashMap(filterDescs.length); fEnabledFilterIds= new HashMap(filterDescs.length); for (int i= 0; i < filterDescs.length; i++) { String id= filterDescs[i].getId(); Boolean isEnabled= new Boolean(filterDescs[i].isEnabled()); if (fEnabledFilterIds.containsKey(id)) RubyPlugin.logErrorMessage("WARNING: Duplicate id for extension-point \"org.eclipse.jdt.ui.javaElementFilters\""); //$NON-NLS-1$ fEnabledFilterIds.put(id, isEnabled); fFilterDescriptorMap.put(id, filterDescs[i]); } } // ---------- viewer filter handling ---------- private void installFilters() { fInstalledBuiltInFilters= new HashMap(fEnabledFilterIds.size()); fPatternFilter= new NamePatternFilter(); fPatternFilter.setPatterns(getUserAndBuiltInPatterns()); fViewer.addFilter(fPatternFilter); updateBuiltInFilters(); } private void updateViewerFilters(boolean refresh) { String[] patterns= getUserAndBuiltInPatterns(); fPatternFilter.setPatterns(patterns); fViewer.getControl().setRedraw(false); updateBuiltInFilters(); if (refresh) fViewer.refresh(); fViewer.getControl().setRedraw(true); } private void updateBuiltInFilters() { Set installedFilters= fInstalledBuiltInFilters.keySet(); Set filtersToAdd= new HashSet(fEnabledFilterIds.size()); Set filtersToRemove= new HashSet(fEnabledFilterIds.size()); Iterator iter= fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry= (Map.Entry)iter.next(); String id= (String)entry.getKey(); boolean isEnabled= ((Boolean)entry.getValue()).booleanValue(); if (isEnabled && !installedFilters.contains(id)) filtersToAdd.add(id); else if (!isEnabled && installedFilters.contains(id)) filtersToRemove.add(id); } // Install the filters FilterDescriptor[] filterDescs= getCachedFilterDescriptors(); for (int i= 0; i < filterDescs.length; i++) { String id= filterDescs[i].getId(); // just to double check - id should denote a custom filter anyway boolean isCustomFilter= filterDescs[i].isCustomFilter(); if (isCustomFilter) { if (filtersToAdd.contains(id)) { ViewerFilter filter= filterDescs[i].createViewerFilter(); if (filter != null) { fViewer.addFilter(filter); fInstalledBuiltInFilters.put(id, filter); } } if (filtersToRemove.contains(id)) { fViewer.removeFilter((ViewerFilter)fInstalledBuiltInFilters.get(id)); fInstalledBuiltInFilters.remove(id); } } } } private String[] getUserAndBuiltInPatterns() { List patterns= new ArrayList(fUserDefinedPatterns.length); if (areUserDefinedPatternsEnabled()) patterns.addAll(Arrays.asList(fUserDefinedPatterns)); FilterDescriptor[] filterDescs= getCachedFilterDescriptors(); for (int i= 0; i < filterDescs.length; i++) { String id= filterDescs[i].getId(); boolean isPatternFilter= filterDescs[i].isPatternFilter(); Object isEnabled= fEnabledFilterIds.get(id); if (isEnabled != null && isPatternFilter && ((Boolean)isEnabled).booleanValue()) patterns.add(filterDescs[i].getPattern()); } return (String[])patterns.toArray(new String[patterns.size()]); } // ---------- view kind/defaults persistency ---------- private void initializeWithViewDefaults() { // get default values for view IPreferenceStore store= RubyPlugin.getDefault().getPreferenceStore(); // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=22533 if (!store.contains(getPreferenceKey("TAG_DUMMY_TO_TEST_EXISTENCE")))//$NON-NLS-1$ return; fUserDefinedPatternsEnabled= store.getBoolean(getPreferenceKey(TAG_USER_DEFINED_PATTERNS_ENABLED)); setUserDefinedPatterns(CustomFiltersDialog.convertFromString(store.getString(getPreferenceKey(TAG_USER_DEFINED_PATTERNS)), SEPARATOR)); Iterator iter= fEnabledFilterIds.keySet().iterator(); while (iter.hasNext()) { String id= (String)iter.next(); Boolean isEnabled= new Boolean(store.getBoolean(id)); fEnabledFilterIds.put(id, isEnabled); } fLRUFilterIdsStack.clear(); String lruFilterIds= store.getString(TAG_LRU_FILTERS); StringTokenizer tokenizer= new StringTokenizer(lruFilterIds, SEPARATOR); while (tokenizer.hasMoreTokens()) { String id= tokenizer.nextToken(); if (fFilterDescriptorMap.containsKey(id) && !fLRUFilterIdsStack.contains(id)) fLRUFilterIdsStack.push(id); } } private void storeViewDefaults() { // get default values for view IPreferenceStore store= RubyPlugin.getDefault().getPreferenceStore(); // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=22533 store.setValue(getPreferenceKey("TAG_DUMMY_TO_TEST_EXISTENCE"), "storedViewPreferences");//$NON-NLS-1$//$NON-NLS-2$ store.setValue(getPreferenceKey(TAG_USER_DEFINED_PATTERNS_ENABLED), fUserDefinedPatternsEnabled); store.setValue(getPreferenceKey(TAG_USER_DEFINED_PATTERNS), CustomFiltersDialog.convertToString(fUserDefinedPatterns ,SEPARATOR)); Iterator iter= fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry= (Map.Entry)iter.next(); String id= (String)entry.getKey(); boolean isEnabled= ((Boolean)entry.getValue()).booleanValue(); store.setValue(id, isEnabled); } StringBuffer buf= new StringBuffer(fLRUFilterIdsStack.size() * 20); iter= fLRUFilterIdsStack.iterator(); while (iter.hasNext()) { buf.append((String)iter.next()); buf.append(SEPARATOR); } store.setValue(TAG_LRU_FILTERS, buf.toString()); } private String getPreferenceKey(String tag) { return "CustomFiltersActionGroup." + fTargetId + '.' + tag; //$NON-NLS-1$ } // ---------- view instance persistency ---------- /** * Saves the state of the custom filters in a memento. * * @param memento the memento into which the state is saved */ public void saveState(IMemento memento) { IMemento customFilters= memento.createChild(TAG_CUSTOM_FILTERS); customFilters.putString(TAG_USER_DEFINED_PATTERNS_ENABLED, new Boolean(fUserDefinedPatternsEnabled).toString()); saveUserDefinedPatterns(customFilters); saveXmlDefinedFilters(customFilters); saveLRUFilters(customFilters); } private void saveXmlDefinedFilters(IMemento memento) { if(fEnabledFilterIds != null && !fEnabledFilterIds.isEmpty()) { IMemento xmlDefinedFilters= memento.createChild(TAG_XML_DEFINED_FILTERS); Iterator iter= fEnabledFilterIds.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry= (Map.Entry)iter.next(); String id= (String)entry.getKey(); Boolean isEnabled= (Boolean)entry.getValue(); IMemento child= xmlDefinedFilters.createChild(TAG_CHILD); child.putString(TAG_FILTER_ID, id); child.putString(TAG_IS_ENABLED, isEnabled.toString()); } } } /** * Stores the last recently used filter Ids into * the given memento * * @param memento the memento into which to store the LRU filter Ids * @since 3.0 */ private void saveLRUFilters(IMemento memento) { if(fLRUFilterIdsStack != null && !fLRUFilterIdsStack.isEmpty()) { IMemento lruFilters= memento.createChild(TAG_LRU_FILTERS); Iterator iter= fLRUFilterIdsStack.iterator(); while (iter.hasNext()) { String id= (String)iter.next(); IMemento child= lruFilters.createChild(TAG_CHILD); child.putString(TAG_FILTER_ID, id); } } } private void saveUserDefinedPatterns(IMemento memento) { if(fUserDefinedPatterns != null && fUserDefinedPatterns.length > 0) { IMemento userDefinedPatterns= memento.createChild(TAG_USER_DEFINED_PATTERNS); for (int i= 0; i < fUserDefinedPatterns.length; i++) { IMemento child= userDefinedPatterns.createChild(TAG_CHILD); child.putString(TAG_PATTERN, fUserDefinedPatterns[i]); } } } /** * Restores the state of the filter actions from a memento. * <p> * Note: This method does not refresh the viewer. * </p> * * @param memento the memento from which the state is restored */ public void restoreState(IMemento memento) { if (memento == null) return; IMemento customFilters= memento.getChild(TAG_CUSTOM_FILTERS); if (customFilters == null) return; String userDefinedPatternsEnabled= customFilters.getString(TAG_USER_DEFINED_PATTERNS_ENABLED); if (userDefinedPatternsEnabled == null) return; fUserDefinedPatternsEnabled= Boolean.valueOf(userDefinedPatternsEnabled).booleanValue(); restoreUserDefinedPatterns(customFilters); restoreXmlDefinedFilters(customFilters); restoreLRUFilters(customFilters); updateViewerFilters(false); } private void restoreUserDefinedPatterns(IMemento memento) { IMemento userDefinedPatterns= memento.getChild(TAG_USER_DEFINED_PATTERNS); if(userDefinedPatterns != null) { IMemento children[]= userDefinedPatterns.getChildren(TAG_CHILD); String[] patterns= new String[children.length]; for (int i = 0; i < children.length; i++) patterns[i]= children[i].getString(TAG_PATTERN); setUserDefinedPatterns(patterns); } else setUserDefinedPatterns(new String[0]); } private void restoreXmlDefinedFilters(IMemento memento) { IMemento xmlDefinedFilters= memento.getChild(TAG_XML_DEFINED_FILTERS); if(xmlDefinedFilters != null) { IMemento[] children= xmlDefinedFilters.getChildren(TAG_CHILD); for (int i= 0; i < children.length; i++) { String id= children[i].getString(TAG_FILTER_ID); Boolean isEnabled= new Boolean(children[i].getString(TAG_IS_ENABLED)); fEnabledFilterIds.put(id, isEnabled); } } } private void restoreLRUFilters(IMemento memento) { IMemento lruFilters= memento.getChild(TAG_LRU_FILTERS); fLRUFilterIdsStack.clear(); if(lruFilters != null) { IMemento[] children= lruFilters.getChildren(TAG_CHILD); for (int i= 0; i < children.length; i++) { String id= children[i].getString(TAG_FILTER_ID); if (fFilterDescriptorMap.containsKey(id) && !fLRUFilterIdsStack.contains(id)) fLRUFilterIdsStack.push(id); } } } private void cleanUpPatternDuplicates() { if (!areUserDefinedPatternsEnabled()) return; List userDefinedPatterns= new ArrayList(Arrays.asList(fUserDefinedPatterns)); FilterDescriptor[] filters= getCachedFilterDescriptors(); for (int i= 0; i < filters.length; i++) { if (filters[i].isPatternFilter()) { String pattern= filters[i].getPattern(); if (userDefinedPatterns.contains(pattern)) { fEnabledFilterIds.put(filters[i].getId(), Boolean.TRUE); boolean hasMore= true; while (hasMore) hasMore= userDefinedPatterns.remove(pattern); } } } fUserDefinedPatterns= (String[])userDefinedPatterns.toArray(new String[userDefinedPatterns.size()]); setUserDefinedPatternsEnabled(fUserDefinedPatternsEnabled && fUserDefinedPatterns.length > 0); } private FilterDescriptor[] getCachedFilterDescriptors() { if (fCachedFilterDescriptors == null) fCachedFilterDescriptors= FilterDescriptor.getFilterDescriptors(fTargetId); return fCachedFilterDescriptors; } // ---------- dialog related code ---------- private void openDialog() { CustomFiltersDialog dialog= new CustomFiltersDialog( fViewer.getControl().getShell(), fTargetId, areUserDefinedPatternsEnabled(), fUserDefinedPatterns, internalGetEnabledFilterIds()); if (dialog.open() == Window.OK) { setEnabledFilterIds(dialog.getEnabledFilterIds()); setUserDefinedPatternsEnabled(dialog.areUserDefinedPatternsEnabled()); setUserDefinedPatterns(dialog.getUserDefinedPatterns()); setRecentlyChangedFilters(dialog.getFilterDescriptorChangeHistory()); storeViewDefaults(); updateViewerFilters(true); } } } --- NEW FILE: MemberFilterActionGroup.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.ui.actions; import java.util.ArrayList; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IMemento; import org.eclipse.ui.actions.ActionGroup; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.actions.ActionMessages; import org.rubypeople.rdt.internal.ui.viewsupport.MemberFilter; import org.rubypeople.rdt.internal.ui.viewsupport.MemberFilterAction; import org.rubypeople.rdt.ui.PreferenceConstants; /** * Action Group that contributes filter buttons for a view parts showing * methods and fields. Contributed filters are: hide fields, hide static * members hide non-public members and hide local types. * <p> * The action group installs a filter on a structured viewer. The filter is connected * to the actions installed in the view part's toolbar menu and is updated when the * state of the buttons changes. * * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> * * @since 2.0 */ public class MemberFilterActionGroup extends ActionGroup { public static final int FILTER_NONPUBLIC= MemberFilter.FILTER_NONPUBLIC; public static final int FILTER_STATIC= MemberFilter.FILTER_STATIC; public static final int FILTER_FIELDS= MemberFilter.FILTER_FIELDS; /** @since 3.0 */ public static final int FILTER_LOCALTYPES= MemberFilter.FILTER_LOCALTYPES; /** @since 3.0 */ public static final int ALL_FILTERS= FILTER_NONPUBLIC | FILTER_FIELDS | FILTER_STATIC | FILTER_LOCALTYPES; private static final String TAG_HIDEFIELDS= "hidefields"; //$NON-NLS-1$ private static final String TAG_HIDESTATIC= "hidestatic"; //$NON-NLS-1$ private static final String TAG_HIDENONPUBLIC= "hidenonpublic"; //$NON-NLS-1$ private static final String TAG_HIDELOCALTYPES= "hidelocaltypes"; //$NON-NLS-1$ private MemberFilterAction[] fFilterActions; private MemberFilter fFilter; private StructuredViewer fViewer; private String fViewerId; private boolean fInViewMenu; /** * Creates a new <code>MemberFilterActionGroup</code>. * * @param viewer the viewer to be filtered * @param viewerId a unique id of the viewer. Used as a key to to store * the last used filter settings in the preference store */ public MemberFilterActionGroup(StructuredViewer viewer, String viewerId) { this(viewer, viewerId, false); } /** * Creates a new <code>MemberFilterActionGroup</code>. * * @param viewer the viewer to be filtered * @param viewerId a unique id of the viewer. Used as a key to to store * the last used filter settings in the preference store * @param inViewMenu if <code>true</code> the actions are added to the view * menu. If <code>false</code> they are added to the toolbar. * * @since 2.1 */ public MemberFilterActionGroup(StructuredViewer viewer, String viewerId, boolean inViewMenu) { this(viewer, viewerId, inViewMenu, ALL_FILTERS); } /** * Creates a new <code>MemberFilterActionGroup</code>. * * @param viewer the viewer to be filtered * @param viewerId a unique id of the viewer. Used as a key to to store * the last used filter settings in the preference store * @param inViewMenu if <code>true</code> the actions are added to the view * menu. If <code>false</code> they are added to the toolbar. * @param availableFilters Specifies which filter action should be contained. <code>FILTER_NONPUBLIC</code>, * <code>FILTER_STATIC</code>, <code>FILTER_FIELDS</code> and <code>FILTER_LOCALTYPES</code> * or a combination of these constants are possible values. Use <code>ALL_FILTERS</code> to select all available filters. * * @since 3.0 */ public MemberFilterActionGroup(StructuredViewer viewer, String viewerId, boolean inViewMenu, int availableFilters) { fViewer= viewer; fViewerId= viewerId; fInViewMenu= inViewMenu; IPreferenceStore store= PreferenceConstants.getPreferenceStore(); fFilter= new MemberFilter(); String title, helpContext; ArrayList actions= new ArrayList(4); // fields int filterProperty= FILTER_FIELDS; if (isSet(filterProperty, availableFilters)) { boolean filterEnabled= store.getBoolean(getPreferenceKey(filterProperty)); if (filterEnabled) { fFilter.addFilter(filterProperty); } title= ActionMessages.MemberFilterActionGroup_hide_fields_label; helpContext= IRubyHelpContextIds.FILTER_FIELDS_ACTION; MemberFilterAction hideFields= new MemberFilterAction(this, title, filterProperty, helpContext, filterEnabled); hideFields.setDescription(ActionMessages.MemberFilterActionGroup_hide_fields_description); hideFields.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_fields_tooltip); RubyPluginImages.setLocalImageDescriptors(hideFields, "fields_co.gif"); //$NON-NLS-1$ actions.add(hideFields); } // static filterProperty= FILTER_STATIC; if (isSet(filterProperty, availableFilters)) { boolean filterEnabled= store.getBoolean(getPreferenceKey(filterProperty)); if (filterEnabled) { fFilter.addFilter(filterProperty); } title= ActionMessages.MemberFilterActionGroup_hide_static_label; helpContext= IRubyHelpContextIds.FILTER_STATIC_ACTION; MemberFilterAction hideStatic= new MemberFilterAction(this, title, FILTER_STATIC, helpContext, filterEnabled); hideStatic.setDescription(ActionMessages.MemberFilterActionGroup_hide_static_description); hideStatic.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_static_tooltip); RubyPluginImages.setLocalImageDescriptors(hideStatic, "static_co.gif"); //$NON-NLS-1$ actions.add(hideStatic); } // non-public filterProperty= FILTER_NONPUBLIC; if (isSet(filterProperty, availableFilters)) { boolean filterEnabled= store.getBoolean(getPreferenceKey(filterProperty)); if (filterEnabled) { fFilter.addFilter(filterProperty); } title= ActionMessages.MemberFilterActionGroup_hide_nonpublic_label; helpContext= IRubyHelpContextIds.FILTER_PUBLIC_ACTION; MemberFilterAction hideNonPublic= new MemberFilterAction(this, title, filterProperty, helpContext, filterEnabled); hideNonPublic.setDescription(ActionMessages.MemberFilterActionGroup_hide_nonpublic_description); hideNonPublic.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_nonpublic_tooltip); RubyPluginImages.setLocalImageDescriptors(hideNonPublic, "public_co.gif"); //$NON-NLS-1$ actions.add(hideNonPublic); } // local types filterProperty= FILTER_LOCALTYPES; if (isSet(filterProperty, availableFilters)) { boolean filterEnabled= store.getBoolean(getPreferenceKey(filterProperty)); if (filterEnabled) { fFilter.addFilter(filterProperty); } title= ActionMessages.MemberFilterActionGroup_hide_localtypes_label; helpContext= IRubyHelpContextIds.FILTER_LOCALTYPES_ACTION; MemberFilterAction hideLocalTypes= new MemberFilterAction(this, title, filterProperty, helpContext, filterEnabled); hideLocalTypes.setDescription(ActionMessages.MemberFilterActionGroup_hide_localtypes_description); hideLocalTypes.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_localtypes_tooltip); RubyPluginImages.setLocalImageDescriptors(hideLocalTypes, "localtypes_co.gif"); //$NON-NLS-1$ actions.add(hideLocalTypes); } // order corresponds to order in toolbar fFilterActions= (MemberFilterAction[]) actions.toArray(new MemberFilterAction[actions.size()]); fViewer.addFilter(fFilter); } private String getPreferenceKey(int filterProperty) { return "MemberFilterActionGroup." + fViewerId + '.' + String.valueOf(filterProperty); //$NON-NLS-1$ } /** * Sets the member filters. * * @param filterProperty the filter to be manipulated. Valid values are <code>FILTER_FIELDS</code>, * <code>FILTER_PUBLIC</code> <code>FILTER_PRIVATE</code> and <code>FILTER_LOCALTYPES_ACTION</code> * as defined by this action group * @param set if <code>true</code> the given filter is installed. If <code>false</code> the * given filter is removed * . */ public void setMemberFilter(int filterProperty, boolean set) { setMemberFilters(new int[] {filterProperty}, new boolean[] {set}, true); } private void setMemberFilters(int[] propertyKeys, boolean[] propertyValues, boolean refresh) { if (propertyKeys.length == 0) return; Assert.isTrue(propertyKeys.length == propertyValues.length); for (int i= 0; i < propertyKeys.length; i++) { int filterProperty= propertyKeys[i]; boolean set= propertyValues[i]; IPreferenceStore store= RubyPlugin.getDefault().getPreferenceStore(); boolean found= false; for (int j= 0; j < fFilterActions.length; j++) { int currProperty= fFilterActions[j].getFilterProperty(); if (currProperty == filterProperty) { fFilterActions[j].setChecked(set); found= true; store.setValue(getPreferenceKey(filterProperty), set); } } if (found) { if (set) { fFilter.addFilter(filterProperty); } else { fFilter.removeFilter(filterProperty); } } } if (refresh) { fViewer.getControl().setRedraw(false); BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() { public void run() { fViewer.refresh(); } }); fViewer.getControl().setRedraw(true); } } private boolean isSet(int flag, int set) { return (flag & set) != 0; } /** * Returns <code>true</code> if the given filter is installed. * * @param filterProperty the filter to be tested. Valid values are <code>FILTER_FIELDS</code>, * <code>FILTER_PUBLIC</code>, <code>FILTER_PRIVATE</code> and <code>FILTER_LOCALTYPES</code> as defined by this action * group */ public boolean hasMemberFilter(int filterProperty) { return fFilter.hasFilter(filterProperty); } /** * Saves the state of the filter actions in a memento. * * @param memento the memento to which the state is saved */ public void saveState(IMemento memento) { memento.putString(TAG_HIDEFIELDS, String.valueOf(hasMemberFilter(FILTER_FIELDS))); memento.putString(TAG_HIDESTATIC, String.valueOf(hasMemberFilter(FILTER_STATIC))); memento.putString(TAG_HIDENONPUBLIC, String.valueOf(hasMemberFilter(FILTER_NONPUBLIC))); memento.putString(TAG_HIDELOCALTYPES, String.valueOf(hasMemberFilter(FILTER_LOCALTYPES))); } /** * Restores the state of the filter actions from a memento. * <p> * Note: This method does not refresh the viewer. * </p> * @param memento the memento from which the state is restored */ public void restoreState(IMemento memento) { setMemberFilters( new int[] {FILTER_FIELDS, FILTER_STATIC, FILTER_NONPUBLIC, FILTER_LOCALTYPES}, new boolean[] { Boolean.valueOf(memento.getString(TAG_HIDEFIELDS)).booleanValue(), Boolean.valueOf(memento.getString(TAG_HIDESTATIC)).booleanValue(), Boolean.valueOf(memento.getString(TAG_HIDENONPUBLIC)).booleanValue(), Boolean.valueOf(memento.getString(TAG_HIDELOCALTYPES)).booleanValue() }, false); } /* (non-Rubydoc) * @see ActionGroup#fillActionBars(IActionBars) */ public void fillActionBars(IActionBars actionBars) { contributeToToolBar(actionBars.getToolBarManager()); } /** * Adds the filter actions to the given tool bar * * @param tbm the tool bar to which the actions are added */ public void contributeToToolBar(IToolBarManager tbm) { if (fInViewMenu) return; for (int i= 0; i < fFilterActions.length; i++) { tbm.add(fFilterActions[i]); } } /** * Adds the filter actions to the given menu manager. * * @param menu the menu manager to which the actions are added * @since 2.1 */ public void contributeToViewMenu(IMenuManager menu) { if (!fInViewMenu) return; final String filters= "filters"; //$NON-NLS-1$ if (menu.find(filters) != null) { for (int i= 0; i < fFilterActions.length; i++) { menu.prependToGroup(filters, fFilterActions[i]); } } else { for (int i= 0; i < fFilterActions.length; i++) { menu.add(fFilterActions[i]); } } } /* (non-Javadoc) * @see ActionGroup#dispose() */ public void dispose() { super.dispose(); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:56:15
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11958/src/org/rubypeople/rdt/ui/actions Modified Files: IRubyEditorActionDefinitionIds.java Log Message: new action to surround selected text with a begin...rescue block Index: IRubyEditorActionDefinitionIds.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/IRubyEditorActionDefinitionIds.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IRubyEditorActionDefinitionIds.java 12 Mar 2005 16:51:24 -0000 1.2 --- IRubyEditorActionDefinitionIds.java 10 Feb 2006 19:56:08 -0000 1.3 *************** *** 33,35 **** --- 33,37 ---- public static final String SHOW_RDOC= "org.rubypeople.rdt.ui.edit.text.ruby.show.rdoc"; //$NON-NLS-1$ + public static final String SURROUND_WITH_BEGIN_RESCUE = "org.rubypeople.rdt.ui.edit.text.ruby.surround.with.begin.rescue"; //$NON-NLS-1$ + } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:56:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11825/src/org/rubypeople/rdt/ui/actions Modified Files: RubyActionGroup.java Added Files: SurroundWithBeginRescueAction.java SelectionDispatchAction.java Log Message: new action to surround selected text with a begin...rescue block --- NEW FILE: SurroundWithBeginRescueAction.java --- package org.rubypeople.rdt.ui.actions; import java.util.Map; import org.eclipse.core.filebuffers.FileBuffers; import org.eclipse.core.filebuffers.ITextFileBufferManager; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextSelection; import org.eclipse.ui.PlatformUI; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.core.formatter.Indents; import org.rubypeople.rdt.internal.corext.util.RubyModelUtil; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.actions.SelectionConverter; import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor; import org.rubypeople.rdt.internal.ui.util.ExceptionHandler; public class SurroundWithBeginRescueAction extends SelectionDispatchAction { private RubyEditor fEditor; /** * Note: This constructor is for internal use only. Clients should not call * this constructor. * * @param editor * the compilation unit editor */ public SurroundWithBeginRescueAction(RubyEditor editor) { super(editor.getEditorSite()); setText("Surround with begin...rescue"); fEditor = editor; setEnabled((fEditor != null && SelectionConverter.getInputAsRubyScript(fEditor) != null)); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.SURROUND_WITH_TRY_CATCH_ACTION); } public void run(ITextSelection selection) { try { createChange(selection, new NullProgressMonitor()); } catch (CoreException e) { // FIXME Localize! Extract into ResourceBundle ExceptionHandler.handle(e, getDialogTitle(), "Error occurred while surrounding code with begin..rescue block"); } } private static String getDialogTitle() { // FIXME Localize! Extract into ResourceBundle return "Surround with begin...rescue"; } private IFile getFile() { IRubyScript cu = getRubyScript(); return (IFile) RubyModelUtil.toOriginal(cu).getResource(); } private IRubyScript getRubyScript() { return SelectionConverter.getInputAsRubyScript(fEditor); } /* * non Java-doc * * @see IRefactoring#createChange(IProgressMonitor) */ public void createChange(ITextSelection selection, IProgressMonitor pm) throws CoreException { final String NN = ""; //$NON-NLS-1$ if (pm == null) pm = new NullProgressMonitor(); pm.beginTask(NN, 2); // This is cheap since the compilation unit is already open in a editor. IPath path = getFile().getFullPath(); ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager(); try { bufferManager.connect(path, new SubProgressMonitor(pm, 1)); IDocument document = bufferManager.getTextFileBuffer(path).getDocument(); String text = createBeginRescueBlock(document, selection); document.replace(selection.getOffset(), selection.getLength(), text); } catch (BadLocationException e) { throw new CoreException(new Status(IStatus.ERROR, RubyPlugin.getPluginId(), IStatus.ERROR, e.getMessage(), e)); } finally { bufferManager.disconnect(path, new SubProgressMonitor(pm, 1)); pm.done(); } } private String createBeginRescueBlock(IDocument document, ITextSelection selection) throws BadLocationException, RubyModelException { String originalText = selection.getText(); String lineDelimiter = document.getLineDelimiter(0); Map options = getRubyScript().getRubyProject().getOptions(true); int lineNumber = selection.getStartLine(); String line = document.get(document.getLineOffset(lineNumber), document .getLineLength(lineNumber)); int indentationUnits = Indents.measureIndentUnits(line, Indents.getTabWidth(options), Indents.getIndentWidth(options)); StringBuffer text = new StringBuffer(); text.append("begin"); text.append(lineDelimiter); text.append(Indents.createIndentString(indentationUnits + 1, options)); text.append(originalText); text.append(lineDelimiter); text.append(Indents.createIndentString(indentationUnits, options)); text.append("rescue StandardError => e"); text.append(lineDelimiter); text.append(Indents.createIndentString(indentationUnits + 1, options)); text.append("puts e"); text.append(lineDelimiter); text.append(Indents.createIndentString(indentationUnits, options)); text.append("end"); text.append(lineDelimiter); text.append(Indents.createIndentString(indentationUnits, options)); return text.toString(); } public void selectionChanged(ITextSelection selection) { setEnabled(selection.getLength() > 0 && (fEditor != null && SelectionConverter.getInputAsRubyScript(fEditor) != null)); } } --- NEW FILE: SelectionDispatchAction.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.ui.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchSite; /** * Action that dispatches the <code>IAction#run()</code> and the * <code>ISelectionChangedListener#selectionChanged</code> * according to the type of the selection. * * <ul> * <li>if selection is of type <code>ITextSelection</code> then * <code>run(ITextSelection)</code> and <code>selectionChanged(ITextSelection)</code> * is called.</li> * <li>if selection is of type <code>IStructuredSelection</code> then * <code>run(IStructuredSelection)</code> and <code> * selectionChanged(IStructuredSelection)</code> is called.</li> * <li>default is to call <code>run(ISelection)</code> and <code> * selectionChanged(ISelection)</code>.</li> * </ul> * * <p> * Note: This class is not intended to be subclassed outside the JDT UI plug-in. * </p> * * @since 2.0 */ public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener { private IWorkbenchSite fSite; private ISelectionProvider fExtraSelectionProvider; /** * Creates a new action with no text and no image. * <p> * Configure the action later using the set methods. * </p> * * @param site the site this action is working on */ protected SelectionDispatchAction(IWorkbenchSite site) { Assert.isNotNull(site); fSite= site; fExtraSelectionProvider= null; } /** * Creates a new action with no text and no image * * <p> * Configure the action later using the set methods. * </p> * * @param site the site this action is working on * @param provider a special selection provider which is used * instead of the site's selection provider. * * @since 3.2 */ protected SelectionDispatchAction(IWorkbenchSite site, ISelectionProvider provider) { Assert.isNotNull(site); Assert.isNotNull(provider); fSite= site; fExtraSelectionProvider= provider; } /** * Returns the site owning this action. * * @return the site owning this action */ public IWorkbenchSite getSite() { return fSite; } /** * Returns the selection provided by the site owning this action. * * @return the site's selection */ public ISelection getSelection() { if (getSelectionProvider() != null) return getSelectionProvider().getSelection(); else return null; } /** * Returns the shell provided by the site owning this action. * * @return the site's shell */ public Shell getShell() { return fSite.getShell(); } /** * Returns the selection provider managed by the site owning this action or the selection provider explicitly set in * {@link #SelectionDispatchAction(IWorkbenchSite, ISelectionProvider)}. * * @return the site's selection provider */ public ISelectionProvider getSelectionProvider() { if (fExtraSelectionProvider != null) { return fExtraSelectionProvider; } return fSite.getSelectionProvider(); } /** * Updates the action's enablement state according to the given selection. This * default implementation calls one of the <code>selectionChanged</code> * methods depending on the type of the passed selection. * * @param selection the selection this action is working on */ public void update(ISelection selection) { dispatchSelectionChanged(selection); } /** * Notifies this action that the given structured selection has changed. This default * implementation calls <code>selectionChanged(ISelection selection)</code>. * * @param selection the new selection */ public void selectionChanged(IStructuredSelection selection) { selectionChanged((ISelection)selection); } /** * Executes this actions with the given structured selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(IStructuredSelection selection) { run((ISelection)selection); } /** * Notifies this action that the given text selection has changed. This default * implementation calls <code>selectionChanged(ISelection selection)</code>. * * @param selection the new selection */ public void selectionChanged(ITextSelection selection) { selectionChanged((ISelection)selection); } /** * Executes this actions with the given text selection. This default implementation * calls <code>run(ISelection selection)</code>. * * @param selection the selection */ public void run(ITextSelection selection) { run((ISelection)selection); } /** * Notifies this action that the given selection has changed. This default * implementation sets the action's enablement state to <code>false</code>. * * @param selection the new selection */ public void selectionChanged(ISelection selection) { setEnabled(false); } /** * Executes this actions with the given selection. This default implementation * does nothing. * * @param selection the selection */ public void run(ISelection selection) { } /* (non-Javadoc) * Method declared on IAction. */ public void run() { dispatchRun(getSelection()); } /* (non-Javadoc) * Method declared on ISelectionChangedListener. */ public void selectionChanged(SelectionChangedEvent event) { dispatchSelectionChanged(event.getSelection()); } private void dispatchSelectionChanged(ISelection selection) { if (selection instanceof IStructuredSelection) { selectionChanged((IStructuredSelection)selection); } else if (selection instanceof ITextSelection) { selectionChanged((ITextSelection)selection); } else { selectionChanged(selection); } } private void dispatchRun(ISelection selection) { if (selection instanceof IStructuredSelection) { run((IStructuredSelection)selection); } else if (selection instanceof ITextSelection) { run((ITextSelection)selection); } else { run(selection); } } } Index: RubyActionGroup.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RubyActionGroup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyActionGroup.java 12 Mar 2005 16:51:24 -0000 1.3 --- RubyActionGroup.java 10 Feb 2006 19:55:56 -0000 1.4 *************** *** 18,21 **** --- 18,22 ---- menu.add(editor.getAction("ToggleComment")); + menu.add(editor.getAction("SurroundWithBeginRescue")); menu.add(editor.getAction("Comment")); menu.add(editor.getAction("Uncomment")); |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:55:31
|
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-serv11575/src/org/rubypeople/rdt/internal/ui/text/folding Modified Files: DefaultRubyFoldingStructureProvider.java Log Message: remove reference to IRubyElement.SINGLETON_METHOD 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.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DefaultRubyFoldingStructureProvider.java 13 Dec 2005 20:02:03 -0000 1.5 --- DefaultRubyFoldingStructureProvider.java 10 Feb 2006 19:55:23 -0000 1.6 *************** *** 192,196 **** break; case IRubyElement.METHOD: - case IRubyElement.SINGLETON_METHOD: collapse = fAllowCollapsing && fCollapseMethods; createProjection = true; --- 192,195 ---- |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:55:05
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11297/src/org/rubypeople/rdt/ui Modified Files: RubyElementLabelProvider.java RubyElementSorter.java Added Files: RubyElementLabels.java RubyElementImageDescriptor.java Log Message: new UI classes for element labels and images Index: RubyElementLabelProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabelProvider.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RubyElementLabelProvider.java 7 Sep 2005 22:02:33 -0000 1.7 --- RubyElementLabelProvider.java 10 Feb 2006 19:54:54 -0000 1.8 *************** *** 1,119 **** package org.rubypeople.rdt.ui; ! import org.eclipse.jface.viewers.ILabelProvider; ! import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.swt.graphics.Image; ! import org.jruby.lexer.yacc.SyntaxException; ! import org.rubypeople.rdt.core.IRubyElement; ! import org.rubypeople.rdt.core.IMethod; ! import org.rubypeople.rdt.core.IType; ! import org.rubypeople.rdt.core.RubyModelException; ! import org.rubypeople.rdt.internal.ui.RubyPluginImages; ! import org.rubypeople.rdt.internal.ui.RubyPlugin; ! public class RubyElementLabelProvider implements ILabelProvider { ! /** ! * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) ! */ ! public Image getImage(Object object) { ! if (object == null) { ! log("Attempting to get Image for null object"); ! return RubyPluginImages.get(RubyPluginImages.IMG_OBJS_ERROR); ! } ! if (object instanceof IRubyElement) { ! IRubyElement rubyElement = (IRubyElement) object; ! if (rubyElement.isType(IRubyElement.IMPORT_CONTAINER)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_IMPORT_CONTAINER); ! if (rubyElement.isType(IRubyElement.GLOBAL)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_GLOBAL); ! if (rubyElement.isType(IRubyElement.CONSTANT)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_CONSTANT); ! if (rubyElement.isType(IRubyElement.CLASS_VAR)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_CLASS_VAR); ! if (rubyElement.isType(IRubyElement.LOCAL_VAR)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_LOCAL_VAR); ! if (rubyElement.isType(IRubyElement.IMPORT)) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_IMPORT); ! if (rubyElement.isType(IRubyElement.SINGLETON_METHOD)) { ! IMethod method = (IMethod) rubyElement; ! try { ! if (method.getVisibility() == IMethod.PUBLIC) { return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_SINGLETONMETHOD_PUB); } ! if (method.getVisibility() == IMethod.PROTECTED) { return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_SINGLETONMETHOD_PRO); } ! } catch (RubyModelException e) { ! RubyPlugin.log(e); ! } ! // assume it's private ! return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_SINGLETONMETHOD); ! } ! if (rubyElement.isType(IRubyElement.METHOD)) { ! IMethod method = (IMethod) rubyElement; ! try { ! if (method.getVisibility() == IMethod.PUBLIC) { return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBYMETHOD_PUB); } ! if (method.getVisibility() == IMethod.PROTECTED) { return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBYMETHOD_PRO); } ! } catch (RubyModelException e) { ! RubyPlugin.log(e); ! } ! // assume it's private ! return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_METHOD); ! } ! if (rubyElement.isType(IRubyElement.INSTANCE_VAR)) { ! // FIXME Transition to showing the methods that attr adds! Rather than saying these variables are read/write ! return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_INSTANCE_VAR); ! } ! if (rubyElement.isType(IRubyElement.TYPE)) { ! IType rubyType = (IType) rubyElement; ! if(rubyType.isClass()) return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_CLASS); ! return RubyPluginImages.get(RubyPluginImages.IMG_CTOOLS_RUBY_MODULE); ! } ! } ! if (object instanceof SyntaxException) { ! return RubyPluginImages.get(RubyPluginImages.IMG_OBJS_ERROR); ! } ! log("Attempting to get Image for unknown object: " + object); ! return RubyPluginImages.get(RubyPluginImages.IMG_OBJS_ERROR); ! } ! /** ! * @param string ! */ ! protected void log(String string) { ! RubyPlugin.log(string); ! } ! /** ! * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) ! */ ! public String getText(Object obj) { ! if (obj instanceof IRubyElement) return ((IRubyElement) obj).getElementName(); ! if (obj instanceof SyntaxException) { ! SyntaxException syntaxException = (SyntaxException) obj ; ! StringBuffer sb = new StringBuffer() ; ! sb.append("Line ") ; ! sb.append(syntaxException.getPosition().getStartLine()) ; ! sb.append(": ") ; ! sb.append(syntaxException.getMessage()) ; ! return sb.toString() ; ! } ! return "Invalid object: " + obj.getClass().getName(); ! } ! /** ! * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) ! */ ! public void addListener(ILabelProviderListener arg0) {} ! /** ! * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() ! */ ! public void dispose() {} ! /** ! * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, ! * java.lang.String) ! */ ! public boolean isLabelProperty(Object arg0, String arg1) { ! return false; ! } ! /** ! * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) ! */ ! public void removeListener(ILabelProviderListener arg0) {} } --- 1,197 ---- package org.rubypeople.rdt.ui; ! import org.eclipse.core.resources.IStorage; ! import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; ! import org.rubypeople.rdt.internal.ui.viewsupport.RubyElementImageProvider; ! import org.rubypeople.rdt.internal.ui.viewsupport.StorageLabelProvider; ! public class RubyElementLabelProvider extends LabelProvider { ! /** ! * Flag (bit mask) indicating that the label should include overlay icons ! * for element type and modifiers. ! */ ! public final static int SHOW_OVERLAY_ICONS = 0x002; ! /** ! * Flag (bit mask) indicating that the label should include the name of the ! * package fragment root (appended). ! */ ! public final static int SHOW_ROOT = 0x004; ! /** ! * Flag (bit mask) indicating that the label should show the icons with no ! * space reserved for overlays. ! */ ! public final static int SHOW_SMALL_ICONS = 0x008; ! /** ! * Flag (bit mask) indicating that the package fragment roots from class ! * path variables should be rendered with the variable in the name ! */ ! public final static int SHOW_VARIABLE = 0x010; ! /** ! * Flag (bit mask) indicating that compilation units, class files, types, ! * declarations and members should be rendered qualified. Examples: ! * <code>java.lang.String</code>, <code>java.util.Vector.size()</code> ! * ! * @since 2.0 ! */ ! public final static int SHOW_QUALIFIED = 0x020; ! /** ! * Flag (bit mask) indicating that compilation units, class files, types, ! * declarations and members should be rendered qualified.The qualification ! * is appended. Examples: <code>String - java.lang</code>, ! * <code>size() - java.util.Vector</code> ! * ! * @since 2.0 ! */ ! public final static int SHOW_POST_QUALIFIED = 0x040; ! /** ! * Constant (value <code>0</code>) indicating that the label should show ! * the basic images only. ! */ ! public final static int SHOW_BASICS = 0x000; ! /** ! * Constant indicating the default label rendering. Currently the default is ! * equivalent to <code>SHOW_OVERLAY_ICONS</code>. ! */ ! public final static int SHOW_DEFAULT = new Integer(SHOW_OVERLAY_ICONS) ! .intValue(); ! ! private RubyElementImageProvider fImageLabelProvider; ! ! private StorageLabelProvider fStorageLabelProvider; ! private int fFlags; ! private int fImageFlags; ! private long fTextFlags; ! ! /** ! * Creates a new label provider with <code>SHOW_DEFAULT</code> flag. ! * ! * @see #SHOW_DEFAULT ! * @since 0.8.0 ! */ ! public RubyElementLabelProvider() { ! this(SHOW_DEFAULT); ! } ! ! /** ! * Creates a new label provider. ! * ! * @param flags ! * the initial options; a bitwise OR of <code>SHOW_* </code> ! * constants ! */ ! public RubyElementLabelProvider(int flags) { ! fImageLabelProvider = new RubyElementImageProvider(); ! fStorageLabelProvider = new StorageLabelProvider(); ! fFlags = flags; ! updateImageProviderFlags(); ! updateTextProviderFlags(); ! } ! ! private boolean getFlag(int flag) { ! return (fFlags & flag) != 0; ! } ! ! /** ! * Turns on the rendering options specified in the given flags. ! * ! * @param flags ! * the options; a bitwise OR of <code>SHOW_* </code> constants ! */ ! public void turnOn(int flags) { ! fFlags |= flags; ! updateImageProviderFlags(); ! updateTextProviderFlags(); ! } ! ! /** ! * Turns off the rendering options specified in the given flags. ! * ! * @param flags ! * the initial options; a bitwise OR of <code>SHOW_* </code> ! * constants ! */ ! public void turnOff(int flags) { ! fFlags &= (~flags); ! updateImageProviderFlags(); ! updateTextProviderFlags(); ! } ! ! private void updateImageProviderFlags() { ! fImageFlags = 0; ! if (getFlag(SHOW_OVERLAY_ICONS)) { ! fImageFlags |= RubyElementImageProvider.OVERLAY_ICONS; ! } ! if (getFlag(SHOW_SMALL_ICONS)) { ! fImageFlags |= RubyElementImageProvider.SMALL_ICONS; ! } ! } ! ! private void updateTextProviderFlags() { ! fTextFlags = RubyElementLabels.M_PARAMETER_NAMES; ! if (getFlag(SHOW_ROOT)) { ! fTextFlags |= RubyElementLabels.APPEND_ROOT_PATH; ! } ! if (getFlag(SHOW_VARIABLE)) { ! fTextFlags |= RubyElementLabels.ROOT_VARIABLE; ! } ! if (getFlag(SHOW_QUALIFIED)) { ! fTextFlags |= (RubyElementLabels.F_FULLY_QUALIFIED ! | RubyElementLabels.M_FULLY_QUALIFIED | RubyElementLabels.I_FULLY_QUALIFIED ! | RubyElementLabels.T_FULLY_QUALIFIED | RubyElementLabels.D_QUALIFIED ! | RubyElementLabels.CF_QUALIFIED | RubyElementLabels.CU_QUALIFIED); ! } ! if (getFlag(SHOW_POST_QUALIFIED)) { ! fTextFlags |= (RubyElementLabels.F_POST_QUALIFIED | RubyElementLabels.M_POST_QUALIFIED ! | RubyElementLabels.I_POST_QUALIFIED | RubyElementLabels.T_POST_QUALIFIED ! | RubyElementLabels.D_POST_QUALIFIED | RubyElementLabels.CF_POST_QUALIFIED | RubyElementLabels.CU_POST_QUALIFIED); ! } ! } ! ! /* ! * (non-Javadoc) ! * ! * @see ILabelProvider#getImage ! */ ! public Image getImage(Object element) { ! Image result = fImageLabelProvider.getImageLabel(element, fImageFlags); ! if (result != null) { return result; } ! ! if (element instanceof IStorage) return fStorageLabelProvider.getImage(element); ! ! return result; ! } ! ! /* ! * (non-Javadoc) ! * ! * @see ILabelProvider#getText ! */ ! public String getText(Object element) { ! String text = RubyElementLabels.getTextLabel(element, fTextFlags); ! if (text.length() > 0) { return text; } ! ! if (element instanceof IStorage) return fStorageLabelProvider.getText(element); ! ! return text; ! } ! ! /* ! * (non-Javadoc) ! * ! * @see IBaseLabelProvider#dispose ! */ ! public void dispose() { ! fStorageLabelProvider.dispose(); ! fImageLabelProvider.dispose(); ! } } --- NEW FILE: RubyElementImageDescriptor.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.ui; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.Assert; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.Point; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyPluginImages; /** * A RubyImageDescriptor consists of a base image and several adornments. The adornments * are computed according to the flags either passed during creation or set via the method * <code>setAdornments</code>. * * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> * * @since 2.0 */ public class RubyElementImageDescriptor extends CompositeImageDescriptor { /** Flag to render the static adornment. */ public final static int STATIC= 0x008; /** Flag to render the warning adornment. */ public final static int WARNING= 0x020; /** Flag to render the error adornment. */ public final static int ERROR= 0x040; /** Flag to render the 'override' adornment. */ public final static int OVERRIDES= 0x080; /** Flag to render the 'implements' adornment. */ public final static int IMPLEMENTS= 0x100; /** Flag to render the 'constructor' adornment. */ public final static int CONSTRUCTOR= 0x200; /** * Flag to render the 'deprecated' adornment. * @since 0.8.0 */ public final static int DEPRECATED= 0x400; private ImageDescriptor fBaseImage; private int fFlags; private Point fSize; /** * Creates a new RubyElementImageDescriptor. * * @param baseImage an image descriptor used as the base image * @param flags flags indicating which adornments are to be rendered. See <code>setAdornments</code> * for valid values. * @param size the size of the resulting image * @see #setAdornments(int) */ public RubyElementImageDescriptor(ImageDescriptor baseImage, int flags, Point size) { fBaseImage= baseImage; Assert.isNotNull(fBaseImage); fFlags= flags; Assert.isTrue(fFlags >= 0); fSize= size; Assert.isNotNull(fSize); } /** * Sets the descriptors adornments. Valid values are: <code>ABSTRACT</code>, <code>FINAL</code>, * <code>SYNCHRONIZED</code>, </code>STATIC<code>, </code>RUNNABLE<code>, </code>WARNING<code>, * </code>ERROR<code>, </code>OVERRIDDES<code>, <code>IMPLEMENTS</code>, <code>CONSTRUCTOR</code>, * <code>DEPRECATED</code>, or any combination of those. * * @param adornments the image descriptors adornments */ public void setAdornments(int adornments) { Assert.isTrue(adornments >= 0); fFlags= adornments; } /** * Returns the current adornments. * * @return the current adornments */ public int getAdronments() { return fFlags; } /** * Sets the size of the image created by calling <code>createImage()</code>. * * @param size the size of the image returned from calling <code>createImage()</code> * @see ImageDescriptor#createImage() */ public void setImageSize(Point size) { Assert.isNotNull(size); Assert.isTrue(size.x >= 0 && size.y >= 0); fSize= size; } /** * Returns the size of the image created by calling <code>createImage()</code>. * * @return the size of the image created by calling <code>createImage()</code> * @see ImageDescriptor#createImage() */ public Point getImageSize() { return new Point(fSize.x, fSize.y); } /* (non-Rubydoc) * Method declared in CompositeImageDescriptor */ protected Point getSize() { return fSize; } /* (non-Rubydoc) * Method declared on Object. */ public boolean equals(Object object) { if (object == null || !RubyElementImageDescriptor.class.equals(object.getClass())) return false; RubyElementImageDescriptor other= (RubyElementImageDescriptor)object; return (fBaseImage.equals(other.fBaseImage) && fFlags == other.fFlags && fSize.equals(other.fSize)); } /* (non-Rubydoc) * Method declared on Object. */ public int hashCode() { return fBaseImage.hashCode() | fFlags | fSize.hashCode(); } /* (non-Rubydoc) * Method declared in CompositeImageDescriptor */ protected void drawCompositeImage(int width, int height) { ImageData bg= getImageData(fBaseImage); if ((fFlags & DEPRECATED) != 0) { // over the full image Point size= getSize(); ImageData data= getImageData(RubyPluginImages.DESC_OVR_DEPRECATED); drawImage(data, 0, size.y - data.height); } drawImage(bg, 0, 0); drawTopRight(); drawBottomRight(); drawBottomLeft(); } private ImageData getImageData(ImageDescriptor descriptor) { ImageData data= descriptor.getImageData(); // see bug 51965: getImageData can return null if (data == null) { data= DEFAULT_IMAGE_DATA; RubyPlugin.logErrorMessage("Image data not available: " + descriptor.toString()); //$NON-NLS-1$ } return data; } private void drawTopRight() { int x= getSize().x; if ((fFlags & CONSTRUCTOR) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_CONSTRUCTOR); x-= data.width; drawImage(data, x, 0); } if ((fFlags & STATIC) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_STATIC); x-= data.width; drawImage(data, x, 0); } } private void drawBottomRight() { Point size= getSize(); int x= size.x; int flags= fFlags; if ((flags & OVERRIDES) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_OVERRIDES); x-= data.width; drawImage(data, x, size.y - data.height); } if ((flags & IMPLEMENTS) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_IMPLEMENTS); x-= data.width; drawImage(data, x, size.y - data.height); } } private void drawBottomLeft() { Point size= getSize(); int x= 0; if ((fFlags & ERROR) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_ERROR); drawImage(data, x, size.y - data.height); x+= data.width; } if ((fFlags & WARNING) != 0) { ImageData data= getImageData(RubyPluginImages.DESC_OVR_WARNING); drawImage(data, x, size.y - data.height); x+= data.width; } } } Index: RubyElementSorter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementSorter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyElementSorter.java 12 Mar 2005 15:32:34 -0000 1.3 --- RubyElementSorter.java 10 Feb 2006 19:54:54 -0000 1.4 *************** *** 7,13 **** --- 7,30 ---- package org.rubypeople.rdt.ui; + import java.text.Collator; + + import org.eclipse.core.resources.IContainer; + import org.eclipse.core.resources.IFile; + import org.eclipse.core.resources.IProject; + import org.eclipse.core.resources.IStorage; + import org.eclipse.core.runtime.IAdaptable; + import org.eclipse.jface.viewers.ContentViewer; + import org.eclipse.jface.viewers.IBaseLabelProvider; + import org.eclipse.jface.viewers.ILabelProvider; + import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; + import org.eclipse.ui.model.IWorkbenchAdapter; + import org.rubypeople.rdt.core.IMember; + import org.rubypeople.rdt.core.IMethod; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IType; + import org.rubypeople.rdt.core.RubyModelException; + import org.rubypeople.rdt.internal.ui.RubyPlugin; + import org.rubypeople.rdt.internal.ui.preferences.MembersOrderPreferenceCache; /** *************** *** 19,51 **** public class RubyElementSorter extends ViewerSorter { ! private static final int RUBY_REQUIRE = 1; ! private static final int RUBY_GLOBAL = 2; ! private static final int RUBY_CLASS_VARIABLE = 3; ! private static final int RUBY_INSTANCE_VARIABLE = 4; ! private static final int RUBY_METHOD = 5; ! private static final int RUBY_MODULE = 6; ! private static final int RUBY_CLASS = 7; ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.viewers.ViewerSorter#category(java.lang.Object) ! */ ! public int category(Object element) { ! if (element instanceof IRubyElement) { ! IRubyElement rubyElement = (IRubyElement) element; ! if (rubyElement.isType(IRubyElement.INSTANCE_VAR)) return RUBY_INSTANCE_VARIABLE; ! if (rubyElement.isType(IRubyElement.GLOBAL)) return RUBY_GLOBAL; ! if (rubyElement.isType(IRubyElement.METHOD)) return RUBY_METHOD; ! if (rubyElement.isType(IRubyElement.TYPE)) { ! IType rubyType = (IType) rubyElement; ! if(rubyType.isClass()) return RUBY_CLASS; ! return RUBY_MODULE; ! } ! if (rubyElement.isType(IRubyElement.IMPORT)) return RUBY_REQUIRE; ! if (rubyElement.isType(IRubyElement.CLASS_VAR)) return RUBY_CLASS_VARIABLE; ! } ! return 0; ! } } \ No newline at end of file --- 36,225 ---- public class RubyElementSorter extends ViewerSorter { ! private static final int PROJECTS = 1; ! private static final int RUBYSCRIPTS = 4; ! ! private static final int RESOURCEFOLDERS = 7; ! private static final int RESOURCES = 8; ! private static final int STORAGE = 9; ! ! private static final int IMPORT_CONTAINER = 11; ! private static final int IMPORT_DECLARATION = 12; ! ! // Includes all categories ordered using the OutlineSortOrderPage: ! // types, initializers, methods & fields ! private static final int MEMBERSOFFSET = 15; ! ! private static final int RUBYELEMENTS = 50; ! private static final int OTHERS = 51; ! ! private MembersOrderPreferenceCache fMemberOrderCache; ! ! /** ! * Constructor. ! */ ! public RubyElementSorter() { ! super(null); // delay initialization of collator ! fMemberOrderCache= RubyPlugin.getDefault().getMemberOrderPreferenceCache(); ! } ! ! /* (non-Javadoc) ! * @see org.eclipse.jface.viewers.ViewerSorter#getCollator() ! */ ! public final Collator getCollator() { ! if (collator == null) { ! collator= Collator.getInstance(); ! } ! return collator; ! } ! ! /* ! * @see ViewerSorter#category ! */ ! public int category(Object element) { ! if (element instanceof IRubyElement) { ! ! IRubyElement je = (IRubyElement) element; ! ! switch (je.getElementType()) { ! case IRubyElement.METHOD: { ! IMethod method = (IMethod) je; ! if (method.isConstructor()) { return getMemberCategory(MembersOrderPreferenceCache.CONSTRUCTORS_INDEX); } ! if (method.isSingleton()) ! return getMemberCategory(MembersOrderPreferenceCache.STATIC_METHODS_INDEX); ! else ! return getMemberCategory(MembersOrderPreferenceCache.METHOD_INDEX); ! } ! case IRubyElement.FIELD: ! case IRubyElement.CLASS_VAR: ! case IRubyElement.INSTANCE_VAR: ! case IRubyElement.CONSTANT: { ! ! return getMemberCategory(MembersOrderPreferenceCache.FIELDS_INDEX); ! } ! case IRubyElement.TYPE: ! return getMemberCategory(MembersOrderPreferenceCache.TYPE_INDEX); ! case IRubyElement.IMPORT_CONTAINER: ! return IMPORT_CONTAINER; ! case IRubyElement.IMPORT: ! return IMPORT_DECLARATION; ! case IRubyElement.PROJECT: ! return PROJECTS; ! case IRubyElement.SCRIPT: ! return RUBYSCRIPTS; ! } ! ! return RUBYELEMENTS; ! } else if (element instanceof IFile) { ! return RESOURCES; ! } else if (element instanceof IProject) { ! return PROJECTS; ! } else if (element instanceof IContainer) { ! return RESOURCEFOLDERS; ! } else if (element instanceof IStorage) { return STORAGE; } ! return OTHERS; ! } ! ! private int getMemberCategory(int kind) { ! int offset = fMemberOrderCache.getCategoryIndex(kind); ! return offset + MEMBERSOFFSET; ! } ! ! /* ! * @see ViewerSorter#compare ! */ ! public int compare(Viewer viewer, Object e1, Object e2) { ! int cat1 = category(e1); ! int cat2 = category(e2); ! ! if (cat1 != cat2) return cat1 - cat2; ! ! if (cat1 == PROJECTS || cat1 == RESOURCES || cat1 == RESOURCEFOLDERS || cat1 == STORAGE ! || cat1 == OTHERS) { ! String name1 = getNonRubyElementLabel(viewer, e1); ! String name2 = getNonRubyElementLabel(viewer, e2); ! if (name1 != null && name2 != null) { return getCollator().compare(name1, name2); } ! return 0; // can't compare ! } ! // only ruby elements from this point ! ! if (e1 instanceof IMethod) { ! if (fMemberOrderCache.isSortByVisibility()) { ! try { ! int flags1 = ((IMethod) e1).getVisibility(); ! int flags2 = ((IMethod) e2).getVisibility(); ! int vis = fMemberOrderCache.getVisibilityIndex(flags1) ! - fMemberOrderCache.getVisibilityIndex(flags2); ! if (vis != 0) { return vis; } ! } catch (RubyModelException ignore) { ! } ! } ! } ! ! if (e1 instanceof IMember) { ! // FIXME Sort members differently! (Constants, Class vars, instance ! // vars) ! } ! ! String name1 = getElementName(e1); ! String name2 = getElementName(e2); ! ! if (e1 instanceof IType) { // handle anonymous types ! if (name1.length() == 0) { ! if (name2.length() == 0) { ! try { ! return getCollator().compare(((IType) e1).getSuperclassName(), ! ((IType) e2).getSuperclassName()); ! } catch (RubyModelException e) { ! return 0; ! } ! } else { ! return 1; ! } ! } else if (name2.length() == 0) { return -1; } ! } ! ! int cmp = getCollator().compare(name1, name2); ! if (cmp != 0) { return cmp; } ! try { ! if (e1 instanceof IMethod) { ! String[] params1 = ((IMethod) e1).getParameterNames(); ! String[] params2 = ((IMethod) e2).getParameterNames(); ! int len = Math.min(params1.length, params2.length); ! for (int i = 0; i < len; i++) { ! cmp = getCollator().compare(params1[i], params2[i]); ! if (cmp != 0) { return cmp; } ! } ! return params1.length - params2.length; ! } ! return 0; ! } catch (RubyModelException e) { ! return 0; ! } ! } ! ! private String getElementName(Object element) { ! if (element instanceof IRubyElement) { ! return ((IRubyElement) element).getElementName(); ! } else { ! return element.toString(); ! } ! } ! ! private String getNonRubyElementLabel(Viewer viewer, Object element) { ! // try to use the workbench adapter for non - ruby resources or if not ! // available, use the viewers label provider ! ! if (element instanceof IAdaptable) { ! IWorkbenchAdapter adapter = (IWorkbenchAdapter) ((IAdaptable) element) ! .getAdapter(IWorkbenchAdapter.class); ! if (adapter != null) { return adapter.getLabel(element); } ! } ! if (viewer instanceof ContentViewer) { ! IBaseLabelProvider prov = ((ContentViewer) viewer).getLabelProvider(); ! if (prov instanceof ILabelProvider) { return ((ILabelProvider) prov).getText(element); } ! } ! return null; ! } } \ No newline at end of file --- NEW FILE: RubyElementLabels.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.ui; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.ui.model.IWorkbenchAdapter; import org.rubypeople.rdt.core.IField; import org.rubypeople.rdt.core.IMethod; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.corext.util.Messages; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyUIMessages; /** * <code>RubyElementLabels</code> provides helper methods to render names of * Ruby elements. * * @since 3.1 */ public class RubyElementLabels { /** * Method names contain parameter names. e.g. <code>foo(index)</code> */ public final static long M_PARAMETER_NAMES = 1L << 1; /** * Method names are fully qualified. e.g. <code>java.util.Vector.size</code> */ public final static long M_FULLY_QUALIFIED = 1L << 7; /** * Method names are post qualified. e.g. * <code>size - java.util.Vector</code> */ public final static long M_POST_QUALIFIED = 1L << 8; /** * Initializer names are fully qualified. e.g. * <code>java.util.Vector.{ ... }</code> */ public final static long I_FULLY_QUALIFIED = 1L << 10; /** * Type names are post qualified. e.g. <code>{ ... } - java.util.Map</code> */ public final static long I_POST_QUALIFIED = 1L << 11; /** * Fields names are fully qualified. e.g. <code>java.lang.System.out</code> */ public final static long F_FULLY_QUALIFIED = 1L << 16; /** * Fields names are post qualified. e.g. <code>out - java.lang.System</code> */ public final static long F_POST_QUALIFIED = 1L << 17; /** * Type names are fully qualified. e.g. <code>java.util.Map.MapEntry</code> */ public final static long T_FULLY_QUALIFIED = 1L << 18; /** * Type names are type container qualified. e.g. <code>Map.MapEntry</code> */ public final static long T_CONTAINER_QUALIFIED = 1L << 19; /** * Type names are post qualified. e.g. <code>MapEntry - java.util.Map</code> */ public final static long T_POST_QUALIFIED = 1L << 20; /** * Declarations (import container / declaration, package declaration) are * qualified. e.g. <code>java.util.Vector.class/import container</code> */ public final static long D_QUALIFIED = 1L << 24; /** * Declarations (import container / declaration, package declaration) are * post qualified. e.g. * <code>import container - java.util.Vector.class</code> */ public final static long D_POST_QUALIFIED = 1L << 25; /** * Class file names are fully qualified. e.g. * <code>java.util.Vector.class</code> */ public final static long CF_QUALIFIED = 1L << 27; /** * Class file names are post qualified. e.g. * <code>Vector.class - java.util</code> */ public final static long CF_POST_QUALIFIED = 1L << 28; /** * Compilation unit names are fully qualified. e.g. * <code>java.util.Vector.java</code> */ public final static long CU_QUALIFIED = 1L << 31; /** * Compilation unit names are post qualified. e.g. * <code>Vector.java - java.util</code> */ public final static long CU_POST_QUALIFIED = 1L << 32; /** * Package names are qualified. e.g. <code>MyProject/src/java.util</code> */ public final static long P_QUALIFIED = 1L << 35; /** * Package names are post qualified. e.g. * <code>java.util - MyProject/src</code> */ public final static long P_POST_QUALIFIED = 1L << 36; /** * Package names are compressed. e.g. <code>o*.e*.search</code> */ public final static long P_COMPRESSED = 1L << 37; /** * Package Fragment Roots contain variable name if from a variable. e.g. * <code>JRE_LIB - c:\java\lib\rt.jar</code> */ public final static long ROOT_VARIABLE = 1L << 40; /** * Package Fragment Roots contain the project name if not an archive * (prepended). e.g. <code>MyProject/src</code> */ public final static long ROOT_QUALIFIED = 1L << 41; /** * Package Fragment Roots contain the project name if not an archive * (appended). e.g. <code>src - MyProject</code> */ public final static long ROOT_POST_QUALIFIED = 1L << 42; /** * Add root path to all elements except Package Fragment Roots and Ruby * projects. e.g. <code>java.lang.Vector - c:\java\lib\rt.jar</code> * Option only applies to getElementLabel */ public final static long APPEND_ROOT_PATH = 1L << 43; /** * Add root path to all elements except Package Fragment Roots and Ruby * projects. e.g. <code>java.lang.Vector - c:\java\lib\rt.jar</code> * Option only applies to getElementLabel */ public final static long PREPEND_ROOT_PATH = 1L << 44; /** * Post qualify referenced package fragment roots. For example * <code>jdt.jar - org.eclipse.jdt.ui</code> if the jar is referenced from * another project. */ public final static long REFERENCED_ROOT_POST_QUALIFIED = 1L << 45; /** * Specified to use the resolved information of a IType, IMethod or IField. * See {@link IType#isResolved()}. If resolved information is available, * types will be rendered with type parameters of the instantiated type. * Resolved method render with the parameter types of the method instance. * <code>Vector<String>.get(String)</code> */ public final static long USE_RESOLVED = 1L << 48; /** * Qualify all elements */ public final static long ALL_FULLY_QUALIFIED = new Long(F_FULLY_QUALIFIED | M_FULLY_QUALIFIED | I_FULLY_QUALIFIED | T_FULLY_QUALIFIED | D_QUALIFIED | CF_QUALIFIED | CU_QUALIFIED | P_QUALIFIED | ROOT_QUALIFIED).longValue(); /** * Post qualify all elements */ public final static long ALL_POST_QUALIFIED = new Long(F_POST_QUALIFIED | M_POST_QUALIFIED | I_POST_QUALIFIED | T_POST_QUALIFIED | D_POST_QUALIFIED | CF_POST_QUALIFIED | CU_POST_QUALIFIED | P_POST_QUALIFIED | ROOT_POST_QUALIFIED).longValue(); /** * Default options (M_PARAMETER_NAMES enabled) */ public final static long ALL_DEFAULT = new Long(M_PARAMETER_NAMES).longValue(); /** * Default qualify options (All except Root and Package) */ public final static long DEFAULT_QUALIFIED = new Long(F_FULLY_QUALIFIED | M_FULLY_QUALIFIED | I_FULLY_QUALIFIED | T_FULLY_QUALIFIED | D_QUALIFIED | CF_QUALIFIED | CU_QUALIFIED) .longValue(); /** * Default post qualify options (All except Root and Package) */ public final static long DEFAULT_POST_QUALIFIED = new Long(F_POST_QUALIFIED | M_POST_QUALIFIED | I_POST_QUALIFIED | T_POST_QUALIFIED | D_POST_QUALIFIED | CF_POST_QUALIFIED | CU_POST_QUALIFIED).longValue(); /** * User-readable string for separating post qualified names (e.g. " - "). */ public final static String CONCAT_STRING = RubyUIMessages.RubyElementLabels_concat_string; /** * User-readable string for separating list items (e.g. ", "). */ public final static String COMMA_STRING = RubyUIMessages.RubyElementLabels_comma_string; /** * User-readable string for separating the return type (e.g. " : "). */ public final static String DECL_STRING = RubyUIMessages.RubyElementLabels_declseparator_string; /** * User-readable string for ellipsis ("..."). */ public final static String ELLIPSIS_STRING = "..."; //$NON-NLS-1$ /** * User-readable string for the default package name (e.g. "(default * package)"). */ public final static String DEFAULT_PACKAGE = RubyUIMessages.RubyElementLabels_default_package; private final static long QUALIFIER_FLAGS = P_COMPRESSED | USE_RESOLVED; private RubyElementLabels() { } private static final boolean getFlag(long flags, long flag) { return (flags & flag) != 0; } /** * Returns the label of the given object. The object must be of type * {@link IRubyElement} or adapt to {@link IWorkbenchAdapter}. The empty * string is returned if the element type is not known. * * @param obj * Object to get the label from. * @param flags * The rendering flags * @return Returns the label or the empty string if the object type is not * supported. */ public static String getTextLabel(Object obj, long flags) { if (obj instanceof IRubyElement) { return getElementLabel((IRubyElement) obj, flags); } else if (obj instanceof IAdaptable) { IWorkbenchAdapter wbadapter = (IWorkbenchAdapter) ((IAdaptable) obj) .getAdapter(IWorkbenchAdapter.class); if (wbadapter != null) { return wbadapter.getLabel(obj); } } return ""; //$NON-NLS-1$ } /** * Returns the label for a Ruby element with the flags as defined by this * class. * * @param element * The element to render. * @param flags * The rendering flags. * @return the label of the Ruby element */ public static String getElementLabel(IRubyElement element, long flags) { StringBuffer buf = new StringBuffer(60); getElementLabel(element, flags, buf); return buf.toString(); } /** * Returns the label for a Ruby element with the flags as defined by this * class. * * @param element * The element to render. * @param flags * The rendering flags. * @param buf * The buffer to append the resulting label to. */ public static void getElementLabel(IRubyElement element, long flags, StringBuffer buf) { int type = element.getElementType(); switch (type) { case IRubyElement.METHOD: getMethodLabel((IMethod) element, flags, buf); break; case IRubyElement.FIELD: getFieldLabel((IField) element, flags, buf); break; case IRubyElement.LOCAL_VARIABLE: getLocalVariableLabel((IField) element, flags, buf); break; case IRubyElement.TYPE: getTypeLabel((IType) element, flags, buf); break; case IRubyElement.SCRIPT: getCompilationUnitLabel((IRubyScript) element, flags, buf); break; case IRubyElement.IMPORT_CONTAINER: case IRubyElement.IMPORT: getDeclarationLabel(element, flags, buf); break; case IRubyElement.PROJECT: case IRubyElement.RUBY_MODEL: buf.append(element.getElementName()); break; default: buf.append(element.getElementName()); } } /** * Appends the label for a method to a {@link StringBuffer}. Considers the * M_* flags. * * @param method * The element to render. * @param flags * The rendering flags. Flags with names starting with 'M_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getMethodLabel(IMethod method, long flags, StringBuffer buf) { try { // qualification if (getFlag(flags, M_FULLY_QUALIFIED)) { if (method.getDeclaringType() != null) { getTypeLabel(method.getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); buf.append('.'); } } buf.append(method.getElementName()); // parameters buf.append('('); if (getFlag(flags, M_PARAMETER_NAMES)) { String[] types = null; int nParams = 0; boolean renderVarargs = false; String[] names = null; if (getFlag(flags, M_PARAMETER_NAMES) && method.exists()) { names = method.getParameterNames(); if (types == null) { nParams = names.length; } else { if (nParams != names.length) { // see // https://bugs.eclipse.org/bugs/show_bug.cgi?id=99137 // and // https://bugs.eclipse.org/bugs/show_bug.cgi?id=101029 // RubyPlugin.logErrorMessage("RubyElementLabels: // Number of param types(" + nParams + ") != number // of names(" + names.length + "): " + // method.getElementName()); // //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ names = null; // no names rendered } } } for (int i = 0; i < nParams; i++) { if (i > 0) { buf.append(COMMA_STRING); } if (names != null) { buf.append(names[i]); } } } buf.append(')'); // post qualification if (getFlag(flags, M_POST_QUALIFIED)) { if (method.getDeclaringType() != null) { buf.append(CONCAT_STRING); getTypeLabel(method.getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); } } } catch (RubyModelException e) { RubyPlugin.log(e); // NotExistsException will not reach this point } } /** * Appends the label for a field to a {@link StringBuffer}. Considers the * F_* flags. * * @param field * The element to render. * @param flags * The rendering flags. Flags with names starting with 'F_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getFieldLabel(IField field, long flags, StringBuffer buf) { // qualification if (getFlag(flags, F_FULLY_QUALIFIED)) { getTypeLabel(field.getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); buf.append('.'); } buf.append(field.getElementName()); // post qualification if (getFlag(flags, F_POST_QUALIFIED)) { buf.append(CONCAT_STRING); getTypeLabel(field.getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); } } /** * Appends the label for a local variable to a {@link StringBuffer}. * * @param localVariable * The element to render. * @param flags * The rendering flags. Flags with names starting with 'F_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getLocalVariableLabel(IField localVariable, long flags, StringBuffer buf) { if (getFlag(flags, F_FULLY_QUALIFIED)) { getElementLabel(localVariable.getParent(), M_FULLY_QUALIFIED | T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); buf.append('.'); } buf.append(localVariable.getElementName()); // post qualification if (getFlag(flags, F_POST_QUALIFIED)) { buf.append(CONCAT_STRING); getElementLabel(localVariable.getParent(), M_FULLY_QUALIFIED | T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); } } /** * Appends the label for a type to a {@link StringBuffer}. Considers the * T_* flags. * * @param type * The element to render. * @param flags * The rendering flags. Flags with names starting with 'T_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getTypeLabel(IType type, long flags, StringBuffer buf) { if (getFlag(flags, T_FULLY_QUALIFIED)) { // IPackageFragment pack = type.getPackageFragment(); // if (!pack.isDefaultPackage()) { // getPackageFragmentLabel(pack, (flags & QUALIFIER_FLAGS), buf); // buf.append('.'); // } } if (getFlag(flags, T_FULLY_QUALIFIED | T_CONTAINER_QUALIFIED)) { IType declaringType = type.getDeclaringType(); if (declaringType != null) { getTypeLabel(declaringType, T_CONTAINER_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); buf.append('.'); } int parentType = type.getParent().getElementType(); if (parentType == IRubyElement.METHOD || parentType == IRubyElement.FIELD) { // anonymous // or local getElementLabel(type.getParent(), 0, buf); buf.append('.'); } } String typeName = type.getElementName(); if (typeName.length() == 0) { // anonymous try { String supertypeName = type.getSuperclassName(); // String[] superInterfaceNames = type.getSuperInterfaceNames(); // if (superInterfaceNames.length > 0) { // supertypeName = Signature.getSimpleName(superInterfaceNames[0]); // } else { // supertypeName = Signature.getSimpleName(type.getSuperclassName()); // } typeName = Messages.format(RubyUIMessages.RubyElementLabels_anonym_type, supertypeName); } catch (RubyModelException e) { // ignore typeName = RubyUIMessages.RubyElementLabels_anonym; } } buf.append(typeName); // post qualification if (getFlag(flags, T_POST_QUALIFIED)) { buf.append(CONCAT_STRING); IType declaringType = type.getDeclaringType(); if (declaringType != null) { getTypeLabel(declaringType, T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf); int parentType = type.getParent().getElementType(); if (parentType == IRubyElement.METHOD || parentType == IRubyElement.FIELD) { // anonymous // or // local buf.append('.'); getElementLabel(type.getParent(), 0, buf); } } else { //getPackageFragmentLabel(type.getPackageFragment(), flags & QUALIFIER_FLAGS, buf); } } } /** * Appends the label for a import container, import or package declaration * to a {@link StringBuffer}. Considers the D_* flags. * * @param declaration * The element to render. * @param flags * The rendering flags. Flags with names starting with 'D_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getDeclarationLabel(IRubyElement declaration, long flags, StringBuffer buf) { if (getFlag(flags, D_QUALIFIED)) { IRubyElement openable = (IRubyElement) declaration.getOpenable(); if (openable != null) { buf.append(getElementLabel(openable, CF_QUALIFIED | CU_QUALIFIED | (flags & QUALIFIER_FLAGS))); buf.append('/'); } } if (declaration.getElementType() == IRubyElement.IMPORT_CONTAINER) { buf.append(RubyUIMessages.RubyElementLabels_import_container); } else { buf.append(declaration.getElementName()); } // post qualification if (getFlag(flags, D_POST_QUALIFIED)) { IRubyElement openable = (IRubyElement) declaration.getOpenable(); if (openable != null) { buf.append(CONCAT_STRING); buf.append(getElementLabel(openable, CF_QUALIFIED | CU_QUALIFIED | (flags & QUALIFIER_FLAGS))); } } } /** * Appends the label for a compilation unit to a {@link StringBuffer}. * Considers the CU_* flags. * * @param cu * The element to render. * @param flags * The rendering flags. Flags with names starting with 'CU_' are * considered. * @param buf * The buffer to append the resulting label to. */ public static void getCompilationUnitLabel(IRubyScript cu, long flags, StringBuffer buf) { if (getFlag(flags, CU_QUALIFIED)) { // IPackageFragment pack = (IPackageFragment) cu.getParent(); // if (!pack.isDefaultPackage()) { // getPackageFragmentLabel(pack, (flags & QUALIFIER_FLAGS), buf); // buf.append('.'); // } } buf.append(cu.getElementName()); if (getFlag(flags, CU_POST_QUALIFIED)) { buf.append(CONCAT_STRING); // getPackageFragmentLabel((IPackageFragment) cu.getParent(), flags & QUALIFIER_FLAGS, buf); } } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:54:55
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11198/src/org/rubypeople/rdt/internal/ui/viewsupport Added Files: DecoratingRubyLabelProvider.java MemberFilterAction.java AppearanceAwareLabelProvider.java RubyUILabelProvider.java StatusBarUpdater.java MemberFilter.java StorageLabelProvider.java RubyElementImageProvider.java Log Message: new UI classes for element labels and images --- NEW FILE: StatusBarUpdater.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.internal.corext.util.Messages; import org.rubypeople.rdt.internal.ui.RubyUIMessages; import org.rubypeople.rdt.ui.RubyElementLabels; /** * Add the <code>StatusBarUpdater</code> to your ViewPart to have the statusbar * describing the selected elements. */ public class StatusBarUpdater implements ISelectionChangedListener { private final long LABEL_FLAGS= RubyElementLabels.DEFAULT_QUALIFIED | RubyElementLabels.ROOT_POST_QUALIFIED | RubyElementLabels.APPEND_ROOT_PATH | RubyElementLabels.M_PARAMETER_NAMES; private IStatusLineManager fStatusLineManager; public StatusBarUpdater(IStatusLineManager statusLineManager) { fStatusLineManager= statusLineManager; } /* * @see ISelectionChangedListener#selectionChanged */ public void selectionChanged(SelectionChangedEvent event) { String statusBarMessage= formatMessage(event.getSelection()); fStatusLineManager.setMessage(statusBarMessage); } protected String formatMessage(ISelection sel) { if (sel instanceof IStructuredSelection && !sel.isEmpty()) { IStructuredSelection selection= (IStructuredSelection) sel; int nElements= selection.size(); if (nElements > 1) { return Messages.format(RubyUIMessages.StatusBarUpdater_num_elements_selected, String.valueOf(nElements)); } else { Object elem= selection.getFirstElement(); if (elem instanceof IRubyElement) { return formatRubyElementMessage((IRubyElement) elem); } else if (elem instanceof IResource) { return formatResourceMessage((IResource) elem); } } } return ""; //$NON-NLS-1$ } private String formatRubyElementMessage(IRubyElement element) { return RubyElementLabels.getElementLabel(element, LABEL_FLAGS); } private String formatResourceMessage(IResource element) { IContainer parent= element.getParent(); if (parent != null && parent.getType() != IResource.ROOT) return element.getName() + RubyElementLabels.CONCAT_STRING + parent.getFullPath().makeRelative().toString(); else return element.getName(); } } --- NEW FILE: MemberFilterAction.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.jface.action.Action; import org.eclipse.ui.PlatformUI; import org.rubypeople.rdt.ui.actions.*; /** * Action used to enable / disable method filter properties */ public class MemberFilterAction extends Action { private int fFilterProperty; private MemberFilterActionGroup fFilterActionGroup; public MemberFilterAction(MemberFilterActionGroup actionGroup, String title, int property, String contextHelpId, boolean initValue) { super(title); fFilterActionGroup= actionGroup; fFilterProperty= property; PlatformUI.getWorkbench().getHelpSystem().setHelp(this, contextHelpId); setChecked(initValue); } /** * Returns this action's filter property. */ public int getFilterProperty() { return fFilterProperty; } /* * @see Action#actionPerformed */ public void run() { fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked()); } } --- NEW FILE: AppearanceAwareLabelProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.LabelProviderChangedEvent; import org.rubypeople.rdt.ui.PreferenceConstants; import org.rubypeople.rdt.ui.RubyElementLabels; /** * RubyUILabelProvider that respects settings from the Appearance preference page. * Triggers a viewer update when a preference changes. */ public class AppearanceAwareLabelProvider extends RubyUILabelProvider implements IPropertyChangeListener { public final static long DEFAULT_TEXTFLAGS= RubyElementLabels.ROOT_VARIABLE | RubyElementLabels.REFERENCED_ROOT_POST_QUALIFIED; public final static int DEFAULT_IMAGEFLAGS= RubyElementImageProvider.OVERLAY_ICONS; private long fTextFlagMask; private int fImageFlagMask; /** * Constructor for AppearanceAwareLabelProvider. */ public AppearanceAwareLabelProvider(long textFlags, int imageFlags) { super(textFlags, imageFlags); initMasks(); PreferenceConstants.getPreferenceStore().addPropertyChangeListener(this); } /** * Creates a labelProvider with DEFAULT_TEXTFLAGS and DEFAULT_IMAGEFLAGS */ public AppearanceAwareLabelProvider() { this(DEFAULT_TEXTFLAGS, DEFAULT_IMAGEFLAGS); } private void initMasks() { IPreferenceStore store= PreferenceConstants.getPreferenceStore(); fTextFlagMask= -1; if (!store.getBoolean(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES)) { fTextFlagMask ^= RubyElementLabels.P_COMPRESSED; } fImageFlagMask= -1; } /* * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (property.equals(PreferenceConstants.APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW) || property.equals(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES)) { initMasks(); LabelProviderChangedEvent lpEvent= new LabelProviderChangedEvent(this, null); // refresh all fireLabelProviderChanged(lpEvent); } } /* * @see IBaseLabelProvider#dispose() */ public void dispose() { PreferenceConstants.getPreferenceStore().removePropertyChangeListener(this); super.dispose(); } /* * @see RubyUILabelProvider#evaluateImageFlags() */ protected int evaluateImageFlags(Object element) { return getImageFlags() & fImageFlagMask; } /* * @see RubyUILabelProvider#evaluateTextFlags() */ protected long evaluateTextFlags(Object element) { return getTextFlags() & fTextFlagMask; } } --- NEW FILE: StorageLabelProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.eclipse.core.runtime.IPath; import org.eclipse.core.resources.IStorage; import org.eclipse.swt.graphics.Image; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.ui.IEditorRegistry; import org.eclipse.ui.IFileEditorMapping; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; /** * Standard label provider for IStorage objects. * Use this class when you want to present IStorage objects in a viewer. */ public class StorageLabelProvider extends LabelProvider { private IEditorRegistry fEditorRegistry= null; private Map fJarImageMap= new HashMap(10); private Image fDefaultImage; private IEditorRegistry getEditorRegistry() { if (fEditorRegistry == null) fEditorRegistry= PlatformUI.getWorkbench().getEditorRegistry(); return fEditorRegistry; } /* (non-Javadoc) * @see ILabelProvider#getImage */ public Image getImage(Object element) { // FIXME Use this for gem files (was intended for JARs)? if (element instanceof IStorage) return getImageForJarEntry((IStorage)element); return super.getImage(element); } /* (non-Javadoc) * @see ILabelProvider#getText */ public String getText(Object element) { if (element instanceof IStorage) return ((IStorage)element).getName(); return super.getText(element); } /* (non-Javadoc) * * @see IBaseLabelProvider#dispose */ public void dispose() { if (fJarImageMap != null) { Iterator each= fJarImageMap.values().iterator(); while (each.hasNext()) { Image image= (Image)each.next(); image.dispose(); } fJarImageMap= null; } fDefaultImage= null; } /* * Gets and caches an image for a JarEntryFile. * The image for a JarEntryFile is retrieved from the EditorRegistry. */ private Image getImageForJarEntry(IStorage element) { if (fJarImageMap == null) return getDefaultImage(); if (element == null || element.getName() == null) return getDefaultImage(); // Try to find icon for full name String name= element.getName(); Image image= (Image)fJarImageMap.get(name); if (image != null) return image; IFileEditorMapping[] mappings= getEditorRegistry().getFileEditorMappings(); int i= 0; while (i < mappings.length) { if (mappings[i].getLabel().equals(name)) break; i++; } String key= name; if (i == mappings.length) { // Try to find icon for extension IPath path= element.getFullPath(); if (path == null) return getDefaultImage(); key= path.getFileExtension(); if (key == null) return getDefaultImage(); image= (Image)fJarImageMap.get(key); if (image != null) return image; } // Get the image from the editor registry ImageDescriptor desc= getEditorRegistry().getImageDescriptor(name); image= desc.createImage(); fJarImageMap.put(key, image); return image; } private Image getDefaultImage() { if (fDefaultImage == null) fDefaultImage= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE); return fDefaultImage; } } --- NEW FILE: DecoratingRubyLabelProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.swt.graphics.Color; import org.eclipse.jface.viewers.DecoratingLabelProvider; import org.eclipse.jface.viewers.IColorProvider; import org.eclipse.ui.PlatformUI; public class DecoratingRubyLabelProvider extends DecoratingLabelProvider implements IColorProvider { /** * Decorating label provider for Ruby. Combines a RubyUILabelProvider * with problem and override indicuator with the workbench decorator (label * decorator extension point). */ public DecoratingRubyLabelProvider(RubyUILabelProvider labelProvider) { this(labelProvider, true); } /** * Decorating label provider for Ruby. Combines a RubyUILabelProvider * (if enabled with problem indicator) with the workbench * decorator (label decorator extension point). */ public DecoratingRubyLabelProvider(RubyUILabelProvider labelProvider, boolean errorTick) { super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()); if (errorTick) { // TODO Uncomment when we have a ProblemsLabelDecorator //labelProvider.addLabelDecorator(new ProblemsLabelDecorator(null)); } } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object) */ public Color getForeground(Object element) { // label provider is a RubyUILabelProvider return ((IColorProvider) getLabelProvider()).getForeground(element); } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object) */ public Color getBackground(Object element) { // label provider is a RubyUILabelProvider return ((IColorProvider) getLabelProvider()).getBackground(element); } } --- NEW FILE: RubyUILabelProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import java.util.ArrayList; import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.util.ListenerList; import org.eclipse.jface.util.SafeRunnable; import org.eclipse.jface.viewers.IColorProvider; import org.eclipse.jface.viewers.ILabelDecorator; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.LabelProviderChangedEvent; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.rubypeople.rdt.ui.RubyElementLabels; public class RubyUILabelProvider implements ILabelProvider, IColorProvider { protected ListenerList fListeners = new ListenerList(1); protected RubyElementImageProvider fImageLabelProvider; protected StorageLabelProvider fStorageLabelProvider; private ArrayList fLabelDecorators; private int fImageFlags; private long fTextFlags; /** * Creates a new label provider with default flags. */ public RubyUILabelProvider() { this(RubyElementLabels.ALL_DEFAULT, RubyElementImageProvider.OVERLAY_ICONS); } /** * @param textFlags Flags defined in <code>RubyElementLabels</code>. * @param imageFlags Flags defined in <code>RubyElementImageProvider</code>. */ public RubyUILabelProvider(long textFlags, int imageFlags) { fImageLabelProvider= new RubyElementImageProvider(); fLabelDecorators= null; fStorageLabelProvider= new StorageLabelProvider(); fImageFlags= imageFlags; fTextFlags= textFlags; } /** * Adds a decorator to the label provider */ public void addLabelDecorator(ILabelDecorator decorator) { if (fLabelDecorators == null) { fLabelDecorators= new ArrayList(2); } fLabelDecorators.add(decorator); } /** * Sets the textFlags. * @param textFlags The textFlags to set */ public final void setTextFlags(long textFlags) { fTextFlags= textFlags; } /** * Sets the imageFlags * @param imageFlags The imageFlags to set */ public final void setImageFlags(int imageFlags) { fImageFlags= imageFlags; } /** * Gets the image flags. * Can be overwriten by super classes. * @return Returns a int */ public final int getImageFlags() { return fImageFlags; } /** * Gets the text flags. * @return Returns a int */ public final long getTextFlags() { return fTextFlags; } /** * Evaluates the image flags for a element. * Can be overwriten by super classes. * @return Returns a int */ protected int evaluateImageFlags(Object element) { return getImageFlags(); } /** * Evaluates the text flags for a element. Can be overwriten by super classes. * @return Returns a int */ protected long evaluateTextFlags(Object element) { return getTextFlags(); } protected Image decorateImage(Image image, Object element) { if (fLabelDecorators != null && image != null) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i); image= decorator.decorateImage(image, element); } } return image; } /* (non-Rubydoc) * @see ILabelProvider#getImage */ public Image getImage(Object element) { Image result= fImageLabelProvider.getImageLabel(element, evaluateImageFlags(element)); if (result == null && (element instanceof IStorage)) { result= fStorageLabelProvider.getImage(element); } return decorateImage(result, element); } protected String decorateText(String text, Object element) { if (fLabelDecorators != null && text.length() > 0) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i); text= decorator.decorateText(text, element); } } return text; } /* (non-Rubydoc) * @see ILabelProvider#getText */ public String getText(Object element) { String result= RubyElementLabels.getTextLabel(element, evaluateTextFlags(element)); if (result.length() == 0 && (element instanceof IStorage)) { result= fStorageLabelProvider.getText(element); } return decorateText(result, element); } /* (non-Rubydoc) * @see IBaseLabelProvider#dispose */ public void dispose() { if (fLabelDecorators != null) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i); decorator.dispose(); } fLabelDecorators= null; } fStorageLabelProvider.dispose(); fImageLabelProvider.dispose(); } /* (non-Rubydoc) * @see IBaseLabelProvider#addListener(ILabelProviderListener) */ public void addListener(ILabelProviderListener listener) { if (fLabelDecorators != null) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i); decorator.addListener(listener); } } fListeners.add(listener); } /* (non-Rubydoc) * @see IBaseLabelProvider#isLabelProperty(Object, String) */ public boolean isLabelProperty(Object element, String property) { return true; } /* (non-Rubydoc) * @see IBaseLabelProvider#removeListener(ILabelProviderListener) */ public void removeListener(ILabelProviderListener listener) { if (fLabelDecorators != null) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i); decorator.removeListener(listener); } } fListeners.remove(listener); } public static ILabelDecorator[] getDecorators(boolean errortick, ILabelDecorator extra) { if (errortick) { if (extra == null) { return new ILabelDecorator[] {}; } else { return new ILabelDecorator[] { extra }; } } if (extra != null) { return new ILabelDecorator[] { extra }; } return null; } /* (non-Rubydoc) * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object) */ public Color getForeground(Object element) { return null; } /* (non-Rubydoc) * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object) */ public Color getBackground(Object element) { return null; } /** * Fires a label provider changed event to all registered listeners * Only listeners registered at the time this method is called are notified. * * @param event a label provider changed event * * @see ILabelProviderListener#labelProviderChanged */ protected void fireLabelProviderChanged(final LabelProviderChangedEvent event) { Object[] listeners = fListeners.getListeners(); for (int i = 0; i < listeners.length; ++i) { final ILabelProviderListener l = (ILabelProviderListener) listeners[i]; Platform.run(new SafeRunnable() { public void run() { l.labelProviderChanged(event); } }); } } } --- NEW FILE: MemberFilter.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.rubypeople.rdt.core.Flags; import org.rubypeople.rdt.core.IMember; import org.rubypeople.rdt.core.IMethod; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.RubyModelException; /** * Filter for the methods viewer. Changing a filter property does not trigger a * refiltering of the viewer */ public class MemberFilter extends ViewerFilter { public static final int FILTER_NONPUBLIC = 1; public static final int FILTER_STATIC = 2; public static final int FILTER_FIELDS = 4; public static final int FILTER_LOCALTYPES = 8; private int fFilterProperties; /** * Modifies filter and add a property to filter for */ public final void addFilter(int filter) { fFilterProperties |= filter; } /** * Modifies filter and remove a property to filter for */ public final void removeFilter(int filter) { fFilterProperties &= (-1 ^ filter); } /** * Tests if a property is filtered */ public final boolean hasFilter(int filter) { return (fFilterProperties & filter) != 0; } /* * @see ViewerFilter#isFilterProperty(java.lang.Object, java.lang.String) */ public boolean isFilterProperty(Object element, Object property) { return false; } /* * @see ViewerFilter#select(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IMember) { IMember member = (IMember) element; int memberType = member.getElementType(); if (hasFilter(FILTER_FIELDS)) { if ((memberType == IRubyElement.CLASS_VAR) || (memberType == IRubyElement.CONSTANT) || (memberType == IRubyElement.INSTANCE_VAR) || (memberType == IRubyElement.LOCAL_VARIABLE)) { return false; } } if (member.isType(IRubyElement.METHOD)) { IMethod method = (IMethod) member; try { if (hasFilter(FILTER_NONPUBLIC) && !Flags.isPublic(method.getVisibility())) { return false; } } catch (RubyModelException e) { return true; } if (hasFilter(FILTER_STATIC) && method.isSingleton()) { return false; } } if (hasFilter(FILTER_LOCALTYPES) && memberType == IRubyElement.TYPE && isLocalType((IType) member)) { return false; } if (member.getElementName().startsWith("<")) { // filter out // <clinit> // //$NON-NLS-1$ return false; } } return true; } private boolean isLocalType(IType type) { IRubyElement parent = type.getParent(); return parent instanceof IMember && !(parent instanceof IType); } private boolean isTopLevelType(IMember member) { IType parent = member.getDeclaringType(); return parent == null; } } --- NEW FILE: RubyElementImageProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.viewsupport; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.debug.internal.ui.ImageDescriptorRegistry; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.Assert; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.ide.IDE; import org.eclipse.ui.model.IWorkbenchAdapter; import org.rubypeople.rdt.core.Flags; import org.rubypeople.rdt.core.IMember; import org.rubypeople.rdt.core.IMethod; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IRubyProject; 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; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.RubyUIMessages; import org.rubypeople.rdt.ui.RubyElementImageDescriptor; /** * Default strategy of the Ruby plugin for the construction of Ruby element * icons. */ public class RubyElementImageProvider { /** * Flags for the RubyImageLabelProvider: Generate images with overlays. */ public final static int OVERLAY_ICONS = 0x1; /** * Generate small sized images. */ public final static int SMALL_ICONS = 0x2; /** * Use the 'light' style for rendering types. */ public final static int LIGHT_TYPE_ICONS = 0x4; public static final Point SMALL_SIZE = new Point(16, 16); public static final Point BIG_SIZE = new Point(22, 16); private static ImageDescriptor DESC_OBJ_PROJECT_CLOSED; private static ImageDescriptor DESC_OBJ_PROJECT; { ISharedImages images = RubyPlugin.getDefault().getWorkbench().getSharedImages(); DESC_OBJ_PROJECT_CLOSED = images .getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED); DESC_OBJ_PROJECT = images.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT); } private ImageDescriptorRegistry fRegistry; public RubyElementImageProvider() { fRegistry = null; // lazy initialization } /** * Returns the icon for a given element. The icon depends on the element * type and element properties. If configured, overlay icons are constructed * for <code>ISourceReference</code>s. * * @param flags * Flags as defined by the RubyImageLabelProvider */ public Image getImageLabel(Object element, int flags) { return getImageLabel(computeDescriptor(element, flags)); } private Image getImageLabel(ImageDescriptor descriptor) { if (descriptor == null) return null; return getRegistry().get(descriptor); } private ImageDescriptorRegistry getRegistry() { if (fRegistry == null) { fRegistry = RubyPlugin.getImageDescriptorRegistry(); } return fRegistry; } private ImageDescriptor computeDescriptor(Object element, int flags) { if (element instanceof IRubyElement) { return getRubyImageDescriptor((IRubyElement) element, flags); } else if (element instanceof IFile) { IFile file = (IFile) element; if (RubyCore.isRubyLikeFileName(file.getName())) { return getCUResourceImageDescriptor( file, flags); // image for a CU not on the build path } return getWorkbenchImageDescriptor(file, flags); } else if (element instanceof IAdaptable) { return getWorkbenchImageDescriptor( (IAdaptable) element, flags); } return null; } private static boolean showOverlayIcons(int flags) { return (flags & OVERLAY_ICONS) != 0; } private static boolean useSmallSize(int flags) { return (flags & SMALL_ICONS) != 0; } private static boolean useLightIcons(int flags) { return (flags & LIGHT_TYPE_ICONS) != 0; } /** * Returns an image descriptor for a compilation unit not on the class path. * The descriptor includes overlays, if specified. */ public ImageDescriptor getCUResourceImageDescriptor(IFile file, int flags) { Point size = useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE; return new RubyElementImageDescriptor(RubyPluginImages.DESC_OBJS_RUBY_RESOURCE, 0, size); } /** * Returns an image descriptor for a java element. The descriptor includes * overlays, if specified. */ public ImageDescriptor getRubyImageDescriptor(IRubyElement element, int flags) { int adornmentFlags = computeRubyAdornmentFlags(element, flags); Point size = useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE; return new RubyElementImageDescriptor(getBaseImageDescriptor(element, flags), adornmentFlags, size); } /** * Returns an image descriptor for a IAdaptable. The descriptor includes * overlays, if specified (only error ticks apply). Returns * <code>null</code> if no image could be found. */ public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) { IWorkbenchAdapter wbAdapter = (IWorkbenchAdapter) adaptable .getAdapter(IWorkbenchAdapter.class); if (wbAdapter == null) { return null; } ImageDescriptor descriptor = wbAdapter.getImageDescriptor(adaptable); if (descriptor == null) { return null; } Point size = useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE; return new RubyElementImageDescriptor(descriptor, 0, size); } // ---- Computation of base image key // ------------------------------------------------- /** * Returns an image descriptor for a ruby element. This is the base image, * no overlays. */ public ImageDescriptor getBaseImageDescriptor(IRubyElement element, int renderFlags) { try { switch (element.getElementType()) { case IRubyElement.METHOD: { IMethod method = (IMethod) element; IType declType = method.getDeclaringType(); int flags = method.getVisibility(); return getMethodImageDescriptor(flags); } case IRubyElement.GLOBAL: return RubyPluginImages.DESC_OBJS_GLOBAL; case IRubyElement.CLASS_VAR: return RubyPluginImages.DESC_OBJS_CLASS_VAR; case IRubyElement.CONSTANT: return RubyPluginImages.DESC_OBJS_CONSTANT; case IRubyElement.LOCAL_VARIABLE: return RubyPluginImages.DESC_OBJS_LOCAL_VAR; case IRubyElement.INSTANCE_VAR: return RubyPluginImages.DESC_OBJS_INSTANCE_VAR; case IRubyElement.IMPORT: return RubyPluginImages.DESC_OBJS_IMPDECL; case IRubyElement.IMPORT_CONTAINER: return RubyPluginImages.DESC_OBJS_IMPCONT; case IRubyElement.TYPE: { IType type = (IType) element; IType declType = type.getDeclaringType(); boolean isInner = declType != null; return getTypeImageDescriptor(type.isModule(), isInner, useLightIcons(renderFlags)); } case IRubyElement.SCRIPT: return RubyPluginImages.DESC_OBJS_SCRIPT; case IRubyElement.PROJECT: IRubyProject jp = (IRubyProject) element; if (jp.getProject().isOpen()) { IProject project = jp.getProject(); IWorkbenchAdapter adapter = (IWorkbenchAdapter) project .getAdapter(IWorkbenchAdapter.class); if (adapter != null) { ImageDescriptor result = adapter.getImageDescriptor(project); if (result != null) return result; } return DESC_OBJ_PROJECT; } return DESC_OBJ_PROJECT_CLOSED; case IRubyElement.RUBY_MODEL: return RubyPluginImages.DESC_OBJS_RUBY_MODEL; } Assert.isTrue(false, RubyUIMessages.RubyImageLabelprovider_assert_wrongImage); return RubyPluginImages.DESC_OBJS_GHOST; } catch (RubyModelException e) { return RubyPluginImages.DESC_OBJS_UNKNOWN; } } public void dispose() { } // ---- Methods to compute the adornments flags // --------------------------------- private int computeRubyAdornmentFlags(IRubyElement element, int renderFlags) { int flags = 0; if (showOverlayIcons(renderFlags) && element instanceof IMember) { IMember member = (IMember) element; if (element.getElementType() == IRubyElement.METHOD && ((IMethod) element).isConstructor()) flags |= RubyElementImageDescriptor.CONSTRUCTOR; } return flags; } public static ImageDescriptor getMethodImageDescriptor(int flags) { if (Flags.isPublic(flags)) return RubyPluginImages.DESC_MISC_PUBLIC; if (Flags.isProtected(flags)) return RubyPluginImages.DESC_MISC_PROTECTED; return RubyPluginImages.DESC_MISC_PRIVATE; } public static ImageDescriptor getTypeImageDescriptor(boolean isModule, boolean isInner, boolean useLightIcons) { if (isModule) { if (useLightIcons) { return RubyPluginImages.DESC_OBJS_MODULEALT; } if (isInner) { return getInnerModuleImageDescriptor(); } return RubyPluginImages.DESC_OBJS_MODULE; } if (useLightIcons) { return RubyPluginImages.DESC_OBJS_CLASSALT; } if (isInner) { return getInnerClassImageDescriptor(); } return getClassImageDescriptor(); } public static Image getDecoratedImage(ImageDescriptor baseImage, int adornments, Point size) { return RubyPlugin.getImageDescriptorRegistry().get( new RubyElementImageDescriptor(baseImage, adornments, size)); } private static ImageDescriptor getClassImageDescriptor() { return RubyPluginImages.DESC_OBJS_CLASS; } private static ImageDescriptor getInnerClassImageDescriptor() { return RubyPluginImages.DESC_OBJS_INNER_CLASS; } private static ImageDescriptor getInnerModuleImageDescriptor() { return RubyPluginImages.DESC_OBJS_MODULE; } public static ImageDescriptor getFieldImageDescriptor() { // TODO What about other types of fields! return RubyPluginImages.DESC_OBJS_CLASS_VAR; } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:54:28
|
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-serv11058/src/org/rubypeople/rdt/internal/ui/text/ruby Added Files: RubyFormattingStrategy.java IRubyReconcilingListener.java RubyReconcilingStrategy.java Log Message: new reconciling files --- NEW FILE: RubyReconcilingStrategy.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.text.ruby; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jface.text.Assert; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.reconciler.DirtyRegion; import org.eclipse.jface.text.reconciler.IReconcilingStrategy; import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.ui.IWorkingCopyManager; import org.rubypeople.rdt.ui.RubyUI; public class RubyReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension { private ITextEditor fEditor; private IWorkingCopyManager fManager; private IDocumentProvider fDocumentProvider; private IProgressMonitor fProgressMonitor; private boolean fNotify= true; private IRubyReconcilingListener fRubyReconcilingListener; private boolean fIsRubyReconcilingListener; public RubyReconcilingStrategy(ITextEditor editor) { fEditor= editor; fManager= RubyPlugin.getDefault().getWorkingCopyManager(); fDocumentProvider= RubyPlugin.getDefault().getRubyDocumentProvider(); fIsRubyReconcilingListener= fEditor instanceof IRubyReconcilingListener; if (fIsRubyReconcilingListener) fRubyReconcilingListener= (IRubyReconcilingListener)fEditor; } private IProblemRequestorExtension getProblemRequestorExtension() { IAnnotationModel model= fDocumentProvider.getAnnotationModel(fEditor.getEditorInput()); if (model instanceof IProblemRequestorExtension) return (IProblemRequestorExtension) model; return null; } private void reconcile(final boolean initialReconcile) { final IRubyScript[] ast= new IRubyScript[1]; try { final IRubyScript unit= fManager.getWorkingCopy(fEditor.getEditorInput()); if (unit != null) { Platform.run(new ISafeRunnable() { public void run() { try { /* fix for missing cancel flag communication */ IProblemRequestorExtension extension= getProblemRequestorExtension(); if (extension != null) { extension.setProgressMonitor(fProgressMonitor); extension.setIsActive(true); } try { unit.reconcile(true, null, fProgressMonitor); } catch (OperationCanceledException ex) { Assert.isTrue(fProgressMonitor == null || fProgressMonitor.isCanceled()); ast[0]= null; } finally { /* fix for missing cancel flag communication */ if (extension != null) { extension.setProgressMonitor(null); extension.setIsActive(false); } } } catch (RubyModelException ex) { handleException(ex); } } public void handleException(Throwable ex) { IStatus status= new Status(IStatus.ERROR, RubyUI.ID_PLUGIN, IStatus.OK, "Error in JDT Core during reconcile", ex); //$NON-NLS-1$ RubyPlugin.getDefault().getLog().log(status); } }); } } finally { // Always notify listeners, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=55969 for the final solution try { if (fIsRubyReconcilingListener) { IProgressMonitor pm= fProgressMonitor; if (pm == null) pm= new NullProgressMonitor(); fRubyReconcilingListener.reconciled(ast[0], !fNotify, pm); } } finally { fNotify= true; } } } /* * @see IReconcilingStrategy#reconcile(IRegion) */ public void reconcile(IRegion partition) { reconcile(false); } /* * @see IReconcilingStrategy#reconcile(DirtyRegion, IRegion) */ public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { reconcile(false); } /* * @see IReconcilingStrategy#setDocument(IDocument) */ public void setDocument(IDocument document) { } /* * @see IReconcilingStrategyExtension#setProgressMonitor(IProgressMonitor) */ public void setProgressMonitor(IProgressMonitor monitor) { fProgressMonitor= monitor; } /* * @see IReconcilingStrategyExtension#initialReconcile() */ public void initialReconcile() { reconcile(true); } /** * Tells this strategy whether to inform its listeners. * * @param notify <code>true</code> if listeners should be notified */ public void notifyListeners(boolean notify) { fNotify= notify; } /** * Called before reconciling is started. * * @since 3.0 */ public void aboutToBeReconciled() { if (fIsRubyReconcilingListener) fRubyReconcilingListener.aboutToBeReconciled(); } } --- NEW FILE: IRubyReconcilingListener.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.text.ruby; import org.eclipse.core.runtime.IProgressMonitor; import org.rubypeople.rdt.core.IRubyScript; /** * Interface of an object listening to Ruby reconciling. * * @since 3.0 */ public interface IRubyReconcilingListener { /** * Called before reconciling is started. */ void aboutToBeReconciled(); /** * Called after reconciling has been finished. * @param ast the ruby script AST or <code>null</code> if * the working copy was consistent or reconciliation has been cancelled * @param forced <code>true</code> iff this reconciliation was forced * @param progressMonitor the progress monitor */ void reconciled(IRubyScript ast, boolean forced, IProgressMonitor progressMonitor); } --- NEW FILE: RubyFormattingStrategy.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.text.ruby; import java.util.LinkedList; import java.util.Map; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.TextUtilities; import org.eclipse.jface.text.TypedPosition; import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy; import org.eclipse.jface.text.formatter.FormattingContextProperties; import org.eclipse.jface.text.formatter.IFormattingContext; import org.eclipse.text.edits.MalformedTreeException; import org.eclipse.text.edits.TextEdit; import org.rubypeople.rdt.core.formatter.CodeFormatter; import org.rubypeople.rdt.internal.corext.util.CodeFormatterUtil; import org.rubypeople.rdt.internal.ui.RubyPlugin; /** * Formatting strategy for ruby source code. * * @since 3.0 */ public class RubyFormattingStrategy extends ContextBasedFormattingStrategy { /** Documents to be formatted by this strategy */ private final LinkedList fDocuments= new LinkedList(); /** Partitions to be formatted by this strategy */ private final LinkedList fPartitions= new LinkedList(); /** * Creates a new java formatting strategy. */ public RubyFormattingStrategy() { super(); } /* * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format() */ public void format() { super.format(); final IDocument document= (IDocument)fDocuments.removeFirst(); final TypedPosition partition= (TypedPosition)fPartitions.removeFirst(); if (document != null && partition != null) { try { final TextEdit edit= CodeFormatterUtil.format2(CodeFormatter.K_RUBY_SCRIPT, document.get(), partition.getOffset(), partition.getLength(), 0, TextUtilities.getDefaultLineDelimiter(document), getPreferences()); if (edit != null) { Map partitioners= null; if (edit.getChildrenSize() > 20) partitioners= TextUtilities.removeDocumentPartitioners(document); edit.apply(document); if (partitioners != null) TextUtilities.addDocumentPartitioners(document, partitioners); } } catch (MalformedTreeException exception) { RubyPlugin.log(exception); } catch (BadLocationException exception) { // Can only happen on concurrent document modification - log and bail out RubyPlugin.log(exception); } } } /* * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext) */ public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); } /* * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops() */ public void formatterStops() { super.formatterStops(); fPartitions.clear(); fDocuments.clear(); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:54:00
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/outline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10670/src/org/rubypeople/rdt/internal/ui/rubyeditor/outline Removed Files: RubyModel.java RubyContentOutlinePage.java IDocumentModelListener.java DocumentModelChangeEvent.java RubyCore.java RubyOutlineContentProvider.java Log Message: remove old helper code for outline view. We now listen for RubyElementDeltas from our normal reconciling/parsing process --- RubyContentOutlinePage.java DELETED --- --- DocumentModelChangeEvent.java DELETED --- --- RubyCore.java DELETED --- --- RubyModel.java DELETED --- --- IDocumentModelListener.java DELETED --- --- RubyOutlineContentProvider.java DELETED --- |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10069/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: TextEditorPreferencePage2.java PreferencesMessages.java TodoTaskConfigurationBlock.java TodoTaskPreferencePage.java PreferencesMessages.properties RdocRiPreferencePage.java PropertyAndPreferencePage.java TodoTaskInputDialog.java Added Files: CodeFormatterPreferencePage.java MembersOrderPreferencePage.java MembersOrderPreferenceCache.java PreferencesAccess.java Log Message: add code formatter preference page, member sort order preference page, change how we do localized strings Index: PreferencesMessages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PreferencesMessages.java 2 Mar 2005 00:56:50 -0000 1.2 --- PreferencesMessages.java 10 Feb 2006 19:52:26 -0000 1.3 *************** *** 11,42 **** package org.rubypeople.rdt.internal.ui.preferences; ! import java.text.MessageFormat; ! import java.util.MissingResourceException; ! import java.util.ResourceBundle; ! public class PreferencesMessages { ! private static final String RESOURCE_BUNDLE= "org.rubypeople.rdt.internal.ui.preferences.PreferencesMessages";//$NON-NLS-1$ ! private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); ! private PreferencesMessages() { ! } ! public static String getString(String key) { ! try { ! return fgResourceBundle.getString(key); ! } catch (MissingResourceException e) { ! return '!' + key + '!'; ! } ! } ! ! public static String getFormattedString(String key, String arg) { ! return getFormattedString(key, new String[] { arg }); ! } ! ! public static String getFormattedString(String key, String[] args) { ! return MessageFormat.format(getString(key), args); ! } ! } --- 11,75 ---- package org.rubypeople.rdt.internal.ui.preferences; ! import org.eclipse.osgi.util.NLS; ! public final class PreferencesMessages extends NLS { ! private static final String BUNDLE_NAME = "org.rubypeople.rdt.internal.ui.preferences.PreferencesMessages";//$NON-NLS-1$ ! private PreferencesMessages() { ! } ! public static String RiPreferencePage_description_label; ! public static String CodeFormatterPreferencePage_title; ! public static String CodeFormatterPreferencePage_description; ! public static String MembersOrderPreferencePage_category_button_up; ! public static String MembersOrderPreferencePage_category_button_down; ! public static String MembersOrderPreferencePage_visibility_button_up; ! public static String MembersOrderPreferencePage_visibility_button_down; ! public static String MembersOrderPreferencePage_label_description; ! public static String MembersOrderPreferencePage_fields_label; ! public static String MembersOrderPreferencePage_constructors_label; ! public static String MembersOrderPreferencePage_methods_label; ! public static String MembersOrderPreferencePage_staticfields_label; ! public static String MembersOrderPreferencePage_staticmethods_label; ! public static String MembersOrderPreferencePage_types_label; ! public static String MembersOrderPreferencePage_public_label; ! public static String MembersOrderPreferencePage_private_label; ! public static String MembersOrderPreferencePage_protected_label; ! public static String MembersOrderPreferencePage_usevisibilitysort_label; ! public static String TodoTaskPreferencePage_description; ! public static String TodoTaskPreferencePage_title; ! public static String TodoTaskInputDialog_new_title; ! public static String TodoTaskInputDialog_edit_title; ! public static String TodoTaskInputDialog_priority_high; ! public static String TodoTaskInputDialog_name_label; ! public static String TodoTaskInputDialog_priority_normal; ! public static String TodoTaskInputDialog_priority_low; ! public static String TodoTaskInputDialog_priority_label; ! public static String TodoTaskInputDialog_error_noSpace; ! public static String TodoTaskInputDialog_error_entryExists; ! public static String TodoTaskInputDialog_error_comma; ! public static String TodoTaskInputDialog_error_enterName; ! public static String RubyEditorPreferencePage_link_tooltip; ! public static String RubyEditorPreferencePage_link; ! public static String RiPreferencePage_ripath_label; ! public static String RiPreferencePage_rdocpath_label; ! public static String TodoTaskConfigurationBlock_tasks_default; ! public static String TodoTaskConfigurationBlock_markers_tasks_high_priority; ! public static String TodoTaskConfigurationBlock_markers_tasks_normal_priority; ! public static String TodoTaskConfigurationBlock_markers_tasks_low_priority; ! public static String TodoTaskConfigurationBlock_markers_tasks_name_column; ! public static String TodoTaskConfigurationBlock_markers_tasks_priority_column; ! public static String TodoTaskConfigurationBlock_casesensitive_label; ! public static String TodoTaskConfigurationBlock_markers_tasks_add_button; ! public static String TodoTaskConfigurationBlock_markers_tasks_edit_button; ! public static String TodoTaskConfigurationBlock_markers_tasks_remove_button; ! public static String TodoTaskConfigurationBlock_markers_tasks_setdefault_button; ! public static String TodoTaskConfigurationBlock_needsbuild_title; ! public static String TodoTaskConfigurationBlock_needsfullbuild_message; ! public static String TodoTaskConfigurationBlock_needsprojectbuild_message; ! static { ! NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class); ! } } Index: TodoTaskInputDialog.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TodoTaskInputDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TodoTaskInputDialog.java 2 Mar 2005 00:56:50 -0000 1.2 --- TodoTaskInputDialog.java 10 Feb 2006 19:52:26 -0000 1.3 *************** *** 58,64 **** if (task == null) { ! setTitle(PreferencesMessages.getString("TodoTaskInputDialog.new.title")); //$NON-NLS-1$ } else { ! setTitle(PreferencesMessages.getString("TodoTaskInputDialog.edit.title")); //$NON-NLS-1$ } --- 58,64 ---- if (task == null) { ! setTitle(PreferencesMessages.TodoTaskInputDialog_new_title); } else { ! setTitle(PreferencesMessages.TodoTaskInputDialog_edit_title); } *************** *** 66,70 **** fNameDialogField= new StringDialogField(); ! fNameDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.name.label")); //$NON-NLS-1$ fNameDialogField.setDialogFieldListener(adapter); --- 66,70 ---- fNameDialogField= new StringDialogField(); ! fNameDialogField.setLabelText(PreferencesMessages.TodoTaskInputDialog_name_label); fNameDialogField.setDialogFieldListener(adapter); *************** *** 72,82 **** String[] items= new String[] { ! PreferencesMessages.getString("TodoTaskInputDialog.priority.high"), //$NON-NLS-1$ ! PreferencesMessages.getString("TodoTaskInputDialog.priority.normal"), //$NON-NLS-1$ ! PreferencesMessages.getString("TodoTaskInputDialog.priority.low") //$NON-NLS-1$ }; fPriorityDialogField= new ComboDialogField(SWT.READ_ONLY); ! fPriorityDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.priority.label")); //$NON-NLS-1$ fPriorityDialogField.setItems(items); if (task != null) { --- 72,82 ---- String[] items= new String[] { ! PreferencesMessages.TodoTaskInputDialog_priority_high, ! PreferencesMessages.TodoTaskInputDialog_priority_normal, ! PreferencesMessages.TodoTaskInputDialog_priority_low }; fPriorityDialogField= new ComboDialogField(SWT.READ_ONLY); ! fPriorityDialogField.setLabelText(PreferencesMessages.TodoTaskInputDialog_priority_label); fPriorityDialogField.setItems(items); if (task != null) { *************** *** 136,147 **** String newText= fNameDialogField.getText(); if (newText.length() == 0) { ! status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.enterName")); //$NON-NLS-1$ } else { if (newText.indexOf(',') != -1) { ! status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.comma")); //$NON-NLS-1$ } else if (fExistingNames.contains(newText)) { ! status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.entryExists")); //$NON-NLS-1$ } else if (Character.isWhitespace(newText.charAt(0)) || Character.isWhitespace(newText.charAt(newText.length() - 1))) { ! status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.noSpace")); //$NON-NLS-1$ } } --- 136,147 ---- String newText= fNameDialogField.getText(); if (newText.length() == 0) { ! status.setError(PreferencesMessages.TodoTaskInputDialog_error_enterName); } else { if (newText.indexOf(',') != -1) { ! status.setError(PreferencesMessages.TodoTaskInputDialog_error_comma); } else if (fExistingNames.contains(newText)) { ! status.setError(PreferencesMessages.TodoTaskInputDialog_error_entryExists); } else if (Character.isWhitespace(newText.charAt(0)) || Character.isWhitespace(newText.charAt(newText.length() - 1))) { ! status.setError(PreferencesMessages.TodoTaskInputDialog_error_noSpace); } } Index: TodoTaskPreferencePage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TodoTaskPreferencePage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TodoTaskPreferencePage.java 2 Mar 2005 00:56:50 -0000 1.2 --- TodoTaskPreferencePage.java 10 Feb 2006 19:52:26 -0000 1.3 *************** *** 11,17 **** --- 11,20 ---- package org.rubypeople.rdt.internal.ui.preferences; + import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; + import org.eclipse.ui.help.WorkbenchHelp; + import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; *************** *** 21,131 **** public class TodoTaskPreferencePage extends PropertyAndPreferencePage { ! public static final String PREF_ID = "org.rubypeople.rdt.ui.preferences.TodoTaskPreferencePage"; //$NON-NLS-1$ ! public static final String PROP_ID = "org.rubypeople.rdt.ui.propertyPages.TodoTaskPreferencePage"; //$NON-NLS-1$ ! private TodoTaskConfigurationBlock fConfigurationBlock; ! public TodoTaskPreferencePage() { ! setPreferenceStore(RubyPlugin.getDefault().getPreferenceStore()); ! setDescription(PreferencesMessages.getString("TodoTaskPreferencePage.description")); //$NON-NLS-1$ ! // only used when page is shown programatically ! setTitle(PreferencesMessages.getString("TodoTaskPreferencePage.title")); //$NON-NLS-1$ ! } ! /* ! * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) ! */ ! public void createControl(Composite parent) { ! fConfigurationBlock = new TodoTaskConfigurationBlock(getNewStatusChangedListener(), getProject()); ! super.createControl(parent); ! // FIXME Uncomment for help context! ! // if (isProjectPreferencePage()) { ! // WorkbenchHelp.setHelp(getControl(), ! // IJavaHelpContextIds.TODOTASK_PROPERTY_PAGE); ! // } else { ! // WorkbenchHelp.setHelp(getControl(), ! // IJavaHelpContextIds.TODOTASK_PREFERENCE_PAGE); ! // } ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#createPreferenceContent(org.eclipse.swt.widgets.Composite) ! */ ! protected Control createPreferenceContent(Composite composite) { ! return fConfigurationBlock.createContents(composite); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#hasProjectSpecificOptions() ! */ ! protected boolean hasProjectSpecificOptions() { ! return fConfigurationBlock.hasProjectSpecificOptions(); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#openWorkspacePreferences() ! */ ! protected void openWorkspacePreferences() { ! TodoTaskPreferencePage page = new TodoTaskPreferencePage(); ! PreferencePageSupport.showPreferencePage(getShell(), PREF_ID, page); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#enablePreferenceContent(boolean) ! */ ! protected void enablePreferenceContent(boolean enable) { ! fConfigurationBlock.setEnabled(enable); // override default behaviour ! } ! /* ! * @see org.eclipse.jface.preference.IPreferencePage#performDefaults() ! */ ! protected void performDefaults() { ! super.performDefaults(); ! if (fConfigurationBlock != null) { ! fConfigurationBlock.performDefaults(); ! } ! } ! /* ! * @see org.eclipse.jface.preference.IPreferencePage#performOk() ! */ ! public boolean performOk() { ! boolean enabled = !isProjectPreferencePage() || useProjectSettings(); ! if (fConfigurationBlock != null && !fConfigurationBlock.performOk(enabled)) { return false; } ! return super.performOk(); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.dialogs.DialogPage#dispose() ! */ ! public void dispose() { ! if (fConfigurationBlock != null) { ! fConfigurationBlock.dispose(); ! } ! super.dispose(); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#setElement(org.eclipse.core.runtime.IAdaptable) ! */ ! public void setElement(IAdaptable element) { ! super.setElement(element); ! setDescription(null); // no description for property page ! } } --- 24,150 ---- public class TodoTaskPreferencePage extends PropertyAndPreferencePage { ! public static final String PREF_ID = "org.rubypeople.rdt.ui.preferences.TodoTaskPreferencePage"; //$NON-NLS-1$ ! public static final String PROP_ID = "org.rubypeople.rdt.ui.propertyPages.TodoTaskPreferencePage"; //$NON-NLS-1$ ! private TodoTaskConfigurationBlock fConfigurationBlock; ! public TodoTaskPreferencePage() { ! setPreferenceStore(RubyPlugin.getDefault().getPreferenceStore()); ! setDescription(PreferencesMessages.TodoTaskPreferencePage_description); ! // only used when page is shown programatically ! setTitle(PreferencesMessages.TodoTaskPreferencePage_title); ! } ! /* ! * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) ! */ ! public void createControl(Composite parent) { ! fConfigurationBlock = new TodoTaskConfigurationBlock(getNewStatusChangedListener(), ! getProject()); ! super.createControl(parent); ! if (isProjectPreferencePage()) { ! WorkbenchHelp.setHelp(getControl(), IRubyHelpContextIds.TODOTASK_PROPERTY_PAGE); ! } else { ! WorkbenchHelp.setHelp(getControl(), IRubyHelpContextIds.TODOTASK_PREFERENCE_PAGE); ! } ! } ! /* ! * (non-Rubydoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID() ! */ ! protected String getPreferencePageID() { ! return PREF_ID; ! } ! /* ! * (non-Rubydoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID() ! */ ! protected String getPropertyPageID() { ! return PROP_ID; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#createPreferenceContent(org.eclipse.swt.widgets.Composite) ! */ ! protected Control createPreferenceContent(Composite composite) { ! return fConfigurationBlock.createContents(composite); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#hasProjectSpecificOptions() ! */ ! protected boolean hasProjectSpecificOptions(IProject project) { ! return fConfigurationBlock.hasProjectSpecificOptions(); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#openWorkspacePreferences() ! */ ! protected void openWorkspacePreferences() { ! TodoTaskPreferencePage page = new TodoTaskPreferencePage(); ! PreferencePageSupport.showPreferencePage(getShell(), PREF_ID, page); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#enablePreferenceContent(boolean) ! */ ! protected void enablePreferenceContent(boolean enable) { ! fConfigurationBlock.setEnabled(enable); // override default behaviour ! } ! /* ! * @see org.eclipse.jface.preference.IPreferencePage#performDefaults() ! */ ! protected void performDefaults() { ! super.performDefaults(); ! if (fConfigurationBlock != null) { ! fConfigurationBlock.performDefaults(); ! } ! } ! /* ! * @see org.eclipse.jface.preference.IPreferencePage#performOk() ! */ ! public boolean performOk() { ! boolean enabled = !isProjectPreferencePage() || useProjectSettings(); ! if (fConfigurationBlock != null && !fConfigurationBlock.performOk(enabled)) { return false; } ! return super.performOk(); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.dialogs.DialogPage#dispose() ! */ ! public void dispose() { ! if (fConfigurationBlock != null) { ! fConfigurationBlock.dispose(); ! } ! super.dispose(); ! } ! ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#setElement(org.eclipse.core.runtime.IAdaptable) ! */ ! public void setElement(IAdaptable element) { ! super.setElement(element); ! setDescription(null); // no description for property page ! } } Index: TextEditorPreferencePage2.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/TextEditorPreferencePage2.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TextEditorPreferencePage2.java 27 Jan 2006 16:27:55 -0000 1.22 --- TextEditorPreferencePage2.java 10 Feb 2006 19:52:26 -0000 1.23 *************** *** 131,135 **** final Shell shell= appearanceComposite.getShell(); ! String text= PreferencesMessages.getString("RubyEditorPreferencePage.link"); Link link= new Link(appearanceComposite, SWT.NONE); link.setText(text); --- 131,135 ---- final Shell shell= appearanceComposite.getShell(); ! String text= PreferencesMessages.RubyEditorPreferencePage_link; Link link= new Link(appearanceComposite, SWT.NONE); link.setText(text); *************** *** 139,143 **** } }); ! link.setToolTipText(PreferencesMessages.getString("RubyEditorPreferencePage.link.tooltip")); return appearanceComposite; --- 139,143 ---- } }); ! link.setToolTipText(PreferencesMessages.RubyEditorPreferencePage_link_tooltip); return appearanceComposite; Index: PreferencesMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PreferencesMessages.properties 20 Dec 2005 04:05:57 -0000 1.5 --- PreferencesMessages.properties 10 Feb 2006 19:52:26 -0000 1.6 *************** *** 10,821 **** ############################################################################### ! 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 ! BuildPathsPropertyPage.job.title=Setting build path ! BuildPathsPropertyPage.no_java_project.message=Not a Java project. ! BuildPathsPropertyPage.closed_project.message=Java information is not available for a closed project. ! ! BuildPathsPropertyPage.unsavedchanges.title=Setting Java Build Path ! BuildPathsPropertyPage.unsavedchanges.message=The Java Build path property page contains unsaved modifications. Do you want to save changes so that other build path related property pages can be updated? ! BuildPathsPropertyPage.unsavedchanges.button.save=Apply ! BuildPathsPropertyPage.unsavedchanges.button.discard=Discard ! BuildPathsPropertyPage.unsavedchanges.button.ignore=Apply Later ! ! ClasspathVariablesPreferencePage.title=Classpath Variables ! ClasspathVariablesPreferencePage.description=A classpath variable can be added to a project's class path. It can be used to define the location of a JAR file that isn't part of the workspace. The reserved class path variables JRE_LIB, JRE_SRC, JRE_SRCROOT are set internally depending on the JRE setting. ! ! ClasspathVariablesPreferencePage.savechanges.title=Classpath Variables ! ClasspathVariablesPreferencePage.savechanges.message=Do you want to apply the changes to the class path variables now? Your changes will be lost if another page modifies the classpath variables as well. ! ! ImportOrganizePreferencePage.description=Preferences used by the Organize Imports action: ! ImportOrganizePreferencePage.title=Organize Imports ! ! ImportOrganizeConfigurationBlock.order.label=Define the &sorting order of import statements. A package name prefix (e.g. org.eclipse) is a valid entry. ! ImportOrganizeConfigurationBlock.order.add.button=&New... ! ImportOrganizeConfigurationBlock.order.edit.button=&Edit... ! ImportOrganizeConfigurationBlock.order.up.button=&Up ! ImportOrganizeConfigurationBlock.order.down.button=Do&wn ! ImportOrganizeConfigurationBlock.order.remove.button=&Remove ! ImportOrganizeConfigurationBlock.order.load.button=I&mport... ! ImportOrganizeConfigurationBlock.order.save.button=E&xport... ! ImportOrganizeConfigurationBlock.ignoreLowerCase.label=Do not create imports for &types starting with a lowercase letter ! ImportOrganizeConfigurationBlock.threshold.label=Number of &imports needed for .* (e.g. org.eclipse.*): ! ImportOrganizeConfigurationBlock.error.invalidthreshold=Invalid import number. ! ImportOrganizeConfigurationBlock.loadDialog.title=Load Import Order from File ! ImportOrganizeConfigurationBlock.loadDialog.error.title=Load Import Order ! ImportOrganizeConfigurationBlock.loadDialog.error.message=Importing failed. Not a valid import order file. ! ImportOrganizeConfigurationBlock.saveDialog.title=Save Import Order to File ! ImportOrganizeConfigurationBlock.saveDialog.error.title=Save Import Order ! ImportOrganizeConfigurationBlock.saveDialog.error.message=Exporting import order file failed. ! ImportOrganizeInputDialog.title=Import Order Entry ! ImportOrganizeInputDialog.message=&Package name or package name prefix: ! ImportOrganizeInputDialog.browse.button=&Browse... ! ImportOrganizeInputDialog.ChoosePackageDialog.title=Package Selection ! ImportOrganizeInputDialog.ChoosePackageDialog.description=Choose package name or package prefix: ! ImportOrganizeInputDialog.ChoosePackageDialog.empty=No packages available. ! ImportOrganizeInputDialog.error.enterName=Enter a package name. ! ImportOrganizeInputDialog.error.invalidName=Not a valid package name. {0} ! ImportOrganizeInputDialog.error.entryExists=Package name already exists in list. ! ! JavaBasePreferencePage.description=General settings for Java development: ! ! JavaBasePreferencePage.doubleclick.action=Action on double click in the Package Explorer ! JavaBasePreferencePage.doubleclick.gointo=&Go into the selected element ! JavaBasePreferencePage.doubleclick.expand=E&xpand the selected element ! ! JavaBasePreferencePage.refactoring.title= Refactoring Java Code ! JavaBasePreferencePage.refactoring.auto_save= &Save all modified resources automatically prior to refactoring ! ! JavaBasePreferencePage.search= Search ! JavaBasePreferencePage.search.small_menu=Use &reduced search menu ! ! NewJavaProjectPreferencePage.title=New Project ! NewJavaProjectPreferencePage.description=Specify the build path entries used as default by the New Java Project creation wizard: ! ! NewJavaProjectPreferencePage.sourcefolder.label=Source and output folder ! NewJavaProjectPreferencePage.sourcefolder.project=&Project ! NewJavaProjectPreferencePage.sourcefolder.folder=&Folders ! NewJavaProjectPreferencePage.folders.src=&Source folder name: ! NewJavaProjectPreferencePage.folders.bin=&Output folder name: ! ! NewJavaProjectPreferencePage.jrelibrary.label=As &JRE library use: ! NewJavaProjectPreferencePage.jre_variable.description=JRE_LIB variable ! NewJavaProjectPreferencePage.jre_container.description=JRE container ! ! NewJavaProjectPreferencePage.folders.error.namesempty=Enter folder names. ! NewJavaProjectPreferencePage.folders.error.invalidsrcname=Invalid source folder name: {0} ! NewJavaProjectPreferencePage.folders.error.invalidbinname=Invalid output folder name: {0} ! NewJavaProjectPreferencePage.folders.error.invalidcp=Settings will result in an invalid build path. Check for nested folders. ! ! NewJavaProjectPreferencePage.error.decode=Error while decoding JRE entry ! ! JavaEditorPreferencePage.showQuickFixables= Indicate annotations solvable with &Quick Fix in vertical ruler ! JavaEditorPreferencePage.analyseAnnotationsWhileTyping= Report &problems as you type ! JavaEditorPreferencePage.description=Java Editor settings: ! ! JavaEditorPreferencePage.multiLineComment=Multi-line comment ! JavaEditorPreferencePage.singleLineComment=Single-line comment ! JavaEditorPreferencePage.returnKeyword= Keyword 'return' ! JavaEditorPreferencePage.keywords=Keywords excluding 'return' ! JavaEditorPreferencePage.strings=Strings ! JavaEditorPreferencePage.others=Others ! JavaEditorPreferencePage.methodNames=Method names ! JavaEditorPreferencePage.operators=Operators and brackets ! JavaEditorPreferencePage.javaCommentTaskTags=Task Tags ! JavaEditorPreferencePage.javaDocKeywords=Tags ! JavaEditorPreferencePage.javaDocHtmlTags=HTML markup ! JavaEditorPreferencePage.javaDocLinks=Links ! JavaEditorPreferencePage.javaDocOthers=Others ! JavaEditorPreferencePage.backgroundColor=Background color ! JavaEditorPreferencePage.systemDefault=&System Default ! JavaEditorPreferencePage.custom=C&ustom: ! JavaEditorPreferencePage.semanticHighlighting.option= &Enable advanced coloring ! JavaEditorPreferencePage.foreground=Ele&ment: ! JavaEditorPreferencePage.color=C&olor: ! JavaEditorPreferencePage.bold=&Bold ! JavaEditorPreferencePage.italic=&Italic ! JavaEditorPreferencePage.enable=Enab&le ! JavaEditorPreferencePage.preview=Previe&w: ! JavaEditorPreferencePage.displayedTabWidth=Displayed &tab width: ! JavaEditorPreferencePage.insertSpaceForTabs=Ins&ert spaces for tab (see Code Formatter preference page) ! JavaEditorPreferencePage.showOverviewRuler=Show overview &ruler ! JavaEditorPreferencePage.highlightMatchingBrackets=Highlight &matching brackets ! JavaEditorPreferencePage.highlightCurrentLine=Highlight ¤t line ! JavaEditorPreferencePage.showPrintMargin=Sho&w print margin ! JavaEditorPreferencePage.printMarginColumn=&Print margin column: ! JavaEditorPreferencePage.insertSingleProposalsAutomatically=Insert single &proposals automatically ! JavaEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext=S&how only proposals visible in the invocation context ! JavaEditorPreferencePage.presentProposalsInAlphabeticalOrder=Present proposals in alpha&betical order ! JavaEditorPreferencePage.coloring.element=&Element: ! JavaEditorPreferencePage.enableAutoActivation=&Enable auto activation ! JavaEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName=Add import instead of qua&lified name ! JavaEditorPreferencePage.completionInserts=Completion inser&ts ! JavaEditorPreferencePage.completionOverwrites=Completion over&writes ! JavaEditorPreferencePage.fillArgumentNamesOnMethodCompletion=&Fill argument names on method completion ! JavaEditorPreferencePage.guessArgumentNamesOnMethodCompletion=&Guess filled argument names ! JavaEditorPreferencePage.autoActivationDelay=A&uto activation delay: ! JavaEditorPreferencePage.autoActivationTriggersForJava=Auto activation trigger&s for Java: ! JavaEditorPreferencePage.autoActivationTriggersForJavaDoc=Auto activation triggers for &Javadoc: ! JavaEditorPreferencePage.completePrefixes= &Insert common prefixes automatically ! ! JavaEditorPreferencePage.codeAssist.colorOptions= Code assist colo&r options: ! JavaEditorPreferencePage.codeAssist.color= C&olor: ! JavaEditorPreferencePage.backgroundForCompletionProposals= Completion proposal background ! JavaEditorPreferencePage.foregroundForCompletionProposals= Completion proposal foreground ! JavaEditorPreferencePage.backgroundForMethodParameters= Method parameter background ! JavaEditorPreferencePage.foregroundForMethodParameters= Method parameter foreground ! JavaEditorPreferencePage.backgroundForCompletionReplacement= Completion overwrite background ! JavaEditorPreferencePage.foregroundForCompletionReplacement= Completion overwrite foreground ! ! JavaEditorPreferencePage.general=Appeara&nce ! JavaEditorPreferencePage.colors=Synta&x ! JavaEditorPreferencePage.empty_input=Empty input ! JavaEditorPreferencePage.invalid_input=''{0}'' is not a valid input. ! JavaEditorPreferencePage.showLineNumbers=Show lin&e numbers ! JavaEditorPreferencePage.lineNumberForegroundColor=Line number foreground ! JavaEditorPreferencePage.matchingBracketsHighlightColor2=Matching brackets highlight ! JavaEditorPreferencePage.currentLineHighlighColor=Current line highlight ! JavaEditorPreferencePage.printMarginColor2=Print margin ! JavaEditorPreferencePage.findScopeColor2=Find scope ! JavaEditorPreferencePage.appearanceOptions=Appearance co&lor options: ! ! JavaEditorPreferencePage.typing.tabTitle=T&yping ! JavaEditorPreferencePage.typing.description= Enable these typing aids in Smart Insert mode: ! JavaEditorPreferencePage.closeStrings= &Strings ! JavaEditorPreferencePage.closeBrackets= Brac&kets and parenthesis' ! JavaEditorPreferencePage.closeBraces= B&races ! JavaEditorPreferencePage.closeJavaDocs= Java&doc and comment regions ! JavaEditorPreferencePage.wrapStrings= &Wrap automatically ! JavaEditorPreferencePage.escapeStrings= Escape text w&hen pasting into a string literal ! JavaEditorPreferencePage.addJavaDocTags= Add &Javadoc tags ! JavaEditorPreferencePage.smartPaste= &Adjust indentation ! JavaEditorPreferencePage.link.before=Java editor preferences. Note that some preferences may be set on the\ ! JavaEditorPreferencePage.link.after= \ preference page. ! JavaEditorPreferencePage.link.linktext=All Text Editors ! JavaEditorPreferencePage.linking.title=Linked Mode ! JavaEditorPreferencePage.link.linktooltip=Show the shared text editor preferences ! JavaEditorPreferencePage.importsOnPaste=&Update imports ! JavaEditorPreferencePage.smartHomeEnd= &Smart caret positioning at line start and end ! JavaEditorPreferencePage.subWordNavigation= Smart &caret positioning in Java names (overrides platform behavior) ! JavaEditorPreferencePage.typing.smartSemicolon= Se&micolons ! JavaEditorPreferencePage.typing.smartOpeningBrace= &Braces ! JavaEditorPreferencePage.typing.smartTab= &Tab indents the current line ! ! ! JavaEditorPreferencePage.hoverTab.title= Ho&vers ! ! JavaBasePreferencePage.openTypeHierarchy=When opening a Type Hierarchy ! JavaBasePreferencePage.inView=Show the &Type Hierarchy View in the current perspective ! JavaBasePreferencePage.inPerspective=Open a new Type Hierarchy &Perspective ! ! JavaEditorPreferencePage.navigationTab.title= Navi&gation ! ! JavaEditorPreferencePage.quickassist.lightbulb=L&ight bulb for quick assists ! ! JavaEditorPreferencePage.accessibility.disableCustomCarets= &Use custom caret ! JavaEditorPreferencePage.accessibility.wideCaret= Enable thic&k caret ! ! JavaEditorHoverConfigurationBlock.annotationRollover= &Enable annotation roll-over when opening a new editor ! JavaEditorHoverConfigurationBlock.hoverPreferences= Text &Hover key modifier preferences: ! JavaEditorHoverConfigurationBlock.enabled= &Enabled ! JavaEditorHoverConfigurationBlock.keyModifier= Pressed key &modifier while hovering: ! JavaEditorHoverConfigurationBlock.description= Description: ! JavaEditorHoverConfigurationBlock.modifierIsNotValid= Modifier ''{0}'' is not valid. ! JavaEditorHoverConfigurationBlock.modifierIsNotValidForHover= Modifier ''{0}'' for ''{1}'' hover is not valid. ! JavaEditorHoverConfigurationBlock.duplicateModifier= ''{0}'' hover uses the same modifier as ''{1}'' hover. ! JavaEditorHoverConfigurationBlock.nameColumnTitle= Text Hover Name ! JavaEditorHoverConfigurationBlock.modifierColumnTitle= Pressed Key Modifier While Hovering ! ! JavaEditorHoverConfigurationBlock.delimiter= + ! JavaEditorHoverConfigurationBlock.insertDelimiterAndModifierAndDelimiter= \ + {0} + ! JavaEditorHoverConfigurationBlock.insertModifierAndDelimiter= \ {0} + ! JavaEditorHoverConfigurationBlock.insertDelimiterAndModifier= \ + {0} ! ! JavaEditorHoverConfigurationBlock.showAffordance= &Show affordance in hover on how to make it sticky ! ! MarkOccurrencesConfigurationBlock.title= &Mark Occurrences ! MarkOccurrencesConfigurationBlock.markOccurrences= Mark &occurrences of the selected element in the current file. ! MarkOccurrencesConfigurationBlock.markTypeOccurrences= &Types ! MarkOccurrencesConfigurationBlock.markMethodOccurrences= &Methods ! MarkOccurrencesConfigurationBlock.markConstantOccurrences= &Constants ! MarkOccurrencesConfigurationBlock.markFieldOccurrences= &Non-constant fields ! MarkOccurrencesConfigurationBlock.markLocalVariableOccurrences= &Local variables ! MarkOccurrencesConfigurationBlock.markExceptionOccurrences= E&xpressions throwing a declared exception ! MarkOccurrencesConfigurationBlock.markMethodExitPoints= Method &exits ! MarkOccurrencesConfigurationBlock.markImplementors= Methods implementing an &interface ! MarkOccurrencesConfigurationBlock.stickyOccurrences= &Keep marks when the selection changes ! ! JavaElementInfoPage.binary=binary ! JavaElementInfoPage.classpath_entry_kind=Classpath entry kind: ! JavaElementInfoPage.library=library ! JavaElementInfoPage.nameLabel=Name: ! JavaElementInfoPage.not_present=not present ! JavaElementInfoPage.package=Package: ! JavaElementInfoPage.package_contents=Package contents: ! JavaElementInfoPage.project=project ! JavaElementInfoPage.resource_path=Resource path: ! JavaElementInfoPage.source=source ! JavaElementInfoPage.variable=variable ! JavaElementInfoPage.variable_path=Variable path: ! JavaElementInfoPage.location=Location: ! ! JavadocConfigurationPropertyPage.IsPackageFragmentRoot.description=Specify the location (URL) of the documentation generated by Javadoc. The Javadoc location will contain a file called 'package-list'. ! JavadocConfigurationPropertyPage.IsIncorrectElement.description=Javadoc location can only be attached to Java projects or archives and class folders in Java projects. Source folders use the location specified at their project. ! JavadocConfigurationPropertyPage.IsJavaProject.description=Specify the location of the project\'s Javadoc documentation. This location is used by the Javadoc export wizard as the default value and by the \'Open External Javadoc\' action. For example: \'c:/myworkspace/myproject/doc\'. ! ! JavadocConfigurationBlock.browse.button=&Browse... ! JavadocConfigurationBlock.error.notafolder=Location does not exist. ! JavadocConfigurationBlock.warning.packagelistnotfound=Location does not contain file 'package-list'. ! JavadocConfigurationBlock.javadocFolderDialog.label=Javadoc Location Selection ! JavadocConfigurationBlock.javadocFolderDialog.message=Select Javadoc location: ! JavadocConfigurationBlock.MalformedURL.error=Invalid URL ! JavadocConfigurationBlock.validate.button=&Validate... ! JavadocConfigurationBlock.InvalidLocation.message= Location is invalid. Location contains neither the file \'package-list\' nor \'index.html'. ! JavadocConfigurationBlock.ValidLocation.message= Location is valid. Files \'package-list\' and \'index.html\' found. Open the location in your browser? ! JavadocConfigurationBlock.UnableToValidateLocation.message=Unable to validate location ! JavadocConfigurationBlock.MessageDialog.title=Validating Javadoc Location ! JavadocConfigurationBlock.location.type.path.label=Javadoc URL (e.g. \'http://www.sample-url.org/doc/\' or 'file:/c:/myworkspace/myproject/doc\') ! JavadocConfigurationBlock.location.type.jar.label=Javadoc in archive ! JavadocConfigurationBlock.location.path.label=Javadoc &location path: ! JavadocConfigurationBlock.location.jar.label=Archive &path: ! JavadocConfigurationBlock.jar.path.label=Path &within archive: ! JavadocConfigurationBlock.zipImportSource.title=Javadoc Archive Selection ! JavadocConfigurationBlock.location_in_jarorzip.message=&Select the folder that is the root of the Javadoc documentation: ! JavadocConfigurationBlock.browse_jarorzip_path.title=Javadoc Root Location ! JavadocConfigurationBlock.error.notafile=Archive does not exist. ! JavadocConfigurationBlock.error.invalidarchivepath=Archive path is not a valid path. ! JavadocConfigurationBlock.error.archivepathnotabsolute=Archive path must be an absolute path. ! ! SourceAttachmentPropertyPage.error.title=Error Attaching Source ! SourceAttachmentPropertyPage.error.message=An error occurred while associating the source ! ! SourceAttachmentPropertyPage.noarchive.message=Source can only be attached to archive and class folders in Java projects. ! SourceAttachmentPropertyPage.containerentry.message=JAR belongs to the container ''{0}''.\nTo configure the source attachment, go directly to the corresponding configuration page (For example for JREs go to ''Installed JREs'' page in the preferences). ! ! AppearancePreferencePage.description= Appearance of Java elements in viewers: ! AppearancePreferencePage.methodreturntype.label= Show &method return types ! AppearancePreferencePage.methodtypeparams.label=Show method type pa&rameters ! AppearancePreferencePage.pkgNamePatternEnable.label= &Compress all package name segments, except the final segment ! AppearancePreferencePage.pkgNamePattern.label= Com&pression pattern (e.g. given package name 'org.eclipse.jdt' pattern '.' will compress it to '..jdt', '0' to 'jdt', '1~.' to 'o~.e~.jdt'): ! AppearancePreferencePage.showMembersInPackagesView=S&how members in Package Explorer ! AppearancePreferencePage.stackViewsVerticallyInTheJavaBrowsingPerspective=&Stack views vertically in the Java Browsing perspective ! AppearancePreferencePage.note=Note: ! AppearancePreferencePage.preferenceOnlyEffectiveForNewPerspectives=This preference will only take effect on new perspectives ! AppearancePreferencePage.packageNameCompressionPattern.error.isEmpty=Enter a package name compression pattern ! AppearancePreferencePage.foldEmptyPackages= &Fold empty packages in hierarchical Package Explorer layout ! ! CodeFormatterPreferencePage.title=Code Formatter ! CodeFormatterPreferencePage.description=Sele&ct a profile: ! ! ! TodoTaskPreferencePage.title=Task Tags ! TodoTaskPreferencePage.description=&Strings indicating tasks in Java comments. The entry marked as default will be used in the code templates. ! ! TodoTaskPropertyPage.description=Strings indicating tasks in Java comments. The entry marked as default will be used in the code templates. ! ! TodoTaskConfigurationBlock.markers.tasks.high.priority=High ! TodoTaskConfigurationBlock.markers.tasks.normal.priority=Normal ! TodoTaskConfigurationBlock.markers.tasks.low.priority=Low ! TodoTaskConfigurationBlock.markers.tasks.add.button=&New... ! TodoTaskConfigurationBlock.markers.tasks.remove.button=&Remove ! TodoTaskConfigurationBlock.markers.tasks.edit.button=&Edit... ! TodoTaskConfigurationBlock.markers.tasks.name.column=Tag ! TodoTaskConfigurationBlock.markers.tasks.priority.column=Priority ! TodoTaskConfigurationBlock.markers.tasks.setdefault.button=Defa&ult ! TodoTaskConfigurationBlock.casesensitive.label=&Case sensitive task tag names ! ! TodoTaskConfigurationBlock.needsbuild.title=Task Tags Settings Changed ! TodoTaskConfigurationBlock.tasks.default={0} (default) ! TodoTaskConfigurationBlock.needsfullbuild.message=The task tags settings have changed. A full rebuild is required to for changes to take effect. Do the full build now? ! TodoTaskConfigurationBlock.needsprojectbuild.message=The task tags settings have changed. A rebuild of the project is required for changes to take effect. Do the project build now? ! ! TodoTaskInputDialog.new.title=New Task Tag ! TodoTaskInputDialog.edit.title=Edit Task Tag ! TodoTaskInputDialog.name.label=T&ag: ! TodoTaskInputDialog.priority.label=&Priority: ! TodoTaskInputDialog.priority.high=High ! TodoTaskInputDialog.priority.normal=Normal ! TodoTaskInputDialog.priority.low=Low ! TodoTaskInputDialog.error.enterName=Enter task tag name. ! TodoTaskInputDialog.error.comma=Name cannot contain a comma. ! TodoTaskInputDialog.error.entryExists=An entry with the same name already exists. ! TodoTaskInputDialog.error.noSpace=Name cannot begin or end with a whitespace. ! ! PropertyAndPreferencePage.useworkspacesettings.change=Configure Workspace Settings... ! PropertyAndPreferencePage.useprojectsettings.label=Enable pr&oject specific settings ! ! RiPreferencePage.description.label=Settings for RDoc and Ri ! RiPreferencePage.ripath.label=R&i path: ! RiPreferencePage.rdocpath.label=&RDoc path: ! ! JavaBuildPreferencePage.title=Builder ! JavaBuildPreferencePage.description=Options for the Java compiler:\nNote that a full rebuild is required for changes to take effect. ! ! JavaBuildConfigurationBlock.section.general=General ! JavaBuildConfigurationBlock.section.output_folder=Output folder ! JavaBuildConfigurationBlock.section.type_restrction=Type restriction ! JavaBuildConfigurationBlock.section.build_path_problems=Build path problems ! JavaBuildConfigurationBlock.section.build_path_properties=Build path properties ! ! ! JavaBuildConfigurationBlock.error=Error ! JavaBuildConfigurationBlock.warning=Warning ! JavaBuildConfigurationBlock.ignore=Ignore ! ! JavaBuildConfigurationBlock.needsbuild.title=Compiler Settings Changed ! JavaBuildConfigurationBlock.needsfullbuild.message=The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now? ! JavaBuildConfigurationBlock.needsprojectbuild.message=The compiler settings have changed. A rebuild of the project is required for changes to take effect. Do the project build now? ! ! JavaBuildConfigurationBlock.resource_filter.description=Filtered resources are not be copied to the output folder during a build. List is comma separated (e.g. '*.doc, plugin.xml, scripts/') ! JavaBuildConfigurationBlock.resource_filter.label=&Filtered Resources: ! JavaBuildConfigurationBlock.build_invalid_classpath.label=Abo&rt build when build path errors occur ! ! JavaBuildConfigurationBlock.build_clean_outputfolder.label=Scrub output folders when clea&ning projects ! JavaBuildConfigurationBlock.enable_exclusion_patterns.label=Enable use of e&xclusion patterns in source folders ! JavaBuildConfigurationBlock.enable_multiple_outputlocations.label=Enable use of &multiple output locations for source folders ! ! JavaBuildConfigurationBlock.pb_incomplete_build_path.label=&Incomplete build path: ! JavaBuildConfigurationBlock.pb_build_path_cycles.label=Circular d&ependencies: ! JavaBuildConfigurationBlock.pb_duplicate_resources.label=Duplica&ted resources: ! JavaBuildConfigurationBlock.pb_forbidden_reference.label=Access restriction vio&lation: ! JavaBuildConfigurationBlock.pb_max_per_unit.label=&Maximum number of problems reported per compilation unit: ! ! JavaBuildConfigurationBlock.pb_check_prereq_binary_level.label=Incompatible required &binaries: ! ! JavaBuildConfigurationBlock.empty_input=Number of problems cannot be empty. ! JavaBuildConfigurationBlock.invalid_input={0} is not a valid number of problems. ! JavaBuildConfigurationBlock.filter.invalidsegment.error=Filter is invalid: {0} ! ! ! ! CompilerConfigurationBlock.unused.description=Select the severity level for the following problems: ! CompilerConfigurationBlock.advanced.description=Select the severity level for the following problems: ! CompilerConfigurationBlock.build_warnings.description=Select the severity level for the following build path problems: ! CompilerConfigurationBlock.15.description=Select the severity level for the following problems: ! ! ! ProblemSeveritiesPreferencePage.title=Problem Severities ! ProblemSeveritiesPreferencePage.description=Options for the Java compiler:\nNote that a full rebuild is required for changes to take effect. ! ! ProblemSeveritiesConfigurationBlock.error=Error ! ProblemSeveritiesConfigurationBlock.warning=Warning ! ProblemSeveritiesConfigurationBlock.ignore=Ignore ! ! ProblemSeveritiesConfigurationBlock.section.potential_programming_problems=&Potential programming problems ! ProblemSeveritiesConfigurationBlock.section.unnecessary_code=&Unnecessary code ! ProblemSeveritiesConfigurationBlock.section.nls=String e&xternalization ! ProblemSeveritiesConfigurationBlock.section.code_style=&Code style ! ProblemSeveritiesConfigurationBlock.section.deprecations=Using &deprecated API ! ProblemSeveritiesConfigurationBlock.section.name_shadowing=Name shadowing and conflicts ! ProblemSeveritiesConfigurationBlock.section.jdk50=&JDK 5.0 options ! ! ProblemSeveritiesConfigurationBlock.help.link=/org.eclipse.jdt.doc.user/reference/ref-preferences-compiler.htm ! ProblemSeveritiesConfigurationBlock.help.tooltip=Help about compiler options ! ! ProblemSeveritiesConfigurationBlock.needsbuild.title=Compiler Settings Changed ! ProblemSeveritiesConfigurationBlock.needsfullbuild.message=The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now? ! ProblemSeveritiesConfigurationBlock.needsprojectbuild.message=The compiler settings have changed. A rebuild of the project is required for changes to take effect. Do the project build now? ! ! ProblemSeveritiesConfigurationBlock.common.description=Select the severity level for the following Java compiler problems: ! ProblemSeveritiesConfigurationBlock.pb_unsafe_type_op.label=Unsafe type operation involving raw types: ! ProblemSeveritiesConfigurationBlock.pb_final_param_bound.label=Generic type parameter used with a final type bound: ! ProblemSeveritiesConfigurationBlock.pb_inexact_vararg.label=Inexact type match for vararg arguments: ! ! ProblemSeveritiesConfigurationBlock.pb_accidential_assignement.label=Possible &accidental boolean assignment (e.g. if (a = b)): ! ProblemSeveritiesConfigurationBlock.pb_local_variable_hiding.label=Local &variable declaration hides another field or variable: ! ProblemSeveritiesConfigurationBlock.pb_field_hiding.label=Field declaration &hides another field or variable: ! ProblemSeveritiesConfigurationBlock.pb_special_param_hiding.label=Include constructor or setter method parameters ! ProblemSeveritiesConfigurationBlock.pb_unqualified_field_access.label=Un&qualified access to instance field: ! ProblemSeveritiesConfigurationBlock.pb_finally_block_not_completing.label='&finally' does not complete normally: ! ProblemSeveritiesConfigurationBlock.pb_undocumented_empty_block.label=Undocumented empty &block: ! ProblemSeveritiesConfigurationBlock.pb_unused_throwing_exception.label=Unnecessar&y declaration of thrown checked exception: ! ProblemSeveritiesConfigurationBlock.pb_unused_throwing_exception_when_overriding.label=Check overriding and implementing methods ! ProblemSeveritiesConfigurationBlock.pb_missing_serial_version.label=Seriali&zable class without serialVersionUID: ! ! ProblemSeveritiesConfigurationBlock.pb_overriding_pkg_dflt.label=Methods &overridden but not package visible: ! ProblemSeveritiesConfigurationBlock.pb_method_naming.label=&Methods with a constructor name: ! ProblemSeveritiesConfigurationBlock.pb_no_effect_assignment.label=Assignmen&t has no effect (e.g. 'x = x'): ! ProblemSeveritiesConfigurationBlock.pb_incompatible_interface_method.label=Interface method conflicts &with protected 'Object' method: ! ProblemSeveritiesConfigurationBlock.pb_indirect_access_to_static.label=&Indirect access to static member: ! ProblemSeveritiesConfigurationBlock.pb_hidden_catchblock.label=Hidden catch bloc&k: ! ProblemSeveritiesConfigurationBlock.pb_static_access_receiver.label=&Non-static access to static member: ! ProblemSeveritiesConfigurationBlock.pb_unused_imports.label=Unused imports: ! ProblemSeveritiesConfigurationBlock.pb_unused_local.label=&Local variable is never read: ! ProblemSeveritiesConfigurationBlock.pb_unused_parameter.label=Parameter is never read: ! ProblemSeveritiesConfigurationBlock.pb_signal_param_in_overriding.label=Check overriding and implementing methods ! ProblemSeveritiesConfigurationBlock.pb_unused_private.label=Unused or unread private members: ! ProblemSeveritiesConfigurationBlock.pb_non_externalized_strings.label=Usage of non-externalized strings: ! ProblemSeveritiesConfigurationBlock.pb_deprecation.label=Usage of deprecated API: ! ProblemSeveritiesConfigurationBlock.pb_deprecation_in_deprecation.label=Signal use of deprecated API inside deprecated code ! ProblemSeveritiesConfigurationBlock.pb_deprecation_when_overriding.label=Signal overriding or implementing deprecated method ! ProblemSeveritiesConfigurationBlock.pb_empty_statement.label=Empty &statement: ! ProblemSeveritiesConfigurationBlock.pb_unnecessary_type_check.label=Unnecessary cast or 'instanceof' operation: ! ProblemSeveritiesConfigurationBlock.pb_unnecessary_else.label=Unnecessary &else statement: ! ProblemSeveritiesConfigurationBlock.pb_synth_access_emul.label=Access to a non-accessible member of an enclosing type: ! ProblemSeveritiesConfigurationBlock.pb_char_array_in_concat.label=Using a char array in string concatenation: ! ! JavadocProblemsPreferencePage.title=Javadoc Comments ! JavadocProblemsPreferencePage.description=Options for the Java compiler:\nNote that a full rebuild is required for changes to take effect. ! ! JavadocProblemsConfigurationBlock.public=Public ! JavadocProblemsConfigurationBlock.protected=Protected ! JavadocProblemsConfigurationBlock.default=Default ! JavadocProblemsConfigurationBlock.private=Private ! ! JavadocProblemsConfigurationBlock.error=Error ! JavadocProblemsConfigurationBlock.warning=Warning ! JavadocProblemsConfigurationBlock.ignore=Ignore ! ! JavadocProblemsConfigurationBlock.needsbuild.title=Compiler Settings Changed ! JavadocProblemsConfigurationBlock.needsfullbuild.message=The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now? ! JavadocProblemsConfigurationBlock.needsprojectbuild.message=The compiler settings have changed. A rebuild of the project is required for changes to take effect. Do the project build now? ! ! JavadocProblemsConfigurationBlock.javadoc.description=Severity level for problems in Javadoc comments: ! ! JavadocProblemsConfigurationBlock.pb_javadoc_support.label=Proc&ess Javadoc comments ! JavadocProblemsConfigurationBlock.pb_invalid_javadoc.label=Mal&formed Javadoc comments: ! JavadocProblemsConfigurationBlock.pb_invalid_javadoc_tags.label=Report e&rrors in tags ! JavadocProblemsConfigurationBlock.pb_invalid_javadoc_tags_visibility.label=On&ly consider members as visible as: ! JavadocProblemsConfigurationBlock.pb_invalid_javadoc_tags_not_visible_ref.label=Report non &visible references ! JavadocProblemsConfigurationBlock.pb_invalid_javadoc_tags_deprecated.label=Report &deprecated references ! JavadocProblemsConfigurationBlock.pb_missing_javadoc.label=Missing Javadoc &tags: ! JavadocProblemsConfigurationBlock.pb_missing_javadoc_tags_visibility.label=O&nly consider members as visible as: ! JavadocProblemsConfigurationBlock.pb_missing_javadoc_tags_overriding.label=C&heck overriding and implementing methods ! JavadocProblemsConfigurationBlock.pb_missing_comments.label=&Missing Javadoc comments: ! JavadocProblemsConfigurationBlock.pb_missing_comments_visibility.label=&Only consider members as visible as: ! JavadocProblemsConfigurationBlock.pb_missing_comments_overriding.label=Chec&k overriding and implementing methods ! ! ! CompliancePreferencePage.title=Compiler ! CompliancePreferencePage.description=Options for the Java compiler:\nNote that a full rebuild is required for changes to take effect. ! ! ComplianceConfigurationBlock.error=Error ! ComplianceConfigurationBlock.warning=Warning ! ComplianceConfigurationBlock.ignore=Ignore ! ! ComplianceConfigurationBlock.version11=1.1 ! ComplianceConfigurationBlock.version12=1.2 ! ComplianceConfigurationBlock.version13=1.3 ! ComplianceConfigurationBlock.version14=1.4 ! ComplianceConfigurationBlock.version15=5.0 ! ! ComplianceConfigurationBlock.needsbuild.title=Compiler Settings Changed ! ComplianceConfigurationBlock.needsfullbuild.message=The compiler settings have changed. A full rebuild is required for changes to take effect. Do the full build now? ! ComplianceConfigurationBlock.needsprojectbuild.message=The compiler settings have changed. A rebuild of the project is required for changes to take effect. Do the project build now? ! ! ComplianceConfigurationBlock.variable_attr.label=Add varia&ble attributes to generated class files (used by the debugger) ! ComplianceConfigurationBlock.line_number_attr.label=Add &line number attributes to generated class files (used by the debugger) ! ComplianceConfigurationBlock.source_file_attr.label=Add source &file name to generated class file (used by the debugger) ! ComplianceConfigurationBlock.codegen_unused_local.label=Pr&eserve unused (never read) local variables ! ComplianceConfigurationBlock.codegen_inline_jsr_bytecode.label=Inline finally bl&ocks (larger class files, but improved performance) ! ComplianceConfigurationBlock.compiler_compliance.label=Comp&iler compliance level: ! ComplianceConfigurationBlock.default_settings.label=Use defaul&t compliance settings ! ComplianceConfigurationBlock.source_compatibility.label=Source co&mpatibility: ! ComplianceConfigurationBlock.codegen_targetplatform.label=Ge&nerated .class files compatibility: ! ComplianceConfigurationBlock.pb_assert_as_identifier.label=Disallow identifie&rs called 'assert': ! ComplianceConfigurationBlock.pb_enum_as_identifier.label=Disallo&w identifiers called 'enum': ! ComplianceConfigurationBlock.compliance.group.label=JDK Compliance ! ComplianceConfigurationBlock.classfiles.group.label=Classfile Generation ! ! ComplianceConfigurationBlock.cpl13src145.error=In 1.3 compliance level, source compatibility must be 1.3 ! ComplianceConfigurationBlock.cpl13trg145.error=In 1.3 compliance level, the classfile compatibility must be 1.3 or less ! ComplianceConfigurationBlock.cpl14src15.error=In 1.4 compliance level, source compatibility must be 1.4 or less ! ComplianceConfigurationBlock.cpl14trg15.error=In 1.4 compliance level, the classfile compatibility must be 1.4 or less ! ComplianceConfigurationBlock.src14tgt14.error=When source compatibility is 1.4, the classfile compatibility has to be 1.4 or greater. ! ComplianceConfigurationBlock.src15tgt15.error=When source compatibility is 5.0, the classfile compatibility has to be 5.0. ! ! ! OptionsConfigurationBlock.job.title=Rebuilding ! ! OptionsConfigurationBlock.buildall.taskname=Build all... ! OptionsConfigurationBlock.buildproject.taskname=Build project ''{0}''... ! ! CodeStylePreferencePage.title=Code Style ! CodeTemplatesPreferencePage.title=Code Templates ! ! JavaCategoryPropertyPage.text=<form>\ ! Project specific settings for project ''{0}''. If specified, they override settings defined in the global workspace preferences.\ ! <li><a href=''{1}''>Build path</a>: Configures the paths used to find source files and classes and defines the output locations for the generated class files.</li>\ ! <li><a href=''{2}''>Compiler</a>: Specifies the used compiler compliance and various options for the Java compiler like <a href=''{3}''>Todo</a> tasks, problem <a href=''{4}''>severities</a>, <a href=''{5}''>Javadoc</a> processing and <a href=''{6}''>build</a> options</li>\ ! <li><a href=''{7}''>Code Style</a>: Defines the rules used when creating code, including your preferred code <a href=''{8}''>formatter</a> settings, used code <a href=''{9}''>templates</a> and <a href=''{10}''>import</a> order</li>\ ! <li><a href=''{11}''>Javadoc location</a>: Configures the location where you want to generate your documentation to.</li>\ ! </form> ! ! ! NameConventionConfigurationBlock.field.label=Fields ! NameConventionConfigurationBlock.static.label=Static Fields ! NameConventionConfigurationBlock.arg.label=Parameters ! NameConventionConfigurationBlock.local.label=Local Variables ! NameConventionConfigurationBlock.keywordthis.label=&Qualify all generated field accesses with 'this.' ! NameConventionConfigurationBlock.isforbooleangetters.label=&Use 'is' prefix for getters that return boolean ! ! NameConventionConfigurationBlock.dialog.prefix=P&refix list: ! NameConventionConfigurationBlock.dialog.suffix=S&uffix list: ! ! NameConventionConfigurationBlock.exceptionname.label=E&xception variable name in catch blocks: ! ! NameConventionConfigurationBlock.error.emptyprefix=Prefix strings cannot contain an empty entry. ! NameConventionConfigurationBlock.error.emptysuffix=Suffix strings cannot contain an empty entry. ! NameConventionConfigurationBlock.error.invalidprefix={0} is not a valid prefix. ! NameConventionConfigurationBlock.error.invalidsuffix={0} is not a valid suffix. ! ! NameConventionConfigurationBlock.list.label=C&onventions for variable names: ! NameConventionConfigurationBlock.list.edit.button=&Edit... ! NameConventionConfigurationBlock.list.name.column=Variable type ! NameConventionConfigurationBlock.list.prefix.column=Prefix list ! NameConventionConfigurationBlock.list.suffix.column=Suffix list ! ! NameConventionConfigurationBlock.field.dialog.title=Field Name Conventions ! NameConventionConfigurationBlock.field.dialog.message=Specify prefix and suffix to be used for fields (comma separated): ! ! NameConventionConfigurationBlock.static.dialog.title=Static Field Name Conventions ! NameConventionConfigurationBlock.static.dialog.message=Specify prefix and suffix to be used for static fields (comma separated): ! ! NameConventionConfigurationBlock.arg.dialog.title=Parameter Name Conventions ! NameConventionConfigurationBlock.arg.dialog.message=Specify prefix and suffix to be used for parameters (comma separated): ! ! NameConventionConfigurationBlock.local.dialog.title=Local Variable Name Conventions ! NameConventionConfigurationBlock.local.dialog.message=Specify prefix and suffix to be used for local variables (comma separated): ! ! MembersOrderPreferencePage.category.button.up=&Up ! MembersOrderPreferencePage.category.button.down=D&own ! ! MembersOrderPreferencePage.visibility.button.up=U&p ! MembersOrderPreferencePage.visibility.button.down=Do&wn ! ! MembersOrderPreferencePage.label.description=&Choose the order in which members will be displayed. The order is also used by the 'Sort Members' action. ! ! ! MembersOrderPreferencePage.fields.label=Fields ! MembersOrderPreferencePage.constructors.label=Constructors ! MembersOrderPreferencePage.methods.label=Methods ! MembersOrderPreferencePage.staticfields.label=Static Fields ! MembersOrder... [truncated message content] |
|
From: Christopher W. <caw...@us...> - 2006-02-10 19:51:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9348/src/org/rubypeople/rdt/internal/ui Modified Files: RdtPerspectiveFactory.java Log Message: add shortcut for File > New to new Class wizard Index: RdtPerspectiveFactory.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RdtPerspectiveFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RdtPerspectiveFactory.java 6 Mar 2005 17:14:20 -0000 1.7 --- RdtPerspectiveFactory.java 10 Feb 2006 19:50:54 -0000 1.8 *************** *** 46,53 **** layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); ! // new actions - Java project creation wizard ! layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ ! layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ ! } } \ No newline at end of file --- 46,55 ---- layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); ! // new actions - Ruby project creation wizard ! layout.addNewWizardShortcut("org.rubypeople.rdt.ui.wizards.RubyNewClassWizard"); //$NON-NLS-1$ ! layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ ! layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ ! layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ ! } } \ No newline at end of file |