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-04-24 21:21:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20061/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: SymbolRule.java Log Message: remove debugging output Index: SymbolRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SymbolRule.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SymbolRule.java 21 Apr 2006 21:06:47 -0000 1.5 --- SymbolRule.java 24 Apr 2006 21:21:56 -0000 1.6 *************** *** 31,35 **** protected boolean wordValid(String word) { - System.out.println(word); return !Character.isDigit(word.charAt(1)); } --- 31,34 ---- |
|
From: Christopher W. <caw...@us...> - 2006-04-23 19:58:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2377/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: PreferencesMessages.properties Log Message: Index: PreferencesMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PreferencesMessages.properties 21 Apr 2006 21:13:28 -0000 1.10 --- PreferencesMessages.properties 23 Apr 2006 19:58:24 -0000 1.11 *************** *** 125,130 **** RubyEditorPreferencePage_typing_tabTitle=T&yping ! RubyEditorPreferencePage_closeStrings= "&Strings" ! RubyEditorPreferencePage_closeBrackets= (Parentheses), [square] and <angle> brac&kets RubyEditorPreferencePage_closeBraces= {B&races} --- 125,130 ---- RubyEditorPreferencePage_typing_tabTitle=T&yping ! RubyEditorPreferencePage_closeStrings= "Double" and 'single' quoted &strings ! RubyEditorPreferencePage_closeBrackets= (Parentheses) and [square] brac&kets RubyEditorPreferencePage_closeBraces= {B&races} |
|
From: Christopher W. <caw...@us...> - 2006-04-23 19:58:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2377/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyEditor.java Log Message: Index: RubyEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** RubyEditor.java 21 Apr 2006 21:13:29 -0000 1.44 --- RubyEditor.java 23 Apr 2006 19:58:23 -0000 1.45 *************** *** 109,112 **** --- 109,114 ---- /** Preference key for automatically closing brackets and parenthesis */ private final static String CLOSE_BRACKETS= PreferenceConstants.EDITOR_CLOSE_BRACKETS; + /** Preference key for automatically closing braces */ + private final static String CLOSE_BRACES= PreferenceConstants.EDITOR_CLOSE_BRACES; /** *************** *** 255,260 **** --- 257,264 ---- IPreferenceStore preferenceStore= getPreferenceStore(); boolean closeBrackets= preferenceStore.getBoolean(CLOSE_BRACKETS); + boolean closeBraces= preferenceStore.getBoolean(CLOSE_BRACES); boolean closeStrings= preferenceStore.getBoolean(CLOSE_STRINGS); fBracketInserter.setCloseBracketsEnabled(closeBrackets); + fBracketInserter.setCloseBracesEnabled(closeBraces); fBracketInserter.setCloseStringsEnabled(closeStrings); ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(fBracketInserter); *************** *** 662,665 **** --- 666,674 ---- return; } + + if (CLOSE_BRACES.equals(property)) { + fBracketInserter.setCloseBracesEnabled(getPreferenceStore().getBoolean(property)); + return; + } if (CLOSE_STRINGS.equals(property)) { *************** *** 929,932 **** --- 938,942 ---- private boolean fCloseBrackets = true; private boolean fCloseStrings = true; + private boolean fCloseBraces = true; private final String CATEGORY = toString(); private IPositionUpdater fUpdater = new ExclusivePositionUpdater(CATEGORY); *************** *** 940,943 **** --- 950,957 ---- fCloseStrings = enabled; } + + public void setCloseBracesEnabled(boolean enabled) { + fCloseBraces = enabled; + } /* *************** *** 989,993 **** case '{': ! if (!fCloseBrackets || nextToken == Symbols.TokenLBRACE || nextToken == Symbols.TokenIDENT || next != null && next.length() > 1) return; --- 1003,1007 ---- case '{': ! if (!fCloseBraces || nextToken == Symbols.TokenLBRACE || nextToken == Symbols.TokenIDENT || next != null && next.length() > 1) return; |
|
From: Christopher W. <caw...@us...> - 2006-04-23 19:43:33
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25144 Modified Files: plugin.properties Log Message: Index: plugin.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/plugin.properties,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** plugin.properties 13 Apr 2006 23:00:38 -0000 1.33 --- plugin.properties 23 Apr 2006 19:43:30 -0000 1.34 *************** *** 49,52 **** --- 49,53 ---- editorSyntaxColoringPage=Syntax Coloring editorFoldingPage=Folding + editorTypingPage=Typing EditorRubyFile.name=Ruby Editor |
|
From: Christopher W. <caw...@us...> - 2006-04-22 23:36:57
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22586/src/org/rubypeople/rdt/internal/ui/text Modified Files: RubyDoubleClickSelector.java RubyWordFinder.java Log Message: tweak word selection (for hover and double-clicking) - don't pick up commas Index: RubyDoubleClickSelector.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyDoubleClickSelector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyDoubleClickSelector.java 12 Dec 2005 19:59:58 -0000 1.1 --- RubyDoubleClickSelector.java 22 Apr 2006 23:36:54 -0000 1.2 *************** *** 13,17 **** IRegion region = RubyWordFinder.findWord(text.getDocument(), position); if (region != null && region.getLength() != 0 ) text.setSelectedRange(region.getOffset(), region.getLength()); - } } \ No newline at end of file --- 13,16 ---- Index: RubyWordFinder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyWordFinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyWordFinder.java 12 Dec 2005 19:59:58 -0000 1.2 --- RubyWordFinder.java 22 Apr 2006 23:36:54 -0000 1.3 *************** *** 22,26 **** */ private static final char[] BOUNDARIES = { ' ', '\n', '\t', '\r', '.', '(', ')', '{', '}', '[', ! ']', '=', '*', '+', '-', '"', '\'', '#'}; public static IRegion findWord(IDocument document, int offset) { int start = -1; --- 22,26 ---- */ private static final char[] BOUNDARIES = { ' ', '\n', '\t', '\r', '.', '(', ')', '{', '}', '[', ! ']', '=', '*', '+', '-', '"', '\'', '#', ','}; public static IRegion findWord(IDocument document, int offset) { int start = -1; |
|
From: Christopher W. <caw...@us...> - 2006-04-22 23:34:14
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21094/src/org/rubypeople/rdt/internal/launching Modified Files: RubyRuntime.java Log Message: remove auto detection of interpreter Index: RubyRuntime.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyRuntime.java 7 Apr 2006 21:25:25 -0000 1.9 --- RubyRuntime.java 22 Apr 2006 23:34:09 -0000 1.10 *************** *** 127,131 **** Reader fileReader = this.getRuntimeConfigurationReader() ; if (fileReader == null) { ! autoDetectRubyInterpreter(); return ; } --- 127,132 ---- Reader fileReader = this.getRuntimeConfigurationReader() ; if (fileReader == null) { ! // FIXME If we get a better algorithm for auto detection we should use it, but apparently this didn't make people happy ! // autoDetectRubyInterpreter(); return ; } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:14:34
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28763/src/org/rubypeople/rdt/internal/ui/preferences Removed Files: TextEditorPreferencePage2.java Log Message: remove old ruby editor preference page --- TextEditorPreferencePage2.java DELETED --- |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:13:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyAbstractEditor.java RubyEditor.java Log Message: make over the ruby editor preference page. Add options for smart typing features (like auto-closing brackets/strings) Index: RubyEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** RubyEditor.java 21 Apr 2006 21:06:47 -0000 1.43 --- RubyEditor.java 21 Apr 2006 21:13:29 -0000 1.44 *************** *** 91,95 **** import org.rubypeople.rdt.internal.ui.text.IRubyPartitions; import org.rubypeople.rdt.internal.ui.text.RubyHeuristicScanner; - import org.rubypeople.rdt.internal.ui.text.RubyPairMatcher; import org.rubypeople.rdt.internal.ui.text.Symbols; import org.rubypeople.rdt.ui.IWorkingCopyManager; --- 91,94 ---- *************** *** 102,111 **** public class RubyEditor extends RubyAbstractEditor { - - protected final static char[] BRACKETS= { '{', '}', '(', ')', '[', ']' }; protected RubyActionGroup actionGroup; private ProjectionSupport fProjectionSupport; /** * Mutex for the reconciler. See --- 101,113 ---- public class RubyEditor extends RubyAbstractEditor { protected RubyActionGroup actionGroup; private ProjectionSupport fProjectionSupport; + /** Preference key for automatically closing strings */ + private final static String CLOSE_STRINGS= PreferenceConstants.EDITOR_CLOSE_STRINGS; + /** Preference key for automatically closing brackets and parenthesis */ + private final static String CLOSE_BRACKETS= PreferenceConstants.EDITOR_CLOSE_BRACKETS; + /** * Mutex for the reconciler. See *************** *** 144,150 **** private ToggleFoldingRunner fFoldingRunner; - /** The editor's bracket matcher */ - protected RubyPairMatcher fBracketMatcher= new RubyPairMatcher(BRACKETS); - private BracketInserter fBracketInserter = new BracketInserter(); --- 146,149 ---- *************** *** 254,257 **** --- 253,261 ---- ISourceViewer sourceViewer = getSourceViewer(); if (sourceViewer instanceof ITextViewerExtension) { + IPreferenceStore preferenceStore= getPreferenceStore(); + boolean closeBrackets= preferenceStore.getBoolean(CLOSE_BRACKETS); + boolean closeStrings= preferenceStore.getBoolean(CLOSE_STRINGS); + fBracketInserter.setCloseBracketsEnabled(closeBrackets); + fBracketInserter.setCloseStringsEnabled(closeStrings); ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(fBracketInserter); } *************** *** 523,528 **** * @see org.rubypeople.rdt.internal.ui.rubyeditor.RubyAbstractEditor#dispose() */ ! public void dispose() { ! super.dispose(); if (fProjectionModelUpdater != null) { --- 527,535 ---- * @see org.rubypeople.rdt.internal.ui.rubyeditor.RubyAbstractEditor#dispose() */ ! public void dispose() { ! ISourceViewer sourceViewer= getSourceViewer(); ! if (sourceViewer instanceof ITextViewerExtension) ! ((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(fBracketInserter); ! if (fProjectionModelUpdater != null) { *************** *** 535,538 **** --- 542,546 ---- fProjectionSupport = null; } + super.dispose(); } *************** *** 650,653 **** --- 658,671 ---- } + if (CLOSE_BRACKETS.equals(property)) { + fBracketInserter.setCloseBracketsEnabled(getPreferenceStore().getBoolean(property)); + return; + } + + if (CLOSE_STRINGS.equals(property)) { + fBracketInserter.setCloseStringsEnabled(getPreferenceStore().getBoolean(property)); + return; + } + ISourceViewer sourceViewer= getSourceViewer(); if (sourceViewer == 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.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** RubyAbstractEditor.java 21 Apr 2006 21:06:47 -0000 1.27 --- RubyAbstractEditor.java 21 Apr 2006 21:13:29 -0000 1.28 *************** *** 79,83 **** protected final static String MATCHING_BRACKETS_COLOR= PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR; ! protected final static char[] BRACKETS= { '{', '}', '(', ')', '[', ']', '<', '>' }; /** The editor's bracket matcher */ --- 79,83 ---- protected final static String MATCHING_BRACKETS_COLOR= PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR; ! protected final static char[] BRACKETS= { '{', '}', '(', ')', '[', ']' }; /** The editor's bracket matcher */ |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:13:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089 Modified Files: plugin.xml Log Message: make over the ruby editor preference page. Add options for smart typing features (like auto-closing brackets/strings) Index: plugin.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/plugin.xml,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** plugin.xml 21 Apr 2006 00:55:57 -0000 1.81 --- plugin.xml 21 Apr 2006 21:13:29 -0000 1.82 *************** *** 25,29 **** name="%PreferencePage.RubyEditor.name" category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase" ! class="org.rubypeople.rdt.internal.ui.preferences.TextEditorPreferencePage2" id="org.rubypeople.rdt.ui.preferences.PreferencePageRubyEditor"> </page> --- 25,29 ---- name="%PreferencePage.RubyEditor.name" category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase" ! class="org.rubypeople.rdt.internal.ui.preferences.RubyEditorPreferencePage" id="org.rubypeople.rdt.ui.preferences.PreferencePageRubyEditor"> </page> *************** *** 74,77 **** --- 74,84 ---- <keywordReference id="org.rubypeople.rdt.ui.folding"/> </page> + <page + name="%editorTypingPage" + category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyEditor" + class="org.rubypeople.rdt.internal.ui.preferences.SmartTypingPreferencePage" + id="org.rubypeople.rdt.ui.preferences.SmartTypingPreferencePage"> + <keywordReference id="org.rubypeople.rdt.ui.smarttyping"/> + </page> </extension> <!-- =========================================================================== --> |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:13:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089/src/org/rubypeople/rdt/internal/ui Modified Files: IRubyHelpContextIds.java Log Message: make over the ruby editor preference page. Add options for smart typing features (like auto-closing brackets/strings) Index: IRubyHelpContextIds.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/IRubyHelpContextIds.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IRubyHelpContextIds.java 5 Mar 2005 19:38:09 -0000 1.1 --- IRubyHelpContextIds.java 21 Apr 2006 21:13:29 -0000 1.2 *************** *** 267,271 **** public static final String JAVA_BASE_PREFERENCE_PAGE= PREFIX + "java_base_preference_page_context"; //$NON-NLS-1$ public static final String REFACTORING_PREFERENCE_PAGE= PREFIX + "refactoring_preference_page_context"; //$NON-NLS-1$ ! public static final String JAVA_EDITOR_PREFERENCE_PAGE= PREFIX + "java_editor_preference_page_context"; //$NON-NLS-1$ public static final String COMPILER_PREFERENCE_PAGE= PREFIX + "compiler_preference_page_context"; //$NON-NLS-1$ public static final String TODOTASK_PREFERENCE_PAGE= PREFIX + "tasktags_preference_page_context"; //$NON-NLS-1$ --- 267,271 ---- public static final String JAVA_BASE_PREFERENCE_PAGE= PREFIX + "java_base_preference_page_context"; //$NON-NLS-1$ public static final String REFACTORING_PREFERENCE_PAGE= PREFIX + "refactoring_preference_page_context"; //$NON-NLS-1$ ! public static final String RUBY_EDITOR_PREFERENCE_PAGE= PREFIX + "ruby_editor_preference_page_context"; //$NON-NLS-1$ public static final String COMPILER_PREFERENCE_PAGE= PREFIX + "compiler_preference_page_context"; //$NON-NLS-1$ public static final String TODOTASK_PREFERENCE_PAGE= PREFIX + "tasktags_preference_page_context"; //$NON-NLS-1$ |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:13:35
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: PreferencesMessages.java PreferencesMessages.properties Added Files: SmartTypingPreferencePage.java RubyEditorPreferencePage.java SmartTypingConfigurationBlock.java RubyEditorAppearanceConfigurationBlock.java Log Message: make over the ruby editor preference page. Add options for smart typing features (like auto-closing brackets/strings) Index: PreferencesMessages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PreferencesMessages.java 13 Apr 2006 23:00:38 -0000 1.6 --- PreferencesMessages.java 21 Apr 2006 21:13:28 -0000 1.7 *************** *** 72,76 **** public static String AppearancePreferencePage_preferenceOnlyEffectiveForNewPerspectives; public static String AppearancePreferencePage_methodtypeparams_label; - public static String AppearancePreferencePage_showMembersInPackagesView; public static String AppearancePreferencePage_stackViewsVerticallyInTheRubyBrowsingPerspective; public static String AppearancePreferencePage_description; --- 72,75 ---- *************** *** 102,105 **** --- 101,122 ---- public static String RubyEditorPreferencePage_invalid_input; public static String RubyEditorPreferencePage_folding_title; + public static String RubyEditorPreferencePage_matchingBracketsHighlightColor2; + public static String RubyEditorPreferencePage_backgroundForCompletionProposals; + public static String RubyEditorPreferencePage_foregroundForCompletionProposals; + public static String RubyEditorPreferencePage_backgroundForMethodParameters; + public static String RubyEditorPreferencePage_foregroundForMethodParameters; + public static String RubyEditorPreferencePage_backgroundForCompletionReplacement; + public static String RubyEditorPreferencePage_foregroundForCompletionReplacement; + public static String RubyEditorPreferencePage_analyseAnnotationsWhileTyping; + public static String SmartTypingConfigurationBlock_annotationReporting_link; + public static String RubyEditorPreferencePage_highlightMatchingBrackets; + public static String RubyEditorPreferencePage_appearanceOptions; + public static String RubyEditorPreferencePage_systemDefault; + public static String RubyEditorPreferencePage_general; + public static String RubyEditorPreferencePage_typing_tabTitle; + public static String SmartTypingConfigurationBlock_autoclose_title; + public static String RubyEditorPreferencePage_closeStrings; + public static String RubyEditorPreferencePage_closeBrackets; + public static String RubyEditorPreferencePage_closeBraces; static { --- NEW FILE: RubyEditorPreferencePage.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; /** * The page for setting the editor options. */ public final class RubyEditorPreferencePage extends AbstractConfigurationBlockPreferencePage { /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() */ protected String getHelpId() { return IRubyHelpContextIds.RUBY_EDITOR_PREFERENCE_PAGE; } /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() */ protected void setDescription() { String description= PreferencesMessages.RubyEditorPreferencePage_general; setDescription(description); } /* * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() */ protected void setPreferenceStore() { setPreferenceStore(RubyPlugin.getDefault().getPreferenceStore()); } protected Label createDescriptionLabel(Composite parent) { return null; // no description for new look. } /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) */ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) { return new RubyEditorAppearanceConfigurationBlock(this, overlayPreferenceStore); } } --- NEW FILE: SmartTypingConfigurationBlock.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.rubypeople.rdt.ui.PreferenceConstants; /** * Configures Ruby Editor typing preferences. * * @since 3.1 */ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock { public SmartTypingConfigurationBlock(OverlayPreferenceStore store) { super(store); store.addKeys(createOverlayStoreKeys()); } private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { return new OverlayPreferenceStore.OverlayKey[] { new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACES) }; } /** * Creates page for mark occurrences preferences. * * @param parent the parent composite * @return the control for the preference page */ public Control createControl(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control= new Composite(scrolled, SWT.NONE); GridLayout layout= new GridLayout(); control.setLayout(layout); Composite composite; composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_autoclose_title); addAutoclosingSection(composite); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; } private void addAutoclosingSection(Composite composite) { GridLayout layout= new GridLayout(); layout.numColumns= 1; composite.setLayout(layout); String label; label= PreferencesMessages.RubyEditorPreferencePage_closeStrings; addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS, 0); label= PreferencesMessages.RubyEditorPreferencePage_closeBrackets; addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS, 0); label= PreferencesMessages.RubyEditorPreferencePage_closeBraces; addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 0); } } Index: PreferencesMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PreferencesMessages.properties 13 Apr 2006 23:00:38 -0000 1.9 --- PreferencesMessages.properties 21 Apr 2006 21:13:28 -0000 1.10 *************** *** 109,111 **** RubyEditorPreferencePage_regular_expressions= Regular Expressions RubyEditorPreferencePage_symbols= Symbols ! RubyEditorPreferencePage_variables= Variables \ No newline at end of file --- 109,133 ---- RubyEditorPreferencePage_regular_expressions= Regular Expressions RubyEditorPreferencePage_symbols= Symbols ! RubyEditorPreferencePage_variables= Variables ! ! RubyEditorPreferencePage_matchingBracketsHighlightColor2=Matching brackets highlight ! RubyEditorPreferencePage_backgroundForCompletionProposals= Completion proposal background ! RubyEditorPreferencePage_foregroundForCompletionProposals= Completion proposal foreground ! RubyEditorPreferencePage_backgroundForMethodParameters= Parameter hints background ! RubyEditorPreferencePage_foregroundForMethodParameters= Parameter hints foreground ! RubyEditorPreferencePage_backgroundForCompletionReplacement= Completion overwrite background ! RubyEditorPreferencePage_foregroundForCompletionReplacement= Completion overwrite foreground ! RubyEditorPreferencePage_analyseAnnotationsWhileTyping= Report &problems as you type ! RubyEditorPreferencePage_highlightMatchingBrackets=Highlight &matching brackets ! RubyEditorPreferencePage_appearanceOptions=Appearance co&lor options: ! RubyEditorPreferencePage_systemDefault=&System Default ! RubyEditorPreferencePage_general=Appeara&nce ! ! RubyEditorPreferencePage_typing_tabTitle=T&yping ! RubyEditorPreferencePage_closeStrings= "&Strings" ! RubyEditorPreferencePage_closeBrackets= (Parentheses), [square] and <angle> brac&kets ! RubyEditorPreferencePage_closeBraces= {B&races} ! ! SmartTypingConfigurationBlock_autoclose_title=Automatically close ! SmartTypingConfigurationBlock_annotationReporting_link=Also see the <a href="org.eclipse.ui.editors.preferencePages.Spelling">spell checking</a> preferences. ! --- NEW FILE: SmartTypingPreferencePage.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; /** * The page for setting the editor options. */ public final class SmartTypingPreferencePage extends AbstractConfigurationBlockPreferencePage { /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() */ protected String getHelpId() { return IRubyHelpContextIds.RUBY_EDITOR_PREFERENCE_PAGE; } /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() */ protected void setDescription() { String description= PreferencesMessages.RubyEditorPreferencePage_typing_tabTitle; setDescription(description); } /* * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() */ protected void setPreferenceStore() { setPreferenceStore(RubyPlugin.getDefault().getPreferenceStore()); } protected Label createDescriptionLabel(Composite parent) { return null; // no description for new look. } /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) */ protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) { return new SmartTypingConfigurationBlock(overlayPreferenceStore); } } --- NEW FILE: RubyEditorAppearanceConfigurationBlock.java --- /******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.preferences; import java.util.ArrayList; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.ColorSelector; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.FontMetrics; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.dialogs.PreferencesUtil; import org.rubypeople.rdt.internal.ui.util.PixelConverter; import org.rubypeople.rdt.ui.PreferenceConstants; /** * Configures Ruby Editor hover preferences. * * @since 2.1 */ class RubyEditorAppearanceConfigurationBlock extends AbstractConfigurationBlock { private final String[][] fAppearanceColorListModel= new String[][] { {PreferencesMessages.RubyEditorPreferencePage_matchingBracketsHighlightColor2, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, null}, {PreferencesMessages.RubyEditorPreferencePage_backgroundForCompletionProposals, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, null }, {PreferencesMessages.RubyEditorPreferencePage_foregroundForCompletionProposals, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, null }, {PreferencesMessages.RubyEditorPreferencePage_backgroundForMethodParameters, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, null }, {PreferencesMessages.RubyEditorPreferencePage_foregroundForMethodParameters, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, null }, {PreferencesMessages.RubyEditorPreferencePage_backgroundForCompletionReplacement, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND, null }, {PreferencesMessages.RubyEditorPreferencePage_foregroundForCompletionReplacement, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND, null }, }; private List fAppearanceColorList; private ColorSelector fAppearanceColorEditor; private Button fAppearanceColorDefault; private FontMetrics fFontMetrics; public RubyEditorAppearanceConfigurationBlock(PreferencePage mainPreferencePage, OverlayPreferenceStore store) { super(store, mainPreferencePage); getPreferenceStore().addKeys(createOverlayStoreKeys()); } private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { ArrayList overlayKeys= new ArrayList(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MATCHING_BRACKETS)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND)); OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); return keys; } /** * Creates page for appearance preferences. * * @param parent the parent composite * @return the control for the preference page */ public Control createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); createHeader(composite); createAppearancePage(composite); return composite; } private void createHeader(Composite contents) { final Shell shell= contents.getShell(); String text= PreferencesMessages.RubyEditorPreferencePage_link; Link link= new Link(contents, SWT.NONE); link.setText(text); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(shell, "org.eclipse.ui.preferencePages.GeneralTextEditor", null, null); //$NON-NLS-1$ } }); // TODO replace by link-specific tooltips when // bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88866 gets fixed link.setToolTipText(PreferencesMessages.RubyEditorPreferencePage_link_tooltip); GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false); gridData.widthHint= 150; // only expand further if anyone else requires it link.setLayoutData(gridData); addFiller(contents); } private void addFiller(Composite composite) { PixelConverter pixelConverter= new PixelConverter(composite); Label filler= new Label(composite, SWT.LEFT ); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2; filler.setLayoutData(gd); } /** * Returns the number of pixels corresponding to the width of the given * number of characters. * <p> * This method may only be called after <code>initializeDialogUnits</code> * has been called. * </p> * <p> * Clients may call this framework method, but should not override it. * </p> * * @param chars * the number of characters * @return the number of pixels */ protected int convertWidthInCharsToPixels(int chars) { // test for failure to initialize for backward compatibility if (fFontMetrics == null) return 0; return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); } /** * Returns the number of pixels corresponding to the height of the given * number of characters. * <p> * This method may only be called after <code>initializeDialogUnits</code> * has been called. * </p> * <p> * Clients may call this framework method, but should not override it. * </p> * * @param chars * the number of characters * @return the number of pixels */ protected int convertHeightInCharsToPixels(int chars) { // test for failure to initialize for backward compatibility if (fFontMetrics == null) return 0; return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars); } private Control createAppearancePage(Composite parent) { Composite appearanceComposite= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; appearanceComposite.setLayout(layout); String label; label= PreferencesMessages.RubyEditorPreferencePage_analyseAnnotationsWhileTyping; addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, 0); String text= PreferencesMessages.SmartTypingConfigurationBlock_annotationReporting_link; addLink(appearanceComposite, text, INDENT); Label spacer= new Label(appearanceComposite, SWT.LEFT ); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.heightHint= convertHeightInCharsToPixels(1) / 2; spacer.setLayoutData(gd); label= PreferencesMessages.RubyEditorPreferencePage_highlightMatchingBrackets; addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_MATCHING_BRACKETS, 0); Label l= new Label(appearanceComposite, SWT.LEFT ); gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.heightHint= convertHeightInCharsToPixels(1) / 2; l.setLayoutData(gd); l= new Label(appearanceComposite, SWT.LEFT); l.setText(PreferencesMessages.RubyEditorPreferencePage_appearanceOptions); gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; l.setLayoutData(gd); Composite editorComposite= new Composite(appearanceComposite, SWT.NONE); layout= new GridLayout(); layout.numColumns= 2; layout.marginHeight= 0; layout.marginWidth= 0; editorComposite.setLayout(layout); gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); gd.horizontalSpan= 2; editorComposite.setLayoutData(gd); fAppearanceColorList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER); gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL); gd.heightHint= convertHeightInCharsToPixels(12); fAppearanceColorList.setLayoutData(gd); Composite stylesComposite= new Composite(editorComposite, SWT.NONE); layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; layout.numColumns= 2; stylesComposite.setLayout(layout); stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); l= new Label(stylesComposite, SWT.LEFT); l.setText(PreferencesMessages.RubyEditorPreferencePage_color); gd= new GridData(); gd.horizontalAlignment= GridData.BEGINNING; l.setLayoutData(gd); fAppearanceColorEditor= new ColorSelector(stylesComposite); Button foregroundColorButton= fAppearanceColorEditor.getButton(); gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment= GridData.BEGINNING; foregroundColorButton.setLayoutData(gd); SelectionListener colorDefaultSelectionListener= new SelectionListener() { public void widgetSelected(SelectionEvent e) { boolean systemDefault= fAppearanceColorDefault.getSelection(); fAppearanceColorEditor.getButton().setEnabled(!systemDefault); int i= fAppearanceColorList.getSelectionIndex(); if (i == -1) return; String key= fAppearanceColorListModel[i][2]; if (key != null) getPreferenceStore().setValue(key, systemDefault); } public void widgetDefaultSelected(SelectionEvent e) {} }; fAppearanceColorDefault= new Button(stylesComposite, SWT.CHECK); fAppearanceColorDefault.setText(PreferencesMessages.RubyEditorPreferencePage_systemDefault); gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment= GridData.BEGINNING; gd.horizontalSpan= 2; fAppearanceColorDefault.setLayoutData(gd); fAppearanceColorDefault.setVisible(false); fAppearanceColorDefault.addSelectionListener(colorDefaultSelectionListener); fAppearanceColorList.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // do nothing } public void widgetSelected(SelectionEvent e) { handleAppearanceColorListSelection(); } }); foregroundColorButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // do nothing } public void widgetSelected(SelectionEvent e) { int i= fAppearanceColorList.getSelectionIndex(); if (i == -1) return; String key= fAppearanceColorListModel[i][1]; PreferenceConverter.setValue(getPreferenceStore(), key, fAppearanceColorEditor.getColorValue()); } }); return appearanceComposite; } private void addLink(Composite composite, String text, int indent) { GridData gd; final Link link= new Link(composite, SWT.NONE); link.setText(text); gd= new GridData(SWT.FILL, SWT.BEGINNING, true, false); gd.widthHint= 300; // don't get wider initially gd.horizontalSpan= 2; gd.horizontalIndent= indent; link.setLayoutData(gd); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, null); } }); } private void handleAppearanceColorListSelection() { int i= fAppearanceColorList.getSelectionIndex(); if (i == -1) return; String key= fAppearanceColorListModel[i][1]; RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), key); fAppearanceColorEditor.setColorValue(rgb); updateAppearanceColorWidgets(fAppearanceColorListModel[i][2]); } private void updateAppearanceColorWidgets(String systemDefaultKey) { if (systemDefaultKey == null) { fAppearanceColorDefault.setSelection(false); fAppearanceColorDefault.setVisible(false); fAppearanceColorEditor.getButton().setEnabled(true); } else { boolean systemDefault= getPreferenceStore().getBoolean(systemDefaultKey); fAppearanceColorDefault.setSelection(systemDefault); fAppearanceColorDefault.setVisible(true); fAppearanceColorEditor.getButton().setEnabled(!systemDefault); } } /* * @see org.eclipse.jdt.internal.ui.preferences.IPreferenceConfigurationBlock#initialize() */ public void initialize() { super.initialize(); for (int i= 0; i < fAppearanceColorListModel.length; i++) fAppearanceColorList.add(fAppearanceColorListModel[i][0]); fAppearanceColorList.getDisplay().asyncExec(new Runnable() { public void run() { if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) { fAppearanceColorList.select(0); handleAppearanceColorListSelection(); } } }); } /* * @see org.eclipse.jdt.internal.ui.preferences.IPreferenceConfigurationBlock#performDefaults() */ public void performDefaults() { super.performDefaults(); handleAppearanceColorListSelection(); } /** * Initializes the computation of horizontal and vertical dialog units based * on the size of current font. * <p> * This method must be called before any of the dialog unit based conversion * methods are called. * </p> * * @param testControl * a control from which to obtain the current font */ protected void initializeDialogUnits(Control testControl) { // Compute and store a font metric GC gc = new GC(testControl); gc.setFont(JFaceResources.getDialogFont()); fFontMetrics = gc.getFontMetrics(); gc.dispose(); } } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:13:35
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089/src/org/rubypeople/rdt/ui Modified Files: PreferenceConstants.java Log Message: make over the ruby editor preference page. Add options for smart typing features (like auto-closing brackets/strings) Index: PreferenceConstants.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PreferenceConstants.java 21 Apr 2006 21:06:47 -0000 1.17 --- PreferenceConstants.java 21 Apr 2006 21:13:29 -0000 1.18 *************** *** 452,455 **** --- 452,484 ---- public final static String CODEASSIST_PREFIX_COMPLETION= "content_assist_prefix_completion"; //$NON-NLS-1$ + /** + * A named preference that controls whether the 'close strings' feature + * is enabled. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String EDITOR_CLOSE_STRINGS= "closeStrings"; //$NON-NLS-1$ + + /** + * A named preference that controls whether the 'close brackets' feature is + * enabled. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String EDITOR_CLOSE_BRACKETS= "closeBrackets"; //$NON-NLS-1$ + + /** + * A named preference that controls whether the 'close braces' feature is + * enabled. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String EDITOR_CLOSE_BRACES= "closeBraces"; //$NON-NLS-1$ public static void initializeDefaultValues(IPreferenceStore store) { *************** *** 458,462 **** // FIXME We can't enabling using code formatter yet, because it breaks on formatting templates (when inserting via content assist) // FIXME Uncomment when we have an AST based formatter which spits out TextEdits (rather than one huge replace) ! // store.setDefault(PreferenceConstants.TEMPLATES_USE_CODEFORMATTER, true); store.setDefault(PreferenceConstants.FORMATTER_PROFILE, ProfileManager.DEFAULT_PROFILE); --- 487,491 ---- // FIXME We can't enabling using code formatter yet, because it breaks on formatting templates (when inserting via content assist) // FIXME Uncomment when we have an AST based formatter which spits out TextEdits (rather than one huge replace) ! //store.setDefault(PreferenceConstants.TEMPLATES_USE_CODEFORMATTER, true); store.setDefault(PreferenceConstants.FORMATTER_PROFILE, ProfileManager.DEFAULT_PROFILE); *************** *** 467,471 **** // 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$ --- 496,499 ---- *************** *** 480,484 **** store.setDefault(PreferenceConstants.BROWSING_STACK_VERTICALLY, false); - // TODO Expose these preferences to the user! store.setDefault(PreferenceConstants.EDITOR_CORRECTION_INDICATION, true); store.setDefault(PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, true); --- 508,511 ---- *************** *** 520,524 **** store.setDefault(PreferenceConstants.CODEASSIST_PREFIX_COMPLETION, false); ! } --- 547,553 ---- store.setDefault(PreferenceConstants.CODEASSIST_PREFIX_COMPLETION, false); ! store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS, true); ! store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACKETS, true); ! store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACES, true); } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:06:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24269/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyAbstractEditor.java RubyEditor.java Log Message: Fix template auto-insert and symbol syntax highlighting Index: RubyEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** RubyEditor.java 12 Apr 2006 21:26:25 -0000 1.42 --- RubyEditor.java 21 Apr 2006 21:06:47 -0000 1.43 *************** *** 45,48 **** --- 45,49 ---- import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.ICharacterPairMatcher; + import org.eclipse.jface.text.source.IOverviewRuler; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.ISourceViewerExtension2; *************** *** 675,689 **** } ! protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { ! fAnnotationAccess = createAnnotationAccess(); ! fOverviewRuler = createOverviewRuler(getSharedColors()); ! ! IPreferenceStore store= getPreferenceStore(); ! ISourceViewer viewer = new RubySourceViewer(parent, ruler, getOverviewRuler(), ! isOverviewRulerVisible(), styles, store); ! // ensure decoration support has been created and configured. ! getSourceViewerDecorationSupport(viewer); ! return viewer; ! } /** --- 676,682 ---- } ! protected ISourceViewer createRubySourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { ! return new AdaptedSourceViewer(parent, verticalRuler, overviewRuler, isOverviewRulerVisible, styles, store); ! } /** Index: RubyAbstractEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** RubyAbstractEditor.java 20 Apr 2006 21:55:42 -0000 1.26 --- RubyAbstractEditor.java 21 Apr 2006 21:06:47 -0000 1.27 *************** *** 12,16 **** --- 12,20 ---- import org.eclipse.jface.text.ITextViewerExtension5; import org.eclipse.jface.text.TextSelection; + import org.eclipse.jface.text.contentassist.ContentAssistant; + import org.eclipse.jface.text.contentassist.IContentAssistant; + import org.eclipse.jface.text.source.IOverviewRuler; import org.eclipse.jface.text.source.ISourceViewer; + import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.ListenerList; *************** *** 22,25 **** --- 26,30 ---- import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.graphics.Point; + import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorInput; *************** *** 47,50 **** --- 52,56 ---- import org.rubypeople.rdt.core.formatter.DefaultCodeFormatterConstants; import org.rubypeople.rdt.internal.ui.RubyPlugin; + import org.rubypeople.rdt.internal.ui.text.ContentAssistPreference; import org.rubypeople.rdt.internal.ui.text.IRubyPartitions; import org.rubypeople.rdt.internal.ui.text.PreferencesAdapter; *************** *** 118,121 **** --- 124,143 ---- super.configureSourceViewerDecorationSupport(support); } + + protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { + fAnnotationAccess = createAnnotationAccess(); + fOverviewRuler = createOverviewRuler(getSharedColors()); + + IPreferenceStore store= getPreferenceStore(); + ISourceViewer viewer = createRubySourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles, store); + // ensure decoration support has been created and configured. + getSourceViewerDecorationSupport(viewer); + return viewer; + } + + protected ISourceViewer createRubySourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) { + return new RubySourceViewer(parent, verticalRuler, overviewRuler, + isOverviewRulerVisible, styles, store); + } /** *************** *** 209,213 **** try { ! ISourceViewer sourceViewer= getSourceViewer(); if (sourceViewer == null) return; --- 231,235 ---- try { ! AdaptedSourceViewer sourceViewer= (AdaptedSourceViewer) getSourceViewer(); if (sourceViewer == null) return; *************** *** 224,227 **** --- 246,254 ---- return; } + + IContentAssistant c= sourceViewer.getContentAssistant(); + if (c instanceof ContentAssistant) + ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event); + } finally { *************** *** 803,807 **** --- 830,847 ---- throw new UnsupportedOperationException(); } + } + + class AdaptedSourceViewer extends RubySourceViewer { + private List fTextConverters; + private boolean fIgnoreTextConverters= false; + + public AdaptedSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { + super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store); + } + + public IContentAssistant getContentAssistant() { + return fContentAssistant; + } } } \ No newline at end of file |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:06:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24269/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: AppearancePreferencePage.java Log Message: Fix template auto-insert and symbol syntax highlighting Index: AppearancePreferencePage.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/AppearancePreferencePage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AppearancePreferencePage.java 30 Mar 2006 02:56:45 -0000 1.1 --- AppearancePreferencePage.java 21 Apr 2006 21:06:47 -0000 1.2 *************** *** 37,41 **** public class AppearancePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - private static final String SHOW_CU_CHILDREN= PreferenceConstants.SHOW_CU_CHILDREN; private static final String PREF_METHOD_PARAMETER_NAMES= PreferenceConstants.APPEARANCE_METHOD_PARAMETER_NAMES; private static final String STACK_BROWSING_VIEWS_VERTICALLY= PreferenceConstants.BROWSING_STACK_VERTICALLY; --- 37,40 ---- *************** *** 43,47 **** private SelectionButtonDialogField fStackBrowsingViewsVertically; - private SelectionButtonDialogField fShowMembersInPackageView; private SelectionButtonDialogField fShowMethodParameterNames; --- 42,45 ---- *************** *** 61,68 **** fShowMethodParameterNames.setLabelText(PreferencesMessages.AppearancePreferencePage_methodtypeparams_label); - fShowMembersInPackageView= new SelectionButtonDialogField(SWT.CHECK); - fShowMembersInPackageView.setDialogFieldListener(listener); - fShowMembersInPackageView.setLabelText(PreferencesMessages.AppearancePreferencePage_showMembersInPackagesView); - fStackBrowsingViewsVertically= new SelectionButtonDialogField(SWT.CHECK); fStackBrowsingViewsVertically.setDialogFieldListener(listener); --- 59,62 ---- *************** *** 73,77 **** IPreferenceStore prefs= getPreferenceStore(); fShowMethodParameterNames.setSelection(prefs.getBoolean(PREF_METHOD_PARAMETER_NAMES)); - fShowMembersInPackageView.setSelection(prefs.getBoolean(SHOW_CU_CHILDREN)); fStackBrowsingViewsVertically.setSelection(prefs.getBoolean(STACK_BROWSING_VIEWS_VERTICALLY)); } --- 67,70 ---- *************** *** 101,106 **** result.setLayout(layout); ! fShowMethodParameterNames.doFillIntoGrid(result, nColumns); ! fShowMembersInPackageView.doFillIntoGrid(result, nColumns); new Separator().doFillIntoGrid(result, nColumns); --- 94,98 ---- result.setLayout(layout); ! fShowMethodParameterNames.doFillIntoGrid(result, nColumns); new Separator().doFillIntoGrid(result, nColumns); *************** *** 146,150 **** IPreferenceStore prefs= getPreferenceStore(); prefs.setValue(PREF_METHOD_PARAMETER_NAMES, fShowMethodParameterNames.isSelected()); - prefs.setValue(SHOW_CU_CHILDREN, fShowMembersInPackageView.isSelected()); prefs.setValue(STACK_BROWSING_VIEWS_VERTICALLY, fStackBrowsingViewsVertically.isSelected()); RubyPlugin.getDefault().savePluginPreferences(); --- 138,141 ---- *************** *** 158,162 **** IPreferenceStore prefs= getPreferenceStore(); fShowMethodParameterNames.setSelection(prefs.getDefaultBoolean(PREF_METHOD_PARAMETER_NAMES)); - fShowMembersInPackageView.setSelection(prefs.getDefaultBoolean(SHOW_CU_CHILDREN)); fStackBrowsingViewsVertically.setSelection(prefs.getDefaultBoolean(STACK_BROWSING_VIEWS_VERTICALLY)); super.performDefaults(); --- 149,152 ---- |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:06:59
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24269/src/org/rubypeople/rdt/internal/ui/text Added Files: ContentAssistPreference.java Log Message: Fix template auto-insert and symbol syntax highlighting --- NEW FILE: ContentAssistPreference.java --- package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.RGB; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.text.ruby.RubyCompletionProcessor; import org.rubypeople.rdt.ui.PreferenceConstants; import org.rubypeople.rdt.ui.text.IColorManager; import org.rubypeople.rdt.ui.text.RubyTextTools; public class ContentAssistPreference { /** Preference key for content assist auto activation */ private final static String AUTOACTIVATION = PreferenceConstants.CODEASSIST_AUTOACTIVATION; /** Preference key for content assist auto activation delay */ private final static String AUTOACTIVATION_DELAY = PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY; /** Preference key for content assist proposal color */ private final static String PROPOSALS_FOREGROUND = PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND; /** Preference key for content assist proposal color */ private final static String PROPOSALS_BACKGROUND = PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND; /** Preference key for content assist parameters color */ private final static String PARAMETERS_FOREGROUND = PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND; /** Preference key for content assist parameters color */ private final static String PARAMETERS_BACKGROUND = PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND; /** Preference key for content assist auto insert */ private final static String AUTOINSERT = PreferenceConstants.CODEASSIST_AUTOINSERT; /** Preference key for prefix completion. */ private static final String PREFIX_COMPLETION= PreferenceConstants.CODEASSIST_PREFIX_COMPLETION; public static void changeConfiguration(ContentAssistant assistant, IPreferenceStore store, PropertyChangeEvent event) { String p = event.getProperty(); if (AUTOACTIVATION.equals(p)) { boolean enabled = store.getBoolean(AUTOACTIVATION); assistant.enableAutoActivation(enabled); } else if (AUTOACTIVATION_DELAY.equals(p)) { int delay = store.getInt(AUTOACTIVATION_DELAY); assistant.setAutoActivationDelay(delay); } else if (PROPOSALS_FOREGROUND.equals(p)) { Color c = getColor(store, PROPOSALS_FOREGROUND); assistant.setProposalSelectorForeground(c); } else if (PROPOSALS_BACKGROUND.equals(p)) { Color c = getColor(store, PROPOSALS_BACKGROUND); assistant.setProposalSelectorBackground(c); } else if (PARAMETERS_FOREGROUND.equals(p)) { Color c = getColor(store, PARAMETERS_FOREGROUND); assistant.setContextInformationPopupForeground(c); assistant.setContextSelectorForeground(c); } else if (PARAMETERS_BACKGROUND.equals(p)) { Color c = getColor(store, PARAMETERS_BACKGROUND); assistant.setContextInformationPopupBackground(c); assistant.setContextSelectorBackground(c); } else if (AUTOINSERT.equals(p)) { boolean enabled = store.getBoolean(AUTOINSERT); assistant.enableAutoInsert(enabled); } else if (PREFIX_COMPLETION.equals(p)) { boolean enabled = store.getBoolean(PREFIX_COMPLETION); assistant.enablePrefixCompletion(enabled); } changeRubyProcessor(assistant, store, p); } /** * Configure the given content assistant from the given store. */ public static void configure(ContentAssistant assistant, IPreferenceStore store) { RubyTextTools textTools= RubyPlugin.getDefault().getRubyTextTools(); IColorManager manager= textTools.getColorManager(); boolean enabled= store.getBoolean(AUTOACTIVATION); assistant.enableAutoActivation(enabled); int delay= store.getInt(AUTOACTIVATION_DELAY); assistant.setAutoActivationDelay(delay); Color c= getColor(store, PROPOSALS_FOREGROUND, manager); assistant.setProposalSelectorForeground(c); c= getColor(store, PROPOSALS_BACKGROUND, manager); assistant.setProposalSelectorBackground(c); c= getColor(store, PARAMETERS_FOREGROUND, manager); assistant.setContextInformationPopupForeground(c); assistant.setContextSelectorForeground(c); c= getColor(store, PARAMETERS_BACKGROUND, manager); assistant.setContextInformationPopupBackground(c); assistant.setContextSelectorBackground(c); enabled= store.getBoolean(AUTOINSERT); assistant.enableAutoInsert(enabled); enabled= store.getBoolean(PREFIX_COMPLETION); assistant.enablePrefixCompletion(enabled); configureRubyProcessor(assistant, store); } private static void configureRubyProcessor(ContentAssistant assistant, IPreferenceStore store) { RubyCompletionProcessor jcp= getRubyProcessor(assistant); if (jcp == null) return; // TODO Uncomment when we can handle auto-activation, visibility limitations or case sensitivity // String triggers= store.getString(AUTOACTIVATION_TRIGGERS_JAVA); // if (triggers != null) // jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); // // boolean enabled= store.getBoolean(SHOW_VISIBLE_PROPOSALS); // jcp.restrictProposalsToVisibility(enabled); // // enabled= store.getBoolean(CASE_SENSITIVITY); // jcp.restrictProposalsToMatchingCases(enabled); } private static Color getColor(IPreferenceStore store, String key, IColorManager manager) { RGB rgb = PreferenceConverter.getColor(store, key); return manager.getColor(rgb); } private static Color getColor(IPreferenceStore store, String key) { RubyTextTools textTools = RubyPlugin.getDefault().getRubyTextTools(); return getColor(store, key, textTools.getColorManager()); } private static void changeRubyProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { RubyCompletionProcessor jcp = getRubyProcessor(assistant); if (jcp == null) return; // TODO Uncomment when we can handle auto-activation, visibility limitations or case sensitivity // if (AUTOACTIVATION_TRIGGERS_JAVA.equals(key)) { // String triggers = store.getString(AUTOACTIVATION_TRIGGERS_JAVA); // if (triggers != null) // jcp.setCompletionProposalAutoActivationCharacters(triggers // .toCharArray()); // } else if (SHOW_VISIBLE_PROPOSALS.equals(key)) { // boolean enabled = store.getBoolean(SHOW_VISIBLE_PROPOSALS); // jcp.restrictProposalsToVisibility(enabled); // } else if (CASE_SENSITIVITY.equals(key)) { // boolean enabled = store.getBoolean(CASE_SENSITIVITY); // jcp.restrictProposalsToMatchingCases(enabled); // } } private static RubyCompletionProcessor getRubyProcessor( ContentAssistant assistant) { IContentAssistProcessor p = assistant .getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE); if (p instanceof RubyCompletionProcessor) return (RubyCompletionProcessor) p; return null; } } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:06:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24269/src/org/rubypeople/rdt/ui Modified Files: PreferenceConstants.java Log Message: Fix template auto-insert and symbol syntax highlighting Index: PreferenceConstants.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PreferenceConstants.java 20 Apr 2006 21:55:43 -0000 1.16 --- PreferenceConstants.java 21 Apr 2006 21:06:47 -0000 1.17 *************** *** 35,46 **** public static final String APPEARANCE_METHOD_PARAMETER_NAMES= "org.rubypeople.rdt.ui.methodparameternames";//$NON-NLS-1$ - /** - * A named preference that specifies whether children of a ruby script are shown in the package explorer. - * <p> - * Value is of type <code>Boolean</code>. - * </p> - */ - public static final String SHOW_CU_CHILDREN= "org.rubypeople.rdt.ui.packages.rubyscriptchildren"; //$NON-NLS-1$ - /** * A named preference that controls whether folding is enabled in the Ruby --- 35,38 ---- *************** *** 317,321 **** --- 309,456 ---- */ public final static String EDITOR_MATCHING_BRACKETS_COLOR= "matchingBracketsColor"; //$NON-NLS-1$ + + /** + * A named preference that controls if the Ruby code assist gets auto activated. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + */ + public final static String CODEASSIST_AUTOACTIVATION= "content_assist_autoactivation"; //$NON-NLS-1$ + + /** + * A name preference that holds the auto activation delay time in milliseconds. + * <p> + * Value is of type <code>Integer</code>. + * </p> + */ + public final static String CODEASSIST_AUTOACTIVATION_DELAY= "content_assist_autoactivation_delay"; //$NON-NLS-1$ + + /** + * A named preference that controls if the Java code assist inserts a + * proposal automatically if only one proposal is available. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String CODEASSIST_AUTOINSERT= "content_assist_autoinsert"; //$NON-NLS-1$ + + /** + * A named preference that controls if the Java code assist only inserts + * completions. If set to false the proposals can also _replace_ code. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String CODEASSIST_INSERT_COMPLETION= "content_assist_insert_completion"; //$NON-NLS-1$ + + /** + * A named preference that controls if argument names are filled in when a method is selected from as list + * of code assist proposal. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + */ + public final static String CODEASSIST_FILL_ARGUMENT_NAMES= "content_assist_fill_method_arguments"; //$NON-NLS-1$ + + /** + * A named preference that controls if method arguments are guessed when a + * method is selected from as list of code assist proposal. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * @since 2.1 + */ + public final static String CODEASSIST_GUESS_METHOD_ARGUMENTS= "content_assist_guess_method_arguments"; //$NON-NLS-1$ + + /** + * A named preference that holds the background color used in the code assist selection dialog. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + */ + public final static String CODEASSIST_PROPOSALS_BACKGROUND= "content_assist_proposals_background"; //$NON-NLS-1$ + + /** + * A named preference that holds the foreground color used in the code assist selection dialog. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + */ + public final static String CODEASSIST_PROPOSALS_FOREGROUND= "content_assist_proposals_foreground"; //$NON-NLS-1$ + + /** + * A named preference that holds the background color used for parameter hints. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + */ + public final static String CODEASSIST_PARAMETERS_BACKGROUND= "content_assist_parameters_background"; //$NON-NLS-1$ + + /** + * A named preference that holds the foreground color used in the code assist selection dialog. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + */ + public final static String CODEASSIST_PARAMETERS_FOREGROUND= "content_assist_parameters_foreground"; //$NON-NLS-1$ + + /** + * A named preference that holds the background color used in the code + * assist selection dialog to mark replaced code. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + * @since 2.1 + */ + public final static String CODEASSIST_REPLACEMENT_BACKGROUND= "content_assist_completion_replacement_background"; //$NON-NLS-1$ + /** + * A named preference that holds the foreground color used in the code + * assist selection dialog to mark replaced code. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + * @since 2.1 + */ + public final static String CODEASSIST_REPLACEMENT_FOREGROUND= "content_assist_completion_replacement_foreground"; //$NON-NLS-1$ + + /** + * A named preference that controls if content assist inserts the common + * prefix of all proposals before presenting choices. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + * + * @since 3.0 + */ + public final static String CODEASSIST_PREFIX_COMPLETION= "content_assist_prefix_completion"; //$NON-NLS-1$ + + public static void initializeDefaultValues(IPreferenceStore store) { store.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); *************** *** 370,373 **** --- 505,523 ---- PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192, 192,192)); + store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION, true); + store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY, 200); + + store.setDefault(PreferenceConstants.CODEASSIST_AUTOINSERT, true); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, new RGB(255, 255, 255)); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0)); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255)); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0)); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND, new RGB(255, 255, 0)); + PreferenceConverter.setDefault(store, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND, new RGB(255, 0, 0)); + store.setDefault(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, true); + store.setDefault(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, true); + store.setDefault(PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, false); + store.setDefault(PreferenceConstants.CODEASSIST_PREFIX_COMPLETION, false); + } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 21:06:55
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24269/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: SymbolRule.java SingleCharacterPrefixRule.java Log Message: Fix template auto-insert and symbol syntax highlighting Index: SingleCharacterPrefixRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SingleCharacterPrefixRule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SingleCharacterPrefixRule.java 20 Dec 2005 15:35:41 -0000 1.2 --- SingleCharacterPrefixRule.java 21 Apr 2006 21:06:47 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- protected int fMinLength; protected int fMaxLength; + private StringBuffer fWord; public SingleCharacterPrefixRule(char prefix, IToken token, int minLength, int maxLength) { *************** *** 35,47 **** int c = scanner.read(); int length = 1; if (((char) c) == fPrefix) { // Now read until we hit EOF, EOL or whitespace while (true) { c = scanner.read(); if (!isValidCharacter(c, length)) { ! scanner.unread(); ! if (!lengthInRange(length)) return Token.UNDEFINED; return fToken; } length++; } --- 36,56 ---- int c = scanner.read(); int length = 1; + fWord = new StringBuffer(); if (((char) c) == fPrefix) { + fWord.append(((char) c)); // Now read until we hit EOF, EOL or whitespace while (true) { c = scanner.read(); if (!isValidCharacter(c, length)) { ! if (!isValidEndCharacter(c, length)) ! scanner.unread(); ! else { ! fWord.append(((char) c)); ! length++; ! } ! if (!lengthInRange(length) || !wordValid(fWord.toString())) return Token.UNDEFINED; return fToken; } + fWord.append(((char) c)); length++; } *************** *** 52,56 **** } ! /** * Determine if the current character is valid for the rule. Return false if * the character is not a part of the token. This is not applied to the --- 61,73 ---- } ! protected boolean wordValid(String word) { ! return true; ! } ! ! protected boolean isValidEndCharacter(int c, int length) { ! return false; ! } ! ! /** * Determine if the current character is valid for the rule. Return false if * the character is not a part of the token. This is not applied to the Index: SymbolRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SymbolRule.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SymbolRule.java 28 Mar 2006 19:48:22 -0000 1.4 --- SymbolRule.java 21 Apr 2006 21:06:47 -0000 1.5 *************** *** 23,33 **** // Symbols can only contain word characters (a-zA-Z0-9_) // TODO which special method names contain brackets? ! String theChar = String.valueOf((char) c); ! if(theChar.matches("\\w")) { ! return true; ! } ! else { ! return false; ! } } --- 23,36 ---- // Symbols can only contain word characters (a-zA-Z0-9_) // TODO which special method names contain brackets? ! return Character.isLetterOrDigit((char) c) || c == '_'; ! } ! ! protected boolean isValidEndCharacter(int c, int length) { ! return c == '?' || c == '!'; ! } ! ! protected boolean wordValid(String word) { ! System.out.println(word); ! return !Character.isDigit(word.charAt(1)); } |
|
From: Christopher W. <caw...@us...> - 2006-04-21 00:56:04
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9059 Modified Files: plugin.xml Log Message: Ticket #109 - Category for some ruby shortcuts Index: plugin.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/plugin.xml,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** plugin.xml 13 Apr 2006 23:00:38 -0000 1.80 --- plugin.xml 21 Apr 2006 00:55:57 -0000 1.81 *************** *** 324,338 **** <extension point="org.eclipse.ui.bindings"> <key ! sequence="M1+M2+F" commandId="org.rubypeople.rdt.ui.edit.text.ruby.format" ! schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> <key sequence="ESC M1+F" commandId="org.rubypeople.rdt.ui.edit.text.ruby.format" platform="gtk" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> <key sequence="M1+/" ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> --- 324,341 ---- <extension point="org.eclipse.ui.bindings"> <key ! sequence="M1+M2+F" commandId="org.rubypeople.rdt.ui.edit.text.ruby.format" ! contextId="org.rubypeople.rdt.ui.rubyEditorScope" ! schemeId="org.eclipse.ui.defaultAcceleratorConfiguration "/> <key sequence="ESC M1+F" commandId="org.rubypeople.rdt.ui.edit.text.ruby.format" + contextId="org.rubypeople.rdt.ui.rubyEditorScope " platform="gtk" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> <key sequence="M1+/" ! commandId=" org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" ! contextId="org.rubypeople.rdt.ui.rubyEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> *************** *** 340,374 **** sequence="M1+M2+C" commandId="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> <key ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" contextId="org.rubypeople.rdt.ui.rubyEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+SPACE"> </key> <key ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" contextId="org.rubypeople.rdt.ui.rubyEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+SPACE" ! platform="carbon"> </key> <key sequence="M1+M2+P" contextId="org.rubypeople.rdt.ui.rubyEditorScope" ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.goto.matching.bracket" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> - <key sequence="F3" commandId="org.rubypeople.rdt.ui.edit.text.ruby.open.editor" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> ! </extension> <extension point="org.eclipse.ui.commands"> <category name="%category.source.name" description="%category.source.description" ! id="org.rubypeople.rdt.ui.category.source"> </category> <command --- 343,390 ---- sequence="M1+M2+C" commandId="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" + contextId="org.rubypeople.rdt.ui.rubyEditorScope " schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> + <!-- alternative for some gtk input modes --> <key ! platform="gtk" ! sequence="ESC CTRL+C" contextId="org.rubypeople.rdt.ui.rubyEditorScope" + commandId="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" + schemeId=" org.eclipse.ui.defaultAcceleratorConfiguration"/> + <key + commandId="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" + contextId="org.rubypeople.rdt.ui.rubyEditorScope " schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+SPACE"> </key> <key ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals " contextId="org.rubypeople.rdt.ui.rubyEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+SPACE" ! platform="carbon"> </key> <key sequence="M1+M2+P" contextId="org.rubypeople.rdt.ui.rubyEditorScope" ! commandId="org.rubypeople.rdt.ui.edit.text.ruby.goto.matching.bracket " schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> <key sequence="F3" + contextId="org.rubypeople.rdt.ui.rubyEditorScope" commandId="org.rubypeople.rdt.ui.edit.text.ruby.open.editor" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> ! </extension> <extension point="org.eclipse.ui.commands"> <category name="%category.source.name" description="%category.source.description" ! id="org.rubypeople.rdt.ui.category.source "> ! </category> ! <category ! name="%category.project.name" ! description="%category.project.description" ! id="org.rubypeople.rdt.ui.category.project "> </category> <command *************** *** 379,386 **** </command> <command ! categoryId="org.rubypeople.rdt.ui.category.source" description="%ActionDefinition.comment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.comment" ! name="%ActionDefinition.comment.name"> </command> <command --- 395,402 ---- </command> <command ! categoryId="org.rubypeople.rdt.ui.category.source " description="%ActionDefinition.comment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.comment" ! name="%ActionDefinition.comment.name"> </command> <command *************** *** 391,398 **** </command> <command ! categoryId="org.rubypeople.rdt.ui.category.source" description="%ActionDefinition.toggleComment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" ! name="%ActionDefinition.toggleComment.name"> </command> <command --- 407,414 ---- </command> <command ! categoryId="org.rubypeople.rdt.ui.category.source " description="%ActionDefinition.toggleComment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment" ! name="%ActionDefinition.toggleComment.name"> </command> <command *************** *** 401,447 **** id="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" name="%ActionDefinition.contentAssist.name"> ! </command> ! ! <category ! name="%category.project.name" ! description="%category.project.description" ! id="org.rubypeople.rdt.ui.category.project"> ! </category> <command categoryId="org.rubypeople.rdt.ui.category.project" description="%ActionDefinition.generateRdoc.description" id="org.rubypeople.rdt.ui.generate.rdoc" ! name="%ActionDefinition.generateRdoc.name"> ! </command> ! <command ! description="%ActionDefinition.comment.description" ! id="org.rubypeople.rdt.ui.edit.text.ruby.comment" ! name="%ActionDefinition.comment.name"> </command> <command description="%ActionDefinition.comment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.comment" name="%ActionDefinition.comment.name"> </command> <command ! description="%ActionDefinition.uncomment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.uncomment" ! name="%ActionDefinition.uncomment.name"> </command> <command description="%ActionDefinition.contentAssist.description" ! id="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" name="%ActionDefinition.contentAssist.name"> </command> <command ! description="%ActionDefinition.generateRdoc.description" ! id="org.rubypeople.rdt.ui.generate.rdoc" ! name="%ActionDefinition.generateRdoc.name"> ! </command> ! <command ! categoryId="org.eclipse.ui.category.navigate" description="%ActionDefinition.gotoMatchingBracket.description" id="org.rubypeople.rdt.ui.edit.text.ruby.goto.matching.bracket" ! name="%ActionDefinition.gotoMatchingBracket.name"> </command> <command --- 417,450 ---- id="org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" name="%ActionDefinition.contentAssist.name"> ! </command> <command categoryId="org.rubypeople.rdt.ui.category.project" description="%ActionDefinition.generateRdoc.description" id="org.rubypeople.rdt.ui.generate.rdoc" ! name="%ActionDefinition.generateRdoc.name"> </command> <command description="%ActionDefinition.comment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.comment" + categoryId="org.rubypeople.rdt.ui.category.source" name="%ActionDefinition.comment.name"> </command> <command ! description="%ActionDefinition.uncomment.description" id="org.rubypeople.rdt.ui.edit.text.ruby.uncomment" ! categoryId="org.rubypeople.rdt.ui.category.source" ! name="%ActionDefinition.uncomment.name"> </command> <command description="%ActionDefinition.contentAssist.description" ! categoryId="org.eclipse.ui.category.edit" ! id=" org.rubypeople.rdt.ui.edit.text.ruby.content.assist.proposals" name="%ActionDefinition.contentAssist.name"> </command> <command ! categoryId="org.eclipse.ui.category.navigate " description="%ActionDefinition.gotoMatchingBracket.description" id="org.rubypeople.rdt.ui.edit.text.ruby.goto.matching.bracket" ! name="%ActionDefinition.gotoMatchingBracket.name"> </command> <command *************** *** 451,454 **** --- 454,463 ---- id="org.rubypeople.rdt.ui.edit.text.ruby.open.editor"> </command> + <command + name="%ActionDefinition.toggleComment.name" + description="%ActionDefinition.toggleComment.description" + categoryId="org.eubypeople.rdt.ui.category.source" + id="org.rubypeople.rdt.ui.edit.text.ruby.toggle.comment "> + </command> </extension> <extension |
|
From: Christopher W. <caw...@us...> - 2006-04-20 21:55:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10318/src/org/rubypeople/rdt/ui Modified Files: PreferenceConstants.java Log Message: add support for highlighting matching brackets (ticket #106) Index: PreferenceConstants.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PreferenceConstants.java 12 Apr 2006 21:26:25 -0000 1.15 --- PreferenceConstants.java 20 Apr 2006 21:55:43 -0000 1.16 *************** *** 3,6 **** --- 3,8 ---- import org.eclipse.core.runtime.IPath; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.preference.PreferenceConverter; + import org.eclipse.swt.graphics.RGB; import org.rubypeople.rdt.internal.launching.RubyInterpreter; import org.rubypeople.rdt.internal.launching.RubyRuntime; *************** *** 296,299 **** --- 298,321 ---- public static final String EDITOR_UNDERLINE_SUFFIX= "_underline"; //$NON-NLS-1$ + /** + * A named preference that controls whether bracket matching highlighting is turned on or off. + * <p> + * Value is of type <code>Boolean</code>. + * </p> + */ + public final static String EDITOR_MATCHING_BRACKETS= "matchingBrackets"; //$NON-NLS-1$ + + /** + * A named preference that holds the color used to highlight matching brackets. + * <p> + * Value is of type <code>String</code>. A RGB color value encoded as a string + * using class <code>PreferenceConverter</code> + * </p> + * + * @see org.eclipse.jface.resource.StringConverter + * @see org.eclipse.jface.preference.PreferenceConverter + */ + public final static String EDITOR_MATCHING_BRACKETS_COLOR= "matchingBracketsColor"; //$NON-NLS-1$ + public static void initializeDefaultValues(IPreferenceStore store) { store.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); *************** *** 343,346 **** --- 365,373 ---- store.setDefault(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, true); + + // RubyEditorPreferencePage + store.setDefault(PreferenceConstants.EDITOR_MATCHING_BRACKETS, true); + PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192, 192,192)); + } |
|
From: Christopher W. <caw...@us...> - 2006-04-20 21:55:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10318/src/org/rubypeople/rdt/internal/ui/rubyeditor Modified Files: RubyAbstractEditor.java Log Message: add support for highlighting matching brackets (ticket #106) Index: RubyAbstractEditor.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** RubyAbstractEditor.java 12 Apr 2006 21:26:25 -0000 1.25 --- RubyAbstractEditor.java 20 Apr 2006 21:55:42 -0000 1.26 *************** *** 31,34 **** --- 31,35 ---- import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.ChainedPreferenceStore; + import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; import org.eclipse.ui.views.contentoutline.ContentOutline; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; *************** *** 48,52 **** --- 49,55 ---- import org.rubypeople.rdt.internal.ui.text.IRubyPartitions; import org.rubypeople.rdt.internal.ui.text.PreferencesAdapter; + import org.rubypeople.rdt.internal.ui.text.RubyPairMatcher; import org.rubypeople.rdt.ui.IWorkingCopyManager; + import org.rubypeople.rdt.ui.PreferenceConstants; import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; import org.rubypeople.rdt.ui.text.RubyTextTools; *************** *** 64,67 **** --- 67,81 ---- private RubyOutlinePage fOutlinePage; + + /** Preference key for matching brackets */ + protected final static String MATCHING_BRACKETS= PreferenceConstants.EDITOR_MATCHING_BRACKETS; + /** Preference key for matching brackets color */ + protected final static String MATCHING_BRACKETS_COLOR= PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR; + + protected final static char[] BRACKETS= { '{', '}', '(', ')', '[', ']', '<', '>' }; + + /** The editor's bracket matcher */ + protected RubyPairMatcher fBracketMatcher= new RubyPairMatcher(BRACKETS); + /** * Creates and returns the preference store for this Ruby editor with the given input. *************** *** 97,100 **** --- 111,121 ---- } } + + protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) { + support.setCharacterPairMatcher(fBracketMatcher); + support.setMatchingCharacterPainterPreferenceKeys(MATCHING_BRACKETS, MATCHING_BRACKETS_COLOR); + + super.configureSourceViewerDecorationSupport(support); + } /** |
|
From: Christopher W. <caw...@us...> - 2006-04-20 21:51:48
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7114/src/org/rubypeople/rdt/internal/ui/preferences Modified Files: MembersOrderPreferenceCache.java Log Message: fix ticket #112 and #113 Index: MembersOrderPreferenceCache.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/MembersOrderPreferenceCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MembersOrderPreferenceCache.java 10 Feb 2006 19:52:26 -0000 1.1 --- MembersOrderPreferenceCache.java 20 Apr 2006 21:51:44 -0000 1.2 *************** *** 28,37 **** public static final int METHOD_INDEX= 2; public static final int FIELDS_INDEX= 3; ! public static final int INIT_INDEX= 4; ! public static final int STATIC_FIELDS_INDEX= 5; ! public static final int STATIC_INIT_INDEX= 6; ! public static final int STATIC_METHODS_INDEX= 7; ! public static final int ENUM_CONSTANTS_INDEX= 8; ! public static final int N_CATEGORIES= ENUM_CONSTANTS_INDEX + 1; private static final int PUBLIC_INDEX= 0; --- 28,34 ---- public static final int METHOD_INDEX= 2; public static final int FIELDS_INDEX= 3; ! public static final int STATIC_FIELDS_INDEX= 4; ! public static final int STATIC_METHODS_INDEX= 5; ! public static final int N_CATEGORIES= STATIC_METHODS_INDEX + 1; private static final int PUBLIC_INDEX= 0; *************** *** 106,110 **** StringTokenizer tokenizer= new StringTokenizer(str, ","); //$NON-NLS-1$ int i= 0; - offsets[ENUM_CONSTANTS_INDEX]= i++; // enum constants always on top while (tokenizer.hasMoreTokens()) { --- 103,106 ---- *************** *** 116,125 **** } else if ("F".equals(token)) { //$NON-NLS-1$ offsets[FIELDS_INDEX]= i++; - } else if ("I".equals(token)) { //$NON-NLS-1$ - offsets[INIT_INDEX]= i++; } else if ("SF".equals(token)) { //$NON-NLS-1$ offsets[STATIC_FIELDS_INDEX]= i++; - } else if ("SI".equals(token)) { //$NON-NLS-1$ - offsets[STATIC_INIT_INDEX]= i++; } else if ("SM".equals(token)) { //$NON-NLS-1$ offsets[STATIC_METHODS_INDEX]= i++; --- 112,117 ---- |
|
From: Christopher W. <caw...@us...> - 2006-04-14 01:34:42
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15805/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: RubyNumberRule.java Log Message: Index: RubyNumberRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyNumberRule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyNumberRule.java 14 Apr 2006 01:33:55 -0000 1.2 --- RubyNumberRule.java 14 Apr 2006 01:34:39 -0000 1.3 *************** *** 33,37 **** c= scanner.read(); } while (Character.isDigit((char) c)); ! if ( Character.isLetter((char)c) ){ scanner.unread(); return Token.UNDEFINED; --- 33,37 ---- c= scanner.read(); } while (Character.isDigit((char) c)); ! if ( Character.isLetter((char)c) || ((char)c) == '_' ){ scanner.unread(); return Token.UNDEFINED; |
|
From: Christopher W. <caw...@us...> - 2006-04-14 01:33:58
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15219/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: RubyNumberRule.java Log Message: fix ticket #68 Index: RubyNumberRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyNumberRule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RubyNumberRule.java 8 Apr 2006 06:17:58 -0000 1.1 --- RubyNumberRule.java 14 Apr 2006 01:33:55 -0000 1.2 *************** *** 21,25 **** scanner.unread(); c = scanner.read(); ! if ( Character.isLetter((char)c)){ do { c= scanner.read(); --- 21,25 ---- scanner.unread(); c = scanner.read(); ! if ( Character.isLetter((char)c) || ((char)c) == '_'){ do { c= scanner.read(); |
|
From: Christopher W. <caw...@us...> - 2006-04-14 01:21:17
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/plugin/src/org/rubypeople/rdt/cruisecontrol/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6263/cruiseControl/plugin/src/org/rubypeople/rdt/cruisecontrol/plugin Modified Files: EclipsePluginLabelProvider.java Log Message: try to make nightly build use 0.8.0 prefix now Index: EclipsePluginLabelProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/plugin/src/org/rubypeople/rdt/cruisecontrol/plugin/EclipsePluginLabelProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EclipsePluginLabelProvider.java 5 Feb 2006 17:02:10 -0000 1.1 --- EclipsePluginLabelProvider.java 14 Apr 2006 01:21:13 -0000 1.2 *************** *** 11,15 **** { private String defaultLabel = "0.1.0" ; ! private String prefix = "0.7.0" ; public EclipsePluginLabelProvider() { --- 11,15 ---- { private String defaultLabel = "0.1.0" ; ! private String prefix = "0.8.0" ; public EclipsePluginLabelProvider() { |
|
From: Christopher W. <caw...@us...> - 2006-04-14 01:21:16
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6263/cruiseControl Modified Files: build.properties config.xml Log Message: try to make nightly build use 0.8.0 prefix now Index: config.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/config.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.xml 5 Feb 2006 19:44:44 -0000 1.5 --- config.xml 14 Apr 2006 01:21:13 -0000 1.6 *************** *** 2,6 **** <project name="RDT" buildafterfailed="false"> <plugin name="labelincrementer" classname="org.rubypeople.rdt.cruisecontrol.plugin.EclipsePluginLabelProvider"/> ! <labelincrementer prefix="0.7.0"/> <!-- Defines where cruise looks for changes, to decide whether to run the build --> --- 2,6 ---- <project name="RDT" buildafterfailed="false"> <plugin name="labelincrementer" classname="org.rubypeople.rdt.cruisecontrol.plugin.EclipsePluginLabelProvider"/> ! <labelincrementer prefix="0.8.0"/> <!-- Defines where cruise looks for changes, to decide whether to run the build --> Index: build.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.build/cruiseControl/build.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.properties 5 Feb 2006 16:40:58 -0000 1.3 --- build.properties 14 Apr 2006 01:21:13 -0000 1.4 *************** *** 127,131 **** # calculate the build label by its own with a label incrementer. See config.xml for # how to change the prefix for the eclipse label incrementer ! nightlyBuildFeatureVersionPrefix=0.7.0. # the buildResultsDirectory specifies a directory into which the build results are copied --- 127,131 ---- # calculate the build label by its own with a label incrementer. See config.xml for # how to change the prefix for the eclipse label incrementer ! nightlyBuildFeatureVersionPrefix=0.8.0. # the buildResultsDirectory specifies a directory into which the build results are copied |