Changeset 3520 for devel-tools/trunk


Ignore:
Timestamp:
Mar 14, 2008, 11:22:18 AM (13 years ago)
Author:
yura
Message:
Location:
devel-tools/trunk/eclipse
Files:
1 added
1 deleted
14 edited

Legend:

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

    r3519 r3520  
    1616 */
    1717public class RfpCore extends Plugin {
    18     private static RfpCore plugin;
     18    private static RfpCore plugin = null;
     19
     20    private static void log (IStatus status) {
     21        if (plugin != null)
     22            plugin.getLog().log(status);
     23    }
    1924
    2025    public static final String PLUGIN_ID = "org.refal.rfpdt.core";
     
    2328    public static final String MARKER_TYPE = "org.refal.rfpdt.core.rfpProblemMarker";
    2429    public static final String RFP_CONTAINER = "org.refal.rfpdt.launching.RFP_CONTAINER";
    25 
    26     public RfpCore () {
    27         plugin = this;
    28     }
    2930
    3031    /**
     
    4041    }
    4142
    42     public static void log (String message, Throwable thr) {
    43         log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, thr));
    44     }
    45 
    4643    public static void log (Throwable e) {
    4744        log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Internal error", e));
    4845    }
    4946
    50     public static void log (IStatus status) {
    51         if (plugin != null)
    52             plugin.getLog().log(status);
     47    public RfpCore () {
     48        plugin = this;
    5349    }
    5450
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/META-INF/MANIFEST.MF

    r3508 r3520  
    44Bundle-SymbolicName: org.refal.rfpdt.ui;singleton:=true
    55Bundle-Version: 1.1.9
    6 Bundle-Activator: org.refal.rfpdt.editor.RfpEditorPlugin
     6Bundle-Activator: org.refal.rfpdt.ui.RfpUI
    77Bundle-Vendor: Program Systems Institute of RAS
    88Bundle-Localization: plugin
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/BracketInserter.java

    r3515 r3520  
    3131import org.eclipse.swt.graphics.Point;
    3232import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
    33 import org.refal.rfpdt.core.RfpCore;
    3433import org.refal.rfpdt.editor.preferences.IPreferenceConstants;
     34import org.refal.rfpdt.ui.RfpUI;
    3535
    3636class BracketInserter implements VerifyKeyListener, ILinkedModeListener {
     
    350350
    351351        } catch (BadLocationException e) {
    352             RfpCore.log(e);
     352            RfpUI.log(e);
    353353        } catch (BadPositionCategoryException e) {
    354             RfpCore.log(e);
     354            RfpUI.log(e);
    355355        }
    356356    }
     
    428428                            document.replace(level.fSecondPosition.offset, level.fSecondPosition.length, null);
    429429                        } catch (BadLocationException e) {
    430                             RfpCore.log(e);
     430                            RfpUI.log(e);
    431431                        }
    432432                    }
     
    437437                            document.removePositionCategory(CATEGORY);
    438438                        } catch (BadPositionCategoryException e) {
    439                             RfpCore.log(e);
     439                            RfpUI.log(e);
    440440                        }
    441441                    }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpDocumentSetupParticipant.java

    r3508 r3520  
    66import org.eclipse.jface.text.IDocumentPartitioner;
    77import org.eclipse.jface.text.rules.FastPartitioner;
     8import org.refal.rfpdt.ui.RfpUI;
    89
    910public class RfpDocumentSetupParticipant implements IDocumentSetupParticipant {
     
    1112        if (document instanceof IDocumentExtension3) {
    1213            IDocumentExtension3 extension3 = (IDocumentExtension3) document;
    13             IDocumentPartitioner partitioner = new FastPartitioner(RfpEditorPlugin.getDefault()
     14            IDocumentPartitioner partitioner = new FastPartitioner(RfpUI.getDefault()
    1415                    .getRfpPartitionScanner(), RfpPartitionScanner.partitionTypes);
    1516            extension3.setDocumentPartitioner(IRfpPartitions.PARTITIONING, partitioner);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditor.java

    r3508 r3520  
    5151import org.refal.rfpdt.editor.color.ColorManager;
    5252import org.refal.rfpdt.editor.preferences.IPreferenceConstants;
     53import org.refal.rfpdt.ui.RfpUI;
    5354import org.refal.rfpdt.ui.actions.GotoMatchingBracketAction;
    5455import org.refal.rfpdt.ui.actions.IRfpEditorActionDefinitionIds;
     
    179180        if (input instanceof IFileEditorInput) {
    180181            IProject project = ((IFileEditorInput) input).getFile().getProject();
    181             stores.add(RfpEditorPlugin.getProjectPropertiesStore(project));
    182         }
    183 
    184         stores.add(RfpEditorPlugin.getPluginPreferenceStore());
     182            stores.add(RfpUI.getProjectPropertiesStore(project));
     183        }
     184
     185        stores.add(RfpUI.getPluginPreferenceStore());
    185186        stores.add(EditorsUI.getPreferenceStore());
    186187        store = new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()]));
     
    262263
    263264    protected void initializeKeyBindingScopes () {
    264         setKeyBindingScopes(new String[] { RfpEditorPlugin.RFP_EDITING_KEYBINDING_SCOPE });
     265        setKeyBindingScopes(new String[] { RfpUI.RFP_EDITING_KEYBINDING_SCOPE });
    265266    }
    266267
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/preferences/BasePreferencePage.java

    r3508 r3520  
    1919import org.eclipse.ui.IWorkbenchPreferencePage;
    2020import org.eclipse.ui.dialogs.PreferencesUtil;
    21 import org.refal.rfpdt.editor.RfpEditorPlugin;
    2221import org.refal.rfpdt.editor.preferences.SyntaxColoringPreferencePage.ModifiableBooleanFieldEditor;
     22import org.refal.rfpdt.ui.RfpUI;
    2323
    2424public class BasePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
     
    2727    public BasePreferencePage () {
    2828        super(GRID);
    29         setPreferenceStore(RfpEditorPlugin.getPluginPreferenceStore());
     29        setPreferenceStore(RfpUI.getPluginPreferenceStore());
    3030    }
    3131
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/preferences/CodeStylePreferencePage.java

    r3515 r3520  
    3030import org.eclipse.ui.model.WorkbenchLabelProvider;
    3131import org.refal.rfpdt.core.RfpCore;
    32 import org.refal.rfpdt.editor.RfpEditorPlugin;
    3332import org.refal.rfpdt.editor.preferences.SyntaxColoringPreferencePage.ModifiableBooleanFieldEditor;
    3433import org.refal.rfpdt.editor.preferences.SyntaxColoringPreferencePage.ModifiableIntegerFieldEditor;
     34import org.refal.rfpdt.ui.RfpUI;
    3535
    3636public class CodeStylePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IWorkbenchPropertyPage {
     
    4545    public CodeStylePreferencePage () {
    4646        super(GRID);
    47         store = RfpEditorPlugin.getPluginPreferenceStore();
     47        store = RfpUI.getPluginPreferenceStore();
    4848        setPreferenceStore(store);
    4949    }
     
    127127                        PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, null).open();
    128128                } catch (CoreException ex) {
    129                     RfpCore.log(ex);
     129                    RfpUI.log(ex);
    130130                }
    131131            }
     
    172172    public void setElement (IAdaptable element) {
    173173        project = (IProject) element.getAdapter(IResource.class);
    174         ProjectPropertiesStore projectStore = RfpEditorPlugin.getProjectPropertiesStore(project);
     174        ProjectPropertiesStore projectStore = RfpUI.getProjectPropertiesStore(project);
    175175        setPreferenceStore(projectStore);
    176176    }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/preferences/ProjectPropertiesStore.java

    r3508 r3520  
    77import org.eclipse.core.resources.ProjectScope;
    88import org.eclipse.ui.preferences.ScopedPreferenceStore;
    9 import org.refal.rfpdt.editor.RfpEditorPlugin;
     9import org.refal.rfpdt.ui.RfpUI;
    1010
    1111public class ProjectPropertiesStore extends ScopedPreferenceStore {
     
    1414
    1515    public ProjectPropertiesStore (IProject project) {
    16         super(new ProjectScope(project), RfpEditorPlugin.PLUGIN_ID);
     16        super(new ProjectScope(project), RfpUI.PLUGIN_ID);
    1717        keys = new HashSet<String>();
    1818        keys.add(IPreferenceConstants.SPACES_FOR_TABS);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/preferences/SyntaxColoringPreferencePage.java

    r3508 r3520  
    2525import org.eclipse.ui.IWorkbenchPreferencePage;
    2626import org.eclipse.ui.dialogs.PreferencesUtil;
    27 import org.refal.rfpdt.editor.RfpEditorPlugin;
    2827import org.refal.rfpdt.editor.color.IColorPreferences;
     28import org.refal.rfpdt.ui.RfpUI;
    2929
    3030public class SyntaxColoringPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
     
    8686    public SyntaxColoringPreferencePage () {
    8787        super(GRID);
    88         setPreferenceStore(RfpEditorPlugin.getPluginPreferenceStore());
     88        setPreferenceStore(RfpUI.getPluginPreferenceStore());
    8989        rgbStore = new HashMap<String, RGB>(keys.length);
    9090        booleanStore = new HashMap<String, Boolean>(keys.length * 4);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/IndentAction.java

    r3517 r3520  
    1717import org.eclipse.ui.IEditorPart;
    1818import org.eclipse.ui.texteditor.IDocumentProvider;
    19 import org.refal.rfpdt.core.RfpCore;
    2019import org.refal.rfpdt.editor.Document;
    2120import org.refal.rfpdt.editor.RfpAutoIndentStrategy;
    2221import org.refal.rfpdt.editor.RfpEditor;
     22import org.refal.rfpdt.ui.RfpUI;
    2323
    2424public class IndentAction implements IEditorActionDelegate {
     
    5858            } catch (BadLocationException e) {
    5959                // will only happen on concurrent modification
    60                 RfpCore.log("ConcurrentModification in IndentAction", e); //$NON-NLS-1$
     60                RfpUI.log("ConcurrentModification in IndentAction", e); //$NON-NLS-1$
    6161                return;
    6262            }
     
    8989                    } catch (BadLocationException e) {
    9090                        // will only happen on concurrent modification
    91                         RfpCore.log("ConcurrentModification in IndentAction", e); //$NON-NLS-1$
     91                        RfpUI.log("ConcurrentModification in IndentAction", e); //$NON-NLS-1$
    9292
    9393                    } finally {
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/ToggleCommentAction.java

    r3515 r3520  
    2121import org.eclipse.ui.IEditorActionDelegate;
    2222import org.eclipse.ui.IEditorPart;
    23 import org.refal.rfpdt.core.RfpCore;
    2423import org.refal.rfpdt.editor.RfpEditor;
     24import org.refal.rfpdt.ui.RfpUI;
    2525
    2626public class ToggleCommentAction extends Action implements IEditorActionDelegate {
     
    137137                } catch (BadLocationException x) {
    138138                        // should not happen
    139                         RfpCore.log(x);
     139                    RfpUI.log(x);
    140140                }
    141141
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/launching/RfpLaunchShortcut.java

    r3508 r3520  
    2626import org.refal.rfpdt.core.RfpBuilder;
    2727import org.refal.rfpdt.editor.RfpEditor;
    28 import org.refal.rfpdt.editor.RfpEditorPlugin;
     28import org.refal.rfpdt.ui.RfpUI;
    2929
    3030/**
     
    4545            return;
    4646        }
    47         MessageDialog.openError(RfpEditorPlugin.getShell(), "Cannot Launch Refal Plus application",
     47        MessageDialog.openError(RfpUI.getShell(), "Cannot Launch Refal Plus application",
    4848                "The selection is not a Refal Plus file. Please select one .rf file to launch.");
    4949    }
     
    5555            return;
    5656        }
    57         MessageDialog.openError(RfpEditorPlugin.getShell(), "Cannot Launch Refal Plus application",
     57        MessageDialog.openError(RfpUI.getShell(), "Cannot Launch Refal Plus application",
    5858                "The selection is not a Refal Plus file. Please select one .rf file to launch.");
    5959    }
     
    135135    private static ILaunchConfiguration chooseConfiguration (List<ILaunchConfiguration> configList, String mode) {
    136136        IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
    137         ElementListSelectionDialog dialog = new ElementListSelectionDialog(RfpEditorPlugin.getShell(), labelProvider);
     137        ElementListSelectionDialog dialog = new ElementListSelectionDialog(RfpUI.getShell(), labelProvider);
    138138        dialog.setElements(configList.toArray());
    139139        dialog.setTitle("Launch Configuration Selection");
     
    193193
    194194    private static IFile getResource () {
    195         IWorkbenchPage page = RfpEditorPlugin.getActivePage();
     195        IWorkbenchPage page = RfpUI.getActivePage();
    196196        if (page == null)
    197197            return null;
     
    205205        Display.getDefault().asyncExec(new Runnable() {
    206206            public void run () {
    207                 ErrorDialog.openError(RfpEditorPlugin.getShell(), "Cannot Create Configuration",
     207                ErrorDialog.openError(RfpUI.getShell(), "Cannot Create Configuration",
    208208                        "An exception occurred attempting to create launch configuration", exception.getStatus());
    209209            }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/ProjectCreationWizard.java

    r3515 r3520  
    1717import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
    1818import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
    19 import org.refal.rfpdt.core.RfpCore;
    20 import org.refal.rfpdt.editor.RfpEditorPlugin;
     19import org.refal.rfpdt.ui.RfpUI;
    2120
    2221public abstract class ProjectCreationWizard extends Wizard implements
     
    3231                super();
    3332                fOperation = operation;
    34                 setDialogSettings(RfpEditorPlugin.getDefault().getDialogSettings());
     33                setDialogSettings(RfpUI.getDefault().getDialogSettings());
    3534                setWindowTitle("Choose project name");
    3635                setNeedsProgressMonitor(true);
     
    101100                        IStatus status = ((CoreException) target).getStatus();
    102101                        ErrorDialog.openError(getShell(), title, message, status);
    103                         RfpCore.log(status);
     102                        RfpUI.log(status);
    104103                } else {
    105104                        MessageDialog.openError(getShell(), title, target.getMessage());
    106                         RfpCore.log(target.getMessage(), target);
     105                        RfpUI.log(target.getMessage(), target);
    107106                }
    108107        }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/wizards/RfpProjectCreationOperation.java

    r3515 r3520  
    1717import org.eclipse.jface.operation.IRunnableWithProgress;
    1818import org.refal.rfpdt.core.RfpCore;
     19import org.refal.rfpdt.ui.RfpUI;
    1920
    2021public class RfpProjectCreationOperation implements IRunnableWithProgress {
     
    3839            ResourcesPlugin.getWorkspace().run(operation, mon);
    3940        } catch (CoreException e) {
    40             RfpCore.log("Problem creating new project.", e);
     41            RfpUI.log("Problem creating new project.", e);
    4142        } finally {
    4243            mon.done();
Note: See TracChangeset for help on using the changeset viewer.