View | Details | Raw Unified | Return to bug 193336
Collapse All | Expand All

(-)src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorColoringConfigurationBlock.java (+3 lines)
Lines 46-51 Link Here
46
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
46
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
47
				PythonPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
47
				PythonPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
48
48
49
                        { PreferencesMessages.DLTKEditorPreferencePage_returnKeyword,
50
                                PythonPreferenceConstants.EDITOR_KEYWORD_RETURN_COLOR, sCoreCategory },
51
				
49
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
52
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
50
				PythonPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
53
				PythonPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
51
54
(-)src/org/eclipse/dltk/tcl/internal/ui/text/TclColorConstants.java (+5 lines)
Lines 41-46 Link Here
41
	 */
41
	 */
42
	public static final String TCL_KEYWORD = DLTKColorConstants.DLTK_KEYWORD;
42
	public static final String TCL_KEYWORD = DLTKColorConstants.DLTK_KEYWORD;
43
43
44
       /**
45
         * The color key for TCL 'return' keyword (value <code>"tcl_return"</code>).
46
         */
47
        public static final String TCL_KEYWORD_RETURN = DLTKColorConstants.DLTK_KEYWORD_RETURN; //$NON-NLS-1$  
48
	
44
	/**
49
	/**
45
	 * The color key for TCL code (value <code>"tcl_default"</code>).
50
	 * The color key for TCL code (value <code>"tcl_default"</code>).
46
	 */
51
	 */
(-)src/org/eclipse/dltk/tcl/internal/ui/text/TclCodeScanner.java (+8 lines)
Lines 16-21 Link Here
16
import org.eclipse.dltk.tcl.internal.ui.rules.TclCommentRule;
16
import org.eclipse.dltk.tcl.internal.ui.rules.TclCommentRule;
17
import org.eclipse.dltk.tcl.internal.ui.rules.TclFloatNumberRule;
17
import org.eclipse.dltk.tcl.internal.ui.rules.TclFloatNumberRule;
18
import org.eclipse.dltk.tcl.internal.ui.rules.TclVariableRule;
18
import org.eclipse.dltk.tcl.internal.ui.rules.TclVariableRule;
19
import org.eclipse.dltk.tcl.ui.TclPreferenceConstants;
19
import org.eclipse.dltk.ui.text.AbstractScriptScanner;
20
import org.eclipse.dltk.ui.text.AbstractScriptScanner;
20
import org.eclipse.dltk.ui.text.IColorManager;
21
import org.eclipse.dltk.ui.text.IColorManager;
21
import org.eclipse.jface.preference.IPreferenceStore;
22
import org.eclipse.jface.preference.IPreferenceStore;
Lines 30-39 Link Here
30
		TclColorConstants.TCL_SINGLE_LINE_COMMENT,
31
		TclColorConstants.TCL_SINGLE_LINE_COMMENT,
31
		TclColorConstants.TCL_DEFAULT,
32
		TclColorConstants.TCL_DEFAULT,
32
		TclColorConstants.TCL_KEYWORD,
33
		TclColorConstants.TCL_KEYWORD,
34
		TclColorConstants.TCL_KEYWORD_RETURN,
33
		TclColorConstants.TCL_NUMBER,
35
		TclColorConstants.TCL_NUMBER,
34
		TclColorConstants.TCL_VARIABLE,
36
		TclColorConstants.TCL_VARIABLE,
35
	};
37
	};
36
	
38
	
39
	private static String returnKeyword = "return";
40
	
37
	public TclCodeScanner(IColorManager manager, IPreferenceStore store) {
41
	public TclCodeScanner(IColorManager manager, IPreferenceStore store) {
38
		super(manager, store);
42
		super(manager, store);
39
		initialize();
43
		initialize();
Lines 67-72 Link Here
67
		for( int i = 0; i < keywords.length; i++ ) {
71
		for( int i = 0; i < keywords.length; i++ ) {
68
			wordRule.addWord(keywords[i], keyword);
72
			wordRule.addWord(keywords[i], keyword);
69
		}
73
		}
74
	        
75
		IToken returnToken = getToken(TclPreferenceConstants.EDITOR_KEYWORD_RETURN_COLOR);
76
	        wordRule.addWord(returnKeyword, returnToken);
77
		
70
		rules.add(wordRule);
78
		rules.add(wordRule);
71
79
72
		setDefaultReturnToken(other);
80
		setDefaultReturnToken(other);
(-)src/org/eclipse/dltk/tcl/ui/TclPreferenceConstants.java (+56 lines)
Lines 19-24 Link Here
19
19
20
public class TclPreferenceConstants extends PreferenceConstants {
20
public class TclPreferenceConstants extends PreferenceConstants {
21
21
22
    /**
23
     * A named preference that holds the color used to render keyword.
24
     * <p>
25
     * Value is of type <code>String</code>. A RGB color value encoded as a string using class <code>PreferenceConverter</code>
26
     * </p>
27
     * 
28
     * @see org.eclipse.jface.resource.StringConverter
29
     * @see org.eclipse.jface.preference.PreferenceConverter
30
     */
31
    public final static String EDITOR_KEYWORD_RETURN_COLOR = TclColorConstants.TCL_KEYWORD_RETURN;
32
33
    /**
34
     * A named preference that controls whether kwyword are rendered in bold.
35
     * <p>
36
     * Value is of type <code>Boolean</code>. If <code>true</code> single line comments are rendered in bold. If <code>false</code> the are
37
     * rendered using no font style attribute.
38
     * </p>
39
     */
40
    public final static String EDITOR_KEYWORD_RETURN_BOLD = TclColorConstants.TCL_KEYWORD_RETURN + EDITOR_BOLD_SUFFIX;
41
42
    /**
43
     * A named preference that controls whether keyword are rendered in italic.
44
     * <p>
45
     * Value is of type <code>Boolean</code>. If <code>true</code> single line comments are rendered in italic. If <code>false</code> the
46
     * are rendered using no italic font style attribute.
47
     * </p>
48
     */
49
    public final static String EDITOR_KEYWORD_RETURN_ITALIC = TclColorConstants.TCL_KEYWORD_RETURN + EDITOR_ITALIC_SUFFIX;
50
51
    /**
52
     * A named preference that controls whether single line comments are rendered in strikethrough.
53
     * <p>
54
     * Value is of type <code>Boolean</code>. If <code>true</code> single line comments are rendered in strikethrough. If <code>false</code>
55
     * the are rendered using no italic font style attribute.
56
     * </p>
57
     */
58
    public final static String EDITOR_KEYWORD_RETURN_STRIKETHROUGH = TclColorConstants.TCL_KEYWORD_RETURN + EDITOR_STRIKETHROUGH_SUFFIX;
59
60
    /**
61
     * A named preference that controls whether keyword are rendered in underline.
62
     * <p>
63
     * Value is of type <code>Boolean</code>. If <code>true</code> single line comments are rendered in underline. If <code>false</code>
64
     * the are rendered using no italic font style attribute.
65
     * </p>
66
     * 
67
     *
68
     */
69
    public final static String EDITOR_KEYWORD_RETURN_UNDERLINE = TclColorConstants.TCL_KEYWORD_RETURN + EDITOR_UNDERLINE_SUFFIX;
70
    
71
    
22
	/**
72
	/**
23
	 * A named preference that holds the color used to render single line
73
	 * A named preference that holds the color used to render single line
24
	 * comments.
74
	 * comments.
Lines 393-398 Link Here
393
		PreferenceConverter.setDefault(store,
443
		PreferenceConverter.setDefault(store,
394
				TclPreferenceConstants.EDITOR_KEYWORD_COLOR,
444
				TclPreferenceConstants.EDITOR_KEYWORD_COLOR,
395
				new RGB(127, 0, 85));
445
				new RGB(127, 0, 85));
446
		PreferenceConverter.setDefault( store, 
447
		                TclPreferenceConstants.EDITOR_KEYWORD_RETURN_COLOR, 
448
		                new RGB( 127, 0, 85 ) );
449
		
396
		PreferenceConverter
450
		PreferenceConverter
397
				.setDefault(store, TclPreferenceConstants.EDITOR_STRING_COLOR,
451
				.setDefault(store, TclPreferenceConstants.EDITOR_STRING_COLOR,
398
						new RGB(42, 0, 255));
452
						new RGB(42, 0, 255));
Lines 413-418 Link Here
413
467
414
		store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_BOLD, true);
468
		store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_BOLD, true);
415
		store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_ITALIC, false);
469
		store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_ITALIC, false);
470
	        store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_RETURN_BOLD, true );
471
	        store.setDefault(TclPreferenceConstants.EDITOR_KEYWORD_RETURN_ITALIC, false );
416
472
417
		store.setDefault(TclPreferenceConstants.EDITOR_CLOSE_STRINGS, true);
473
		store.setDefault(TclPreferenceConstants.EDITOR_CLOSE_STRINGS, true);
418
		store.setDefault(TclPreferenceConstants.EDITOR_CLOSE_BRACKETS, true);
474
		store.setDefault(TclPreferenceConstants.EDITOR_CLOSE_BRACKETS, true);
(-)src/org/eclipse/dltk/tcl/internal/ui/preferences/TclEditorColoringConfigurationBlock.java (+3 lines)
Lines 46-51 Link Here
46
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
46
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
47
					TclPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
47
					TclPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
48
48
49
                        { PreferencesMessages.DLTKEditorPreferencePage_returnKeyword,
50
                                        TclPreferenceConstants.EDITOR_KEYWORD_RETURN_COLOR, sCoreCategory },
51
					
49
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
52
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
50
					TclPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
53
					TclPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
51
54
(-)src/org/eclipse/dltk/ruby/internal/ui/preferences/RubyEditorColoringConfigurationBlock.java (-1 / +4 lines)
Lines 50-59 Link Here
50
					
50
					
51
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
51
			{ PreferencesMessages.DLTKEditorPreferencePage_keywords,
52
				RubyPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
52
				RubyPreferenceConstants.EDITOR_KEYWORD_COLOR, sCoreCategory },
53
                                
54
	                { PreferencesMessages.DLTKEditorPreferencePage_returnKeyword,
55
                                RubyPreferenceConstants.EDITOR_KEYWORD_RETURN_COLOR, sCoreCategory },
53
56
54
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
57
			{ PreferencesMessages.DLTKEditorPreferencePage_strings,
55
				RubyPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
58
				RubyPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
56
59
				
57
			{ PreferencesMessages.DLTKEditorPreferencePage_numbers,
60
			{ PreferencesMessages.DLTKEditorPreferencePage_numbers,
58
				RubyPreferenceConstants.EDITOR_NUMBER_COLOR, sCoreCategory },							
61
				RubyPreferenceConstants.EDITOR_NUMBER_COLOR, sCoreCategory },							
59
				
62
				

Return to bug 193336