Changeset 3878


Ignore:
Timestamp:
Jul 24, 2008, 3:49:54 PM (12 years ago)
Author:
yura
Message:
Location:
devel-tools/trunk/eclipse
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpProject.java

    r3819 r3878  
    1010import org.eclipse.core.resources.IResourceVisitor;
    1111import org.eclipse.core.resources.IWorkspaceRoot;
     12import org.eclipse.core.resources.ProjectScope;
    1213import org.eclipse.core.runtime.CoreException;
    1314import org.eclipse.core.runtime.IPath;
     15import org.eclipse.core.runtime.Platform;
     16import org.eclipse.core.runtime.preferences.DefaultScope;
     17import org.eclipse.core.runtime.preferences.IScopeContext;
     18import org.eclipse.core.runtime.preferences.InstanceScope;
    1419import org.eclipse.jdt.core.IClasspathEntry;
    1520import org.eclipse.jdt.core.IJavaProject;
     
    2025    private final IJavaProject javaProject;
    2126    private final IWorkspaceRoot workspaceRoot;
     27    private final IScopeContext[] scopes;
    2228
    2329    RfpProject (IProject project) {
     
    2531        this.javaProject = JavaCore.create(project);
    2632        this.workspaceRoot = project.getWorkspace().getRoot();
     33        this.scopes = new IScopeContext[] { new ProjectScope(project), new InstanceScope(), new DefaultScope() };
    2734    }
    2835
     
    163170    }
    164171
    165     private boolean addLineNumber = true;
    166     private boolean addVariableNames = true;
    167     private boolean addSource = true;
    168 
    169172    public boolean getCompilerOptionAddLineNumber () {
    170         return addLineNumber;
     173        return Platform.getPreferencesService().getBoolean(ICompilerPreferences.QUALIFIER,
     174                ICompilerPreferences.ADD_LINE_NUMBERS, false, scopes);
    171175    }
    172176
    173177    public boolean getCompilerOptionAddVariableNames () {
    174         return addVariableNames;
     178        return Platform.getPreferencesService().getBoolean(ICompilerPreferences.QUALIFIER,
     179                ICompilerPreferences.ADD_VARIABLE_NAMES, false, scopes);
    175180    }
    176181
    177182    public boolean getCompilerOptionAddSource () {
    178         return addSource;
    179     }
    180 
    181     public void setCompilerOptionAddLineNumber (boolean newValue) {
    182         addLineNumber = newValue;
    183     }
    184 
    185     public void setCompilerOptionAddVariableNames (boolean newValue) {
    186         addVariableNames = newValue;
    187     }
    188 
    189     public void setCompilerOptionAddSource (boolean newValue) {
    190         addSource = newValue;
     183        return Platform.getPreferencesService().getBoolean(ICompilerPreferences.QUALIFIER,
     184                ICompilerPreferences.ADD_SOURCE, false, scopes);
    191185    }
    192186
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/RfpUI.java

    r3870 r3878  
    99import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
    1010import org.eclipse.jface.preference.IPreferenceStore;
    11 import org.eclipse.jface.util.IPropertyChangeListener;
    12 import org.eclipse.jface.util.PropertyChangeEvent;
    1311import org.eclipse.swt.widgets.Shell;
    1412import org.eclipse.ui.IWorkbenchPage;
     
    1715import org.eclipse.ui.preferences.ScopedPreferenceStore;
    1816import org.osgi.framework.BundleContext;
    19 import org.refal.rfpdt.core.RfpCore;
    2017import org.refal.rfpdt.editor.RfpPartitionScanner;
    21 import org.refal.rfpdt.ui.preferences.IPreferenceConstants;
    2218import org.refal.rfpdt.ui.preferences.ProjectPropertiesStore;
    2319
     
    138134            stores.put(project, store);
    139135        }
    140         store.addPropertyChangeListener(new IPropertyChangeListener() {
    141             public void propertyChange (PropertyChangeEvent event) {
    142                 if (IPreferenceConstants.COMPILER_ADD_LINE_NUMBERS.equals(event.getProperty()))
    143                     RfpCore.getRfpProject(project).setCompilerOptionAddLineNumber((Boolean) event.getNewValue());
    144                 else if (IPreferenceConstants.COMPILER_ADD_VARIABLE_NAMES.equals(event.getProperty()))
    145                     RfpCore.getRfpProject(project).setCompilerOptionAddVariableNames((Boolean) event.getNewValue());
    146                 else if (IPreferenceConstants.COMPILER_ADD_SOURCE.equals(event.getProperty()))
    147                     RfpCore.getRfpProject(project).setCompilerOptionAddSource((Boolean) event.getNewValue());
    148             }
    149 
    150         });
    151         RfpCore.getRfpProject(project).setCompilerOptionAddLineNumber(store.getBoolean(IPreferenceConstants.COMPILER_ADD_LINE_NUMBERS));
    152         RfpCore.getRfpProject(project).setCompilerOptionAddVariableNames(store.getBoolean(IPreferenceConstants.COMPILER_ADD_VARIABLE_NAMES));
    153         RfpCore.getRfpProject(project).setCompilerOptionAddSource(store.getBoolean(IPreferenceConstants.COMPILER_ADD_SOURCE));
    154136        return store;
    155137    }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/preferences/IPreferenceConstants.java

    r3873 r3878  
    11package org.refal.rfpdt.ui.preferences;
     2
     3import org.refal.rfpdt.core.ICompilerPreferences;
    24
    35/**
     
    1921    public String MATCHING_BRACKETS = PREFIX + "matchingBrackets"; //$NON-NLS-1$
    2022    public String MATCHING_BRACKETS_COLOR = PREFIX + "matchingBracketsColor"; //$NON-NLS-1$
    21     public String COMPILER_ADD_VARIABLE_NAMES = PREFIX + "compilerVarNames"; //$NON-NLS-1$
    22     public String COMPILER_ADD_LINE_NUMBERS = PREFIX + "compilerLineNumbers"; //$NON-NLS-1$
    23     public String COMPILER_ADD_SOURCE = PREFIX + "compilerSource"; //$NON-NLS-1$
     23
     24    public String COMPILER_ADD_LINE_NUMBERS = ICompilerPreferences.ADD_LINE_NUMBERS;
     25    public String COMPILER_ADD_SOURCE = ICompilerPreferences.ADD_SOURCE;
     26    public String COMPILER_ADD_VARIABLE_NAMES = ICompilerPreferences.ADD_VARIABLE_NAMES;
    2427
    2528    public String SYMBOL = PREFIX + "symbol";
Note: See TracChangeset for help on using the changeset viewer.