source: trunk/src/org/modelica/mdt/MdtPlugin.java @ 19

Last change on this file since 19 was 17, checked in by boris, 19 years ago
  • added a filter to modelica projects view that removes .* files and folders
File size: 833 bytes
RevLine 
[10]1package org.modelica.mdt;
2import org.eclipse.core.resources.IProject;
3import org.eclipse.core.resources.IProjectDescription;
4import org.eclipse.core.runtime.CoreException;
[17]5import org.eclipse.core.runtime.Plugin;
[10]6
[17]7public class MdtPlugin extends Plugin
[10]8{
9
10    public static final String MODELICA_NATURE = 
11        "org.modelica.mdt.ModelicaNature";
12   
13    public static void addModelicaNature(IProject project) throws CoreException
14    {
15        if (project.hasNature(MODELICA_NATURE)) 
16            return;
17
18        IProjectDescription description = project.getDescription();
19        String[] ids= description.getNatureIds();
20        String[] newIds= new String[ids.length + 1];
21        System.arraycopy(ids, 0, newIds, 0, ids.length);
22        newIds[ids.length]= MODELICA_NATURE;
23        description.setNatureIds(newIds);
24        project.setDescription(description, null);
25    }
26   
27}
Note: See TracBrowser for help on using the repository browser.