Changeset 3516


Ignore:
Timestamp:
Mar 14, 2008, 9:44:16 AM (13 years ago)
Author:
yura
Message:
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core
Files:
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/META-INF/MANIFEST.MF

    r3508 r3516  
    44Bundle-SymbolicName: org.refal.rfpdt.core;singleton:=true
    55Bundle-Version: 1.1.9
    6 Bundle-Activator: org.refal.rfpdt.core.RfpCorePlugin
     6Bundle-Activator: org.refal.rfpdt.core.RfpCore
    77Bundle-Vendor: Program Systems Institute of RAS
    88Require-Bundle: org.eclipse.core.resources,
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpBuilder.java

    r3511 r3516  
    5151    private void makeClass (String className, byte[] bytes) {
    5252        IProject project = getProject();
    53         IJavaProject javaProject = RfpCorePlugin.getJavaProject(project);
     53        IJavaProject javaProject = RfpCore.getJavaProject(project);
    5454        try {
    5555            IPath projectPath = project.getFullPath();
     
    6464            classFile.setDerived(true);
    6565        } catch (Exception e) {
    66             RfpCorePlugin.log(e);
     66            RfpCore.log(e);
    6767        }
    6868    }
     
    142142                return new InputStreamReader(file.getContents(), file.getCharset());
    143143            } catch (Exception e) {
    144                 RfpCorePlugin.log(e);
     144                RfpCore.log(e);
    145145                return null;
    146146            }
     
    154154                return new InputStreamReader(file.getContents(), file.getCharset());
    155155            } catch (Exception e) {
    156                 RfpCorePlugin.log(e);
     156                RfpCore.log(e);
    157157                return null;
    158158            }
     
    163163                for (IClasspathEntry entry : getClasspathEntries(project))
    164164                    if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
    165                         IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), RfpCorePlugin
     165                        IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), RfpCore
    166166                                .getJavaProject(project));
    167167                        for (IClasspathEntry entry2 : container.getClasspathEntries()) {
     
    178178                    }
    179179            } catch (Exception e) {
    180                 RfpCorePlugin.log(e);
     180                RfpCore.log(e);
    181181            }
    182182            return null;
     
    199199    }
    200200
    201     public static final String BUILDER_ID = "org.refal.rfpdt.core.rfpbuilder";
    202 
    203     private static final QualifiedName IMPORTED_MODULES_PROPKEY = new QualifiedName(RfpCorePlugin.PLUGIN_ID,
     201    private static final QualifiedName IMPORTED_MODULES_PROPKEY = new QualifiedName(RfpCore.PLUGIN_ID,
    204202            "imported_modules");
    205 
    206     private static final String MARKER_TYPE = "org.refal.rfpdt.core.rfpProblemMarker";
    207203
    208204    private static boolean isRfFile (IResource resource) {
     
    218214    private static void addMarker (IFile file, String message, int lineNumber, int charStart, int charEnd, int severity) {
    219215        try {
    220             IMarker marker = file.createMarker(MARKER_TYPE);
     216            IMarker marker = file.createMarker(RfpCore.MARKER_TYPE);
    221217            if (message == null)
    222218                message = "Error";
     
    255251    protected void clean (IProgressMonitor monitor) throws CoreException {
    256252        IProject project = getProject();
    257         project.deleteMarkers(MARKER_TYPE, false, IResource.DEPTH_INFINITE);
     253        project.deleteMarkers(RfpCore.MARKER_TYPE, false, IResource.DEPTH_INFINITE);
    258254
    259255        project.accept(new IResourceVisitor() {
     
    407403            }
    408404        } catch (CoreException e) {
    409             RfpCorePlugin.log(e);
     405            RfpCore.log(e);
    410406        }
    411407    }
     
    413409    private static void deleteMarkers (IFile file) {
    414410        try {
    415             file.deleteMarkers(MARKER_TYPE, false, IResource.DEPTH_ZERO);
     411            file.deleteMarkers(RfpCore.MARKER_TYPE, false, IResource.DEPTH_ZERO);
    416412        } catch (CoreException e) {
    417             RfpCorePlugin.log(e);
     413            RfpCore.log(e);
    418414        }
    419415    }
     
    431427            compileModules(modulesToRecompile, monitor);
    432428        } catch (CoreException e) {
    433             RfpCorePlugin.log(e);
     429            RfpCore.log(e);
    434430        }
    435431    }
     
    452448    private static IClasspathEntry[] getClasspathEntries (IProject project) {
    453449        try {
    454             return RfpCorePlugin.getJavaProject(project).getRawClasspath();
     450            return RfpCore.getJavaProject(project).getRawClasspath();
    455451        } catch (Exception e) {
    456             RfpCorePlugin.log(e);
     452            RfpCore.log(e);
    457453            return new IClasspathEntry[0];
    458454        }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpCore.java

    r3513 r3516  
    1717 * The activator class controls the plug-in life cycle
    1818 */
    19 public class RfpCorePlugin extends Plugin {
     19public class RfpCore extends Plugin {
     20
     21    private static RfpCore plugin;
    2022
    2123    public static final String PLUGIN_ID = "org.refal.rfpdt";
     24    public static final String NATURE_ID = "org.refal.rfpdt.core.rfpnature";
     25    public static final String BUILDER_ID = "org.refal.rfpdt.core.rfpbuilder";
     26    public static final String MARKER_TYPE = "org.refal.rfpdt.core.rfpProblemMarker";
     27    public static final String RFP_CONTAINER = "org.refal.rfpdt.launching.RFP_CONTAINER";
    2228
    23     private static RfpCorePlugin plugin;
    24 
    25     public RfpCorePlugin () {
     29    public RfpCore () {
    2630        plugin = this;
    2731    }
     
    5155     * @return the shared instance
    5256     */
    53     public static RfpCorePlugin getDefault () {
     57    public static RfpCore getDefault () {
    5458        return plugin;
    5559    }
     
    100104    public static IJavaProject getJavaProject (IProject project) {
    101105        try {
    102             if (project == null || !project.exists() || !project.hasNature(RfpNature.NATURE_ID))
     106            if (project == null || !project.exists() || !project.hasNature(RfpCore.NATURE_ID))
    103107                return null;
    104108        } catch (CoreException e) {
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpNature.java

    r3511 r3516  
    1212import org.eclipse.jdt.core.JavaCore;
    1313import org.eclipse.jdt.launching.JavaRuntime;
    14 import org.refal.rfpdt.launching.RfpContainerInitializerAndResolver;
    1514
    1615public class RfpNature implements IProjectNature {
    1716    private static final String EXCLUSION_FILTER_ID = "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter";
    1817    private static final String EXCLUSION_EXTENTIONS = "*.rf,*.rfi";
    19 
    20     public static final String NATURE_ID = "org.refal.rfpdt.core.rfpnature";
    2118
    2219    private IProject project;
     
    2623        ICommand[] commands = desc.getBuildSpec();
    2724        for (int i = 0; i < commands.length; i++)
    28             if (commands[i].getBuilderName().equals(RfpBuilder.BUILDER_ID))
     25            if (commands[i].getBuilderName().equals(RfpCore.BUILDER_ID))
    2926                return;
    3027        ICommand[] newCommands = new ICommand[commands.length + 1];
    3128        System.arraycopy(commands, 0, newCommands, 0, commands.length);
    3229        ICommand command = desc.newCommand();
    33         command.setBuilderName(RfpBuilder.BUILDER_ID);
     30        command.setBuilderName(RfpCore.BUILDER_ID);
    3431        newCommands[newCommands.length - 1] = command;
    3532        desc.setBuildSpec(newCommands);
     
    3734
    3835        { // setup the .classpath
    39             IJavaProject javaProject = RfpCorePlugin.getJavaProject(project);
     36            IJavaProject javaProject = RfpCore.getJavaProject(project);
    4037            IClasspathEntry[] entriesOld = javaProject.getRawClasspath();
    4138            IClasspathEntry[] entriesNew = new IClasspathEntry[entriesOld.length + 2];
     
    4946                }
    5047            entriesNew[entriesOld.length + 0] = JavaCore.newContainerEntry(new Path(
    51                     RfpContainerInitializerAndResolver.RFP_CONTAINER));
     48                    RfpCore.RFP_CONTAINER));
    5249            entriesNew[entriesOld.length + 1] = JavaCore.newContainerEntry(new Path(JavaRuntime.JRE_CONTAINER));
    5350            javaProject.setRawClasspath(entriesNew, null);
     
    6764        ICommand[] commands = description.getBuildSpec();
    6865        for (int i = 0; i < commands.length; i++)
    69             if (commands[i].getBuilderName().equals(RfpBuilder.BUILDER_ID)) {
     66            if (commands[i].getBuilderName().equals(RfpCore.BUILDER_ID)) {
    7067                ICommand[] newCommands = new ICommand[commands.length - 1];
    7168                System.arraycopy(commands, 0, newCommands, 0, i);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/launching/RfpContainerInitializerAndResolver.java

    r3508 r3516  
    2020import org.eclipse.jdt.launching.JavaRuntime;
    2121import org.osgi.framework.Bundle;
    22 import org.refal.rfpdt.core.RfpCorePlugin;
     22import org.refal.rfpdt.core.RfpCore;
    2323
    2424public class RfpContainerInitializerAndResolver extends ClasspathContainerInitializer implements
     
    6060                    return new Path(file.substring(5, file.length() - 2));
    6161            } catch (IOException e) {
    62                 RfpCorePlugin.log(e);
     62                RfpCore.log(e);
    6363            }
    6464        return null;
    6565    }
    6666
    67     public static final String RFP_CONTAINER = "org.refal.rfpdt.launching.RFP_CONTAINER";
    68 
    6967    @Override
    7068    public void initialize (IPath containerPath, IJavaProject project) throws CoreException {
    71         if (containerPath.segmentCount() > 0 && containerPath.segment(0).equals(RFP_CONTAINER)) {
     69        if (containerPath.segmentCount() > 0 && containerPath.segment(0).equals(RfpCore.RFP_CONTAINER)) {
    7270            JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project },
    7371                    new IClasspathContainer[] { new RfpContainer(containerPath) }, null);
    7472        } else
    75             RfpCorePlugin.log("Invalid RfpContainer path", IStatus.ERROR);
     73            RfpCore.log("Invalid RfpContainer path", IStatus.ERROR);
    7674    }
    7775
Note: See TracChangeset for help on using the changeset viewer.