Changeset 3873 for devel-tools/trunk


Ignore:
Timestamp:
Jul 23, 2008, 9:14:59 PM (12 years ago)
Author:
yura
Message:
  • IColorPreferences and IPreferenceConstants are merged.
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  
    4949import org.refal.rfpdt.compiler.RfpResource;
    5050import org.refal.rfpdt.compiler.SrcPosition;
    51 import org.refal.rfpdt.ui.preferences.IColorPreferences;
     51import org.refal.rfpdt.ui.preferences.IPreferenceConstants;
    5252import org.refal.rfpdt.ui.scanner.ColorScanner;
    5353
     
    7171            if (textAttribute == null)
    7272                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());
    7475            int style = textAttribute.getStyle();
    7576            styleRange.fontStyle = style & (SWT.BOLD | SWT.ITALIC);
     
    9091
    9192    private void addAstNameStyle (AstNode name, String key) {
    92         if (! rfpResource.equals(name.pos.rfpResource))
     93        if (!rfpResource.equals(name.pos.rfpResource))
    9394            return;
    9495        styleRangeList.add(new StylePosition(name.pos, key));
     
    102103    private void visitObjectDefinition (AstName name) {
    103104        if (name != null)
    104             addAstNameStyle(name, IColorPreferences.IDENTIFIER_DEFINITION);
     105            addAstNameStyle(name, IPreferenceConstants.IDENTIFIER_DEFINITION);
    105106    }
    106107
    107108    private void visitObjectUse (AstName name) {
    108109        if (name != null && name.identifier.length() < name.pos.charEnd - name.pos.charStart)
    109             addAstNameStyle(name, IColorPreferences.IDENTIFIER_USE);
     110            addAstNameStyle(name, IPreferenceConstants.IDENTIFIER_USE);
    110111    }
    111112
    112113    private void visitVariableDefinition (AstName name) {
    113114        if (name != null)
    114             addAstNameStyle(name, IColorPreferences.VARIABLE_DEFINITION);
     115            addAstNameStyle(name, IPreferenceConstants.VARIABLE_DEFINITION);
    115116    }
    116117
     
    121122    private void visitSymbol (AstWordSymbol astWordSymbol) {
    122123        if (astWordSymbol.word.length() == astWordSymbol.pos.charEnd - astWordSymbol.pos.charStart)
    123             addAstNameStyle(astWordSymbol, IColorPreferences.SYMBOL);
     124            addAstNameStyle(astWordSymbol, IPreferenceConstants.SYMBOL);
    124125    }
    125126
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpPresentationReconciler.java

    r3871 r3873  
    88import org.eclipse.jface.util.IPropertyChangeListener;
    99import org.eclipse.jface.util.PropertyChangeEvent;
    10 import org.refal.rfpdt.ui.preferences.IColorPreferences;
     10import org.refal.rfpdt.ui.preferences.IPreferenceConstants;
    1111import org.refal.rfpdt.ui.scanner.ColorScanner;
    1212
     
    2727        setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    2828        multiLineComment = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store,
    29                 IColorPreferences.COMMENT));
     29                IPreferenceConstants.COMMENT));
    3030        setDamager(multiLineComment, IRfpPartitions.MULTI_LINE_COMMENT);
    3131        setRepairer(multiLineComment, IRfpPartitions.MULTI_LINE_COMMENT);
    3232        singleLineComment = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store,
    33                 IColorPreferences.COMMENT));
     33                IPreferenceConstants.COMMENT));
    3434        setDamager(singleLineComment, IRfpPartitions.SINGLE_LINE_COMMENT);
    3535        setRepairer(singleLineComment, IRfpPartitions.SINGLE_LINE_COMMENT);
    36         word = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IColorPreferences.SYMBOL));
     36        word = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL));
    3737        setDamager(word, IRfpPartitions.WORD);
    3838        setRepairer(word, IRfpPartitions.WORD);
    39         character = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IColorPreferences.SYMBOL));
     39        character = new NonRuleBasedDamagerRepairer(ColorScanner.getTextAttribute(store, IPreferenceConstants.SYMBOL));
    4040        setDamager(character, IRfpPartitions.CHARACTER);
    4141        setRepairer(character, IRfpPartitions.CHARACTER);
     
    5656    public void propertyChange (PropertyChangeEvent event) {
    5757        defaultContentScanner.setTokens();
    58         multiLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IColorPreferences.COMMENT));
    59         singleLineComment.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IColorPreferences.COMMENT));
    60         word.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IColorPreferences.SYMBOL));
    61         character.setDefaultTextAttribute(ColorScanner.getTextAttribute(store, IColorPreferences.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));
    6262    }
    6363}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/IPreferenceConstants.java

    r3870 r3873  
    2222    public String COMPILER_ADD_LINE_NUMBERS = PREFIX + "compilerLineNumbers"; //$NON-NLS-1$
    2323    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";
    2434}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/SyntaxColoringPreferencePage.java

    r3872 r3873  
    6767    }
    6868
    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 };
    7374
    7475    private final HashMap<String, RGB> rgbStore;
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/scanner/ColorScanner.java

    r3872 r3873  
    1919import org.refal.rfpdt.editor.ColorManager;
    2020import org.refal.rfpdt.editor.RfpEditor;
    21 import org.refal.rfpdt.ui.preferences.IColorPreferences;
     21import org.refal.rfpdt.ui.preferences.IPreferenceConstants;
    2222
    2323public class ColorScanner implements ITokenScanner {
     
    3939        if (colorManager == null)
    4040            return null;
    41         Color color = colorManager.getColor(
    42                 PreferenceConverter.getColor(store, key + ".color"));
     41        Color color = colorManager.getColor(PreferenceConverter.getColor(store, key + ".color"));
    4342        int style = store.getBoolean(key + ".bold") ? SWT.BOLD : SWT.NORMAL;
    4443        if (store.getBoolean(key + ".italic"))
     
    7069
    7170    public void setTokens () {
    72         symbol = new Token(getTextAttribute(store, IColorPreferences.SYMBOL));
    73         keyword = new Token(getTextAttribute(store, IColorPreferences.KEYWORD));
    74         identifier = new Token(getTextAttribute(store, IColorPreferences.IDENTIFIER_USE));
    75         variable_type = new Token(getTextAttribute(store, IColorPreferences.VARIABLE_TYPE));
    76         variable = new Token(getTextAttribute(store, IColorPreferences.VARIABLE_USE));
    77         other = new Token(getTextAttribute(store, IColorPreferences.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));
    7877        ArrayList<IRule> rules = new ArrayList<IRule>();
    7978        rules.add(new WhitespaceRule(new WhitespaceDetector()));
Note: See TracChangeset for help on using the changeset viewer.