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-18 16:53:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28822/templates Modified Files: rdt.xml Log Message: overhaul our completion proposal/template code. Now we will apply formatting to templates when inserted! Plus we're closer to the way JDT does things. We still can't use the actual code formatter on the templates (because our old one does a massive replace edit which messes up variables like the cursor placement). The end result is that users should create templates with somewhat proper formatting initially. Index: rdt.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/templates/rdt.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rdt.xml 2 Dec 2005 15:44:08 -0000 1.2 --- rdt.xml 18 Feb 2006 16:53:50 -0000 1.3 *************** *** 3,7 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%forTemplate1.description" id="org.rubypeople.rdt.ui.templates.for1" --- 3,7 ---- <template ! context="ruby" description="%forTemplate1.description" id="org.rubypeople.rdt.ui.templates.for1" *************** *** 11,15 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%forTemplate2.description" id="org.rubypeople.rdt.ui.templates.for2" --- 11,15 ---- <template ! context="ruby" description="%forTemplate2.description" id="org.rubypeople.rdt.ui.templates.for2" *************** *** 19,23 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%defTemplate1.description" id="org.rubypeople.rdt.ui.templates.def1" --- 19,23 ---- <template ! context="ruby" description="%defTemplate1.description" id="org.rubypeople.rdt.ui.templates.def1" *************** *** 27,31 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%whileTemplate1.description" id="org.rubypeople.rdt.ui.templates.while1" --- 27,31 ---- <template ! context="ruby" description="%whileTemplate1.description" id="org.rubypeople.rdt.ui.templates.while1" *************** *** 35,39 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%whileTemplate2.description" id="org.rubypeople.rdt.ui.templates.while2" --- 35,39 ---- <template ! context="ruby" description="%whileTemplate2.description" id="org.rubypeople.rdt.ui.templates.while2" *************** *** 41,45 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%classTemplate1.description" id="org.rubypeople.rdt.ui.templates.class1" --- 41,45 ---- <template ! context="ruby" description="%classTemplate1.description" id="org.rubypeople.rdt.ui.templates.class1" *************** *** 49,53 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%classTemplate2.description" id="org.rubypeople.rdt.ui.templates.class2" --- 49,53 ---- <template ! context="ruby" description="%classTemplate2.description" id="org.rubypeople.rdt.ui.templates.class2" *************** *** 57,61 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%moduleTemplate1.description" id="org.rubypeople.rdt.ui.templates.module1" --- 57,61 ---- <template ! context="ruby" description="%moduleTemplate1.description" id="org.rubypeople.rdt.ui.templates.module1" *************** *** 65,69 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%doTemplate1.description" id="org.rubypeople.rdt.ui.templates.do1" --- 65,69 ---- <template ! context="ruby" description="%doTemplate1.description" id="org.rubypeople.rdt.ui.templates.do1" *************** *** 73,77 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%ifTemplate1.description" id="org.rubypeople.rdt.ui.templates.if1" --- 73,77 ---- <template ! context="ruby" description="%ifTemplate1.description" id="org.rubypeople.rdt.ui.templates.if1" *************** *** 81,85 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%ifelseTemplate1.description" id="org.rubypeople.rdt.ui.templates.ifelse1" --- 81,85 ---- <template ! context="ruby" description="%ifelseTemplate1.description" id="org.rubypeople.rdt.ui.templates.ifelse1" *************** *** 91,95 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%elsifTemplate1.description" id="org.rubypeople.rdt.ui.templates.elsif1" --- 91,95 ---- <template ! context="ruby" description="%elsifTemplate1.description" id="org.rubypeople.rdt.ui.templates.elsif1" *************** *** 99,103 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%caseTemplate1.description" id="org.rubypeople.rdt.ui.templates.case" --- 99,103 ---- <template ! context="ruby" description="%caseTemplate1.description" id="org.rubypeople.rdt.ui.templates.case" *************** *** 110,114 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%elseTemplate1.description" id="org.rubypeople.rdt.ui.templates.else" --- 110,114 ---- <template ! context="ruby" description="%elseTemplate1.description" id="org.rubypeople.rdt.ui.templates.else" *************** *** 118,122 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%beginTemplate1.description" id="org.rubypeople.rdt.ui.templates.begin1" --- 118,122 ---- <template ! context="ruby" description="%beginTemplate1.description" id="org.rubypeople.rdt.ui.templates.begin1" *************** *** 126,130 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%beginTemplate2.description" id="org.rubypeople.rdt.ui.templates.begin2" --- 126,130 ---- <template ! context="ruby" description="%beginTemplate2.description" id="org.rubypeople.rdt.ui.templates.begin2" *************** *** 134,138 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%beginTemplate3.description" id="org.rubypeople.rdt.ui.templates.begin3" --- 134,138 ---- <template ! context="ruby" description="%beginTemplate3.description" id="org.rubypeople.rdt.ui.templates.begin3" *************** *** 144,148 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%beginTemplate4.description" id="org.rubypeople.rdt.ui.templates.begin4" --- 144,148 ---- <template ! context="ruby" description="%beginTemplate4.description" id="org.rubypeople.rdt.ui.templates.begin4" *************** *** 156,160 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%untilTemplate1.description" id="org.rubypeople.rdt.ui.templates.until1" --- 156,160 ---- <template ! context="ruby" description="%untilTemplate1.description" id="org.rubypeople.rdt.ui.templates.until1" *************** *** 164,168 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%aliasTemplate1.description" id="org.rubypeople.rdt.ui.templates.alias1" --- 164,168 ---- <template ! context="ruby" description="%aliasTemplate1.description" id="org.rubypeople.rdt.ui.templates.alias1" *************** *** 170,174 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%rescueTemplate1.description" id="org.rubypeople.rdt.ui.templates.rescue1" --- 170,174 ---- <template ! context="ruby" description="%rescueTemplate1.description" id="org.rubypeople.rdt.ui.templates.rescue1" *************** *** 178,182 **** <template ! context="org.rubypeople.rdt.ui.templateContextType.rubyFile" description="%rescueTemplate2.description" id="org.rubypeople.rdt.ui.templates.rescue2" --- 178,182 ---- <template ! context="ruby" description="%rescueTemplate2.description" id="org.rubypeople.rdt.ui.templates.rescue2" |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:53:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/template/contentassist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28779/src/org/rubypeople/rdt/internal/ui/text/template/contentassist Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/template/contentassist added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:53:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/template/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28779/src/org/rubypeople/rdt/internal/corext/template/ruby Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/template/ruby added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:53:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28779/src/org/rubypeople/rdt/internal/corext/template Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/template added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:53:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28779/src/org/rubypeople/rdt/internal/ui/text/template Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/template added to the repository |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:51:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27341/src/org/rubypeople/rdt/internal/formatter Modified Files: OldCodeFormatter.java Log Message: take into account initial indent level (given by newer format method call). If invoked the old way, guess the initial indent level as we used to. Index: OldCodeFormatter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/formatter/OldCodeFormatter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OldCodeFormatter.java 10 Feb 2006 18:32:16 -0000 1.1 --- OldCodeFormatter.java 18 Feb 2006 16:50:59 -0000 1.2 *************** *** 104,109 **** firstAbstractBlockMarker.print(); } try { ! return this.formatString(unformatted, firstAbstractBlockMarker); } catch (PatternSyntaxException ex) { return unformatted; --- 104,110 ---- firstAbstractBlockMarker.print(); } + int initialIndentLevel = Indents.measureIndentUnits(unformatted, preferences.tab_size, preferences.indentation_size); try { ! return this.formatString(unformatted, firstAbstractBlockMarker, initialIndentLevel); } catch (PatternSyntaxException ex) { return unformatted; *************** *** 118,122 **** } ! protected String formatString(String unformatted, AbstractBlockMarker abstractBlockMarker) throws PatternSyntaxException { Pattern pat = Pattern.compile("\n"); --- 119,123 ---- } ! protected String formatString(String unformatted, AbstractBlockMarker abstractBlockMarker, int initialIndentLevel) throws PatternSyntaxException { Pattern pat = Pattern.compile("\n"); *************** *** 125,137 **** StringBuffer formatted = new StringBuffer(); Pattern whitespacePattern = Pattern.compile("^[\t ]*"); ! for (int i = 0; i < lines.length; i++) { ! String line = lines[i]; ! int initialIndentLevel = Indents.measureIndentUnits(line, preferences.tab_size, preferences.indentation_size); ! Matcher whitespaceMatcher = whitespacePattern.matcher(lines[i]); whitespaceMatcher.find(); int leadingWhitespace = whitespaceMatcher.end(0); if (state == null) { ! state = new IndentationState(unformatted, preferences.indentation_size, leadingWhitespace, initialIndentLevel); } --- 126,135 ---- StringBuffer formatted = new StringBuffer(); Pattern whitespacePattern = Pattern.compile("^[\t ]*"); ! for (int i = 0; i < lines.length; i++) { Matcher whitespaceMatcher = whitespacePattern.matcher(lines[i]); whitespaceMatcher.find(); int leadingWhitespace = whitespaceMatcher.end(0); if (state == null) { ! state = new IndentationState(unformatted, preferences.indentation_size, leadingWhitespace, initialIndentLevel); } *************** *** 455,461 **** public TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) { ! String newText = formatString(source.substring(offset, length)); return new ReplaceEdit(offset, length, newText); } } --- 453,471 ---- public TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) { ! String newText = formatString(source.substring(offset, length), indentationLevel); return new ReplaceEdit(offset, length, newText); } + private String formatString(String unformatted, int indentationLevel) { + AbstractBlockMarker firstAbstractBlockMarker = this.createBlockMarkerList(unformatted); + if (isDebug()) { + firstAbstractBlockMarker.print(); + } + try { + return this.formatString(unformatted, firstAbstractBlockMarker, indentationLevel); + } catch (PatternSyntaxException ex) { + return unformatted; + } + } + } |
|
From: Christopher W. <caw...@us...> - 2006-02-18 16:50:20
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27221/src/org/rubypeople/rdt/internal/core Modified Files: RubyScriptStructureBuilder.java Log Message: assume a variable is of type "Object" if we can't get initial type info from declaration/assignment Index: RubyScriptStructureBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RubyScriptStructureBuilder.java 10 Feb 2006 18:29:16 -0000 1.17 --- RubyScriptStructureBuilder.java 18 Feb 2006 16:50:17 -0000 1.18 *************** *** 1076,1080 **** } else if (value instanceof BignumNode) { return "Bignum"; } ! return null; } --- 1076,1080 ---- } else if (value instanceof BignumNode) { return "Bignum"; } ! return "Object"; } |
|
From: Christopher W. <caw...@us...> - 2006-02-17 20:38:57
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7988/src/org/rubypeople/rdt/ui/wizards Modified Files: RubyNewClassWizard.java Log Message: don't append "< Object" when superclass is Object. Create indent the "right" way - use set options Index: RubyNewClassWizard.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyNewClassWizard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyNewClassWizard.java 31 Jan 2006 20:29:53 -0000 1.1 --- RubyNewClassWizard.java 17 Feb 2006 20:38:53 -0000 1.2 *************** *** 28,31 **** --- 28,33 ---- import org.eclipse.ui.PlatformUI; import org.eclipse.ui.ide.IDE; + import org.rubypeople.rdt.core.RubyCore; + import org.rubypeople.rdt.core.formatter.Indents; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyPluginImages; *************** *** 177,185 **** contents.append("class "); contents.append(className); ! if (superclassName != null && superclassName != "Object") { contents.append(" < "); contents.append(superclassName); } ! contents.append("\n \nend\n"); return new ByteArrayInputStream(contents.toString().getBytes()); } --- 179,189 ---- contents.append("class "); contents.append(className); ! if (superclassName != null && !superclassName.equals("Object")) { contents.append(" < "); contents.append(superclassName); } ! contents.append("\n"); ! contents.append(Indents.createIndentString(1, RubyCore.getOptions())); ! contents.append("\nend\n"); return new ByteArrayInputStream(contents.toString().getBytes()); } |
|
From: Christopher W. <caw...@us...> - 2006-02-17 20:28:13
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3113/src/org/rubypeople/rdt/internal/ui/search Modified Files: RubySearchPage.java RubySearchQuery.java Log Message: make compatible with latest 3.2 Milestone release. (Hopefully this is backwards compatible too) Index: RubySearchQuery.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubySearchQuery.java 20 Nov 2005 18:09:30 -0000 1.5 --- RubySearchQuery.java 17 Feb 2006 20:28:07 -0000 1.6 *************** *** 1,12 **** /* Copyright (c) 2005 RubyPeople. ! * ! * Author: Markus ! * ! * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. RDT ! * is subject to the "Common Public License (CPL) v 1.0". You may not use RDT ! * except in compliance with the License. For further information see ! * org.rubypeople.rdt/rdt.license. ! * ! */ package org.rubypeople.rdt.internal.ui.search; --- 1,12 ---- /* Copyright (c) 2005 RubyPeople. ! * ! * Author: Markus ! * ! * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. RDT ! * is subject to the "Common Public License (CPL) v 1.0". You may not use RDT ! * except in compliance with the License. For further information see ! * org.rubypeople.rdt/rdt.license. ! * ! */ package org.rubypeople.rdt.internal.ui.search; *************** *** 19,23 **** import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.OperationCanceledException; - import org.eclipse.search.internal.core.SearchScope; import org.eclipse.search.ui.ISearchQuery; import org.eclipse.search.ui.ISearchResult; --- 19,22 ---- *************** *** 32,43 **** private String fSearchString; ! // private SearchScope fScope; private RubySearchResult fResult; - private int fSymbolType ; ! public RubySearchQuery(SearchScope scope, String searchString, int symbolType) { ! // fScope = scope; fSearchString = searchString; ! fSymbolType = symbolType ; } --- 31,42 ---- private String fSearchString; ! private RubySearchResult fResult; ! private int fSymbolType; ! ! public RubySearchQuery(String searchString, int symbolType) { fSearchString = searchString; ! fSymbolType = symbolType; } *************** *** 52,56 **** public String getLabel() { ! return toString() ; } --- 51,55 ---- public String getLabel() { ! return toString(); } *************** *** 63,94 **** } ! public IStatus run(IProgressMonitor monitor) throws OperationCanceledException { ! Set entries = RubyCore.getPlugin().getSymbolFinder().find(fSearchString, fSymbolType ); for (Iterator iter = entries.iterator(); iter.hasNext();) { SearchResult searchResult = (SearchResult) iter.next(); ! int startOffset = searchResult.getLocation().getPosition().getStartOffset(); ! int length = searchResult.getLocation().getPosition().getEndOffset() - startOffset; ! fResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, startOffset, length)); } ! MultiStatus status = new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, "Alright", null); //$NON-NLS-1$ return status; } public String toString() { ! String args[] = new String[2] ; switch (fSymbolType) { case METHOD_SYMBOL: ! args[0] = RubyUIMessages.getString("RubySearch.SearchForMethodSymbol") ; //$NON-NLS-1$ break; case CLASS_SYMBOL: ! args[0] = RubyUIMessages.getString("RubySearch.SearchForClassSymbol") ; //$NON-NLS-1$ break; default: break; } ! args[1] = fSearchString ; ! return RubyUIMessages.getFormattedString("RubySearch.ResultLabel", args) ; //$NON-NLS-1$ } --- 62,103 ---- } ! public IStatus run(IProgressMonitor monitor) ! throws OperationCanceledException { ! Set entries = RubyCore.getPlugin().getSymbolFinder().find( ! fSearchString, fSymbolType); for (Iterator iter = entries.iterator(); iter.hasNext();) { SearchResult searchResult = (SearchResult) iter.next(); ! int startOffset = searchResult.getLocation().getPosition() ! .getStartOffset(); ! int length = searchResult.getLocation().getPosition() ! .getEndOffset() ! - startOffset; ! fResult.addMatch(new Match(searchResult, Match.UNIT_CHARACTER, ! startOffset, length)); } ! MultiStatus status = new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, ! "Alright", null); //$NON-NLS-1$ return status; } public String toString() { ! String args[] = new String[2]; switch (fSymbolType) { case METHOD_SYMBOL: ! args[0] = RubyUIMessages ! .getString("RubySearch.SearchForMethodSymbol"); //$NON-NLS-1$ break; case CLASS_SYMBOL: ! args[0] = RubyUIMessages ! .getString("RubySearch.SearchForClassSymbol"); //$NON-NLS-1$ break; default: break; } ! args[1] = fSearchString; ! return RubyUIMessages ! .getFormattedString("RubySearch.ResultLabel", args); //$NON-NLS-1$ } Index: RubySearchPage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubySearchPage.java 20 Nov 2005 18:09:30 -0000 1.5 --- RubySearchPage.java 17 Feb 2006 20:28:07 -0000 1.6 *************** *** 23,27 **** import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.util.Assert; - import org.eclipse.search.internal.core.SearchScope; import org.eclipse.search.internal.ui.Messages; import org.eclipse.search.internal.ui.ScopePart; --- 23,26 ---- *************** *** 53,530 **** public class RubySearchPage extends DialogPage implements ISearchPage, ISymbolTypes { ! // Shouldn't SearchPatternData be a public class in org.eclipse.search ? ! private static class SearchPatternData { ! private int searchFor; ! private int limitTo; ! private String pattern; ! private boolean isCaseSensitive; ! private int scope; ! private IWorkingSet[] workingSets; ! public SearchPatternData(int searchFor, int limitTo, boolean isCaseSensitive, String pattern) { ! this(searchFor, limitTo, pattern, isCaseSensitive, ISearchPageContainer.WORKSPACE_SCOPE, null); ! } ! public SearchPatternData(int searchFor, int limitTo, String pattern, boolean isCaseSensitive, int scope, IWorkingSet[] workingSets) { ! this.searchFor = searchFor; ! this.limitTo = limitTo; ! this.pattern = pattern; ! this.isCaseSensitive = isCaseSensitive; ! this.scope = scope; ! this.workingSets = workingSets; ! } ! public boolean isCaseSensitive() { ! return isCaseSensitive; ! } ! public int getLimitTo() { ! return limitTo; ! } ! public String getPattern() { ! return pattern; ! } ! public int getScope() { ! return scope; ! } ! public int getSearchFor() { ! return searchFor; ! } ! public IWorkingSet[] getWorkingSets() { ! return workingSets; ! } ! public void store(IDialogSettings settings) { ! settings.put("searchFor", searchFor); //$NON-NLS-1$ ! settings.put("scope", scope); //$NON-NLS-1$ ! settings.put("pattern", pattern); //$NON-NLS-1$ ! settings.put("limitTo", limitTo); //$NON-NLS-1$ ! // TODO ! // settings.put("rubyElement", rubyElement != null ? ! // rubyElement.getHandleIdentifier() : ""); //$NON-NLS-1$ ! // //$NON-NLS-2$ ! settings.put("isCaseSensitive", isCaseSensitive); //$NON-NLS-1$ ! if (workingSets != null) { ! String[] wsIds = new String[workingSets.length]; ! for (int i = 0; i < workingSets.length; i++) { ! wsIds[i] = workingSets[i].getId(); ! } ! settings.put("workingSets", wsIds); //$NON-NLS-1$ ! } else { ! settings.put("workingSets", new String[0]); //$NON-NLS-1$ ! } ! } ! public static SearchPatternData create(IDialogSettings settings) { ! String pattern = settings.get("pattern"); //$NON-NLS-1$ ! if (pattern.length() == 0) { return null; } ! // handle the RubyElement ! // this is copied from JavaSearchPage ! String[] wsIds = settings.getArray("workingSets"); //$NON-NLS-1$ ! IWorkingSet[] workingSets = null; ! if (wsIds != null && wsIds.length > 0) { ! IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); ! workingSets = new IWorkingSet[wsIds.length]; ! for (int i = 0; workingSets != null && i < wsIds.length; i++) { ! workingSets[i] = workingSetManager.getWorkingSet(wsIds[i]); ! if (workingSets[i] == null) { ! workingSets = null; ! } ! } ! } ! try { ! int searchFor = settings.getInt("searchFor"); //$NON-NLS-1$ ! int scope = settings.getInt("scope"); //$NON-NLS-1$ ! int limitTo = settings.getInt("limitTo"); //$NON-NLS-1$ ! boolean isCaseSensitive = settings.getBoolean("isCaseSensitive"); //$NON-NLS-1$ ! // TODO ! IRubyElement elem = null; // settings.get("rubyElement") ; ! return new SearchPatternData(searchFor, limitTo, pattern, isCaseSensitive, scope, workingSets); ! } catch (NumberFormatException e) { ! return null; ! } ! } ! } ! // private static final int HISTORY_SIZE = 12; ! // Dialog store id constants ! // private final static String PAGE_NAME = "JavaSearchPage"; //$NON-NLS-1$ ! // private final static String STORE_CASE_SENSITIVE = "CASE_SENSITIVE"; //$NON-NLS-1$ ! // private final static String STORE_HISTORY = "HISTORY"; //$NON-NLS-1$ ! // private final static String STORE_HISTORY_SIZE = "HISTORY_SIZE"; //$NON-NLS-1$ ! private final List fPreviousSearchPatterns; ! // private SearchPatternData fInitialData; ! private boolean fFirstTime = true; ! // private IDialogSettings fDialogSettings; ! // private boolean fIsCaseSensitive; ! private Combo fPattern; ! private ISearchPageContainer fContainer; ! private Button fCaseSensitive; ! // private Button[] fLimitTo; ! /* ! // private String[] fLimitToText = { "declarations" //$NON-NLS-1$ ! * SearchMessages.SearchPage_limitTo_declarations, ! * SearchMessages.SearchPage_limitTo_implementors, ! * SearchMessages.SearchPage_limitTo_references, ! * SearchMessages.SearchPage_limitTo_allOccurrences ! }; ! */ ! // private Button fSearchJRE; ! // private static final int INDEX_REFERENCES = 2; ! // private static final int INDEX_ALL = 3; ! private SearchForManager searchForManager = new SearchForManager(); ! /** ! * ! */ ! public RubySearchPage() { ! fPreviousSearchPatterns = new ArrayList(); ! } ! // ---- Action Handling ------------------------------------------------ ! public boolean performAction() { ! NewSearchUI.runQueryInBackground(getSearchQuery()); ! return true; ! } ! private ISearchQuery getSearchQuery() { ! SearchPatternData patternData = getPatternData(); ! // Setup search scope ! SearchScope scope = null; ! switch (getContainer().getSelectedScope()) { ! case ISearchPageContainer.WORKSPACE_SCOPE: ! scope = SearchScope.newWorkspaceScope(); ! break; ! /* ! * case ISearchPageContainer.SELECTION_SCOPE: scope= ! * getSelectedResourcesScope(false); break; case ! * ISearchPageContainer.SELECTED_PROJECTS_SCOPE: scope= ! * getSelectedResourcesScope(true); break; ! */ ! case ISearchPageContainer.WORKING_SET_SCOPE: ! IWorkingSet[] workingSets = getContainer().getSelectedWorkingSets(); ! String desc = Messages.format(SearchMessages.WorkingSetScope, ScopePart.toString(workingSets)); ! scope = SearchScope.newSearchScope(desc, workingSets); ! } ! NewSearchUI.activateSearchResultView(); ! return new RubySearchQuery(scope, patternData.getPattern(), patternData.getSearchFor()); ! } ! private int getLimitTo() { ! // for (int i = 0; i < fLimitTo.length; i++) { ! // if (fLimitTo[i].getSelection()) return i; ! // } ! return -1; ! } ! /* ! private void setLimitTo(int searchFor, int limitTo) { ! * if (!(searchFor == TYPE || searchFor == INTERFACE) && limitTo == ! * IMPLEMENTORS) { limitTo= REFERENCES; } ! * ! * if (!(searchFor == FIELD) && (limitTo == READ_ACCESSES || limitTo == ! * WRITE_ACCESSES)) { limitTo= REFERENCES; } ! * ! * for (int i= 0; i < fLimitTo.length; i++) { ! * fLimitTo[i].setSelection(limitTo == i); } ! * ! * fLimitTo[DECLARATIONS].setEnabled(true); ! * fLimitTo[IMPLEMENTORS].setEnabled(searchFor == INTERFACE || searchFor == ! * TYPE); fLimitTo[REFERENCES].setEnabled(true); ! * fLimitTo[ALL_OCCURRENCES].setEnabled(true); ! * fLimitTo[READ_ACCESSES].setEnabled(searchFor == FIELD); ! * fLimitTo[WRITE_ACCESSES].setEnabled(searchFor == FIELD); ! } ! */ ! private String[] getPreviousSearchPatterns() { ! // Search results are not persistent ! int patternCount = fPreviousSearchPatterns.size(); ! String[] patterns = new String[patternCount]; ! for (int i = 0; i < patternCount; i++) ! patterns[i] = ((SearchPatternData) fPreviousSearchPatterns.get(i)).getPattern(); ! return patterns; ! } ! private String getPattern() { ! return fPattern.getText(); ! } ! private SearchPatternData findInPrevious(String pattern) { ! for (Iterator iter = fPreviousSearchPatterns.iterator(); iter.hasNext();) { ! SearchPatternData element = (SearchPatternData) iter.next(); ! if (pattern.equals(element.getPattern())) { return element; } ! } ! return null; ! } ! /** ! * Return search pattern data and update previous searches. An existing ! * entry will be updated. ! */ ! private SearchPatternData getPatternData() { ! String pattern = getPattern(); ! SearchPatternData match = findInPrevious(pattern); ! if (match != null) { ! fPreviousSearchPatterns.remove(match); ! } ! match = new SearchPatternData(searchForManager.getSelectedSymbolType(), getLimitTo(), pattern, fCaseSensitive.getSelection(), getContainer().getSelectedScope(), getContainer().getSelectedWorkingSets()); ! fPreviousSearchPatterns.add(0, match); // insert on top ! return match; ! } ! /* ! * Implements method from IDialogPage ! */ ! public void setVisible(boolean visible) { ! if (visible && fPattern != null) { ! if (fFirstTime) { ! fFirstTime = false; ! // Set item and text here to prevent page from resizing ! fPattern.setItems(getPreviousSearchPatterns()); ! // initSelections(); ! } ! fPattern.setFocus(); ! } ! // updateOKStatus(); ! super.setVisible(visible); ! } ! public boolean isValid() { ! return true; ! } ! // ---- Widget creation ------------------------------------------------ ! /** ! * Creates the page's content. ! */ ! public void createControl(Composite parent) { ! initializeDialogUnits(parent); ! // readConfiguration(); ! Composite result = new Composite(parent, SWT.NONE); ! GridLayout layout = new GridLayout(2, false); ! layout.horizontalSpacing = 10; ! result.setLayout(layout); ! Control expressionComposite = createExpression(result); ! expressionComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1)); ! Label separator = new Label(result, SWT.NONE); ! separator.setVisible(false); ! GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1); ! data.heightHint = convertHeightInCharsToPixels(1) / 3; ! separator.setLayoutData(data); ! Control searchFor = searchForManager.createSearchFor(result); ! searchFor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); ! Control limitTo = createLimitTo(result); ! limitTo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); ! // createParticipants(result); ! setControl(result); ! Dialog.applyDialogFont(result); ! // PlatformUI.getWorkbench().getHelpSystem().setHelp(result, ! // IJavaHelpContextIds.JAVA_SEARCH_PAGE); ! } ! /* ! * private Control createParticipants(Composite result) { if ! * (!SearchParticipantsExtensionPoint.hasAnyParticipants()) return new ! * Composite(result, SWT.NULL); Button selectParticipants= new ! * Button(result, SWT.PUSH); ! * selectParticipants.setText(SearchMessages.getString("SearchPage.select_participants.label")); ! * //$NON-NLS-1$ GridData gd= new GridData(); gd.verticalAlignment= ! * GridData.VERTICAL_ALIGN_BEGINNING; gd.horizontalAlignment= ! * GridData.HORIZONTAL_ALIGN_END; gd.grabExcessHorizontalSpace= false; ! * gd.horizontalAlignment= GridData.END; gd.horizontalSpan= 2; ! * selectParticipants.setLayoutData(gd); ! * selectParticipants.addSelectionListener(new SelectionAdapter() { public ! * void widgetSelected(SelectionEvent e) { ! * PreferencePageSupport.showPreferencePage(getShell(), ! * "org.eclipse.jdt.ui.preferences.SearchParticipantsExtensionPoint", new ! * SearchParticipantsExtensionPoint()); //$NON-NLS-1$ } ! * ! * }); return selectParticipants; } ! */ ! private Control createExpression(Composite parent) { ! Composite result = new Composite(parent, SWT.NONE); ! GridLayout layout = new GridLayout(2, false); ! layout.marginWidth = 0; ! layout.marginHeight = 0; ! result.setLayout(layout); ! // Pattern text + info ! Label label = new Label(result, SWT.LEFT); ! // TODO ! label.setText("Expression"); //$NON-NLS-1$ ! // label.setText(SearchMessages.SearchPage_expression_label); ! label.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1)); ! // Pattern combo ! fPattern = new Combo(result, SWT.SINGLE | SWT.BORDER); ! fPattern.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! // handlePatternSelected(); ! // updateOKStatus(); ! } ! }); ! fPattern.addModifyListener(new ModifyListener() { ! public void modifyText(ModifyEvent e) { ! doPatternModified(); ! // updateOKStatus(); ! } ! }); ! GridData data = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1); ! data.widthHint = convertWidthInCharsToPixels(50); ! fPattern.setLayoutData(data); ! // Ignore case checkbox ! fCaseSensitive = new Button(result, SWT.CHECK); ! // TODO ! fCaseSensitive.setText("CaseSensitive"); //$NON-NLS-1$ ! fCaseSensitive.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! // fIsCaseSensitive = fCaseSensitive.getSelection(); ! } ! }); ! fCaseSensitive.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 1, 1)); ! return result; ! } ! // private boolean isValidSearchPattern() { ! // if (getPattern().length() == 0) { return false; } ! // // TODO ! // return true; ! // // return SearchPattern.createPattern(getPattern(), getSearchFor(), ! // // getLimitTo(), SearchPattern.R_EXACT_MATCH) != null; ! // } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.dialogs.DialogPage#dispose() ! */ ! public void dispose() { ! // writeConfiguration(); ! super.dispose(); ! } ! private void doPatternModified() { ! /* ! * if (fInitialData != null && ! * getPattern().equals(fInitialData.getPattern()) && ! * fInitialData.getJavaElement() != null && fInitialData.getSearchFor() == ! * getSearchFor()) { fCaseSensitive.setEnabled(false); ! * fCaseSensitive.setSelection(true); fJavaElement= ! * fInitialData.getJavaElement(); } else { fCaseSensitive.setEnabled(true); ! * fCaseSensitive.setSelection(fIsCaseSensitive); fJavaElement= null; } ! */ ! } ! private Control createLimitTo(Composite parent) { ! Group result = new Group(parent, SWT.NONE); ! /* ! * result.setText("Limit to") ! * ;//SearchMessages.SearchPage_limitTo_label); result.setLayout(new ! * GridLayout(2, true)); ! * ! * SelectionAdapter listener= new SelectionAdapter() { public void ! * widgetSelected(SelectionEvent e) { //updateUseJRE(); } }; ! * ! * fLimitTo= new Button[fLimitToText.length]; for (int i= 0; i < ! * fLimitToText.length; i++) { Button button= new Button(result, ! * SWT.RADIO); button.setText(fLimitToText[i]); fLimitTo[i]= button; ! * button.setSelection(i == REFERENCES); ! * button.addSelectionListener(listener); button.setLayoutData(new ! * GridData()); } ! */ ! return result; ! } ! /* ! * Implements method from ISearchPage ! */ ! public void setContainer(ISearchPageContainer container) { ! fContainer = container; ! } ! /** ! * Returns the search page's container. ! */ ! private ISearchPageContainer getContainer() { ! return fContainer; ! } ! class SearchForManager { ! private Button[] fSearchFor; ! private Button createButton(Group parent, String text, int symbolType) { ! Button button = new Button(parent, SWT.RADIO); ! button.setText(text); ! button.setData(new Integer(symbolType)); ! button.setLayoutData(new GridData()); ! return button; ! } ! private Control createSearchFor(Composite parent) { ! Group result = new Group(parent, SWT.NONE); ! result.setText(RubyUIMessages.getString("RubySearchPage.SearchForGroupLabel")); //$NON-NLS-1$ ! result.setLayout(new GridLayout(2, true)); ! fSearchFor = new Button[2]; ! fSearchFor[0] = createButton(result, RubyUIMessages.getString("RubySearch.SearchForClassSymbol"), CLASS_SYMBOL); //$NON-NLS-1$ ! fSearchFor[0].setSelection(true); ! fSearchFor[1] = createButton(result, RubyUIMessages.getString("RubySearch.SearchForMethodSymbol"), METHOD_SYMBOL); //$NON-NLS-1$ ! return result; ! } ! public int getSelectedSymbolType() { ! for (int i = 0; i < fSearchFor.length; i++) { ! if (fSearchFor[i].getSelection()) { return ((Integer) fSearchFor[i].getData()).intValue(); } ! } ! Assert.isTrue(false, "Error in RubySearchPage: There should always be a selected symbol type to search for"); //$NON-NLS-1$ ! return CLASS_SYMBOL; ! } ! } } --- 52,544 ---- public class RubySearchPage extends DialogPage implements ISearchPage, ISymbolTypes { ! // Shouldn't SearchPatternData be a public class in org.eclipse.search ? ! private static class SearchPatternData { ! private int searchFor; ! private int limitTo; ! private String pattern; ! private boolean isCaseSensitive; ! private int scope; ! private IWorkingSet[] workingSets; ! public SearchPatternData(int searchFor, int limitTo, boolean isCaseSensitive, String pattern) { ! this(searchFor, limitTo, pattern, isCaseSensitive, ! ISearchPageContainer.WORKSPACE_SCOPE, null); ! } ! public SearchPatternData(int searchFor, int limitTo, String pattern, ! boolean isCaseSensitive, int scope, IWorkingSet[] workingSets) { ! this.searchFor = searchFor; ! this.limitTo = limitTo; ! this.pattern = pattern; ! this.isCaseSensitive = isCaseSensitive; ! this.scope = scope; ! this.workingSets = workingSets; ! } ! public boolean isCaseSensitive() { ! return isCaseSensitive; ! } ! public int getLimitTo() { ! return limitTo; ! } ! public String getPattern() { ! return pattern; ! } ! public int getScope() { ! return scope; ! } ! public int getSearchFor() { ! return searchFor; ! } ! public IWorkingSet[] getWorkingSets() { ! return workingSets; ! } ! public void store(IDialogSettings settings) { ! settings.put("searchFor", searchFor); //$NON-NLS-1$ ! settings.put("scope", scope); //$NON-NLS-1$ ! settings.put("pattern", pattern); //$NON-NLS-1$ ! settings.put("limitTo", limitTo); //$NON-NLS-1$ ! // TODO ! // settings.put("rubyElement", rubyElement != null ? ! // rubyElement.getHandleIdentifier() : ""); //$NON-NLS-1$ ! // //$NON-NLS-2$ ! settings.put("isCaseSensitive", isCaseSensitive); //$NON-NLS-1$ ! if (workingSets != null) { ! String[] wsIds = new String[workingSets.length]; ! for (int i = 0; i < workingSets.length; i++) { ! wsIds[i] = workingSets[i].getId(); ! } ! settings.put("workingSets", wsIds); //$NON-NLS-1$ ! } else { ! settings.put("workingSets", new String[0]); //$NON-NLS-1$ ! } ! } ! public static SearchPatternData create(IDialogSettings settings) { ! String pattern = settings.get("pattern"); //$NON-NLS-1$ ! if (pattern.length() == 0) { return null; } ! // handle the RubyElement ! // this is copied from JavaSearchPage ! String[] wsIds = settings.getArray("workingSets"); //$NON-NLS-1$ ! IWorkingSet[] workingSets = null; ! if (wsIds != null && wsIds.length > 0) { ! IWorkingSetManager workingSetManager = PlatformUI.getWorkbench() ! .getWorkingSetManager(); ! workingSets = new IWorkingSet[wsIds.length]; ! for (int i = 0; workingSets != null && i < wsIds.length; i++) { ! workingSets[i] = workingSetManager.getWorkingSet(wsIds[i]); ! if (workingSets[i] == null) { ! workingSets = null; ! } ! } ! } ! try { ! int searchFor = settings.getInt("searchFor"); //$NON-NLS-1$ ! int scope = settings.getInt("scope"); //$NON-NLS-1$ ! int limitTo = settings.getInt("limitTo"); //$NON-NLS-1$ ! boolean isCaseSensitive = settings.getBoolean("isCaseSensitive"); //$NON-NLS-1$ ! // TODO ! IRubyElement elem = null; // settings.get("rubyElement") ; ! return new SearchPatternData(searchFor, limitTo, pattern, isCaseSensitive, scope, ! workingSets); ! } catch (NumberFormatException e) { ! return null; ! } ! } ! } ! // private static final int HISTORY_SIZE = 12; ! // Dialog store id constants ! // private final static String PAGE_NAME = "JavaSearchPage"; //$NON-NLS-1$ ! // private final static String STORE_CASE_SENSITIVE = "CASE_SENSITIVE"; ! // //$NON-NLS-1$ ! // private final static String STORE_HISTORY = "HISTORY"; //$NON-NLS-1$ ! // private final static String STORE_HISTORY_SIZE = "HISTORY_SIZE"; ! // //$NON-NLS-1$ ! private final List fPreviousSearchPatterns; ! // private SearchPatternData fInitialData; ! private boolean fFirstTime = true; ! // private IDialogSettings fDialogSettings; ! // private boolean fIsCaseSensitive; ! private Combo fPattern; ! private ISearchPageContainer fContainer; ! private Button fCaseSensitive; ! // private Button[] fLimitTo; ! /* ! * // private String[] fLimitToText = { "declarations" //$NON-NLS-1$ ! * SearchMessages.SearchPage_limitTo_declarations, ! * SearchMessages.SearchPage_limitTo_implementors, ! * SearchMessages.SearchPage_limitTo_references, ! * SearchMessages.SearchPage_limitTo_allOccurrences }; ! */ ! // private Button fSearchJRE; ! // private static final int INDEX_REFERENCES = 2; ! // private static final int INDEX_ALL = 3; ! private SearchForManager searchForManager = new SearchForManager(); ! /** ! * ! */ ! public RubySearchPage() { ! fPreviousSearchPatterns = new ArrayList(); ! } ! // ---- Action Handling ------------------------------------------------ ! public boolean performAction() { ! NewSearchUI.runQueryInBackground(getSearchQuery()); ! return true; ! } ! private ISearchQuery getSearchQuery() { ! SearchPatternData patternData = getPatternData(); ! // Setup search scope ! // SearchScope scope = null; ! switch (getContainer().getSelectedScope()) { ! case ISearchPageContainer.WORKSPACE_SCOPE: ! // scope = SearchScope.newWorkspaceScope(); ! break; ! /* ! * case ISearchPageContainer.SELECTION_SCOPE: scope= ! * getSelectedResourcesScope(false); break; case ! * ISearchPageContainer.SELECTED_PROJECTS_SCOPE: scope= ! * getSelectedResourcesScope(true); break; ! */ ! case ISearchPageContainer.WORKING_SET_SCOPE: ! IWorkingSet[] workingSets = getContainer().getSelectedWorkingSets(); ! String desc = Messages.format(SearchMessages.WorkingSetScope, ScopePart ! .toString(workingSets)); ! // scope = SearchScope.newSearchScope(desc, workingSets); ! } ! NewSearchUI.activateSearchResultView(); ! return new RubySearchQuery(patternData.getPattern(), patternData.getSearchFor()); ! } ! private int getLimitTo() { ! // for (int i = 0; i < fLimitTo.length; i++) { ! // if (fLimitTo[i].getSelection()) return i; ! // } ! return -1; ! } ! /* ! * private void setLimitTo(int searchFor, int limitTo) { if (!(searchFor == ! * TYPE || searchFor == INTERFACE) && limitTo == IMPLEMENTORS) { limitTo= ! * REFERENCES; } ! * ! * if (!(searchFor == FIELD) && (limitTo == READ_ACCESSES || limitTo == ! * WRITE_ACCESSES)) { limitTo= REFERENCES; } ! * ! * for (int i= 0; i < fLimitTo.length; i++) { ! * fLimitTo[i].setSelection(limitTo == i); } ! * ! * fLimitTo[DECLARATIONS].setEnabled(true); ! * fLimitTo[IMPLEMENTORS].setEnabled(searchFor == INTERFACE || searchFor == ! * TYPE); fLimitTo[REFERENCES].setEnabled(true); ! * fLimitTo[ALL_OCCURRENCES].setEnabled(true); ! * fLimitTo[READ_ACCESSES].setEnabled(searchFor == FIELD); ! * fLimitTo[WRITE_ACCESSES].setEnabled(searchFor == FIELD); } ! */ ! private String[] getPreviousSearchPatterns() { ! // Search results are not persistent ! int patternCount = fPreviousSearchPatterns.size(); ! String[] patterns = new String[patternCount]; ! for (int i = 0; i < patternCount; i++) ! patterns[i] = ((SearchPatternData) fPreviousSearchPatterns.get(i)).getPattern(); ! return patterns; ! } ! private String getPattern() { ! return fPattern.getText(); ! } ! private SearchPatternData findInPrevious(String pattern) { ! for (Iterator iter = fPreviousSearchPatterns.iterator(); iter.hasNext();) { ! SearchPatternData element = (SearchPatternData) iter.next(); ! if (pattern.equals(element.getPattern())) { return element; } ! } ! return null; ! } ! /** ! * Return search pattern data and update previous searches. An existing ! * entry will be updated. ! */ ! private SearchPatternData getPatternData() { ! String pattern = getPattern(); ! SearchPatternData match = findInPrevious(pattern); ! if (match != null) { ! fPreviousSearchPatterns.remove(match); ! } ! match = new SearchPatternData(searchForManager.getSelectedSymbolType(), getLimitTo(), ! pattern, fCaseSensitive.getSelection(), getContainer().getSelectedScope(), ! getContainer().getSelectedWorkingSets()); ! fPreviousSearchPatterns.add(0, match); // insert on top ! return match; ! } ! /* ! * Implements method from IDialogPage ! */ ! public void setVisible(boolean visible) { ! if (visible && fPattern != null) { ! if (fFirstTime) { ! fFirstTime = false; ! // Set item and text here to prevent page from resizing ! fPattern.setItems(getPreviousSearchPatterns()); ! // initSelections(); ! } ! fPattern.setFocus(); ! } ! // updateOKStatus(); ! super.setVisible(visible); ! } ! public boolean isValid() { ! return true; ! } ! // ---- Widget creation ------------------------------------------------ ! /** ! * Creates the page's content. ! */ ! public void createControl(Composite parent) { ! initializeDialogUnits(parent); ! // readConfiguration(); ! Composite result = new Composite(parent, SWT.NONE); ! GridLayout layout = new GridLayout(2, false); ! layout.horizontalSpacing = 10; ! result.setLayout(layout); ! Control expressionComposite = createExpression(result); ! expressionComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, ! 2, 1)); ! Label separator = new Label(result, SWT.NONE); ! separator.setVisible(false); ! GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1); ! data.heightHint = convertHeightInCharsToPixels(1) / 3; ! separator.setLayoutData(data); ! Control searchFor = searchForManager.createSearchFor(result); ! searchFor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); ! Control limitTo = createLimitTo(result); ! limitTo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); ! // createParticipants(result); ! setControl(result); ! Dialog.applyDialogFont(result); ! // PlatformUI.getWorkbench().getHelpSystem().setHelp(result, ! // IJavaHelpContextIds.JAVA_SEARCH_PAGE); ! } ! /* ! * private Control createParticipants(Composite result) { if ! * (!SearchParticipantsExtensionPoint.hasAnyParticipants()) return new ! * Composite(result, SWT.NULL); Button selectParticipants= new ! * Button(result, SWT.PUSH); ! * selectParticipants.setText(SearchMessages.getString("SearchPage.select_participants.label")); ! * //$NON-NLS-1$ GridData gd= new GridData(); gd.verticalAlignment= ! * GridData.VERTICAL_ALIGN_BEGINNING; gd.horizontalAlignment= ! * GridData.HORIZONTAL_ALIGN_END; gd.grabExcessHorizontalSpace= false; ! * gd.horizontalAlignment= GridData.END; gd.horizontalSpan= 2; ! * selectParticipants.setLayoutData(gd); ! * selectParticipants.addSelectionListener(new SelectionAdapter() { public ! * void widgetSelected(SelectionEvent e) { ! * PreferencePageSupport.showPreferencePage(getShell(), ! * "org.eclipse.jdt.ui.preferences.SearchParticipantsExtensionPoint", new ! * SearchParticipantsExtensionPoint()); //$NON-NLS-1$ } ! * ! * }); return selectParticipants; } ! */ ! private Control createExpression(Composite parent) { ! Composite result = new Composite(parent, SWT.NONE); ! GridLayout layout = new GridLayout(2, false); ! layout.marginWidth = 0; ! layout.marginHeight = 0; ! result.setLayout(layout); ! // Pattern text + info ! Label label = new Label(result, SWT.LEFT); ! // TODO ! label.setText("Expression"); //$NON-NLS-1$ ! // label.setText(SearchMessages.SearchPage_expression_label); ! label.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1)); ! // Pattern combo ! fPattern = new Combo(result, SWT.SINGLE | SWT.BORDER); ! fPattern.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! // handlePatternSelected(); ! // updateOKStatus(); ! } ! }); ! fPattern.addModifyListener(new ModifyListener() { ! public void modifyText(ModifyEvent e) { ! doPatternModified(); ! // updateOKStatus(); ! } ! }); ! GridData data = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1); ! data.widthHint = convertWidthInCharsToPixels(50); ! fPattern.setLayoutData(data); ! // Ignore case checkbox ! fCaseSensitive = new Button(result, SWT.CHECK); ! // TODO ! fCaseSensitive.setText("CaseSensitive"); //$NON-NLS-1$ ! fCaseSensitive.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! // fIsCaseSensitive = fCaseSensitive.getSelection(); ! } ! }); ! fCaseSensitive ! .setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 1, 1)); ! return result; ! } ! // private boolean isValidSearchPattern() { ! // if (getPattern().length() == 0) { return false; } ! // // TODO ! // return true; ! // // return SearchPattern.createPattern(getPattern(), getSearchFor(), ! // // getLimitTo(), SearchPattern.R_EXACT_MATCH) != null; ! // } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.jface.dialogs.DialogPage#dispose() ! */ ! public void dispose() { ! // writeConfiguration(); ! super.dispose(); ! } ! private void doPatternModified() { ! /* ! * if (fInitialData != null && ! * getPattern().equals(fInitialData.getPattern()) && ! * fInitialData.getJavaElement() != null && fInitialData.getSearchFor() == ! * getSearchFor()) { fCaseSensitive.setEnabled(false); ! * fCaseSensitive.setSelection(true); fJavaElement= ! * fInitialData.getJavaElement(); } else { ! * fCaseSensitive.setEnabled(true); ! * fCaseSensitive.setSelection(fIsCaseSensitive); fJavaElement= null; } ! */ ! } ! private Control createLimitTo(Composite parent) { ! Group result = new Group(parent, SWT.NONE); ! /* ! * result.setText("Limit to") ! * ;//SearchMessages.SearchPage_limitTo_label); result.setLayout(new ! * GridLayout(2, true)); ! * ! * SelectionAdapter listener= new SelectionAdapter() { public void ! * widgetSelected(SelectionEvent e) { //updateUseJRE(); } }; ! * ! * fLimitTo= new Button[fLimitToText.length]; for (int i= 0; i < ! * fLimitToText.length; i++) { Button button= new Button(result, ! * SWT.RADIO); button.setText(fLimitToText[i]); fLimitTo[i]= button; ! * button.setSelection(i == REFERENCES); ! * button.addSelectionListener(listener); button.setLayoutData(new ! * GridData()); } ! */ ! return result; ! } ! /* ! * Implements method from ISearchPage ! */ ! public void setContainer(ISearchPageContainer container) { ! fContainer = container; ! } ! /** ! * Returns the search page's container. ! */ ! private ISearchPageContainer getContainer() { ! return fContainer; ! } ! class SearchForManager { ! private Button[] fSearchFor; ! private Button createButton(Group parent, String text, int symbolType) { ! Button button = new Button(parent, SWT.RADIO); ! button.setText(text); ! button.setData(new Integer(symbolType)); ! button.setLayoutData(new GridData()); ! return button; ! } ! private Control createSearchFor(Composite parent) { ! Group result = new Group(parent, SWT.NONE); ! result.setText(RubyUIMessages.getString("RubySearchPage.SearchForGroupLabel")); //$NON-NLS-1$ ! result.setLayout(new GridLayout(2, true)); + fSearchFor = new Button[2]; + fSearchFor[0] = createButton(result, RubyUIMessages + .getString("RubySearch.SearchForClassSymbol"), CLASS_SYMBOL); //$NON-NLS-1$ + fSearchFor[0].setSelection(true); + fSearchFor[1] = createButton(result, RubyUIMessages + .getString("RubySearch.SearchForMethodSymbol"), METHOD_SYMBOL); //$NON-NLS-1$ ! return result; ! } + public int getSelectedSymbolType() { + for (int i = 0; i < fSearchFor.length; i++) { + if (fSearchFor[i].getSelection()) { return ((Integer) fSearchFor[i].getData()) + .intValue(); } + } + Assert + .isTrue(false, + "Error in RubySearchPage: There should always be a selected symbol type to search for"); //$NON-NLS-1$ + return CLASS_SYMBOL; + } ! } } |
|
From: Christopher W. <caw...@us...> - 2006-02-17 20:25:26
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1928/src/org/rubypeople/rdt/internal/corext/util Modified Files: RubyModelUtil.java Log Message: Index: RubyModelUtil.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util/RubyModelUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyModelUtil.java 10 Mar 2005 04:10:15 -0000 1.1 --- RubyModelUtil.java 17 Feb 2006 20:25:21 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- import org.rubypeople.rdt.core.IRubyScript; + import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; *************** *** 43,45 **** --- 44,53 ---- return cu.getOwner() == null; } + + public static void reconcile(IRubyScript unit) throws RubyModelException { + unit.reconcile( + false /* don't force problem detection */, + null /* use primary owner */, + null /* no progress monitor */); + } } |
|
From: Christopher W. <caw...@us...> - 2006-02-17 20:25:13
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1465/src/org/rubypeople/rdt/internal/corext/util Added Files: Messages.java Log Message: --- NEW FILE: Messages.java --- package org.rubypeople.rdt.internal.corext.util; import java.text.MessageFormat; /** * Helper class to format message strings. * * @since 0.8.0 */ public class Messages { public static String format(String message, Object object) { return MessageFormat.format(message, new Object[] { object}); } public static String format(String message, Object[] objects) { return MessageFormat.format(message, objects); } private Messages() { // Not for instantiation } } |
|
From: Christopher W. <caw...@us...> - 2006-02-17 20:23:31
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/corext/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1036/src/org/rubypeople/rdt/internal/corext/util Added Files: CodeFormatterUtil.java Log Message: --- NEW FILE: CodeFormatterUtil.java --- package org.rubypeople.rdt.internal.corext.util; import java.util.Map; import org.eclipse.text.edits.TextEdit; import org.rubypeople.rdt.core.ToolFactory; public class CodeFormatterUtil { /** * Creates edits that describe how to format the given string. Returns * <code>null</code> if the code could not be formatted for the given * kind. * * @throws IllegalArgumentException * If the offset and length are not inside the string, a * IllegalArgumentException is thrown. */ public static TextEdit format2(int kind, String string, int offset, int length, int indentationLevel, String lineSeparator, Map options) { if (offset < 0 || length < 0 || offset + length > string.length()) { throw new IllegalArgumentException( "offset or length outside of string. offset: " + offset + ", length: " + length + ", string size: " + string.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ } return ToolFactory.createCodeFormatter(options).format(kind, string, offset, length, indentationLevel, lineSeparator); } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 23:05:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23147/src/org/rubypeople/rdt/ui/text Modified Files: RubySourceViewerConfiguration.java Log Message: Index: RubySourceViewerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubySourceViewerConfiguration.java 10 Feb 2006 19:50:19 -0000 1.1 --- RubySourceViewerConfiguration.java 10 Feb 2006 23:05:47 -0000 1.2 *************** *** 388,392 **** (RubyAbstractEditor) fTextEditor), true); reconciler.setIsIncrementalReconciler(false); ! reconciler.setIsAllowedToModifyDocument(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); --- 388,394 ---- (RubyAbstractEditor) fTextEditor), true); reconciler.setIsIncrementalReconciler(false); ! // TODO Uncomment when we move to Eclipse 3.2 ! // ECLIPSE 3.2 ! //reconciler.setIsAllowedToModifyDocument(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); |
|
From: Christopher W. <caw...@us...> - 2006-02-10 23:05:58
|
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-serv23147/src/org/rubypeople/rdt/internal/ui/preferences/formatter Modified Files: RubyPreview.java Log Message: Index: RubyPreview.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/formatter/RubyPreview.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyPreview.java 10 Feb 2006 19:57:50 -0000 1.1 --- RubyPreview.java 10 Feb 2006 23:05:47 -0000 1.2 *************** *** 39,193 **** import org.rubypeople.rdt.ui.PreferenceConstants; - public abstract class RubyPreview { - - - private final class RubySourcePreviewerUpdater { - - final IPropertyChangeListener fontListener= new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(PreferenceConstants.EDITOR_TEXT_FONT)) { - final Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); - fSourceViewer.getTextWidget().setFont(font); - if (fMarginPainter != null) { - fMarginPainter.initialize(); - } - } - } - }; - - final IPropertyChangeListener propertyListener= new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if (fViewerConfiguration.affectsTextPresentation(event)) { - fViewerConfiguration.handlePropertyChangeEvent(event); - fSourceViewer.invalidateTextPresentation(); - } - } - }; - - - public RubySourcePreviewerUpdater() { - - JFaceResources.getFontRegistry().addListener(fontListener); - fPreferenceStore.addPropertyChangeListener(propertyListener); - - fSourceViewer.getTextWidget().addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - JFaceResources.getFontRegistry().removeListener(fontListener); - fPreferenceStore.removePropertyChangeListener(propertyListener); - } - }); - } - } - - protected final SimpleRubySourceViewerConfiguration fViewerConfiguration; - protected final Document fPreviewDocument; - protected final SourceViewer fSourceViewer; - protected final IPreferenceStore fPreferenceStore; - - protected final MarginPainter fMarginPainter; - - protected Map fWorkingValues; ! private int fTabSize= 0; ! ! /** ! * Create a new Ruby preview ! * @param workingValues ! * @param parent ! */ ! public RubyPreview(Map workingValues, Composite parent) { ! RubyTextTools tools= RubyPlugin.getDefault().getRubyTextTools(); ! fPreviewDocument= new Document(); ! fWorkingValues= workingValues; ! tools.setupRubyDocumentPartitioner( fPreviewDocument, IRubyPartitions.RUBY_PARTITIONING); ! ! IPreferenceStore[] chain= { RubyPlugin.getDefault().getCombinedPreferenceStore() }; ! fPreferenceStore= new ChainedPreferenceStore(chain); ! fSourceViewer= new RubySourceViewer(parent, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, fPreferenceStore); ! fViewerConfiguration= new SimpleRubySourceViewerConfiguration(tools.getColorManager(), fPreferenceStore, null, IRubyPartitions.RUBY_PARTITIONING, true); ! fSourceViewer.configure(fViewerConfiguration); ! fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); ! ! fMarginPainter= new MarginPainter(fSourceViewer); ! final RGB rgb= PreferenceConverter.getColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR); ! fMarginPainter.setMarginRulerColor(tools.getColorManager().getColor(rgb)); ! fSourceViewer.addPainter(fMarginPainter); ! ! new RubySourcePreviewerUpdater(); ! fSourceViewer.setDocument(fPreviewDocument); ! } ! ! public Control getControl() { ! return fSourceViewer.getControl(); ! } ! ! ! public void update() { ! if (fWorkingValues == null) { ! fPreviewDocument.set(""); //$NON-NLS-1$ ! return; ! } ! ! // update the print margin ! final String value= (String)fWorkingValues.get(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT); ! final int lineWidth= getPositiveIntValue(value, 0); ! fMarginPainter.setMarginRulerColumn(lineWidth); ! ! // update the tab size ! final int tabSize= getPositiveIntValue((String) fWorkingValues.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE), 0); ! if (tabSize != fTabSize) fSourceViewer.getTextWidget().setTabs(tabSize); ! fTabSize= tabSize; ! ! final StyledText widget= (StyledText)fSourceViewer.getControl(); ! final int height= widget.getClientArea().height; ! final int top0= widget.getTopPixel(); ! ! final int totalPixels0= getHeightOfAllLines(widget); ! final int topPixelRange0= totalPixels0 > height ? totalPixels0 - height : 0; ! ! widget.setRedraw(false); ! doFormatPreview(); ! fSourceViewer.setSelection(null); ! ! final int totalPixels1= getHeightOfAllLines(widget); ! final int topPixelRange1= totalPixels1 > height ? totalPixels1 - height : 0; ! final int top1= topPixelRange0 > 0 ? (int)(topPixelRange1 * top0 / (double)topPixelRange0) : 0; ! widget.setTopPixel(top1); ! widget.setRedraw(true); ! } ! ! private int getHeightOfAllLines(StyledText styledText) { ! int height= 0; ! int lineCount= styledText.getLineCount(); ! for (int i= 0; i < lineCount; i++) ! height= height + styledText.getLineHeight(styledText.getOffsetAtLine(i)); ! return height; ! } ! ! protected abstract void doFormatPreview(); ! ! private static int getPositiveIntValue(String string, int defaultValue) { ! try { ! int i= Integer.parseInt(string); ! if (i >= 0) { ! return i; ! } ! } catch (NumberFormatException e) { ! } ! return defaultValue; ! } ! ! ! public final Map getWorkingValues() { ! return fWorkingValues; ! } ! ! ! public final void setWorkingValues(Map workingValues) { ! fWorkingValues= workingValues; ! } } --- 39,217 ---- import org.rubypeople.rdt.ui.PreferenceConstants; public abstract class RubyPreview { ! private final class RubySourcePreviewerUpdater { ! final IPropertyChangeListener fontListener = new IPropertyChangeListener() { ! public void propertyChange(PropertyChangeEvent event) { ! if (event.getProperty().equals( ! PreferenceConstants.EDITOR_TEXT_FONT)) { ! final Font font = JFaceResources ! .getFont(PreferenceConstants.EDITOR_TEXT_FONT); ! fSourceViewer.getTextWidget().setFont(font); ! if (fMarginPainter != null) { ! fMarginPainter.initialize(); ! } ! } ! } ! }; ! final IPropertyChangeListener propertyListener = new IPropertyChangeListener() { ! public void propertyChange(PropertyChangeEvent event) { ! if (fViewerConfiguration.affectsTextPresentation(event)) { ! fViewerConfiguration.handlePropertyChangeEvent(event); ! fSourceViewer.invalidateTextPresentation(); ! } ! } ! }; ! public RubySourcePreviewerUpdater() { ! ! JFaceResources.getFontRegistry().addListener(fontListener); ! fPreferenceStore.addPropertyChangeListener(propertyListener); ! ! fSourceViewer.getTextWidget().addDisposeListener( ! new DisposeListener() { ! public void widgetDisposed(DisposeEvent e) { ! JFaceResources.getFontRegistry().removeListener( ! fontListener); ! fPreferenceStore ! .removePropertyChangeListener(propertyListener); ! } ! }); ! } ! } ! ! protected final SimpleRubySourceViewerConfiguration fViewerConfiguration; ! ! protected final Document fPreviewDocument; ! ! protected final SourceViewer fSourceViewer; ! ! protected final IPreferenceStore fPreferenceStore; ! ! protected final MarginPainter fMarginPainter; ! ! protected Map fWorkingValues; ! ! private int fTabSize = 0; ! ! /** ! * Create a new Ruby preview ! * ! * @param workingValues ! * @param parent ! */ ! public RubyPreview(Map workingValues, Composite parent) { ! RubyTextTools tools = RubyPlugin.getDefault().getRubyTextTools(); ! fPreviewDocument = new Document(); ! fWorkingValues = workingValues; ! tools.setupRubyDocumentPartitioner(fPreviewDocument, ! IRubyPartitions.RUBY_PARTITIONING); ! ! IPreferenceStore[] chain = { RubyPlugin.getDefault() ! .getCombinedPreferenceStore() }; ! fPreferenceStore = new ChainedPreferenceStore(chain); ! fSourceViewer = new RubySourceViewer(parent, null, null, false, ! SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER, ! fPreferenceStore); ! fViewerConfiguration = new SimpleRubySourceViewerConfiguration(tools ! .getColorManager(), fPreferenceStore, null, ! IRubyPartitions.RUBY_PARTITIONING, true); ! fSourceViewer.configure(fViewerConfiguration); ! fSourceViewer.getTextWidget().setFont( ! JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); ! ! fMarginPainter = new MarginPainter(fSourceViewer); ! final RGB rgb = PreferenceConverter ! .getColor( ! fPreferenceStore, ! AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR); ! fMarginPainter.setMarginRulerColor(tools.getColorManager() ! .getColor(rgb)); ! fSourceViewer.addPainter(fMarginPainter); ! ! new RubySourcePreviewerUpdater(); ! fSourceViewer.setDocument(fPreviewDocument); ! } ! ! public Control getControl() { ! return fSourceViewer.getControl(); ! } ! ! public void update() { ! if (fWorkingValues == null) { ! fPreviewDocument.set(""); //$NON-NLS-1$ ! return; ! } ! ! // update the print margin ! final String value = (String) fWorkingValues ! .get(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT); ! final int lineWidth = getPositiveIntValue(value, 0); ! fMarginPainter.setMarginRulerColumn(lineWidth); ! ! // update the tab size ! final int tabSize = getPositiveIntValue((String) fWorkingValues ! .get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE), 0); ! if (tabSize != fTabSize) ! fSourceViewer.getTextWidget().setTabs(tabSize); ! fTabSize = tabSize; ! ! final StyledText widget = (StyledText) fSourceViewer.getControl(); ! final int height = widget.getClientArea().height; ! final int top0 = widget.getTopPixel(); ! ! final int totalPixels0 = getHeightOfAllLines(widget); ! final int topPixelRange0 = totalPixels0 > height ? totalPixels0 ! - height : 0; ! ! widget.setRedraw(false); ! doFormatPreview(); ! fSourceViewer.setSelection(null); ! ! final int totalPixels1 = getHeightOfAllLines(widget); ! final int topPixelRange1 = totalPixels1 > height ? totalPixels1 ! - height : 0; ! ! final int top1 = topPixelRange0 > 0 ? (int) (topPixelRange1 * top0 / (double) topPixelRange0) ! : 0; ! widget.setTopPixel(top1); ! widget.setRedraw(true); ! } ! ! private int getHeightOfAllLines(StyledText styledText) { ! int height = 0; ! int lineCount = styledText.getLineCount(); ! for (int i = 0; i < lineCount; i++) { ! // TODO Uncomment the line below and delete on after when moving to ! // Eclipse 3.2 ! // ECLIPSE 3.2 ! // height= height + ! // styledText.getLineHeight(styledText.getOffsetAtLine(i)); ! height = height + styledText.getLineHeight(); ! } ! return height; ! } ! ! protected abstract void doFormatPreview(); ! ! private static int getPositiveIntValue(String string, int defaultValue) { ! try { ! int i = Integer.parseInt(string); ! if (i >= 0) { ! return i; ! } ! } catch (NumberFormatException e) { ! } ! return defaultValue; ! } ! ! public final Map getWorkingValues() { ! return fWorkingValues; ! } ! ! public final void setWorkingValues(Map workingValues) { ! fWorkingValues = workingValues; ! } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 23:05:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23147/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates Modified Files: RubyContext.java RubyTemplatePreferencePage.java Log Message: Index: RubyTemplatePreferencePage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates/RubyTemplatePreferencePage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyTemplatePreferencePage.java 2 Mar 2005 00:56:52 -0000 1.2 --- RubyTemplatePreferencePage.java 10 Feb 2006 23:05:47 -0000 1.3 *************** *** 25,30 **** import org.eclipse.ui.texteditor.templates.TemplatePreferencePage; import org.rubypeople.rdt.internal.ui.RubyPlugin; - import org.rubypeople.rdt.internal.ui.text.RubySourceViewerConfiguration; import org.rubypeople.rdt.ui.PreferenceConstants; /** --- 25,30 ---- import org.eclipse.ui.texteditor.templates.TemplatePreferencePage; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.ui.PreferenceConstants; + import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; /** *************** *** 59,63 **** // FIXME Pass in the current editor! ! SourceViewerConfiguration configuration = new RubySourceViewerConfiguration(RubyPlugin.getDefault().getTextTools(), null); IDocument document = new Document(); // FIXME Do we need this? --- 59,63 ---- // FIXME Pass in the current editor! ! SourceViewerConfiguration configuration = new RubySourceViewerConfiguration(RubyPlugin.getDefault().getRubyTextTools(), null); IDocument document = new Document(); // FIXME Do we need this? Index: RubyContext.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/templates/RubyContext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyContext.java 1 Oct 2005 23:10:44 -0000 1.2 --- RubyContext.java 10 Feb 2006 23:05:47 -0000 1.3 *************** *** 19,23 **** import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateException; ! import org.rubypeople.rdt.internal.ui.rubyeditor.outline.RubyModel; public class RubyContext extends DocumentTemplateContext { --- 19,23 ---- import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateException; ! import org.rubypeople.rdt.internal.core.RubyModel; public class RubyContext extends DocumentTemplateContext { |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:17:31
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20514 Modified Files: plugin.properties plugin.xml Log Message: Index: plugin.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/plugin.properties,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** plugin.properties 31 Jan 2006 20:29:53 -0000 1.26 --- plugin.properties 10 Feb 2006 20:17:19 -0000 1.27 *************** *** 97,99 **** GenerateRdocAction.label= &Generate Rdoc... ! RubySearchPage.label=Ruby Search \ No newline at end of file --- 97,102 ---- GenerateRdocAction.label= &Generate Rdoc... ! RubySearchPage.label=Ruby Search ! ! memberSortPrefName=Members Sort Order ! codeFormatterPrefName=Formatter \ No newline at end of file Index: plugin.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/plugin.xml,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** plugin.xml 31 Jan 2006 20:29:53 -0000 1.71 --- plugin.xml 10 Feb 2006 20:17:20 -0000 1.72 *************** *** 22,25 **** --- 22,32 ---- </page> <page + name="%codeFormatterPrefName" + category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase" + class="org.rubypeople.rdt.internal.ui.preferences.CodeFormatterPreferencePage" + id="org.rubypeople.rdt.ui.preferences.CodeFormatterPreferencePage"> + <keywordReference id="org.rubypeople.rdt.ui.formatter"/> + </page> + <page name="%PreferencePage.rdtTaskPreferences" category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase" *************** *** 39,42 **** --- 46,56 ---- id="org.rubypeople.rdt.ui.RdocRiPreferencePage"> </page> + <page + name="%memberSortPrefName" + category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase" + class="org.rubypeople.rdt.internal.ui.preferences.MembersOrderPreferencePage" + id="org.rubypeople.rdt.ui.preferences.MembersOrderPreferencePage"> + <keywordReference id="org.rubypeople.rdt.ui.sortorder"/> + </page> </extension> <extension *************** *** 53,65 **** <category name="%NewWizardCategory.name" ! id="org.rubypeople.rdt.ui.NewWizardCategoryRuby"> </category> <wizard name="%NewWizardRubyProject.name" icon="icons/full/etool16/newrprj_wiz.gif" ! category="org.rubypeople.rdt.ui.NewWizardCategoryRuby" class="org.rubypeople.rdt.internal.ui.wizards.NewProjectCreationWizard" preferredPerspectives="org.rubypeople.rdt.ui.PerspectiveRuby" project="true" id="org.rubypeople.rdt.ui.wizards.NewWizardProjectCreation"> <description> --- 67,80 ---- <category name="%NewWizardCategory.name" ! id="org.rubypeople.rdt.ui"> </category> <wizard name="%NewWizardRubyProject.name" icon="icons/full/etool16/newrprj_wiz.gif" ! category="org.rubypeople.rdt.ui" class="org.rubypeople.rdt.internal.ui.wizards.NewProjectCreationWizard" preferredPerspectives="org.rubypeople.rdt.ui.PerspectiveRuby" project="true" + finalPerspective="org.rubypeople.rdt.ui.PerspectiveRuby" id="org.rubypeople.rdt.ui.wizards.NewWizardProjectCreation"> <description> *************** *** 70,74 **** name="%NewWizardRubyClass.name" icon="icons/full/etool16/newclass_wiz.gif" ! category="org.rubypeople.rdt.ui.NewWizardCategoryRuby" class="org.rubypeople.rdt.ui.wizards.RubyNewClassWizard" preferredPerspectives="org.rubypeople.rdt.ui.PerspectiveRuby" --- 85,89 ---- name="%NewWizardRubyClass.name" icon="icons/full/etool16/newclass_wiz.gif" ! category="org.rubypeople.rdt.ui" class="org.rubypeople.rdt.ui.wizards.RubyNewClassWizard" preferredPerspectives="org.rubypeople.rdt.ui.PerspectiveRuby" *************** *** 325,328 **** --- 340,350 ---- id="org.rubypeople.rdt.ui.actions.ToggleComment"> </action> + <action + definitionId="org.rubypeople.rdt.ui.edit.text.ruby.surround.with.begin.rescue" + label="%SurroundWithBeginRescueAction.label" + retarget="true" + menubarPath="org.rubypeople.rdt.ui.ruby.menu/editGroup" + id="org.rubypeople.rdt.ui.actions.SurroundWithBeginRescue"> + </action> </actionSet> <actionSet *************** *** 419,426 **** --- 441,464 ---- <extension point="org.eclipse.ui.ide.resourceFilters"> + <filter + selected="true" + pattern=".*"> + </filter> <filter selected="false" pattern="*.xml"> </filter> + <filter + selected="false" + pattern="*.yml"> + </filter> + <filter + selected="false" + pattern="*.gem"> + </filter> + <filter + selected="false" + pattern="*.so"> + </filter> </extension> <extension |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:15:41
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19735/META-INF Modified Files: MANIFEST.MF Log Message: Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MANIFEST.MF 4 Feb 2006 11:49:11 -0000 1.7 --- MANIFEST.MF 10 Feb 2006 20:15:29 -0000 1.8 *************** *** 18,22 **** org.rubypeople.rdt.internal.ui.resourcesview, org.rubypeople.rdt.internal.ui.rubyeditor, - org.rubypeople.rdt.internal.ui.rubyeditor.outline, org.rubypeople.rdt.internal.ui.rubyeditor.templates, org.rubypeople.rdt.internal.ui.search, --- 18,21 ---- |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:15:04
|
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-serv19417/src/org/rubypeople/rdt/internal/ui/text/comment Added Files: CommentFormattingStrategy.java CommentFormattingContext.java Log Message: --- NEW FILE: CommentFormattingContext.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.comment; import org.eclipse.jface.text.formatter.FormattingContext; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; /** * Formatting context for the comment formatter. * * @since 3.0 */ public class CommentFormattingContext extends FormattingContext { /* * @see org.eclipse.jface.text.formatter.IFormattingContext#getPreferenceKeys() */ public String[] getPreferenceKeys() { return new String[] { DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES}; } /* * @see org.eclipse.jface.text.formatter.IFormattingContext#isBooleanPreference(java.lang.String) */ public boolean isBooleanPreference(String key) { return !key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH); } /* * @see org.eclipse.jface.text.formatter.IFormattingContext#isIntegerPreference(java.lang.String) */ public boolean isIntegerPreference(String key) { return key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH); } } --- NEW FILE: CommentFormattingStrategy.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.comment; 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.ToolFactory; import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; import org.rubypeople.rdt.core.formatter.CodeFormatter; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.text.IRubyPartitions; /** * Formatting strategy for general source code comments. * * @since 3.0 */ public class CommentFormattingStrategy 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(); /** Last formatted document's hash-code. */ private int fLastDocumentHash; /** Last formatted document header's hash-code. */ private int fLastHeaderHash; /** End of the first class or interface token in the last document. */ private int fLastMainTokenEnd= -1; /** End of the header in the last document. */ private int fLastDocumentsHeaderEnd; /* * @see org.eclipse.jface.text.formatter.IFormattingStrategyExtension#format() */ public void format() { super.format(); final IDocument document= (IDocument) fDocuments.removeFirst(); final TypedPosition position= (TypedPosition)fPartitions.removeFirst(); if (document == null || position == null) return; Map preferences= getPreferences(); final boolean isFormattingHeader= Boolean.toString(true).equals(preferences.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER)); int documentsHeaderEnd= computeHeaderEnd(document); if (isFormattingHeader || position.offset >= documentsHeaderEnd) { TextEdit edit= null; try { // compute offset in document of region passed to the formatter int sourceOffset= document.getLineOffset(document.getLineOfOffset(position.getOffset())); // format region int partitionOffset= position.getOffset() - sourceOffset; int sourceLength= partitionOffset + position.getLength(); String source= document.get(sourceOffset, sourceLength); CodeFormatter commentFormatter= ToolFactory.createCodeFormatter(preferences); int indentationLevel= inferIndentationLevel(source.substring(0, partitionOffset), getTabSize(preferences)); edit= commentFormatter.format(getKindForPartitionType(position.getType()), source, partitionOffset, position.getLength(), indentationLevel, TextUtilities.getDefaultLineDelimiter(document)); // move edit offset to match document if (edit != null) edit.moveTree(sourceOffset); } catch (BadLocationException x) { RubyPlugin.log(x); } try { if (edit != null) edit.apply(document); } catch (MalformedTreeException x) { RubyPlugin.log(x); } catch (BadLocationException x) { RubyPlugin.log(x); } } } /* * @see org.eclipse.jface.text.formatter.IFormattingStrategyExtension#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext) */ public void formatterStarts(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.IFormattingStrategyExtension#formatterStops() */ public void formatterStops() { fPartitions.clear(); fDocuments.clear(); super.formatterStops(); } /** * Map from {@link IRubyPartitions}comment partition types to * {@link CodeFormatter}code snippet kinds. * * @param type the partition type * @return the code snippet kind * @since 3.1 */ private static int getKindForPartitionType(String type) { if (IRubyPartitions.RUBY_SINGLE_LINE_COMMENT.equals(type)) return CodeFormatter.K_SINGLE_LINE_COMMENT; if (IRubyPartitions.RUBY_MULTI_LINE_COMMENT.equals(type)) return CodeFormatter.K_MULTI_LINE_COMMENT; if (IRubyPartitions.RUBY_DOC.equals(type)) return CodeFormatter.K_RUBY_DOC; return CodeFormatter.K_UNKNOWN; } /** * Infer the indentation level based on the given reference indentation * and tab size. * * @param reference the reference indentation * @param tabSize the tab size * @return the inferred indentation level * @since 3.1 */ private int inferIndentationLevel(String reference, int tabSize) { StringBuffer expanded= expandTabs(reference, tabSize); int referenceWidth= expanded.length(); if (tabSize == 0) return referenceWidth; int spaceWidth= 1; int level= referenceWidth / (tabSize * spaceWidth); if (referenceWidth % (tabSize * spaceWidth) > 0) level++; return level; } /** * Expands the given string's tabs according to the given tab size. * * @param string the string * @param tabSize the tab size * @return the expanded string * @since 3.1 */ private static StringBuffer expandTabs(String string, int tabSize) { StringBuffer expanded= new StringBuffer(); for (int i= 0, n= string.length(), chars= 0; i < n; i++) { char ch= string.charAt(i); if (ch == '\t') { for (; chars < tabSize; chars++) expanded.append(' '); chars= 0; } else { expanded.append(ch); chars++; if (chars >= tabSize) chars= 0; } } return expanded; } /** * Returns the value of {@link DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE} * from the given preferences. * * @param preferences the preferences * @return the value of {@link DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE} * from the given preferences * @since 3.1 */ private static int getTabSize(Map preferences) { if (preferences.containsKey(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE)) try { return Integer.parseInt((String) preferences.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE)); } catch (NumberFormatException e) { // use default } return 4; } /** * Returns the end offset for the document's header. * * @param document the document * @return the header's end offset */ private int computeHeaderEnd(IDocument document) { if (document == null) return -1; try { if (fLastMainTokenEnd >= 0 && document.hashCode() == fLastDocumentHash && fLastMainTokenEnd < document.getLength() && document.get(0, fLastMainTokenEnd).hashCode() == fLastHeaderHash) return fLastDocumentsHeaderEnd; } catch (BadLocationException e) { // should not happen -> recompute } // FIXME Search for end of initial comment. If we hit code, then give up return -1; } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:15:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19417/src/org/rubypeople/rdt/ui Modified Files: PreferenceConstants.java Log Message: Index: PreferenceConstants.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PreferenceConstants.java 18 Sep 2005 18:47:24 -0000 1.10 --- PreferenceConstants.java 10 Feb 2006 20:14:52 -0000 1.11 *************** *** 6,163 **** import org.rubypeople.rdt.internal.launching.RubyRuntime; import org.rubypeople.rdt.internal.ui.RubyPlugin; public class PreferenceConstants { ! private PreferenceConstants() {} ! ! public static final String RI_PATH = "riDirectoryPath"; ! public static final String RDOC_PATH = "rdocDirectoryPath"; ! public static final String FORMAT_INDENTATION = "formatIndentation"; //$NON-NLS-1$ ! public static final String FORMAT_USE_TAB = "formatUseTab"; //$NON-NLS-1$ ! // TODO Finish implementing this option! ! public static final String TEMPLATES_USE_CODEFORMATTER = "templatesUSeCodeFormatter"; ! ! private final static String DEFAULT_RDOC_CMD = "rdoc"; //$NON-NLS-1$ ! private final static String DEFAULT_RI_CMD = "ri"; //$NON-NLS-1$ ! /** ! * A named preference that controls whether folding is enabled in the Ruby ! * editor. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$ ! /** ! * A named preference that stores the configured folding provider. ! * <p> ! * Value is of type <code>String</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_PROVIDER = "editor_folding_provider"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for Rdoc folding for the default ! * folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_RDOC = "editor_folding_default_rdoc"; //$NON-NLS-1$ ! /** ! * A named preference that controls if temporary problems are evaluated and ! * shown in the UI. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! */ ! public final static String EDITOR_EVALUTE_TEMPORARY_PROBLEMS = "handleTemporaryProblems"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for inner type folding for the ! * default folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_INNERTYPES = "editor_folding_default_innertypes"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for method folding for the ! * default folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_METHODS = "editor_folding_default_methods"; //$NON-NLS-1$ ! /** ! * Preference key suffix for bold text style preference keys. ! * ! * @since 2.1 ! */ ! public static final String EDITOR_BOLD_SUFFIX = "_bold"; //$NON-NLS-1$ ! /** ! * Preference key suffix for italic text style preference keys. ! * ! * @since 3.0 ! */ ! public static final String EDITOR_ITALIC_SUFFIX = "_italic"; //$NON-NLS-1$ ! /** ! * A named preference that controls if correction indicators are shown in ! * the UI. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! */ ! public final static String EDITOR_CORRECTION_INDICATION = "RubyEditor.ShowTemporaryProblem"; //$NON-NLS-1$ ! /** ! * A named preference that defines whether the hint to make hover sticky ! * should be shown. ! * ! * @see RubyUI ! * @since 3.0 ! */ ! public static final String EDITOR_SHOW_TEXT_HOVER_AFFORDANCE = "PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE"; //$NON-NLS-1$ ! public static void initializeDefaultValues(IPreferenceStore store) { ! store.setDefault(PreferenceConstants.FORMAT_INDENTATION, 2); ! store.setDefault(PreferenceConstants.FORMAT_USE_TAB, false); ! // TODO Expose these preferences to the user! ! store.setDefault(PreferenceConstants.EDITOR_CORRECTION_INDICATION, true); ! store.setDefault(PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, true); ! // folding ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, "org.rubypeople.rdt.ui.text.defaultFoldingProvider"); //$NON-NLS-1$ ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_RDOC, false); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, true); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false); ! store.setDefault(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true); ! ! store.setDefault( PreferenceConstants.RDOC_PATH, PreferenceConstants.getDefaultPath(PreferenceConstants.DEFAULT_RDOC_CMD)) ; ! store.setDefault( PreferenceConstants.RI_PATH, PreferenceConstants.getDefaultPath(PreferenceConstants.DEFAULT_RI_CMD)) ; ! } ! private static String getDefaultPath(String programName) { ! RubyInterpreter interpreter = RubyRuntime.getDefault().getSelectedInterpreter(); ! if (interpreter == null) { ! return programName ; ! } ! IPath path = interpreter.getInstallLocation(); ! path = path.uptoSegment(path.segmentCount() - 1).append(programName); ! return path.toOSString(); ! } ! /** ! * Returns the RDT-UI preference store. ! * ! * @return the RDT-UI preference store ! */ ! public static IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } } --- 6,285 ---- import org.rubypeople.rdt.internal.launching.RubyRuntime; import org.rubypeople.rdt.internal.ui.RubyPlugin; + import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager; public class PreferenceConstants { ! private PreferenceConstants() { ! } ! public static final String RI_PATH = "riDirectoryPath"; ! public static final String RDOC_PATH = "rdocDirectoryPath"; ! public static final String FORMAT_INDENTATION = "formatIndentation"; //$NON-NLS-1$ ! public static final String FORMAT_USE_TAB = "formatUseTab"; //$NON-NLS-1$ ! // TODO Finish implementing this option! ! public static final String TEMPLATES_USE_CODEFORMATTER = "templatesUSeCodeFormatter"; + private final static String DEFAULT_RDOC_CMD = "rdoc"; //$NON-NLS-1$ + private final static String DEFAULT_RI_CMD = "ri"; //$NON-NLS-1$ ! /** ! * A named preference that controls whether folding is enabled in the Ruby ! * editor. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$ ! /** ! * A named preference that stores the configured folding provider. ! * <p> ! * Value is of type <code>String</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_PROVIDER = "editor_folding_provider"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for Rdoc folding for the default ! * folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_RDOC = "editor_folding_default_rdoc"; //$NON-NLS-1$ ! /** ! * A named preference that controls if temporary problems are evaluated and ! * shown in the UI. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! */ ! public final static String EDITOR_EVALUTE_TEMPORARY_PROBLEMS = "handleTemporaryProblems"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for inner type folding for the ! * default folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_INNERTYPES = "editor_folding_default_innertypes"; //$NON-NLS-1$ ! /** ! * A named preference that stores the value for method folding for the ! * default folding provider. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 3.0 ! */ ! public static final String EDITOR_FOLDING_METHODS = "editor_folding_default_methods"; //$NON-NLS-1$ ! /** ! * Preference key suffix for bold text style preference keys. ! * ! * @since 2.1 ! */ ! public static final String EDITOR_BOLD_SUFFIX = "_bold"; //$NON-NLS-1$ ! /** ! * Preference key suffix for italic text style preference keys. ! * ! * @since 3.0 ! */ ! public static final String EDITOR_ITALIC_SUFFIX = "_italic"; //$NON-NLS-1$ ! /** ! * A named preference that controls if correction indicators are shown in ! * the UI. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! */ ! public final static String EDITOR_CORRECTION_INDICATION = "RubyEditor.ShowTemporaryProblem"; //$NON-NLS-1$ ! /** ! * A named preference that defines whether the hint to make hover sticky ! * should be shown. ! * ! * @see RubyUI ! * @since 0.8.0 ! */ ! public static final String EDITOR_SHOW_TEXT_HOVER_AFFORDANCE = "PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE"; //$NON-NLS-1$ ! /** ! * A named preference that controls if segmented view (show selected element ! * only) is turned on or off. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! */ ! public static final String EDITOR_SHOW_SEGMENTS = "org.rubypeople.rdt.ui.editor.showSegments"; //$NON-NLS-1$ ! /** ! * A named preference that controls whether the outline view selection ! * should stay in sync with with the element at the current cursor position. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 0.8.0 ! */ ! public final static String EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE = "RubyEditor.SyncOutlineOnCursorMove"; //$NON-NLS-1$ ! /** ! * A named preference that defines how member elements are ordered by the ! * Ruby views using the <code>RubyElementSorter</code>. ! * <p> ! * Value is of type <code>String</code>: A comma separated list of the ! * following entries. Each entry must be in the list, no duplication. List ! * order defines the sort order. ! * <ul> ! * <li><b>T</b>: Types</li> ! * <li><b>C</b>: Constructors</li> ! * <li><b>M</b>: Methods</li> ! * <li><b>F</b>: Fields</li> ! * <li><b>SM</b>: Static Methods</li> ! * <li><b>SF</b>: Static Fields</li> ! * </ul> ! * </p> ! * ! * @since 0.8.0 ! */ ! public static final String APPEARANCE_MEMBER_SORT_ORDER = "outlinesortoption"; //$NON-NLS-1$ ! /** ! * A named preference that defines how member elements are ordered by ! * visibility in the Ruby views using the <code>RubyElementSorter</code>. ! * <p> ! * Value is of type <code>String</code>: A comma separated list of the ! * following entries. Each entry must be in the list, no duplication. List ! * order defines the sort order. ! * <ul> ! * <li><b>B</b>: Public</li> ! * <li><b>V</b>: Private</li> ! * <li><b>R</b>: Protected</li> ! * </ul> ! * </p> ! * ! * @since 0.8.0 ! */ ! public static final String APPEARANCE_VISIBILITY_SORT_ORDER = "org.eclipse.jdt.ui.visibility.order"; //$NON-NLS-1$ ! /** ! * A named preferences that controls if Ruby elements are also sorted by ! * visibility. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @since 0.8.0 ! */ ! public static final String APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER = "org.rubypeople.rdt.ui.enable.visibility.order"; //$NON-NLS-1$ ! /** ! * A named preference that controls if package name compression is turned on ! * or off. ! * <p> ! * Value is of type <code>Boolean</code>. ! * </p> ! * ! * @see #APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW ! */ ! public static final String APPEARANCE_COMPRESS_PACKAGE_NAMES = "org.rubypeople.rdt.ui.compresspackagenames";//$NON-NLS-1$ + /** + * A named preference that defines the pattern used for package name + * compression. + * <p> + * Value is of type <code>String</code>. For example for the given + * package name 'org.eclipse.jdt' pattern '.' will compress it to '..jdt', + * '1~' to 'o~.e~.jdt'. + * </p> + */ + public static final String APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW = "PackagesView.pkgNamePatternForPackagesView";//$NON-NLS-1$ + /** + * The symbolic font name for the Ruby editor text font + * (value <code>"org.rubypeople.rdt.ui.editors.textfont"</code>). + * + * @since 0.8.0 + */ + public final static String EDITOR_TEXT_FONT= "org.rubypeople.rdt.ui.editors.textfont"; //$NON-NLS-1$ + /** + * A named preference that controls which profile is used by the code formatter. + * <p> + * Value is of type <code>String</code>. + * </p> + * + * @since 0.8.0 + */ + public static final String FORMATTER_PROFILE = "formatter_profile"; //$NON-NLS-1$ ! public static void initializeDefaultValues(IPreferenceStore store) { ! store.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); ! ! store.setDefault(PreferenceConstants.FORMATTER_PROFILE, ProfileManager.DEFAULT_PROFILE); + // MembersOrderPreferencePage + // TODO Expose to users! + store.setDefault(PreferenceConstants.APPEARANCE_MEMBER_SORT_ORDER, "T,SF,SM,F,C,M"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.APPEARANCE_VISIBILITY_SORT_ORDER, "B,V,R"); //$NON-NLS-1$ + store.setDefault(PreferenceConstants.APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER, false); ! store.setDefault(PreferenceConstants.FORMAT_INDENTATION, 2); ! store.setDefault(PreferenceConstants.FORMAT_USE_TAB, false); ! ! // AppearancePreferencePage ! store.setDefault(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES, false); ! store.setDefault(PreferenceConstants.APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW, ""); //$NON-NLS-1$ ! ! // TODO Expose these preferences to the user! ! store.setDefault(PreferenceConstants.EDITOR_CORRECTION_INDICATION, true); ! store.setDefault(PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, true); ! ! // folding ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, ! "org.rubypeople.rdt.ui.text.defaultFoldingProvider"); //$NON-NLS-1$ ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_RDOC, false); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, true); ! store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false); ! ! store.setDefault(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true); ! ! store.setDefault(PreferenceConstants.RDOC_PATH, PreferenceConstants ! .getDefaultPath(PreferenceConstants.DEFAULT_RDOC_CMD)); ! store.setDefault(PreferenceConstants.RI_PATH, PreferenceConstants ! .getDefaultPath(PreferenceConstants.DEFAULT_RI_CMD)); ! ! store.setDefault(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, true); ! ! } ! ! private static String getDefaultPath(String programName) { ! RubyInterpreter interpreter = RubyRuntime.getDefault().getSelectedInterpreter(); ! if (interpreter == null) { return programName; } ! IPath path = interpreter.getInstallLocation(); ! path = path.uptoSegment(path.segmentCount() - 1).append(programName); ! return path.toOSString(); ! } ! ! /** ! * Returns the RDT-UI preference store. ! * ! * @return the RDT-UI preference store ! */ ! public static IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:14:52
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19365/src/org/rubypeople/rdt/internal/ui/text Modified Files: RubyCommentScanner.java RubyTextTools.java IRubyPartitions.java Added Files: SimpleRubySourceViewerConfiguration.java Removed Files: RubyReconcilingStrategy.java Log Message: --- RubyReconcilingStrategy.java DELETED --- Index: RubyTextTools.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyTextTools.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RubyTextTools.java 1 Apr 2005 02:11:42 -0000 1.10 --- RubyTextTools.java 10 Feb 2006 20:14:43 -0000 1.11 *************** *** 20,254 **** import org.rubypeople.rdt.internal.ui.text.ruby.RubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyCodeScanner; public class RubyTextTools { ! /** ! * This tools' preference listener. ! */ ! private class PreferenceListener implements IPropertyChangeListener, Preferences.IPropertyChangeListener { ! public void propertyChange(PropertyChangeEvent event) { ! adaptToPreferenceChange(event); ! } ! public void propertyChange(Preferences.PropertyChangeEvent event) { ! adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue())); ! } ! } ! protected static String[] keywords; ! protected RubyColorManager fColorManager; ! protected RubyPartitionScanner partitionScanner; ! protected AbstractRubyScanner fCodeScanner; ! protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, stringScanner; ! private IPreferenceStore fPreferenceStore; ! private Preferences fCorePreferenceStore; ! /** The preference change listener */ ! private PreferenceListener fPreferenceListener = new PreferenceListener(); ! private SingleTokenRubyCodeScanner fRegexpScanner; ! private SingleTokenRubyCodeScanner fCommandScanner; ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore) { ! this(store, coreStore, true); ! } ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @param autoDisposeOnDisplayDispose ! * if <code>true</code> the color manager automatically ! * disposes all managed colors when the current display gets ! * disposed and all calls to ! * {@link org.eclipse.jface.text.source.ISharedTextColors#dispose()} ! * are ignored. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore, boolean autoDisposeOnDisplayDispose) { ! super(); ! fColorManager = new RubyColorManager(autoDisposeOnDisplayDispose); ! partitionScanner = new RubyPartitionScanner(); ! fCodeScanner = new RubyCodeScanner(fColorManager, store); ! fMultilineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, IRubyColorConstants.RUBY_MULTI_LINE_COMMENT); ! fSinglelineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT); ! stringScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_STRING); ! fRegexpScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_REGEXP); ! fCommandScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_COMMAND); ! ! fPreferenceStore = store; ! fPreferenceStore.addPropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = coreStore; ! if (fCorePreferenceStore != null) fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); ! // fJavaDocScanner= new JavaDocScanner(fColorManager, store, coreStore); ! // fPartitionScanner= new FastJavaPartitionScanner(); ! } ! /** ! * Adapts the behavior of the contained components to the change encoded in ! * the given event. ! * ! * @param event ! * the event to which to adapt ! * @since 2.0 ! * @deprecated As of 3.0, no replacement ! */ ! protected void adaptToPreferenceChange(PropertyChangeEvent event) { ! if (fCodeScanner.affectsBehavior(event)) fCodeScanner.adaptToPreferenceChange(event); ! if (fMultilineCommentScanner.affectsBehavior(event)) fMultilineCommentScanner.adaptToPreferenceChange(event); ! if (fSinglelineCommentScanner.affectsBehavior(event)) fSinglelineCommentScanner.adaptToPreferenceChange(event); ! if (stringScanner.affectsBehavior(event)) stringScanner.adaptToPreferenceChange(event); ! if (fRegexpScanner.affectsBehavior(event)) fRegexpScanner.adaptToPreferenceChange(event); ! if (fCommandScanner.affectsBehavior(event)) fCommandScanner.adaptToPreferenceChange(event); ! // if (fJavaDocScanner.affectsBehavior(event)) ! // fJavaDocScanner.adaptToPreferenceChange(event); ! } ! public IDocumentPartitioner createDocumentPartitioner() { ! return new DefaultPartitioner(getPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! } ! protected IPartitionTokenScanner getPartitionScanner() { ! return partitionScanner; ! } ! public AbstractRubyScanner getCodeScanner() { ! return fCodeScanner; ! } ! protected ITokenScanner getMultilineCommentScanner() { ! return fMultilineCommentScanner; ! } ! protected ITokenScanner getSinglelineCommentScanner() { ! return fSinglelineCommentScanner; ! } ! protected ITokenScanner getStringScanner() { ! return stringScanner; ! } ! public IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } ! public static String[] getKeyWords() { ! if (keywords == null) { ! String csvKeywords = RubyEditorPreferences.getString("keywords"); ! List keywordList = new ArrayList(); ! StringTokenizer tokenizer = new StringTokenizer(csvKeywords, ","); ! while (tokenizer.hasMoreTokens()) ! keywordList.add(tokenizer.nextToken()); ! keywords = new String[keywordList.size()]; ! keywordList.toArray(keywords); ! } ! return keywords; ! } ! public boolean affectsTextPresentation(PropertyChangeEvent event) { ! return fCodeScanner.affectsBehavior(event) ! || fMultilineCommentScanner.affectsBehavior(event) ! || fSinglelineCommentScanner.affectsBehavior(event) ! || stringScanner.affectsBehavior(event) ! || fRegexpScanner.affectsBehavior(event) ! || fCommandScanner.affectsBehavior(event); ! } ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * given partitioning. ! * ! * @param document ! * the document to be set up ! * @param partitioning ! * the document partitioning ! * @since 3.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document, String partitioning) { ! IDocumentPartitioner partitioner = createDocumentPartitioner(); ! if (document instanceof IDocumentExtension3) { ! IDocumentExtension3 extension3 = (IDocumentExtension3) document; ! extension3.setDocumentPartitioner(partitioning, partitioner); ! } else { ! document.setDocumentPartitioner(partitioner); ! } ! partitioner.connect(document); ! } ! /** ! * Disposes all the individual tools of this tools collection. ! */ ! public void dispose() { ! fCodeScanner = null; ! fMultilineCommentScanner = null; ! fSinglelineCommentScanner = null; ! stringScanner = null; ! fRegexpScanner = null; ! fCommandScanner = null; ! // fJavaDocScanner= null; ! partitionScanner = null; ! if (fColorManager != null) { ! fColorManager.dispose(); ! fColorManager = null; ! } ! if (fPreferenceStore != null) { ! fPreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fPreferenceStore = null; ! if (fCorePreferenceStore != null) { ! fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = null; ! } ! fPreferenceListener = null; ! } ! } ! public ITokenScanner getRegexpScanner() { ! return fRegexpScanner; ! } ! public ITokenScanner getCommandScanner() { ! return fCommandScanner; ! } } --- 20,329 ---- import org.rubypeople.rdt.internal.ui.text.ruby.RubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyCodeScanner; + import org.rubypeople.rdt.ui.text.IColorManager; + import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; public class RubyTextTools { ! /** ! * This tools' preference listener. ! */ ! private class PreferenceListener implements IPropertyChangeListener, ! Preferences.IPropertyChangeListener { ! public void propertyChange(PropertyChangeEvent event) { ! adaptToPreferenceChange(event); ! } ! public void propertyChange(Preferences.PropertyChangeEvent event) { ! adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), ! event.getOldValue(), event.getNewValue())); ! } ! } ! protected static String[] keywords; ! protected RubyColorManager fColorManager; ! protected RubyPartitionScanner partitionScanner; ! protected AbstractRubyScanner fCodeScanner; ! protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, ! stringScanner; ! private IPreferenceStore fPreferenceStore; ! private Preferences fCorePreferenceStore; ! /** The preference change listener */ ! private PreferenceListener fPreferenceListener = new PreferenceListener(); ! private SingleTokenRubyCodeScanner fRegexpScanner; ! private SingleTokenRubyCodeScanner fCommandScanner; ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore) { ! this(store, coreStore, true); ! } ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @param autoDisposeOnDisplayDispose ! * if <code>true</code> the color manager automatically ! * disposes all managed colors when the current display gets ! * disposed and all calls to ! * {@link org.eclipse.jface.text.source.ISharedTextColors#dispose()} ! * are ignored. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore, ! boolean autoDisposeOnDisplayDispose) { ! super(); ! fColorManager = new RubyColorManager(autoDisposeOnDisplayDispose); ! partitionScanner = new RubyPartitionScanner(); ! fCodeScanner = new RubyCodeScanner(fColorManager, store); ! fMultilineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, ! IRubyColorConstants.RUBY_MULTI_LINE_COMMENT); ! fSinglelineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, ! IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT); ! stringScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_STRING); ! fRegexpScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_REGEXP); ! fCommandScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_COMMAND); ! fPreferenceStore = store; ! fPreferenceStore.addPropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = coreStore; ! if (fCorePreferenceStore != null) ! fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); ! // fJavaDocScanner= new JavaDocScanner(fColorManager, store, coreStore); ! // fPartitionScanner= new FastJavaPartitionScanner(); ! } ! /** ! * Adapts the behavior of the contained components to the change encoded in ! * the given event. ! * ! * @param event ! * the event to which to adapt ! * @since 2.0 ! * @deprecated As of 3.0, no replacement ! */ ! protected void adaptToPreferenceChange(PropertyChangeEvent event) { ! if (fCodeScanner.affectsBehavior(event)) fCodeScanner.adaptToPreferenceChange(event); ! if (fMultilineCommentScanner.affectsBehavior(event)) ! fMultilineCommentScanner.adaptToPreferenceChange(event); ! if (fSinglelineCommentScanner.affectsBehavior(event)) ! fSinglelineCommentScanner.adaptToPreferenceChange(event); ! if (stringScanner.affectsBehavior(event)) stringScanner.adaptToPreferenceChange(event); ! if (fRegexpScanner.affectsBehavior(event)) fRegexpScanner.adaptToPreferenceChange(event); ! if (fCommandScanner.affectsBehavior(event)) fCommandScanner.adaptToPreferenceChange(event); ! // if (fJavaDocScanner.affectsBehavior(event)) ! // fJavaDocScanner.adaptToPreferenceChange(event); ! } ! public IDocumentPartitioner createDocumentPartitioner() { ! return new DefaultPartitioner(getPartitionScanner(), ! RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! } ! protected IPartitionTokenScanner getPartitionScanner() { ! return partitionScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getCodeScanner()} ! */ ! public AbstractRubyScanner getCodeScanner() { ! return fCodeScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getMultilineCommentScanner()} ! */ ! public ITokenScanner getMultilineCommentScanner() { ! return fMultilineCommentScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getSingleineCommentScanner()} ! */ ! public ITokenScanner getSinglelineCommentScanner() { ! return fSinglelineCommentScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getStringScanner()} ! */ ! public ITokenScanner getStringScanner() { ! return stringScanner; ! } ! public IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } ! public static String[] getKeyWords() { ! if (keywords == null) { ! String csvKeywords = RubyEditorPreferences.getString("keywords"); ! List keywordList = new ArrayList(); ! StringTokenizer tokenizer = new StringTokenizer(csvKeywords, ","); ! while (tokenizer.hasMoreTokens()) ! keywordList.add(tokenizer.nextToken()); ! keywords = new String[keywordList.size()]; ! keywordList.toArray(keywords); ! } ! return keywords; ! } ! public boolean affectsTextPresentation(PropertyChangeEvent event) { ! return fCodeScanner.affectsBehavior(event) ! || fMultilineCommentScanner.affectsBehavior(event) ! || fSinglelineCommentScanner.affectsBehavior(event) ! || stringScanner.affectsBehavior(event) || fRegexpScanner.affectsBehavior(event) ! || fCommandScanner.affectsBehavior(event); ! } ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * given partitioning. ! * ! * @param document ! * the document to be set up ! * @param partitioning ! * the document partitioning ! * @since 3.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document, String partitioning) { ! IDocumentPartitioner partitioner = createDocumentPartitioner(); ! if (document instanceof IDocumentExtension3) { ! IDocumentExtension3 extension3 = (IDocumentExtension3) document; ! extension3.setDocumentPartitioner(partitioning, partitioner); ! } else { ! document.setDocumentPartitioner(partitioner); ! } ! partitioner.connect(document); ! } ! /** ! * Disposes all the individual tools of this tools collection. ! */ ! public void dispose() { ! fCodeScanner = null; ! fMultilineCommentScanner = null; ! fSinglelineCommentScanner = null; ! stringScanner = null; ! fRegexpScanner = null; ! fCommandScanner = null; ! // fJavaDocScanner= null; ! partitionScanner = null; ! if (fColorManager != null) { ! fColorManager.dispose(); ! fColorManager = null; ! } ! if (fPreferenceStore != null) { ! fPreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fPreferenceStore = null; ! if (fCorePreferenceStore != null) { ! fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = null; ! } ! fPreferenceListener = null; ! } ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getRegexpScanner()} ! */ ! public ITokenScanner getRegexpScanner() { ! return fRegexpScanner; ! } ! ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getCommandScanner()} ! */ ! public ITokenScanner getCommandScanner() { ! return fCommandScanner; ! } ! ! /** ! * Returns the color manager which is used to manage any Ruby-specific ! * colors needed for such things like syntax highlighting. ! * <p> ! * Clients which are only interested in the color manager of the Ruby UI ! * plug-in should use {@link org.rubypeople.rdt.ui.RubyUI#getColorManager()}. ! * </p> ! * ! * @return the color manager to be used for Ruby text viewers ! * @see org.rubypeople.rdt.ui.RubyUI#getColorManager() ! */ ! public IColorManager getColorManager() { ! return fColorManager; ! } ! ! /** ! * Returns this text tool's core preference store. ! * ! * @return the core preference store ! * @since 0.8.0 ! */ ! public Preferences getCorePreferenceStore() { ! return fCorePreferenceStore; ! } ! ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * default partitioning. ! * ! * @param document ! * the document to be set up ! * @since 0.8.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document) { ! setupRubyDocumentPartitioner(document, IDocumentExtension3.DEFAULT_PARTITIONING); ! } } Index: RubyCommentScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyCommentScanner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyCommentScanner.java 2 Mar 2005 00:56:49 -0000 1.2 --- RubyCommentScanner.java 10 Feb 2006 20:14:43 -0000 1.3 *************** *** 179,182 **** --- 179,195 ---- initialize(); } + + /** + * Initialize with the given arguments. + * + * @param manager Color manager + * @param store Preference store + * @param defaultTokenProperty Default token property + * + * @since 0.8.0 + */ + public RubyCommentScanner(IColorManager manager, IPreferenceStore store, String defaultTokenProperty) { + this(manager, store, null, defaultTokenProperty, new String[] { defaultTokenProperty, TASK_TAG }); + } public boolean affectsBehavior(PropertyChangeEvent event) { Index: IRubyPartitions.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IRubyPartitions.java 2 Mar 2005 00:56:49 -0000 1.2 --- IRubyPartitions.java 10 Feb 2006 20:14:43 -0000 1.3 *************** *** 14,20 **** /** * The name of the Ruby partitioning. ! * @since 3.0 */ public final static String RUBY_PARTITIONING= "___ruby_partitioning"; //$NON-NLS-1$ } --- 14,45 ---- /** * The name of the Ruby partitioning. ! * @since 0.7.0 */ public final static String RUBY_PARTITIONING= "___ruby_partitioning"; //$NON-NLS-1$ + + /** + * The identifier of the single-line end comment partition content type. + */ + String RUBY_SINGLE_LINE_COMMENT= "__ruby_singleline_comment"; //$NON-NLS-1$ + + /** + * The identifier multi-line comment partition content type. + */ + String RUBY_MULTI_LINE_COMMENT= "__ruby_multiline_comment"; //$NON-NLS-1$ + + /** + * The identifier of the Rdoc (JLS2: DocumentationComment) partition content type. + */ + String RUBY_DOC= "__ruby_rdoc"; //$NON-NLS-1$ + + /** + * The identifier of the Ruby string partition content type. + */ + String RUBY_STRING= "__ruby_string"; //$NON-NLS-1$ + + /** + * The identifier of the Ruby character partition content type. + */ + String RUBY_CHARACTER= "__ruby_character"; //$NON-NLS-1$ } --- NEW FILE: SimpleRubySourceViewerConfiguration.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; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.IAutoEditStrategy; import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.formatter.IContentFormatter; import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; import org.eclipse.jface.text.information.IInformationPresenter; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.ui.texteditor.ITextEditor; import org.rubypeople.rdt.ui.text.IColorManager; import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; /** * A simple * {@linkplain org.eclipse.jdt.ui.text.RubySourceViewerConfiguration Ruby source viewer configuration}. * <p> * This simple source viewer configuration basically provides syntax coloring * and disables all other features like code assist, quick outlines, * hyperlinking, etc. * </p> * * @since 3.1 */ public class SimpleRubySourceViewerConfiguration extends RubySourceViewerConfiguration { private boolean fConfigureFormatter; /** * Creates a new Ruby source viewer configuration for viewers in the given * editor using the given preference store, the color manager and the * specified document partitioning. * * @param colorManager * the color manager * @param preferenceStore * the preference store, can be read-only * @param editor * the editor in which the configured viewer(s) will reside, or * <code>null</code> if none * @param partitioning * the document partitioning for this configuration, or * <code>null</code> for the default partitioning * @param configureFormatter * <code>true</code> if a content formatter should be * configured */ public SimpleRubySourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, String partitioning, boolean configureFormatter) { super(colorManager, preferenceStore, editor, partitioning); fConfigureFormatter = configureFormatter; } /* * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, * java.lang.String) */ public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) */ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer) */ public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, * String) */ public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int) */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { return null; } /* * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String) */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) */ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { if (fConfigureFormatter) return super.getContentFormatter(sourceViewer); else return null; } /* * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer) */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer) */ public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { return null; } /* * @see org.eclipse.jdt.ui.text.RubySourceViewerConfiguration#getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer, * boolean) */ public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } /* * @see org.eclipse.jdt.ui.text.RubySourceViewerConfiguration#getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer, * boolean) */ public IInformationPresenter getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } /* * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer) */ public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { return null; } } |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:14:45
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19287/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: ExternalRubyDocumentProvider.java GotoAnnotationAction.java RubyEditorActionContributor.java RubyAbstractEditor.java RubyEditor.java RubyDocumentSetupParticipant.java ExternalRubyEditor.java RubySourceViewer.java Added Files: RubyOutlinePage.java TogglePresentationAction.java Log Message: Index: RubyDocumentSetupParticipant.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyDocumentSetupParticipant.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyDocumentSetupParticipant.java 2 Mar 2005 00:54:29 -0000 1.2 --- RubyDocumentSetupParticipant.java 10 Feb 2006 20:14:31 -0000 1.3 *************** *** 29,33 **** */ public void setup(IDocument document) { ! RubyTextTools tools= RubyPlugin.getDefault().getTextTools(); tools.setupRubyDocumentPartitioner(document, IRubyPartitions.RUBY_PARTITIONING); } --- 29,33 ---- */ public void setup(IDocument document) { ! RubyTextTools tools= RubyPlugin.getDefault().getRubyTextTools(); tools.setupRubyDocumentPartitioner(document, IRubyPartitions.RUBY_PARTITIONING); } Index: RubySourceViewer.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubySourceViewer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RubySourceViewer.java 18 Sep 2005 15:17:42 -0000 1.4 --- RubySourceViewer.java 10 Feb 2006 20:14:31 -0000 1.5 *************** *** 7,31 **** package org.rubypeople.rdt.internal.ui.rubyeditor; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.source.IOverviewRuler; import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.jface.text.source.projection.ProjectionViewer; import org.eclipse.swt.widgets.Composite; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.ui.PreferenceConstants; ! /* Copied from Ant StatusLineSourceViewer */ ! public class RubySourceViewer extends ProjectionViewer { private boolean isTabReplacing = false; private boolean fIgnoreTextConverters = false; private TabExpander tabExpander; public RubySourceViewer(Composite composite, IVerticalRuler verticalRuler, ! IOverviewRuler overviewRuler, boolean overviewRulerVisible, int styles) { super(composite, verticalRuler, overviewRuler, overviewRulerVisible, styles); initializeTabReplace(); } public void doOperation(int operation) { --- 7,248 ---- package org.rubypeople.rdt.internal.ui.rubyeditor; + import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.source.IOverviewRuler; import org.eclipse.jface.text.source.IVerticalRuler; + import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jface.text.source.projection.ProjectionViewer; + import org.eclipse.jface.util.IPropertyChangeListener; + import org.eclipse.jface.util.PropertyChangeEvent; + import org.eclipse.swt.custom.StyledText; + import org.eclipse.swt.graphics.Color; + import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; + import org.eclipse.swt.widgets.Display; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; + import org.eclipse.ui.texteditor.AbstractTextEditor; + import org.rubypeople.rdt.core.RubyCore; + import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; + import org.rubypeople.rdt.core.formatter.Indents; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.ui.PreferenceConstants; ! public class RubySourceViewer extends ProjectionViewer implements IPropertyChangeListener { private boolean isTabReplacing = false; private boolean fIgnoreTextConverters = false; private TabExpander tabExpander; + + /** + * This viewer's foreground color. + * @since 0.8.0 + */ + private Color fForegroundColor; + /** + * The viewer's background color. + * @since 0.8.0 + */ + private Color fBackgroundColor; + /** + * This viewer's selection foreground color. + * @since 0.8.0 + */ + private Color fSelectionForegroundColor; + /** + * The viewer's selection background color. + * @since 0.8.0 + */ + private Color fSelectionBackgroundColor; + + /** + * The preference store. + * + * @since 0.8.0 + */ + private IPreferenceStore fPreferenceStore; + + /** + * Is this source viewer configured? + * + * @since 0.8.0 + */ + private boolean fIsConfigured; public RubySourceViewer(Composite composite, IVerticalRuler verticalRuler, ! IOverviewRuler overviewRuler, boolean overviewRulerVisible, int styles, IPreferenceStore store) { super(composite, verticalRuler, overviewRuler, overviewRulerVisible, styles); + setPreferenceStore(store); initializeTabReplace(); } + + /** + * Sets the preference store on this viewer. + * + * @param store the preference store + * + * @since 0.8.0 + */ + public void setPreferenceStore(IPreferenceStore store) { + if (fIsConfigured && fPreferenceStore != null) + fPreferenceStore.removePropertyChangeListener(this); + + fPreferenceStore= store; + + if (fIsConfigured && fPreferenceStore != null) { + fPreferenceStore.addPropertyChangeListener(this); + initializeViewerColors(); + } + } + + protected void initializeViewerColors() { + if (fPreferenceStore != null) { + + StyledText styledText= getTextWidget(); + + // ----------- foreground color -------------------- + Color color= fPreferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT) + ? null + : createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay()); + styledText.setForeground(color); + + if (fForegroundColor != null) + fForegroundColor.dispose(); + + fForegroundColor= color; + + // ---------- background color ---------------------- + color= fPreferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) + ? null + : createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); + styledText.setBackground(color); + + if (fBackgroundColor != null) + fBackgroundColor.dispose(); + + fBackgroundColor= color; + + // ----------- selection foreground color -------------------- + color= fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR) + ? null + : createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, styledText.getDisplay()); + styledText.setSelectionForeground(color); + + if (fSelectionForegroundColor != null) + fSelectionForegroundColor.dispose(); + + fSelectionForegroundColor= color; + + // ---------- selection background color ---------------------- + color= fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR) + ? null + : createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, styledText.getDisplay()); + styledText.setSelectionBackground(color); + + if (fSelectionBackgroundColor != null) + fSelectionBackgroundColor.dispose(); + + fSelectionBackgroundColor= color; + } + } + + /* + * @see ISourceViewer#configure(SourceViewerConfiguration) + */ + public void configure(SourceViewerConfiguration configuration) { + + /* + * Prevent access to colors disposed in unconfigure(), see: + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=53641 + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86177 + */ + StyledText textWidget= getTextWidget(); + if (textWidget != null && !textWidget.isDisposed()) { + Color foregroundColor= textWidget.getForeground(); + if (foregroundColor != null && foregroundColor.isDisposed()) + textWidget.setForeground(null); + Color backgroundColor= textWidget.getBackground(); + if (backgroundColor != null && backgroundColor.isDisposed()) + textWidget.setBackground(null); + } + + super.configure(configuration); + + if (fPreferenceStore != null) { + fPreferenceStore.addPropertyChangeListener(this); + initializeViewerColors(); + } + + fIsConfigured= true; + } + + /* + * @see org.eclipse.jface.text.source.ISourceViewerExtension2#unconfigure() + * @since 0.8.0 + */ + public void unconfigure() { + if (fForegroundColor != null) { + fForegroundColor.dispose(); + fForegroundColor= null; + } + if (fBackgroundColor != null) { + fBackgroundColor.dispose(); + fBackgroundColor= null; + } + + if (fPreferenceStore != null) + fPreferenceStore.removePropertyChangeListener(this); + + super.unconfigure(); + + fIsConfigured= false; + } + + /* + * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) + */ + public void propertyChange(PropertyChangeEvent event) { + String property = event.getProperty(); + if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property) + || AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT.equals(property) + || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND.equals(property) + || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT.equals(property) + || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR.equals(property) + || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR.equals(property) + || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR.equals(property) + || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR.equals(property)) + { + initializeViewerColors(); + } + } + + /** + * Creates a color from the information stored in the given preference store. + * Returns <code>null</code> if there is no such information available. + * + * @param store the store to read from + * @param key the key used for the lookup in the preference store + * @param display the display used create the color + * @return the created color according to the specification in the preference store + * @since 3.0 + */ + private Color createColor(IPreferenceStore store, String key, Display display) { + + RGB rgb= null; + + if (store.contains(key)) { + + if (store.isDefault(key)) + rgb= PreferenceConverter.getDefaultColor(store, key); + else + rgb= PreferenceConverter.getColor(store, key); + + if (rgb != null) + return new Color(display, rgb); + } + + return null; + } public void doOperation(int operation) { *************** *** 56,61 **** PreferenceConstants.FORMAT_USE_TAB); if (this.isTabReplacing) { ! int length = RubyPlugin.getDefault().getPreferenceStore().getInt( ! PreferenceConstants.FORMAT_INDENTATION); tabExpander = new TabExpander(length); } --- 273,277 ---- PreferenceConstants.FORMAT_USE_TAB); if (this.isTabReplacing) { ! int length = Indents.getTabWidth(RubyCore.getOptions()); tabExpander = new TabExpander(length); } *************** *** 77,79 **** --- 293,296 ---- return tabExpander.getFullIndent(); } + } Index: RubyEditorActionContributor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyEditorActionContributor.java 18 Sep 2005 15:17:42 -0000 1.9 --- RubyEditorActionContributor.java 10 Feb 2006 20:14:31 -0000 1.10 *************** *** 6,14 **** import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchActionConstants; - import org.eclipse.ui.IWorkbenchPage; - import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; import org.eclipse.ui.texteditor.ITextEditor; - import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; import org.eclipse.ui.texteditor.RetargetTextEditorAction; import org.rubypeople.rdt.internal.ui.RubyUIMessages; --- 6,11 ---- *************** *** 16,69 **** public class RubyEditorActionContributor extends BasicTextEditorActionContributor { - protected RetargetTextEditorAction contentAssistProposal; - private GotoAnnotationAction fPreviousAnnotation; - private GotoAnnotationAction fNextAnnotation; ! public RubyEditorActionContributor() { ! super(); ! contentAssistProposal = new RetargetTextEditorAction(RubyUIMessages.getResourceBundle(), "ContentAssistProposal."); ! ! fPreviousAnnotation= new GotoAnnotationAction("PreviousAnnotation.", false); //$NON-NLS-1$ ! fNextAnnotation= new GotoAnnotationAction("NextAnnotation.", true); //$NON-NLS-1$ ! } ! public void contributeToMenu(IMenuManager menuManager) { ! IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); ! if (editMenu != null) { ! editMenu.add(new Separator()); ! editMenu.add(contentAssistProposal); ! } ! } ! public void setActiveEditor(IEditorPart part) { ! super.setActiveEditor(part); ! ITextEditor editor = null; ! if (part instanceof ITextEditor) ! editor = (ITextEditor) part; ! contentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); ! IActionBars bars= getActionBars(); ! bars.setGlobalActionHandler(RubyActionIds.COMMENT, getAction(editor, "Comment")); ! bars.setGlobalActionHandler(RubyActionIds.UNCOMMENT, getAction(editor, "Uncomment")); ! ! fPreviousAnnotation.setEditor(editor); ! fNextAnnotation.setEditor(editor); ! } ! ! /* ! * @see IEditorActionBarContributor#init(IActionBars, IWorkbenchPage) ! */ ! public void init(IActionBars bars, IWorkbenchPage page) { ! super.init(bars, page); ! ! // register actions that have a dynamic editor. ! bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, fNextAnnotation); ! bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_PREVIOUS_ANNOTATION, fPreviousAnnotation); ! bars.setGlobalActionHandler(ActionFactory.NEXT.getId(), fNextAnnotation); ! bars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), fPreviousAnnotation); ! } } --- 13,45 ---- public class RubyEditorActionContributor extends BasicTextEditorActionContributor { ! protected RetargetTextEditorAction contentAssistProposal; ! public RubyEditorActionContributor() { ! super(); ! contentAssistProposal = new RetargetTextEditorAction(RubyUIMessages.getResourceBundle(), ! "ContentAssistProposal."); ! } ! public void contributeToMenu(IMenuManager menuManager) { ! IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); ! if (editMenu != null) { ! editMenu.add(new Separator()); ! editMenu.add(contentAssistProposal); ! } ! } ! public void setActiveEditor(IEditorPart part) { ! super.setActiveEditor(part); ! ITextEditor editor = null; ! if (part instanceof ITextEditor) editor = (ITextEditor) part; ! contentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); ! IActionBars bars = getActionBars(); ! bars.setGlobalActionHandler(RubyActionIds.COMMENT, getAction(editor, "Comment")); ! bars.setGlobalActionHandler(RubyActionIds.UNCOMMENT, getAction(editor, "Uncomment")); ! } } Index: GotoAnnotationAction.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/GotoAnnotationAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GotoAnnotationAction.java 11 Mar 2005 03:21:14 -0000 1.3 --- GotoAnnotationAction.java 10 Feb 2006 20:14:31 -0000 1.4 *************** *** 11,18 **** package org.rubypeople.rdt.internal.ui.rubyeditor; ! import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; - import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; --- 11,17 ---- package org.rubypeople.rdt.internal.ui.rubyeditor; ! import org.eclipse.ui.PlatformUI; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; *************** *** 26,36 **** fForward= forward; if (forward) { ! WorkbenchHelp.setHelp(this, IRubyHelpContextIds.GOTO_NEXT_ERROR_ACTION); ! // FIXME Uncomment and delete the above line when we move to 3.1+ ! //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.GOTO_NEXT_ERROR_ACTION); } else { ! WorkbenchHelp.setHelp(this, IRubyHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION); ! // FIXME Uncomment and delete the above line when we move to 3.1+ ! //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION); } } --- 25,31 ---- fForward= forward; if (forward) { ! PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.GOTO_NEXT_ERROR_ACTION); } else { ! PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.GOTO_PREVIOUS_ERROR_ACTION); } } Index: RubyEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** RubyEditor.java 12 Mar 2005 16:52:13 -0000 1.36 --- RubyEditor.java 10 Feb 2006 20:14:31 -0000 1.37 *************** *** 14,21 **** import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; - import org.eclipse.core.runtime.Preferences; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.BadPositionCategoryException; --- 14,21 ---- import org.eclipse.core.runtime.IStatus; [...1847 lines suppressed...] ! return unit.getElementAt(offset); ! ! } catch (RubyModelException x) { ! if (!x.isDoesNotExist()) ! RubyPlugin.log(x.getStatus()); ! // nothing found, be tolerant and go on ! } ! } ! ! return null; ! } ! ! /* ! * @see RubyEditor#getElementAt(int) ! */ ! protected IRubyElement getElementAt(int offset) { ! return getElementAt(offset, true); ! } } \ No newline at end of file --- NEW FILE: TogglePresentationAction.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.rubyeditor; import org.eclipse.jface.action.IAction; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; 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.ui.IWorkingCopyManager; import org.rubypeople.rdt.ui.PreferenceConstants; /** * A tool bar action which toggles the presentation model of the * connected text editor. The editor shows either the highlight range * only or always the whole document. */ public class TogglePresentationAction extends TextEditorAction implements IPropertyChangeListener { private IPreferenceStore fStore; /** * Constructs and updates the action. */ public TogglePresentationAction() { super(RubyEditorMessages.getBundleForConstructedKeys(), "TogglePresentation.", null, IAction.AS_CHECK_BOX); //$NON-NLS-1$ RubyPluginImages.setToolImageDescriptors(this, "segment_edit.gif"); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.TOGGLE_PRESENTATION_ACTION); update(); } /* * @see IAction#actionPerformed */ public void run() { ITextEditor editor= getTextEditor(); if (editor == null) return; IRegion remembered= editor.getHighlightRange(); editor.resetHighlightRange(); boolean showAll= !editor.showsHighlightRangeOnly(); setChecked(showAll); editor.showHighlightRangeOnly(showAll); if (remembered != null) editor.setHighlightRange(remembered.getOffset(), remembered.getLength(), true); fStore.removePropertyChangeListener(this); fStore.setValue(PreferenceConstants.EDITOR_SHOW_SEGMENTS, showAll); fStore.addPropertyChangeListener(this); } /* * @see TextEditorAction#update */ public void update() { ITextEditor editor= getTextEditor(); boolean checked= (editor != null && editor.showsHighlightRangeOnly()); setChecked(checked); if (editor instanceof RubyEditor) { IWorkingCopyManager manager= RubyPlugin.getDefault().getWorkingCopyManager(); setEnabled(manager.getWorkingCopy(editor.getEditorInput()) != null); } else setEnabled(editor != null); } /* * @see TextEditorAction#setEditor(ITextEditor) */ public void setEditor(ITextEditor editor) { super.setEditor(editor); if (editor != null) { if (fStore == null) { fStore= RubyPlugin.getDefault().getPreferenceStore(); fStore.addPropertyChangeListener(this); } synchronizeWithPreference(editor); } else if (fStore != null) { fStore.removePropertyChangeListener(this); fStore= null; } update(); } /** * Synchronizes the appearance of the editor with what the preference store tells him. * * @param editor the text editor */ private void synchronizeWithPreference(ITextEditor editor) { if (editor == null) return; boolean showSegments= fStore.getBoolean(PreferenceConstants.EDITOR_SHOW_SEGMENTS); setChecked(showSegments); if (editor.showsHighlightRangeOnly() != showSegments) { IRegion remembered= editor.getHighlightRange(); editor.resetHighlightRange(); editor.showHighlightRangeOnly(showSegments); if (remembered != null) editor.setHighlightRange(remembered.getOffset(), remembered.getLength(), true); } } /* * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(PreferenceConstants.EDITOR_SHOW_SEGMENTS)) synchronizeWithPreference(getTextEditor()); } } --- NEW FILE: RubyOutlinePage.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.rubyeditor; import java.util.Enumeration; import java.util.Hashtable; import java.util.List; import java.util.Vector; import org.eclipse.core.resources.IResource; [...1217 lines suppressed...] */ protected IShowInTarget getShowInTarget() { return new IShowInTarget() { public boolean show(ShowInContext context) { ISelection sel= context.getSelection(); if (sel instanceof ITextSelection) { ITextSelection tsel= (ITextSelection) sel; int offset= tsel.getOffset(); IRubyElement element= fEditor.getElementAt(offset); if (element != null) { setSelection(new StructuredSelection(element)); return true; } } return false; } }; } } Index: ExternalRubyDocumentProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExternalRubyDocumentProvider.java 5 Mar 2005 16:04:24 -0000 1.4 --- ExternalRubyDocumentProvider.java 10 Feb 2006 20:14:31 -0000 1.5 *************** *** 47,51 **** // TODO: check if this should be inherited from RubyDocumentProvider if (document != null) { ! RubyTextTools tools = RubyPlugin.getDefault().getTextTools(); IDocumentPartitioner partitioner = tools.createDocumentPartitioner(); document.setDocumentPartitioner(partitioner); --- 47,51 ---- // TODO: check if this should be inherited from RubyDocumentProvider if (document != null) { ! RubyTextTools tools = RubyPlugin.getDefault().getRubyTextTools(); IDocumentPartitioner partitioner = tools.createDocumentPartitioner(); document.setDocumentPartitioner(partitioner); Index: ExternalRubyEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExternalRubyEditor.java 29 Feb 2004 22:01:18 -0000 1.1 --- ExternalRubyEditor.java 10 Feb 2006 20:14:31 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.rubypeople.rdt.internal.ui.rubyeditor; + import org.rubypeople.rdt.core.IRubyElement; + public class ExternalRubyEditor extends RubyAbstractEditor { *************** *** 14,16 **** --- 16,26 ---- } + protected IRubyElement getElementAt(int caret, boolean b) { + return null; + } + + protected IRubyElement getElementAt(int offset) { + return null; + } + } Index: RubyAbstractEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RubyAbstractEditor.java 30 Mar 2005 01:55:33 -0000 1.21 --- RubyAbstractEditor.java 10 Feb 2006 20:14:31 -0000 1.22 *************** *** 5,13 **** import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelection; - import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; --- 5,13 ---- import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.text.ITextViewerExtension5; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; *************** *** 21,27 **** --- 21,30 ---- import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.ChainedPreferenceStore; + import org.eclipse.ui.views.contentoutline.ContentOutline; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + import org.rubypeople.rdt.core.IImportContainer; import org.rubypeople.rdt.core.IImportDeclaration; import org.rubypeople.rdt.core.IMember; + import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IRubyScript; import org.rubypeople.rdt.core.ISourceRange; *************** *** 29,316 **** import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; - import org.rubypeople.rdt.internal.ui.rubyeditor.outline.DocumentModelChangeEvent; - import org.rubypeople.rdt.internal.ui.rubyeditor.outline.IDocumentModelListener; - import org.rubypeople.rdt.internal.ui.rubyeditor.outline.RubyContentOutlinePage; - import org.rubypeople.rdt.internal.ui.rubyeditor.outline.RubyCore; - import org.rubypeople.rdt.internal.ui.rubyeditor.outline.RubyModel; - import org.rubypeople.rdt.internal.ui.text.RubySourceViewerConfiguration; import org.rubypeople.rdt.internal.ui.text.RubyTextTools; import org.rubypeople.rdt.ui.IWorkingCopyManager; ! public class RubyAbstractEditor extends TextEditor { ! protected RubyContentOutlinePage outlinePage; ! protected RubyTextTools textTools; ! private IDocumentModelListener fListener; ! private RubyCore fCore; ! private RubyModel model; ! private ISourceReference reference; ! private IPreferenceStore createCombinedPreferenceStore() { ! IPreferenceStore rdtStore = RubyPlugin.getDefault().getPreferenceStore(); ! IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore(); ! return new ChainedPreferenceStore(new IPreferenceStore[] { rdtStore, generalTextStore}); ! } ! protected void initializeEditor() { ! super.initializeEditor(); ! setPreferenceStore(this.createCombinedPreferenceStore()); ! textTools = RubyPlugin.getDefault().getTextTools(); ! setSourceViewerConfiguration(new RubySourceViewerConfiguration(textTools, this)); ! if (fListener == null) { ! fListener = createRubyModelChangeListener(); ! } ! fCore = RubyCore.getDefault(); ! fCore.addDocumentModelListener(fListener); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.ui.texteditor.ExtendedTextEditor#dispose() ! */ ! public void dispose() { ! super.dispose(); ! // Remove the listener so we don't try and create markers on a closed ! // document ! fCore.removeDocumentModelListener(fListener); ! } ! /** ! * @return ! */ ! private IDocumentModelListener createRubyModelChangeListener() { ! return new IDocumentModelListener() { ! public void documentModelChanged(final DocumentModelChangeEvent event) { ! if (event.getModel() == getRubyModel()) { ! getSite().getShell().getDisplay().asyncExec(new Runnable() { ! public void run() { ! try { ! createMarkers(event.getModel().getScript()); ! } catch (CoreException e) { ! RubyPlugin.log(e); ! } ! } ! }); ! } ! } ! }; ! } ! public Object getAdapter(Class required) { ! if (IContentOutlinePage.class.equals(required)) return createRubyOutlinePage(); ! return super.getAdapter(required); ! } ! protected RubyContentOutlinePage createRubyOutlinePage() { ! outlinePage = new RubyContentOutlinePage(getSourceViewer().getDocument(), this); ! setOutlinePageInput(outlinePage, getEditorInput()); ! outlinePage.addSelectionChangedListener(new ISelectionChangedListener() { ! public void selectionChanged(SelectionChangedEvent event) { ! handleOutlinePageSelection(event); ! } ! }); ! return outlinePage; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput) ! */ ! protected void doSetInput(IEditorInput input) throws CoreException { ! super.doSetInput(input); ! setOutlinePageInput(outlinePage, input); ! } ! protected void setOutlinePageInput(RubyContentOutlinePage page, IEditorInput input) { ! if (page != null) { ! IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager(); ! page.setInput(manager.getWorkingCopy(input)); ! } ! } ! protected void handleOutlinePageSelection(SelectionChangedEvent event) { ! StructuredSelection selection = (StructuredSelection) event.getSelection(); ! Iterator iter = ((IStructuredSelection) selection).iterator(); ! while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof ISourceReference) { ! reference = (ISourceReference) o; ! break; ! } ! } ! // FIXME Uncomment so we bring editor to top ! if (!isActivePart() && RubyPlugin.getActivePage() != null) RubyPlugin.getActivePage().bringToTop(this); ! // setSelection(reference, !isActivePart()); ! setSelection(reference, true); ! } ! protected boolean isActivePart() { ! IWorkbenchPart part = getActivePart(); ! return part != null && part.equals(this); ! } ! private IWorkbenchPart getActivePart() { ! IWorkbenchWindow window = getSite().getWorkbenchWindow(); ! IPartService service = window.getPartService(); ! IWorkbenchPart part = service.getActivePart(); ! return part; ! } ! protected void setSelection(ISourceReference reference, boolean moveCursor) { ! if (getSelectionProvider() == null) return; ! ISelection selection = getSelectionProvider().getSelection(); ! if (selection instanceof TextSelection) { ! TextSelection textSelection = (TextSelection) selection; ! // PR 39995: [navigation] Forward history cleared after going back ! // in navigation history: ! // mark only in navigation history if the cursor is being moved ! // (which it isn't if ! // this is called from a PostSelectionEvent that should only update ! // the magnet) ! if (moveCursor && (textSelection.getOffset() != 0 || textSelection.getLength() != 0)) markInNavigationHistory(); ! } ! if (reference != null) { ! StyledText textWidget = null; ! ISourceViewer sourceViewer = getSourceViewer(); ! if (sourceViewer != null) textWidget = sourceViewer.getTextWidget(); ! if (textWidget == null) return; ! try { ! ISourceRange range = null; ! // if (reference instanceof ILocalVariable) { ! // IRubyElement je = ((ILocalVariable) reference).getParent(); ! // if (je instanceof ISourceReference) range = ((ISourceReference) je).getSourceRange(); ! // } else ! range = reference.getSourceRange(); ! if (range == null) return; ! int offset = range.getOffset(); ! int length = range.getLength(); ! if (offset < 0 || length < 0) return; ! setHighlightRange(offset, length, moveCursor); ! if (!moveCursor) ! return; ! ! offset= -1; ! length= -1; ! if (reference instanceof IMember) { ! range = ((IMember) reference).getNameRange(); ! if (range != null) { ! offset = range.getOffset(); ! length = range.getLength(); ! } ! // } else if (reference instanceof ILocalVariable) { ! // range= ((ILocalVariable)reference).getNameRange(); ! // if (range != null) { ! // offset= range.getOffset(); ! // length= range.getLength(); ! // } ! } else if (reference instanceof IImportDeclaration) { ! String name = ((IImportDeclaration) reference).getElementName(); ! if (name != null && name.length() > 0) { ! String content = reference.getSource(); ! if (content != null) { ! offset = range.getOffset() + content.indexOf(name); ! length = name.length(); ! } ! } ! } ! if (offset > -1 && length > 0) { ! try { ! textWidget.setRedraw(false); ! sourceViewer.revealRange(offset, length); ! sourceViewer.setSelectedRange(offset, length); ! } finally { ! textWidget.setRedraw(true); ! } ! markInNavigationHistory(); ! } ! } catch (RubyModelException x) {} catch (IllegalArgumentException x) {} ! } else if (moveCursor) { ! resetHighlightRange(); ! markInNavigationHistory(); ! } ! } ! protected boolean affectsTextPresentation(PropertyChangeEvent event) { ! return textTools.affectsTextPresentation(event); ! } ! /** ! * @param script ! * @throws CoreException ! */ ! private void createMarkers(IRubyScript script) throws CoreException { ! // FIXME Create Markers on the file ! // IEditorInput input = getEditorInput(); ! // if (input == null) { ! // // can happen at workbench shutdown ! // return; ! // } ! // IResource resource = (IResource) ((IAdaptable) ! // input).getAdapter(org.eclipse.core.resources.IResource.class); ! // if (resource == null) { ! // // happens if ruby file is external ! // return; ! // } ! // resource.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE); ! // if ! // (!RdtUiPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.CREATE_PARSER_ANNOTATIONS)) ! // { return; } ! // IDocument doc = getDocumentProvider().getDocument(getEditorInput()); ! // Set errors = script.getParseErrors(); ! // for (Iterator iter = errors.iterator(); iter.hasNext();) { ! // ParseError pe = (ParseError) iter.next(); ! // Map attributes = new HashMap(); ! // MarkerUtilities.setMessage(attributes, pe.getError()); ! // MarkerUtilities.setLineNumber(attributes, pe.getLine()); ! // try { ! // int offset = doc.getLineOffset(pe.getLine()); ! // MarkerUtilities.setCharStart(attributes, offset + pe.getStart()); ! // MarkerUtilities.setCharEnd(attributes, offset + pe.getEnd()); ! // ! // attributes.put(IMarker.SEVERITY, pe.getSeverity()); ! // try { ! // MarkerUtilities.createMarker(resource, attributes, IMarker.PROBLEM); ! // } catch (CoreException x) { ! // RubyPlugin.log(x); ! // } ! // } catch (BadLocationException e) { ! // RubyPlugin.log(e); ! // } ! // ! // } ! } ! public RubyModel getRubyModel() { ! if (model == null) { ! model = new RubyModel(); ! } ! return model; ! } } \ No newline at end of file --- 32,392 ---- import org.rubypeople.rdt.core.RubyModelException; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.text.RubyTextTools; import org.rubypeople.rdt.ui.IWorkingCopyManager; + import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; ! public abstract class RubyAbstractEditor extends TextEditor { ! protected RubyTextTools textTools; ! private ISourceReference reference; ! /** Outliner context menu Id */ ! protected String fOutlinerContextMenuId; ! /** The selection changed listener */ ! protected AbstractSelectionChangedListener fOutlineSelectionChangedListener = new OutlineSelectionChangedListener(); ! private RubyOutlinePage fOutlinePage; ! private IPreferenceStore createCombinedPreferenceStore() { ! IPreferenceStore rdtStore = RubyPlugin.getDefault().getPreferenceStore(); ! IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore(); ! return new ChainedPreferenceStore(new IPreferenceStore[] { rdtStore, generalTextStore}); ! } ! /** ! * Informs the editor that its outliner has been closed. ! */ ! public void outlinePageClosed() { ! if (fOutlinePage != null) { ! fOutlineSelectionChangedListener.uninstall(fOutlinePage); ! fOutlinePage = null; ! resetHighlightRange(); ! } ! } ! /** ! * Sets the outliner's context menu ID. ! * ! * @param menuId ! * the menu ID ! */ ! protected void setOutlinerContextMenuId(String menuId) { ! fOutlinerContextMenuId = menuId; ! } ! protected void initializeEditor() { ! super.initializeEditor(); ! setPreferenceStore(this.createCombinedPreferenceStore()); ! textTools = RubyPlugin.getDefault().getRubyTextTools(); ! setSourceViewerConfiguration(new RubySourceViewerConfiguration(textTools, this)); ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.ui.texteditor.ExtendedTextEditor#dispose() ! */ ! public void dispose() { ! super.dispose(); ! } ! public Object getAdapter(Class required) { ! if (IContentOutlinePage.class.equals(required)) { ! if (fOutlinePage == null) fOutlinePage = createRubyOutlinePage(); ! return fOutlinePage; ! } ! return super.getAdapter(required); ! } ! protected RubyOutlinePage createRubyOutlinePage() { ! RubyOutlinePage outlinePage = new RubyOutlinePage(fOutlinerContextMenuId, this); ! fOutlineSelectionChangedListener.install(outlinePage); ! setOutlinePageInput(outlinePage, getEditorInput()); ! return outlinePage; ! } ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput) ! */ ! protected void doSetInput(IEditorInput input) throws CoreException { ! super.doSetInput(input); ! setOutlinePageInput(fOutlinePage, input); ! } ! protected void setOutlinePageInput(RubyOutlinePage page, IEditorInput input) { ! if (page != null) { ! IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager(); ! page.setInput(manager.getWorkingCopy(input)); ! } ! } ! protected void handleOutlinePageSelection(SelectionChangedEvent event) { ! StructuredSelection selection = (StructuredSelection) event.getSelection(); ! Iterator iter = ((IStructuredSelection) selection).iterator(); ! while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof ISourceReference) { ! reference = (ISourceReference) o; ! break; ! } ! } ! if (!isActivePart() && RubyPlugin.getActivePage() != null) ! RubyPlugin.getActivePage().bringToTop(this); ! // setSelection(reference, !isActivePart()); ! setSelection(reference, true); ! } ! protected boolean isActivePart() { ! IWorkbenchPart part = getActivePart(); ! return part != null && part.equals(this); ! } ! private IWorkbenchPart getActivePart() { ! IWorkbenchWindow window = getSite().getWorkbenchWindow(); ! IPartService service = window.getPartService(); ! IWorkbenchPart part = service.getActivePart(); ! return part; ! } ! public void setSelection(IRubyElement element) { ! if (element == null || element instanceof IRubyScript) { ! /* ! * If the element is an IRubyScript this unit is either the input of ! * this editor or not being displayed. In both cases, nothing should ! * happened. (http://dev.eclipse.org/bugs/show_bug.cgi?id=5128) ! */ ! return; ! } ! IRubyElement corresponding = getCorrespondingElement(element); ! if (corresponding instanceof ISourceReference) { ! ISourceReference reference = (ISourceReference) corresponding; ! // set highlight range ! setSelection(reference, true); ! // set outliner selection ! if (fOutlinePage != null) { ! fOutlineSelectionChangedListener.uninstall(fOutlinePage); ! fOutlinePage.select(reference); ! fOutlineSelectionChangedListener.install(fOutlinePage); ! } ! } ! } ! protected IRubyElement getCorrespondingElement(IRubyElement element) { ! // TODO: With new working copy story: original == working copy. ! // Note that the previous code could result in a reconcile as side ! // effect. Should check if that ! // is still required. ! return element; ! } ! /** ! * Synchronizes the outliner selection with the given element position in ! * the editor. ! * ! * @param element ! * the java element to select ! * @param checkIfOutlinePageActive ! * <code>true</code> if check for active outline page needs to ! * be done ! */ ! protected void synchronizeOutlinePage(ISourceReference element, boolean checkIfOutlinePageActive) { ! if (fOutlinePage != null && element != null ! && !(checkIfOutlinePageActive && isRubyOutlinePageActive())) { ! fOutlineSelectionChangedListener.uninstall(fOutlinePage); ! fOutlinePage.select(element); ! fOutlineSelectionChangedListener.install(fOutlinePage); ! } ! } ! private boolean isRubyOutlinePageActive() { ! IWorkbenchPart part = getActivePart(); ! return part instanceof ContentOutline ! && ((ContentOutline) part).getCurrentPage() == fOutlinePage; ! } ! protected void setSelection(ISourceReference reference, boolean moveCursor) { ! if (getSelectionProvider() == null) return; ! ISelection selection = getSelectionProvider().getSelection(); ! if (selection instanceof TextSelection) { ! TextSelection textSelection = (TextSelection) selection; ! // PR 39995: [navigation] Forward history cleared after going back ! // in navigation history: ! // mark only in navigation history if the cursor is being moved ! // (which it isn't if ! // this is called from a PostSelectionEvent that should only update ! // the magnet) ! if (moveCursor && (textSelection.getOffset() != 0 || textSelection.getLength() != 0)) ! markInNavigationHistory(); ! } ! if (reference != null) { ! StyledText textWidget = null; ! ISourceViewer sourceViewer = getSourceViewer(); ! if (sourceViewer != null) textWidget = sourceViewer.getTextWidget(); ! if (textWidget == null) return; ! try { ! ISourceRange range = null; ! // if (reference instanceof ILocalVariable) { ! // IRubyElement je = ((ILocalVariable) reference).getParent(); ! // if (je instanceof ISourceReference) range = ! // ((ISourceReference) je).getSourceRange(); ! // } else ! range = reference.getSourceRange(); ! if (range == null) return; ! int offset = range.getOffset(); ! int length = range.getLength(); ! if (offset < 0 || length < 0) return; ! setHighlightRange(offset, length, moveCursor); ! if (!moveCursor) return; ! offset = -1; ! length = -1; ! if (reference instanceof IMember) { ! range = ((IMember) reference).getNameRange(); ! if (range != null) { ! offset = range.getOffset(); ! length = range.getLength(); ! } ! // } else if (reference instanceof ILocalVariable) { ! // range= ((ILocalVariable)reference).getNameRange(); ! // if (range != null) { ! // offset= range.getOffset(); ! // length= range.getLength(); ! // } ! } else if (reference instanceof IImportDeclaration) { ! String name = ((IImportDeclaration) reference).getElementName(); ! if (name != null && name.length() > 0) { ! String content = reference.getSource(); ! if (content != null) { ! offset = range.getOffset() + content.indexOf(name); ! length = name.length(); ! } ! } ! } ! if (offset > -1 && length > 0) { ! ! try { ! textWidget.setRedraw(false); ! sourceViewer.revealRange(offset, length); ! sourceViewer.setSelectedRange(offset, length); ! } finally { ! textWidget.setRedraw(true); ! } ! ! markInNavigationHistory(); ! } ! ! } catch (RubyModelException x) { ! } catch (IllegalArgumentException x) { ! } ! ! } else if (moveCursor) { ! resetHighlightRange(); ! markInNavigationHistory(); ! } ! } ! ! protected boolean affectsTextPresentation(PropertyChangeEvent event) { ! return textTools.affectsTextPresentation(event); ! } ! ! protected void doSelectionChanged(SelectionChangedEvent event) { ! ! ISourceReference reference = null; ! ! ISelection selection = event.getSelection(); ! Iterator iter = ((IStructuredSelection) selection).iterator(); ! while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof ISourceReference) { ! reference = (ISourceReference) o; ! break; ! } ! } ! if (!isActivePart() && RubyPlugin.getActivePage() != null) ! RubyPlugin.getActivePage().bringToTop(this); ! ! setSelection(reference, !isActivePart()); ! } ! ! class OutlineSelectionChangedListener extends AbstractSelectionChangedListener { ! ! public void selectionChanged(SelectionChangedEvent event) { ! doSelectionChanged(event); ! } ! } ! ! /** ! * Computes and returns the source reference that includes the caret and ! * serves as provider for the outline page selection and the editor range ! * indication. ! * ! * @return the computed source reference ! * @since 3.0 ! */ ! protected ISourceReference computeHighlightRangeSourceReference() { ! ISourceViewer sourceViewer= getSourceViewer(); ! if (sourceViewer == null) ! return null; ! ! StyledText styledText= sourceViewer.getTextWidget(); ! if (styledText == null) ! return null; ! ! int caret= 0; ! if (sourceViewer instanceof ITextViewerExtension5) { ! ITextViewerExtension5 extension= (ITextViewerExtension5)sourceViewer; ! caret= extension.widgetOffset2ModelOffset(styledText.getCaretOffset()); ! } else { ! int offset= sourceViewer.getVisibleRegion().getOffset(); ! caret= offset + styledText.getCaretOffset(); ! } ! ! IRubyElement element= getElementAt(caret, false); ! ! if ( !(element instanceof ISourceReference)) ! return null; ! ! if (element.getElementType() == IRubyElement.IMPORT) { ! ! IImportDeclaration declaration= (IImportDeclaration) element; ! IImportContainer container= (IImportContainer) declaration.getParent(); ! ISourceRange srcRange= null; ! ! try { ! srcRange= container.getSourceRange(); ! } catch (RubyModelException e) { ! } ! ! if (srcRange != null && srcRange.getOffset() == caret) ! return container; ! } ! ! return (ISourceReference) element; ! } ! ! protected abstract IRubyElement getElementAt(int caret, boolean b); ! ! protected abstract IRubyElement getElementAt(int offset); } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:14:30
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19241/src/org/rubypeople/rdt/internal/ui Modified Files: RubyUIMessages.java RubyUIMessages.properties RubyPluginImages.java RubyPlugin.java Added Files: RubyUIException.java Log Message: --- NEW FILE: RubyUIException.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; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; /** * An exception to wrap a status. This is necessary to use the core's IRunnableWithProgress * support */ public class RubyUIException extends CoreException { private static final long serialVersionUID= 1L; public RubyUIException(IStatus status) { super(status); } } Index: RubyPluginImages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RubyPluginImages.java 26 Oct 2005 21:55:50 -0000 1.12 --- RubyPluginImages.java 10 Feb 2006 20:14:19 -0000 1.13 *************** *** 4,7 **** --- 4,9 ---- import java.net.URL; + import org.eclipse.core.runtime.IPath; + import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IAction; import org.eclipse.jface.resource.ImageDescriptor; *************** *** 18,62 **** iconBaseURL= RubyPlugin.getDefault().getBundle().getEntry("/icons/full/"); //$NON-NLS-1$ } private static final ImageRegistry IMAGE_REGISTRY = new ImageRegistry(); private static final String T_OBJ = "obj16"; //$NON-NLS-1$ private static final String T_ELCL= "elcl16"; //$NON-NLS-1$ private static final String T_CTOOL = "ctool16"; //$NON-NLS-1$ private static final String T_WIZBAN= "wizban"; //$NON-NLS-1$ ! public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif"; ! public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif"; ! public static final String IMG_OBJS_INFO = NAME_PREFIX + "info_obj.gif"; ! public static final String IMG_OBJS_HELP= NAME_PREFIX + "help.gif"; //$NON-NLS-1$ ! public static final String IMG_CTOOLS_RUBY_IMPORT_CONTAINER = NAME_PREFIX + "imp_c.gif"; ! public static final String IMG_CTOOLS_RUBY_IMPORT = NAME_PREFIX + "imp_obj.gif"; ! public static final String IMG_TEMPLATE_PROPOSAL = NAME_PREFIX + "template_obj.gif"; ! public static final String IMG_CTOOLS_RUBY_LOCAL_VAR = NAME_PREFIX + "localvariable_obj.gif"; ! public static final String IMG_CTOOLS_RUBY_PAGE = NAME_PREFIX + "ruby_page.gif"; ! public static final String IMG_CTOOLS_RUBY = NAME_PREFIX + "ruby.gif"; ! public static final String IMG_CTOOLS_RUBY_GLOBAL = NAME_PREFIX + "ruby_global.gif"; ! public static final String IMG_CTOOLS_RUBY_CLASS = NAME_PREFIX + "ruby_class.gif"; ! public static final String IMG_CTOOLS_RUBY_MODULE = NAME_PREFIX + "ruby_module.gif"; ! public static final String IMG_CTOOLS_RUBY_METHOD = NAME_PREFIX + "ruby_method.gif"; ! public static final String IMG_CTOOLS_RUBYMETHOD_PRO = NAME_PREFIX + "ruby_method_pro.gif"; ! public static final String IMG_CTOOLS_RUBYMETHOD_PUB = NAME_PREFIX + "ruby_method_pub.gif"; ! public static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD = NAME_PREFIX + "ruby_singletonmethod.gif"; ! public static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD_PUB = NAME_PREFIX + "ruby_singletonmethod_pub.gif"; ! public static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD_PRO = NAME_PREFIX + "ruby_singletonmethod_pro.gif"; ! public static final String IMG_CTOOLS_RUBY_CLASS_VAR = NAME_PREFIX + "ruby_class_var.gif"; ! public static final String IMG_CTOOLS_RUBY_INSTANCE_VAR = NAME_PREFIX + "ruby_instance_var.gif"; ! public static final String IMG_CTOOLS_RUBY_CONSTANT = NAME_PREFIX + "ruby_constant.gif"; ! public static final String IMG_OBJS_FIXABLE_PROBLEM= NAME_PREFIX + "quickfix_warning_obj.gif"; //$NON-NLS-1$ ! public static final String IMG_OBJS_FIXABLE_ERROR= NAME_PREFIX + "quickfix_error_obj.gif"; //$NON-NLS-1$ ! public static final ImageDescriptor DESC_WIZBAN_NEWJPRJ = create(T_WIZBAN, "newrprj_wiz.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_WIZBAN_NEWCLASS = create(T_WIZBAN, "newclass_wiz.gif"); //$NON-NLS-1$ // RI ! public static final ImageDescriptor TOOLBAR_REFRESH = create(T_ELCL, "refresh.png");; static { createManaged(T_OBJ, IMG_OBJS_FIXABLE_ERROR); --- 20,133 ---- iconBaseURL= RubyPlugin.getDefault().getBundle().getEntry("/icons/full/"); //$NON-NLS-1$ } + + public static final IPath ICONS_PATH= new Path("$nl$/icons/full"); //$NON-NLS-1$ private static final ImageRegistry IMAGE_REGISTRY = new ImageRegistry(); private static final String T_OBJ = "obj16"; //$NON-NLS-1$ + private static final String T_OVR= "ovr16"; //$NON-NLS-1$ private static final String T_ELCL= "elcl16"; //$NON-NLS-1$ + private static final String T_DLCL= "dlcl16"; //$NON-NLS-1$ private static final String T_CTOOL = "ctool16"; //$NON-NLS-1$ private static final String T_WIZBAN= "wizban"; //$NON-NLS-1$ ! /* ! * Keys for images available from the Ruby-UI plug-in image registry. ! */ ! public static final String IMG_MISC_PUBLIC= NAME_PREFIX + "methpub_obj.gif"; //$NON-NLS-1$ ! public static final String IMG_MISC_PROTECTED= NAME_PREFIX + "methpro_obj.gif"; //$NON-NLS-1$ ! public static final String IMG_MISC_PRIVATE= NAME_PREFIX + "methpri_obj.gif"; //$NON-NLS-1$ ! ! public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif"; ! public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif"; ! public static final String IMG_OBJS_INFO = NAME_PREFIX + "info_obj.gif"; ! public static final String IMG_OBJS_HELP= NAME_PREFIX + "help.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_GHOST= NAME_PREFIX + "ghost.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_CLASS= NAME_PREFIX + "class_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_INNER_CLASS= NAME_PREFIX + "innerclass_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_CLASSALT= NAME_PREFIX + "classfo_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_MODULE = NAME_PREFIX + "module_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_MODULEALT= NAME_PREFIX + "modulefo_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_RUBY_MODEL= NAME_PREFIX + "ruby_model_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_SCRIPT= NAME_PREFIX + "rscript_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_RUBY_RESOURCE= NAME_PREFIX + "rscript_resource_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_UNKNOWN= NAME_PREFIX + "unknown_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_CTOOLS_RUBY_IMPORT_CONTAINER = NAME_PREFIX + "imp_c.gif"; ! private static final String IMG_CTOOLS_RUBY_IMPORT = NAME_PREFIX + "imp_obj.gif"; ! public static final String IMG_TEMPLATE_PROPOSAL = NAME_PREFIX + "template_obj.gif"; ! private static final String IMG_CTOOLS_RUBY_LOCAL_VAR = NAME_PREFIX + "localvariable_obj.gif"; ! public static final String IMG_CTOOLS_RUBY_PAGE = NAME_PREFIX + "ruby_page.gif"; ! public static final String IMG_CTOOLS_RUBY = NAME_PREFIX + "ruby.gif"; ! private static final String IMG_CTOOLS_RUBY_GLOBAL = NAME_PREFIX + "ruby_global.gif"; ! private static final String IMG_CTOOLS_RUBY_CLASS = NAME_PREFIX + "ruby_class.gif"; ! private static final String IMG_CTOOLS_RUBY_METHOD = NAME_PREFIX + "ruby_method.gif"; ! private static final String IMG_CTOOLS_RUBYMETHOD_PRO = NAME_PREFIX + "ruby_method_pro.gif"; ! private static final String IMG_CTOOLS_RUBYMETHOD_PUB = NAME_PREFIX + "ruby_method_pub.gif"; ! private static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD = NAME_PREFIX + "ruby_singletonmethod.gif"; ! private static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD_PUB = NAME_PREFIX + "ruby_singletonmethod_pub.gif"; ! private static final String IMG_CTOOLS_RUBY_SINGLETONMETHOD_PRO = NAME_PREFIX + "ruby_singletonmethod_pro.gif"; ! private static final String IMG_CTOOLS_RUBY_CLASS_VAR = NAME_PREFIX + "ruby_class_var.gif"; ! private static final String IMG_CTOOLS_RUBY_INSTANCE_VAR = NAME_PREFIX + "ruby_instance_var.gif"; ! private static final String IMG_CTOOLS_RUBY_CONSTANT = NAME_PREFIX + "ruby_constant.gif"; ! public static final String IMG_OBJS_FIXABLE_PROBLEM= NAME_PREFIX + "quickfix_warning_obj.gif"; //$NON-NLS-1$ ! private static final String IMG_OBJS_FIXABLE_ERROR= NAME_PREFIX + "quickfix_error_obj.gif"; //$NON-NLS-1$ ! public static final ImageDescriptor DESC_WIZBAN_NEWJPRJ = createUnManaged(T_WIZBAN, "newrprj_wiz.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_WIZBAN_NEWCLASS = createUnManaged(T_WIZBAN, "newclass_wiz.gif"); //$NON-NLS-1$ // RI ! public static final ImageDescriptor TOOLBAR_REFRESH = createUnManaged(T_ELCL, "refresh.png"); ! ! public static final ImageDescriptor DESC_OBJ_OVERRIDES= createUnManaged(T_OBJ, "over_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OBJ_IMPLEMENTS= createUnManaged(T_OBJ, "implm_co.gif"); //$NON-NLS-1$ ! ! public static final ImageDescriptor DESC_OVR_STATIC= createUnManaged(T_OVR, "static_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_FINAL= createUnManaged(T_OVR, "final_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_ABSTRACT= createUnManaged(T_OVR, "abstract_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_SYNCH= createUnManaged(T_OVR, "synch_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_RUN= createUnManaged(T_OVR, "run_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_WARNING= createUnManaged(T_OVR, "warning_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_ERROR= createUnManaged(T_OVR, "error_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_OVERRIDES= createUnManaged(T_OVR, "over_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_IMPLEMENTS= createUnManaged(T_OVR, "implm_co.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_SYNCH_AND_OVERRIDES= createUnManaged(T_OVR, "sync_over.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_SYNCH_AND_IMPLEMENTS= createUnManaged(T_OVR, "sync_impl.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_CONSTRUCTOR= createUnManaged(T_OVR, "constr_ovr.gif"); //$NON-NLS-1$ ! public static final ImageDescriptor DESC_OVR_DEPRECATED= createUnManaged(T_OVR, "deprecated.gif"); + public static final ImageDescriptor DESC_ELCL_FILTER= createUnManaged(T_ELCL, "filter_ps.gif"); //$NON-NLS-1$ + public static final ImageDescriptor DESC_DLCL_FILTER= createUnManaged(T_DLCL, "filter_ps.gif"); //$NON-NLS-1$ + + public static final ImageDescriptor DESC_OBJS_GHOST= createManaged(T_OBJ, IMG_OBJS_GHOST); + public static final ImageDescriptor DESC_OBJS_IMPDECL= createManaged(T_OBJ, IMG_CTOOLS_RUBY_IMPORT); + public static final ImageDescriptor DESC_OBJS_IMPCONT= createManaged(T_OBJ, IMG_CTOOLS_RUBY_IMPORT_CONTAINER); + + public static final ImageDescriptor DESC_OBJS_RUBY_MODEL= createManaged(T_OBJ, IMG_OBJS_RUBY_MODEL); + + public static final ImageDescriptor DESC_OBJS_LOCAL_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_LOCAL_VAR); + public static final ImageDescriptor DESC_OBJS_GLOBAL = createManaged(T_OBJ, IMG_CTOOLS_RUBY_GLOBAL); + public static final ImageDescriptor DESC_OBJS_MODULE = createManaged(T_OBJ, IMG_OBJS_MODULE); + public static final ImageDescriptor DESC_OBJS_CLASS_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_CLASS_VAR); + public static final ImageDescriptor DESC_OBJS_INSTANCE_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_INSTANCE_VAR); + public static final ImageDescriptor DESC_OBJS_CONSTANT = createManaged(T_OBJ, IMG_CTOOLS_RUBY_CONSTANT); + + public static final ImageDescriptor DESC_OBJS_CLASS= createManaged(T_OBJ, IMG_OBJS_CLASS); + public static final ImageDescriptor DESC_OBJS_CLASSALT= createManaged(T_OBJ, IMG_OBJS_CLASSALT); + public static final ImageDescriptor DESC_OBJS_INNER_CLASS= createManaged(T_OBJ, IMG_OBJS_INNER_CLASS); + public static final ImageDescriptor DESC_OBJS_MODULEALT = createManaged(T_OBJ, IMG_OBJS_MODULEALT); + + + public static final ImageDescriptor DESC_OBJS_SCRIPT= createManaged(T_OBJ, IMG_OBJS_SCRIPT); + public static final ImageDescriptor DESC_OBJS_RUBY_RESOURCE= createManaged(T_OBJ, IMG_OBJS_RUBY_RESOURCE); + + public static final ImageDescriptor DESC_MISC_PUBLIC= createManaged(T_OBJ, IMG_MISC_PUBLIC); + public static final ImageDescriptor DESC_MISC_PROTECTED= createManaged(T_OBJ, IMG_MISC_PROTECTED); + public static final ImageDescriptor DESC_MISC_PRIVATE= createManaged(T_OBJ, IMG_MISC_PRIVATE); + + public static final ImageDescriptor DESC_OBJS_UNKNOWN= createManaged(T_OBJ, IMG_OBJS_UNKNOWN); + + static { createManaged(T_OBJ, IMG_OBJS_FIXABLE_ERROR); *************** *** 72,76 **** createManaged(T_CTOOL, IMG_CTOOLS_RUBY_GLOBAL); createManaged(T_CTOOL, IMG_CTOOLS_RUBY_CLASS); ! createManaged(T_CTOOL, IMG_CTOOLS_RUBY_MODULE); createManaged(T_CTOOL, IMG_CTOOLS_RUBY_METHOD); createManaged(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PRO); --- 143,147 ---- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_GLOBAL); createManaged(T_CTOOL, IMG_CTOOLS_RUBY_CLASS); ! createManaged(T_CTOOL, IMG_OBJS_MODULE); createManaged(T_CTOOL, IMG_CTOOLS_RUBY_METHOD); createManaged(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PRO); *************** *** 84,87 **** --- 155,160 ---- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_INSTANCE_VAR); } + + /** * Returns the image managed under the given key in this registry. *************** *** 128,132 **** // ImageDescriptor.createFromURL(makeIconFileURL("c" + type, relPath)); ! action.setImageDescriptor(create("e" + type, relPath)); } --- 201,205 ---- // ImageDescriptor.createFromURL(makeIconFileURL("c" + type, relPath)); ! action.setImageDescriptor(createUnManaged("e" + type, relPath)); } *************** *** 141,145 **** } ! protected static ImageDescriptor create(String prefix, String name) { try { return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); --- 214,218 ---- } ! protected static ImageDescriptor createUnManaged(String prefix, String name) { try { return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); Index: RubyUIMessages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyUIMessages.java 5 Mar 2005 20:48:57 -0000 1.2 --- RubyUIMessages.java 10 Feb 2006 20:14:19 -0000 1.3 *************** *** 5,33 **** import java.util.ResourceBundle; ! public class RubyUIMessages { ! private static final String RESOURCE_BUNDLE= RubyUIMessages.class.getName(); ! private static ResourceBundle resourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); ! private RubyUIMessages() { ! } ! public static String getString(String key) { ! try { ! return resourceBundle.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); ! } ! ! public static ResourceBundle getResourceBundle() { ! return resourceBundle; ! } } --- 5,53 ---- import java.util.ResourceBundle; ! import org.eclipse.osgi.util.NLS; ! public class RubyUIMessages extends NLS { ! private static final String BUNDLE_NAME = RubyUIMessages.class.getName(); ! private static ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME); ! ! public static String StatusBarUpdater_num_elements_selected; ! ! public static String RubyElementLabels_default_package; ! public static String RubyElementLabels_anonym_type; ! public static String RubyElementLabels_anonym; ! public static String RubyElementLabels_import_container; ! public static String RubyElementLabels_initializer; ! public static String RubyElementLabels_concat_string; ! public static String RubyElementLabels_comma_string; ! public static String RubyElementLabels_declseparator_string; ! ! public static String RubyImageLabelprovider_assert_wrongImage; ! ! private RubyUIMessages() { ! } ! ! public static String getString(String key) { ! try { ! return resourceBundle.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); ! } ! ! public static ResourceBundle getResourceBundle() { ! return resourceBundle; ! } ! ! static { ! NLS.initializeMessages(BUNDLE_NAME, RubyUIMessages.class); ! } } Index: RubyPlugin.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** RubyPlugin.java 27 Jan 2006 16:27:56 -0000 1.22 --- RubyPlugin.java 10 Feb 2006 20:14:19 -0000 1.23 *************** *** 19,22 **** --- 19,26 ---- import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; + import org.eclipse.debug.internal.ui.ImageDescriptorRegistry; + import org.eclipse.jface.action.GroupMarker; + import org.eclipse.jface.action.IMenuManager; + import org.eclipse.jface.action.Separator; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; *************** *** 25,28 **** --- 29,33 ---- import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; + import org.eclipse.search.ui.IContextMenuConstants; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Shell; *************** *** 43,47 **** import org.rubypeople.rdt.core.WorkingCopyOwner; import org.rubypeople.rdt.internal.core.util.EclipseJobScheduler; ! import org.rubypeople.rdt.internal.formatter.CodeFormatter; import org.rubypeople.rdt.internal.ui.preferences.MockupPreferenceStore; import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility; --- 48,53 ---- import org.rubypeople.rdt.core.WorkingCopyOwner; import org.rubypeople.rdt.internal.core.util.EclipseJobScheduler; ! import org.rubypeople.rdt.internal.formatter.OldCodeFormatter; ! import org.rubypeople.rdt.internal.ui.preferences.MembersOrderPreferenceCache; import org.rubypeople.rdt.internal.ui.preferences.MockupPreferenceStore; import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility; *************** *** 86,89 **** --- 92,97 ---- private RubyFoldingStructureProviderRegistry fFoldingStructureProviderRegistry; private boolean new060ViewsOpened; + private ImageDescriptorRegistry fImageDescriptorRegistry; + private MembersOrderPreferenceCache fMembersOrderPreferenceCache; public RubyPlugin() { *************** *** 132,135 **** --- 140,147 ---- }); + IPreferenceStore store= getPreferenceStore(); + fMembersOrderPreferenceCache= new MembersOrderPreferenceCache(); + fMembersOrderPreferenceCache.install(store); + RubyCore rubyCore = RubyCore.getPlugin(); *************** *** 208,211 **** --- 220,229 ---- textTools = null; } + + if (fMembersOrderPreferenceCache != null) { + fMembersOrderPreferenceCache.dispose(); + fMembersOrderPreferenceCache= null; + } + } finally { super.stop(context); *************** *** 252,267 **** } ! public synchronized RubyTextTools getTextTools() { if (textTools == null) textTools = new RubyTextTools(getPreferenceStore(), RubyCore.getPlugin().getPluginPreferences()); return textTools; } ! public CodeFormatter getCodeFormatter() { ! char indentChar = this.getPreferenceStore().getBoolean(PreferenceConstants.FORMAT_USE_TAB) ? '\t' : ' '; ! String codeFormatterOption = Platform.getDebugOption(RubyCore.PLUGIN_ID + "/codeformatter"); ! boolean isDebug = codeFormatterOption == null ? false : codeFormatterOption.equalsIgnoreCase("true"); ! CodeFormatter codeFormatter = new CodeFormatter(indentChar, isDebug); ! codeFormatter.setIndentation(this.getPreferenceStore().getInt(PreferenceConstants.FORMAT_INDENTATION)); ! return codeFormatter; } --- 270,280 ---- } ! public synchronized RubyTextTools getRubyTextTools() { if (textTools == null) textTools = new RubyTextTools(getPreferenceStore(), RubyCore.getPlugin().getPluginPreferences()); return textTools; } ! public OldCodeFormatter getCodeFormatter() { ! return new OldCodeFormatter(RubyCore.getOptions()); } *************** *** 443,445 **** --- 456,497 ---- } + public static boolean isDebug() { + // TODO set to true based on debugging/tracing! + return false; + } + + /** + * Creates the Java plugin standard groups in a context menu. + * + * @param menu the menu manager to be populated + */ + public static void createStandardGroups(IMenuManager menu) { + if (!menu.isEmpty()) + return; + menu.add(new Separator(IContextMenuConstants.GROUP_NEW)); + menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO)); + menu.add(new Separator(IContextMenuConstants.GROUP_OPEN)); + menu.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW)); + menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE)); + menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE)); + menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH)); + menu.add(new Separator(IContextMenuConstants.GROUP_BUILD)); + menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS)); + menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP)); + menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES)); + } + + public static ImageDescriptorRegistry getImageDescriptorRegistry() { + return getDefault().internalGetImageDescriptorRegistry(); + } + private synchronized ImageDescriptorRegistry internalGetImageDescriptorRegistry() { + if (fImageDescriptorRegistry == null) + fImageDescriptorRegistry= new ImageDescriptorRegistry(); + return fImageDescriptorRegistry; + } + + public synchronized MembersOrderPreferenceCache getMemberOrderPreferenceCache() { + // initialized on startup + return fMembersOrderPreferenceCache; + } } \ No newline at end of file Index: RubyUIMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RubyUIMessages.properties 27 Jan 2006 16:27:56 -0000 1.12 --- RubyUIMessages.properties 10 Feb 2006 20:14:19 -0000 1.13 *************** *** 143,144 **** --- 143,151 ---- ErrorRunningRdocTitle=Error running RDoc + 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. + |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:13:12
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/icons/full/ovr16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18568/icons/full/ovr16 Added Files: static_co.gif constr_ovr.gif Log Message: new icons for UI --- NEW FILE: constr_ovr.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: static_co.gif --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/icons/full/obj16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18505/icons/full/obj16 Added Files: localvariable_obj.gif modulefo_obj.gif ruby_constant.gif rscript_obj.gif ruby_global.gif ruby_instance_var.gif imp_c.gif class_obj.gif methpub_obj.gif ruby_class_var.gif classfo_obj.gif methpri_obj.gif ruby_model_obj.gif unknown_obj.gif imp_obj.gif module_obj.gif rscript_resource_obj.gif methpro_obj.gif innerclass_obj.gif Log Message: new icons for UI --- NEW FILE: methpri_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ruby_class_var.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: class_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rscript_resource_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: methpub_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: localvariable_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: innerclass_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: imp_c.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: methpro_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ruby_instance_var.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: module_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: imp_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ruby_model_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ruby_constant.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: modulefo_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: classfo_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rscript_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ruby_global.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: unknown_obj.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Christopher W. <caw...@us...> - 2006-02-10 20:12:37
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/icons/full/elcl16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18440/icons/full/elcl16 Added Files: localtypes_co.gif synced.gif static_co.gif fields_co.gif gointo_toplevel_type.gif public_co.gif filter_ps.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.) |