Changeset 3873 for devel-tools/trunk
- Timestamp:
- Jul 23, 2008, 9:14:59 PM (12 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/PresentationVisitor.java
r3871 r3873 49 49 import org.refal.rfpdt.compiler.RfpResource; 50 50 import org.refal.rfpdt.compiler.SrcPosition; 51 import org.refal.rfpdt.ui.preferences.I ColorPreferences;51 import org.refal.rfpdt.ui.preferences.IPreferenceConstants; 52 52 import org.refal.rfpdt.ui.scanner.ColorScanner; 53 53 … … 71 71 if (textAttribute == null) 72 72 return null; 73 StyleRange styleRange = new StyleRange(offset, length, textAttribute.getForeground(), textAttribute.getBackground()); 73 StyleRange styleRange = new StyleRange(offset, length, textAttribute.getForeground(), textAttribute 74 .getBackground()); 74 75 int style = textAttribute.getStyle(); 75 76 styleRange.fontStyle = style & (SWT.BOLD | SWT.ITALIC); … … 90 91 91 92 private void addAstNameStyle (AstNode name, String key) { 92 if (! 93 if (!rfpResource.equals(name.pos.rfpResource)) 93 94 return; 94 95 styleRangeList.add(new StylePosition(name.pos, key)); … … 102 103 private void visitObjectDefinition (AstName name) { 103 104 if (name != null) 104 addAstNameStyle(name, I ColorPreferences.IDENTIFIER_DEFINITION);105 addAstNameStyle(name, IPreferenceConstants.IDENTIFIER_DEFINITION); 105 106 } 106 107 107 108 private void visitObjectUse (AstName name) { 108 109 if (name != null && name.identifier.length() < name.pos.charEnd - name.pos.charStart) 109 addAstNameStyle(name, I ColorPreferences.IDENTIFIER_USE);110 addAstNameStyle(name, IPreferenceConstants.IDENTIFIER_USE); 110 111 } 111 112 112 113 private void visitVariableDefinition (AstName name) { 113 114 if (name != null) 114 addAstNameStyle(name, I ColorPreferences.VARIABLE_DEFINITION);115 addAstNameStyle(name, IPreferenceConstants.VARIABLE_DEFINITION); 115 116 } 116 117 … … 121 122 private void visitSymbol (AstWordSymbol astWordSymbol) { 122 123 if (astWordSymbol.word.length() == astWordSymbol.pos.charEnd - astWordSymbol.pos.charStart) 123 addAstNameStyle(astWordSymbol, I ColorPreferences.SYMBOL);124 addAstNameStyle(astWordSymbol, IPreferenceConstants.SYMBOL); 124 125 } 125 126 -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpPresentationReconciler.java
r3871 r3873 8 8 import org.eclipse.jface.util.IPropertyChangeListener; 9 9 import org.eclipse.jface.util.PropertyChangeEvent; 10 import org.refal.rfpdt.ui.preferences.I ColorPreferences;10 import org.refal.rfpdt.ui.preferences.IPreferenceConstants; 11 11 import org.refal.rfpdt.ui.scanner.ColorScanner; 12 12 … … 27 27 setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); 28 28 multiLineComment = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, 29 I ColorPreferences.COMMENT));29 IPreferenceConstants.COMMENT)); 30 30 setDamager(multiLineComment, IRfpPartitions.MULTI_LINE_COMMENT); 31 31 setRepairer(multiLineComment, IRfpPartitions.MULTI_LINE_COMMENT); 32 32 singleLineComment = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, 33 I ColorPreferences.COMMENT));33 IPreferenceConstants.COMMENT)); 34 34 setDamager(singleLineComment, IRfpPartitions.SINGLE_LINE_COMMENT); 35 35 setRepairer(singleLineComment, IRfpPartitions.SINGLE_LINE_COMMENT); 36 word = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, I ColorPreferences.SYMBOL));36 word = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL)); 37 37 setDamager(word, IRfpPartitions.WORD); 38 38 setRepairer(word, IRfpPartitions.WORD); 39 character = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, I ColorPreferences.SYMBOL));39 character = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL)); 40 40 setDamager(character, IRfpPartitions.CHARACTER); 41 41 setRepairer(character, IRfpPartitions.CHARACTER); … … 56 56 public void propertyChange (PropertyChangeEvent event) { 57 57 defaultContentScanner.setTokens(); 58 multiLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, I ColorPreferences.COMMENT));59 singleLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, I ColorPreferences.COMMENT));60 word.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, I ColorPreferences.SYMBOL));61 character.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, I ColorPreferences.SYMBOL));58 multiLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IPreferenceConstants.COMMENT)); 59 singleLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IPreferenceConstants.COMMENT)); 60 word.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL)); 61 character.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL)); 62 62 } 63 63 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/IPreferenceConstants.java
r3870 r3873 22 22 public String COMPILER_ADD_LINE_NUMBERS = PREFIX + "compilerLineNumbers"; //$NON-NLS-1$ 23 23 public String COMPILER_ADD_SOURCE = PREFIX + "compilerSource"; //$NON-NLS-1$ 24 25 public String SYMBOL = PREFIX + "symbol"; 26 public String KEYWORD = PREFIX + "keyword"; 27 public String IDENTIFIER_DEFINITION = PREFIX + "identifierDefinition"; 28 public String IDENTIFIER_USE = PREFIX + "identifierUse"; 29 public String VARIABLE_TYPE = PREFIX + "variableType"; 30 public String VARIABLE_DEFINITION = PREFIX + "variableDefinition"; 31 public String VARIABLE_USE = PREFIX + "variableUse"; 32 public String COMMENT = PREFIX + "comment"; 33 public String OTHER_SYMBOLS = PREFIX + "otherSymbols"; 24 34 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/SyntaxColoringPreferencePage.java
r3872 r3873 67 67 } 68 68 69 private static final String[] keys = { IColorPreferences.SYMBOL, IColorPreferences.COMMENT, 70 IColorPreferences.KEYWORD, IColorPreferences.IDENTIFIER_DEFINITION, IColorPreferences.IDENTIFIER_USE, 71 IColorPreferences.VARIABLE_TYPE, IColorPreferences.VARIABLE_DEFINITION, IColorPreferences.VARIABLE_USE, 72 IColorPreferences.OTHER_SYMBOLS }; 69 private static final String[] keys = { IPreferenceConstants.SYMBOL, IPreferenceConstants.COMMENT, 70 IPreferenceConstants.KEYWORD, IPreferenceConstants.IDENTIFIER_DEFINITION, 71 IPreferenceConstants.IDENTIFIER_USE, IPreferenceConstants.VARIABLE_TYPE, 72 IPreferenceConstants.VARIABLE_DEFINITION, IPreferenceConstants.VARIABLE_USE, 73 IPreferenceConstants.OTHER_SYMBOLS }; 73 74 74 75 private final HashMap<String, RGB> rgbStore; -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/scanner/ColorScanner.java
r3872 r3873 19 19 import org.refal.rfpdt.editor.ColorManager; 20 20 import org.refal.rfpdt.editor.RfpEditor; 21 import org.refal.rfpdt.ui.preferences.I ColorPreferences;21 import org.refal.rfpdt.ui.preferences.IPreferenceConstants; 22 22 23 23 public class ColorScanner implements ITokenScanner { … … 39 39 if (colorManager == null) 40 40 return null; 41 Color color = colorManager.getColor( 42 PreferenceConverter.getColor(store, key + ".color")); 41 Color color = colorManager.getColor(PreferenceConverter.getColor(store, key + ".color")); 43 42 int style = store.getBoolean(key + ".bold") ? SWT.BOLD : SWT.NORMAL; 44 43 if (store.getBoolean(key + ".italic")) … … 70 69 71 70 public void setTokens () { 72 symbol = new Token(getTextAttribute(store, I ColorPreferences.SYMBOL));73 keyword = new Token(getTextAttribute(store, I ColorPreferences.KEYWORD));74 identifier = new Token(getTextAttribute(store, I ColorPreferences.IDENTIFIER_USE));75 variable_type = new Token(getTextAttribute(store, I ColorPreferences.VARIABLE_TYPE));76 variable = new Token(getTextAttribute(store, I ColorPreferences.VARIABLE_USE));77 other = new Token(getTextAttribute(store, I ColorPreferences.OTHER_SYMBOLS));71 symbol = new Token(getTextAttribute(store, IPreferenceConstants.SYMBOL)); 72 keyword = new Token(getTextAttribute(store, IPreferenceConstants.KEYWORD)); 73 identifier = new Token(getTextAttribute(store, IPreferenceConstants.IDENTIFIER_USE)); 74 variable_type = new Token(getTextAttribute(store, IPreferenceConstants.VARIABLE_TYPE)); 75 variable = new Token(getTextAttribute(store, IPreferenceConstants.VARIABLE_USE)); 76 other = new Token(getTextAttribute(store, IPreferenceConstants.OTHER_SYMBOLS)); 78 77 ArrayList<IRule> rules = new ArrayList<IRule>(); 79 78 rules.add(new WhitespaceRule(new WhitespaceDetector()));
Note: See TracChangeset
for help on using the changeset viewer.