当前位置: 首页>>代码示例>>Java>>正文


Java XtextProjectHelper类代码示例

本文整理汇总了Java中org.eclipse.xtext.ui.XtextProjectHelper的典型用法代码示例。如果您正苦于以下问题:Java XtextProjectHelper类的具体用法?Java XtextProjectHelper怎么用?Java XtextProjectHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XtextProjectHelper类属于org.eclipse.xtext.ui包,在下文中一共展示了XtextProjectHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTestProject

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
/**
 * 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()), true, monitor());
	IFile moreLibFile = path.getFile("MoreLibs.n4js");
	moreLibFile.create(new StringInputStream(
			"export public class MoreLibFirstClass {} export public class MoreLibSecondClass {}",
			moreLibFile.getCharset()), true, monitor());
	IFile testFile = path.getFile("Test.n4js");
	testFile.create(new StringInputStream("", testFile.getCharset()), true, monitor());
	addNature(staticProject, XtextProjectHelper.NATURE_ID);
	ProjectUtils.waitForAutoBuild();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:AbstractN4JSContentAssistTest.java

示例2: toggleNature

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
/**
 * 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());
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:26,代码来源:ProjectUtils.java

示例3: configureProjectWithXtext

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
/** 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, true, null);
	}
	return folder;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:ProjectUtils.java

示例4: createTempProject

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
/***/
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);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:EclipseBasedProjectModelSetup.java

示例5: checkExists

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
@Override
protected boolean checkExists() {
	if (XtextProjectHelper.hasNature(project)) {
		return project.getFile(N4MF_MANIFEST).exists();
	}
	return false;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:8,代码来源:N4JSEclipseProject.java

示例6: addNature

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
public void addNature(IProject project) {
	try {
		IProjectDescription description = project.getDescription();
		String[] natures = description.getNatureIds();
		String[] newNatures = new String[natures.length + 1];
		System.arraycopy(natures, 0, newNatures, 0, natures.length);
		newNatures[natures.length] = XtextProjectHelper.NATURE_ID;
		description.setNatureIds(newNatures);
		project.setDescription(description, null);
	} catch (CoreException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Yakindu,项目名称:solidity-ide,代码行数:14,代码来源:KickStartNewProjectAction.java

示例7: getProjectNatures

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
protected String[] getProjectNatures() {
      return new String[] {
      	JavaCore.NATURE_ID,
	"org.eclipse.pde.PluginNature", //$NON-NLS-1$
	XtextProjectHelper.NATURE_ID
};
  }
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:AbstractProjectCreator.java

示例8: getBuilders

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
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
	};
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:AbstractProjectCreator.java

示例9: loadParticipants

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
@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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:RenameElementProcessor.java

示例10: checkXtextNature

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
protected void checkXtextNature() {
	IFileEditorInput editorInput = (IFileEditorInput) getEditorInput();
	IProject project = editorInput.getFile().getProject();
	if (project != null && !XtextProjectHelper.hasNature(project) && project.isAccessible()
			&& !project.isHidden()) {
		addNature(project);
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:9,代码来源:StatechartDiagramEditor.java

示例11: createJavaProjectWithRootSrc

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
private IJavaProject createJavaProjectWithRootSrc(String string)
		throws CoreException {
	IJavaProject project = createJavaProject(string);
	addNature(project.getProject(), XtextProjectHelper.NATURE_ID);
	addSourceFolder(project, "src");
	return project;
}
 
开发者ID:eclipse,项目名称:xsemantics,代码行数:8,代码来源:LambdaIntegrationTest.java

示例12: isAccessibleXtextProject

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
protected boolean isAccessibleXtextProject(IProject p) {
	return p != null && XtextProjectHelper.hasNature(p) && XtextProjectHelper.hasNature(p);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:WorkspaceProjectsStateHelper.java

示例13: isAccessibleXtextProject

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
protected boolean isAccessibleXtextProject(IProject p) {
	return p != null && XtextProjectHelper.hasNature(p) && XtextProjectHelper.hasBuilder(p);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:4,代码来源:JavaProjectsStateHelper.java

示例14: natureIds

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
private String[] natureIds() {
	return new String[] { JavaCore.NATURE_ID, GaugeProjectNature.NATURE_ID, XtextProjectHelper.NATURE_ID };
}
 
开发者ID:getgauge-contrib,项目名称:Gauge-Eclipse,代码行数:4,代码来源:GaugeProjectCreator.java

示例15: getProjectNatures

import org.eclipse.xtext.ui.XtextProjectHelper; //导入依赖的package包/类
protected String[] getProjectNatures() {
	return new String[] {
		XtextProjectHelper.NATURE_ID // we want the Xtext nature by default
	};
}
 
开发者ID:boalang,项目名称:xtext-ide,代码行数:6,代码来源:BoaCustomProjectCreator.java


注:本文中的org.eclipse.xtext.ui.XtextProjectHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。