微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

org.eclipse.xtext.ui.XtextProjectHelper的实例源码

项目:n4js    文件AbstractN4JSContentAssistTest.java   
/**
 * Creates a project with two files.
 */
@SuppressWarnings("resource")
@BeforeClass
public static void createTestProject() throws Exception {
    staticProject = ProjectUtils.createJSProject(PROJECT_NAME);
    IFolder path = staticProject.getFolder("src").getFolder("path");
    path.create(true,true,null);
    IFile libFile = path.getFile("Libs.n4js");
    libFile.create(new StringInputStream(
            "export public class MyFirstClass {} export public class MySecondClass {} class MyHiddenClass {}",libFile.getCharset()),monitor());
    IFile moreLibFile = path.getFile("MoreLibs.n4js");
    moreLibFile.create(new StringInputStream(
            "export public class MoreLibFirstClass {} export public class MoreLibSecondClass {}",moreLibFile.getCharset()),monitor());
    IFile testFile = path.getFile("Test.n4js");
    testFile.create(new StringInputStream("",testFile.getCharset()),monitor());
    addNature(staticProject,XtextProjectHelper.NATURE_ID);
    ProjectUtils.waitForAutoBuild();
}
项目:EASyProducer    文件ProjectUtils.java   
/**
 * Toggles the EASy nature of <code>project</code>.
 * 
 * @param project the project to toggle the EASy nature for
 * @throws IOException in case of initialization problems
 * @throws InvalidProjectnameException if a projectname is not valid
 */
public static final void toggleNature(IProject project) throws IOException,InvalidProjectnameException {
    try {
        boolean hasNature = NatureUtils.hasNature(project,EASyNature.NATURE_ID);
        if (!hasNature) {
            ResourcesMgmt.INSTANCE.addEASyNatures(project,XtextProjectHelper.NATURE_ID,EASyNature.NATURE_ID);
        } else {
            String projectID = ResourcesMgmt.INSTANCE.getIDfromresource(project);
            ProductLineProject deletedplP = (ProductLineProject) SPLsManager.INSTANCE.getPLP(projectID);
            if (null != deletedplP) {
                deletedplP.close();
            }
            NatureUtils.removeNature(project,EASyNature.NATURE_ID,null);
            project.refreshLocal(IProject.DEPTH_INFINITE,null);
        }
    } catch (CoreException e) {
        throw new IOException(e.getMessage());
    }
}
项目:n4js    文件ProjectUtils.java   
/** Applies the Xtext nature to the project and creates (if necessary) and returns the source folder. */
public static IFolder configureProjectWithXtext(IProject project,String sourceFolder) throws CoreException {
    addNature(project.getProject(),XtextProjectHelper.NATURE_ID);
    IFolder folder = project.getProject().getFolder(sourceFolder);
    if (!folder.exists()) {
        folder.create(true,null);
    }
    return folder;
}
项目:n4js    文件EclipseBasedProjectModelSetup.java   
/***/
protected URI createTempProject(String projectName) throws CoreException {
    IProjectDescription description = workspace.getWorkspace().newProjectDescription(projectName);
    // deliberately avoid the build command
    description.setNatureIds(new String[] { XtextProjectHelper.NATURE_ID });
    IProject newProject = workspace.getProject(projectName);
    newProject.create(null);
    newProject.open(null);
    newProject.setDescription(description,null);
    return URI.createPlatformResourceURI(projectName,true);
}
项目:n4js    文件N4JSEclipseProject.java   
@Override
protected boolean checkExists() {
    if (XtextProjectHelper.hasNature(project)) {
        return project.getFile(N4MF_MANIFEST).exists();
    }
    return false;
}
项目:solidity-ide    文件KickStartNewProjectAction.java   
public void addNature(IProject project) {
    try {
        IProjectDescription description = project.getDescription();
        String[] natures = description.getNatureIds();
        String[] newNatures = new String[natures.length + 1];
        System.arraycopy(natures,newNatures,natures.length);
        newNatures[natures.length] = XtextProjectHelper.NATURE_ID;
        description.setNatureIds(newNatures);
        project.setDescription(description,null);
    } catch (CoreException e) {
        e.printstacktrace();
    }
}
项目:bts    文件AbstractProjectCreator.java   
protected String[] getProjectNatures() {
      return new String[] {
        JavaCore.NATURE_ID,"org.eclipse.pde.PluginNature",//$NON-NLS-1$
    XtextProjectHelper.NATURE_ID
};
  }
项目:bts    文件AbstractProjectCreator.java   
protected String[] getBuilders() {
    return new String[]{
        JavaCore.BUILDER_ID,"org.eclipse.pde.ManifestBuilder",//$NON-NLS-1$
        "org.eclipse.pde.SchemaBuilder",//$NON-NLS-1$
        XtextProjectHelper.BUILDER_ID
    };
}
项目:bts    文件RenameElementProcessor.java   
@Override
public RefactoringParticipant[] loadParticipants(RefactoringStatus status,SharableParticipants sharedParticipants)
        throws CoreException {
    RenameParticipant[] renameParticipants = ParticipantManager.loadRenameParticipants(status,this,renameElementContext,new RenameArguments(newName,true),new String[] { XtextProjectHelper.NATURE_ID },sharedParticipants);
    return renameParticipants;
}
项目:statecharts    文件StatechartDiagramEditor.java   
protected void checkXtextNature() {
    IFileEditorInput editorInput = (IFileEditorInput) getEditorinput();
    IProject project = editorInput.getFile().getProject();
    if (project != null && !XtextProjectHelper.hasNature(project) && project.isAccessible()
            && !project.isHidden()) {
        addNature(project);
    }
}
项目:statecharts    文件StatechartDiagramEditor.java   
public void addNature(IProject project) {
    try {
        IProjectDescription description = project.getDescription();
        String[] natures = description.getNatureIds();
        String[] newNatures = new String[natures.length + 1];
        System.arraycopy(natures,null);
    } catch (CoreException e) {
        e.printstacktrace();
    }
}
项目:xsemantics    文件LambdaIntegrationTest.java   
private IJavaProject createJavaProjectWithRootSrc(String string)
        throws CoreException {
    IJavaProject project = createJavaProject(string);
    addNature(project.getProject(),XtextProjectHelper.NATURE_ID);
    addSourceFolder(project,"src");
    return project;
}
项目:bts    文件WorkspaceProjectsstateHelper.java   
protected boolean isAccessibleXtextProject(IProject p) {
    return p != null && XtextProjectHelper.hasNature(p) && XtextProjectHelper.hasNature(p);
}
项目:bts    文件JavaProjectsstateHelper.java   
protected boolean isAccessibleXtextProject(IProject p) {
    return p != null && XtextProjectHelper.hasNature(p) && XtextProjectHelper.hasBuilder(p);
}
项目:Gauge-Eclipse    文件GaugeProjectCreator.java   
private String[] natureIds() {
    return new String[] { JavaCore.NATURE_ID,GaugeProjectNature.NATURE_ID,XtextProjectHelper.NATURE_ID };
}
项目:xtext-ide    文件BoaCustomProjectCreator.java   
protected String[] getProjectNatures() {
    return new String[] {
        XtextProjectHelper.NATURE_ID // we want the Xtext nature by default
    };
}
项目:xsemantics    文件AbstractOutlineWorkbenchTest.java   
/**
 * This creates the Java project that will be used for the tests.
 * @throws CoreException
 */
protected void createTestJavaProject() throws CoreException {
    IJavaProject javaProject = createJavaProject(TEST_PROJECT);
    addNature(javaProject.getProject(),XtextProjectHelper.NATURE_ID);
}
项目:SensIDL    文件NewSensidlProjectWizard.java   
private void addXtextNatureto(IProject project) throws CoreException {

    String[] natureIds = (String[]) Arrays.asList(XtextProjectHelper.NATURE_ID).toArray();

    IProjectDescription description = project.getDescription();
    description.setNatureIds(natureIds);

    project.setDescription(description,null);

}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。