Changeset 3640 for devel-tools/trunk


Ignore:
Timestamp:
Mar 31, 2008, 3:07:19 PM (13 years ago)
Author:
yura
Message:
 
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpDocumentSetupParticipant.java

    r3520 r3640  
    1212        if (document instanceof IDocumentExtension3) {
    1313            IDocumentExtension3 extension3 = (IDocumentExtension3) document;
    14             IDocumentPartitioner partitioner = new FastPartitioner(RfpUI.getDefault()
    15                     .getRfpPartitionScanner(), RfpPartitionScanner.partitionTypes);
     14            IDocumentPartitioner partitioner = new FastPartitioner(RfpUI.getRfpPartitionScanner(),
     15                    RfpPartitionScanner.partitionTypes);
    1616            extension3.setDocumentPartitioner(IRfpPartitions.PARTITIONING, partitioner);
    1717            partitioner.connect(document);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/RfpUI.java

    r3639 r3640  
    99import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
    1010import org.eclipse.jface.preference.IPreferenceStore;
    11 import org.eclipse.jface.resource.ImageDescriptor;
    1211import org.eclipse.swt.widgets.Shell;
    1312import org.eclipse.ui.IWorkbenchPage;
     
    1918import org.refal.rfpdt.editor.preferences.ProjectPropertiesStore;
    2019
    21 /**
    22  * The activator class controls the plug-in life cycle
    23  */
    2420@SuppressWarnings("restriction")
    2521public class RfpUI extends AbstractUIPlugin {
     
    3026    public static final String RFP_DEFAULTS = "org.refal.rfpdt.ui.rfpDefaults";
    3127
    32     // The shared instance
    33     private static RfpUI plugin;
    34     private static HashMap<IProject, ProjectPropertiesStore> stores;
    35 
    36     private static String filters = "org.refal.plus.Expr,org.refal.plus.Expr$InplaceConcatenator"
     28    private static final String filters = "org.refal.plus.Expr,org.refal.plus.Expr$InplaceConcatenator"
    3729            + ",org.refal.plus.Expr$Iterator,org.refal.plus.Expr$ListConcatenator"
    3830            + ",org.refal.plus.Expr$ListConcatenator$ParenthesesMarker,org.refal.plus.Expr$SplitIterator"
    3931            + ",org.refal.plus.Native,org.refal.plus.RefalException,org.refal.plus.Result";
     32    private static final String formatters = "org.refal.plus.Expr,return formattedRepresentation();,1"
     33            + ",org.refal.plus.Result,return expr == null ? null : expr.formattedRepresentation();,1";
    4034
    41     private static String formatters = "org.refal.plus.Expr,return formattedRepresentation();,1"
    42             + ",org.refal.plus.Result,return expr == null ? null : expr.formattedRepresentation();,1";
     35    // The shared instance
     36    private static RfpUI plugin = null;
     37    private static HashMap<IProject, ProjectPropertiesStore> stores = null;
     38    private static RfpPartitionScanner partitionScanner = null;
    4339
    4440    static {
     
    6763    }
    6864
    69     private RfpPartitionScanner partitionScanner;
    70 
    7165    /**
    7266     * The constructor
     
    7468    public RfpUI () {
    7569        plugin = this;
    76         stores = new HashMap<IProject, ProjectPropertiesStore>();
    7770    }
    7871
     
    8477    public void start (BundleContext context) throws Exception {
    8578        super.start(context);
     79        stores = new HashMap<IProject, ProjectPropertiesStore>();
    8680    }
    8781
     
    9286     */
    9387    public void stop (BundleContext context) throws Exception {
    94         plugin = null;
    9588        for (ScopedPreferenceStore store : stores.values())
    9689            store.save();
     
    133126    }
    134127
    135     /**
    136      * Returns an image descriptor for the image file at the given plug-in relative path
    137      *
    138      * @param path
    139      *            the path
    140      * @return the image descriptor
    141      */
    142     public static ImageDescriptor getImageDescriptor (String path) {
    143         return imageDescriptorFromPlugin(PLUGIN_ID, path);
    144     }
    145 
    146     public RfpPartitionScanner getRfpPartitionScanner () {
     128    public static RfpPartitionScanner getRfpPartitionScanner () {
    147129        if (partitionScanner == null)
    148130            partitionScanner = new RfpPartitionScanner();
     
    151133
    152134    public static IPreferenceStore getPluginPreferenceStore () {
    153         return plugin.getPreferenceStore();
     135        return plugin == null ? null : plugin.getPreferenceStore();
    154136    }
    155137
    156138    public static ProjectPropertiesStore getProjectPropertiesStore (IProject project) {
     139        if (stores == null)
     140            return null;
    157141        ProjectPropertiesStore store = stores.get(project);
    158142        if (store == null) {
     
    179163        return window == null ? null : window.getActivePage();
    180164    }
    181 
    182     /**
    183      * Returns an image descriptor for the image file at the given plug-in relative path
    184      *
    185      * @param path
    186      *            the path
    187      * @return the image descriptor
    188      */
    189     // public static ImageDescriptor getImageDescriptor(String path) {
    190     // return imageDescriptorFromPlugin(PLUGIN_ID, path);
    191     // }
    192165}
Note: See TracChangeset for help on using the changeset viewer.