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


Java IFileSystemAccess2类代码示例

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


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

示例1: getFileSystemAccess

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
protected IFileSystemAccess2 getFileSystemAccess(final IProject project, final IProgressMonitor monitor) {
	EclipseResourceFileSystemAccess2 access = fileSystemAccessProvider.get();
	access.setContext(project);
	access.setMonitor(monitor);
	OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
	defaultOutput.setDescription("Output Folder");
	defaultOutput.setOutputDirectory("./");
	defaultOutput.setOverrideExistingResources(true);
	defaultOutput.setCreateOutputDirectory(true);
	defaultOutput.setCleanUpDerivedResources(false);
	defaultOutput.setSetDerivedProperty(false);
	defaultOutput.setKeepLocalHistory(false);
	HashMap<String, OutputConfiguration> outputConfigurations = new HashMap<String, OutputConfiguration>();
	outputConfigurations.put(IFileSystemAccess.DEFAULT_OUTPUT, defaultOutput);
	access.setOutputConfigurations(outputConfigurations);
	return access;
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:18,代码来源:RestauranteProjectCreator.java

示例2: generateInitialContents

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
public void generateInitialContents(final IFileSystemAccess2 fsa) {
  String _primaryFileExtension = this.fileExtensionProvider.getPrimaryFileExtension();
  String _plus = ("src/model/Model." + _primaryFileExtension);
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("Restaurantes \"Hola\" fecha 30-10-2016");
  _builder.newLine();
  _builder.newLine();
  _builder.append("Ingredientes {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("Ingrediente: COD1 \'moluscos\' infoURL: http://moluscos.com alergenico");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  fsa.generateFile(_plus, _builder);
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:17,代码来源:RestauranteNewProjectWizardInitialContents.java

示例3: writeTo

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void writeTo(final IFileSystemAccess2 fileSystemAccess) {
  try {
    if ((fileSystemAccess != null)) {
      CharSequence _content = this.getContent();
      StringBuffer _stringBuffer = new StringBuffer(_content);
      final String contentToWrite = MergeableManifest.make512Safe(_stringBuffer, this.lineDelimiter);
      byte[] _bytes = contentToWrite.getBytes("UTF-8");
      ByteArrayInputStream _byteArrayInputStream = new ByteArrayInputStream(_bytes);
      final MergeableManifest mergableManifest = new MergeableManifest(_byteArrayInputStream);
      mergableManifest.setLineDelimiter(this.lineDelimiter);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      mergableManifest.write(bout);
      byte[] _byteArray = bout.toByteArray();
      ByteArrayInputStream _byteArrayInputStream_1 = new ByteArrayInputStream(_byteArray);
      fileSystemAccess.generateFile(this.getPath(), _byteArrayInputStream_1);
    }
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:ManifestAccess.java

示例4: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
  GeneradorTexto generatorTexto = new GeneradorTexto(resource, fsa);
  generatorTexto.compilar();
  GeneradorWeb generatorWeb = new GeneradorWeb(resource, fsa);
  generatorWeb.compilar();
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:8,代码来源:RestauranteGenerator.java

示例5: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void doGenerate(final Resource input, final IFileSystemAccess fsa) {
  Iterable<Element> _filter = Iterables.<Element>filter(IteratorExtensions.<EObject>toIterable(input.getAllContents()), Element.class);
  for (final Element ele : _filter) {
    {
      if ((fsa instanceof IFileSystemAccess2)) {
        StringConcatenation _builder = new StringConcatenation();
        String _name = ele.getName();
        _builder.append(_name);
        _builder.append(".txt");
        boolean _isFile = ((IFileSystemAccess2)fsa).isFile(_builder.toString());
        if (_isFile) {
          StringConcatenation _builder_1 = new StringConcatenation();
          String _name_1 = ele.getName();
          _builder_1.append(_name_1);
          _builder_1.append(".txt");
          ((IFileSystemAccess2)fsa).readTextFile(_builder_1.toString());
        }
      }
      StringConcatenation _builder_2 = new StringConcatenation();
      String _name_2 = ele.getName();
      _builder_2.append(_name_2);
      _builder_2.append(".txt");
      StringConcatenation _builder_3 = new StringConcatenation();
      _builder_3.append("object ");
      String _name_3 = ele.getName();
      _builder_3.append(_name_3);
      fsa.generateFile(_builder_2.toString(), _builder_3);
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:32,代码来源:MyGenerator.java

示例6: getPath

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
protected String getPath(final IFileSystemAccess2 fsa) {
  final String path = fsa.getURI("").toFileString();
  boolean _endsWith = path.endsWith(File.separator);
  if (_endsWith) {
    int _length = path.length();
    int _minus = (_length - 1);
    return path.substring(0, _minus);
  } else {
    return path;
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:FragmentAdapter.java

示例7: writeTo

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void writeTo(final IFileSystemAccess2 fileSystemAccess) {
  boolean _isEmpty = this.entries.isEmpty();
  boolean _not = (!_isEmpty);
  if (_not) {
    super.writeTo(fileSystemAccess);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:9,代码来源:PluginXmlAccess.java

示例8: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
	public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
//		Iterator<Greeting> filtered = Iterators.filter(resource.getAllContents(), Greeting.class);
//		Iterator<String> names = Iterators.transform(filtered, new Function<Greeting, String>() {
//
//			@Override
//			public String apply(Greeting greeting) {
//				return greeting.getName();
//			}
//		});
//		fsa.generateFile("greetings.txt", "People to greet: " + IteratorExtensions.join(names, ", "));
	}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:13,代码来源:FileAwareTestLanguageGenerator.java

示例9: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
	Iterator<Greeting> filtered = Iterators.filter(resource.getAllContents(), Greeting.class);
	Iterator<String> names = Iterators.transform(filtered, new Function<Greeting, String>() {

		@Override
		public String apply(Greeting greeting) {
			return greeting.getName();
		}
	});
	String fileName = resource.getURI().lastSegment();
	if(fileName == null) fileName = "greetings";
	fsa.generateFile(fileName+".txt", "People to greet: " + IteratorExtensions.join(names, ", "));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:15,代码来源:NoJdtTestLanguageGenerator.java

示例10: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void doGenerate(final Resource input, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
  final TreeIterator<EObject> iter = input.getAllContents();
  while (iter.hasNext()) {
    EObject _next = iter.next();
    final EObject e = _next;
    boolean _matched = false;
    if (e instanceof Entity) {
      _matched=true;
      String _name = ((Entity)e).getName();
      String _plus = (_name + ".txt");
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("Hello ");
      String _name_1 = ((Entity)e).getName();
      _builder.append(_name_1);
      _builder.append("!");
      _builder.newLineIfNotEmpty();
      fsa.generateFile(_plus, _builder);
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:IndexTestLanguageGenerator.java

示例11: fileExists

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
private boolean fileExists(IFileSystemAccess2 fsa, String fileName) {
	try {
		return fsa.isFile(fileName);
	} catch (Exception e) {
		return false;
	}
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:8,代码来源:JenaBasedSadlModelProcessor.java

示例12: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) {
}
 
开发者ID:hristo-vrigazov,项目名称:bromium,代码行数:4,代码来源:BromiumGenerator.java

示例13: doGenerate

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
   public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context)
{

   }
 
开发者ID:mochalog,项目名称:mochalog,代码行数:6,代码来源:PrologGenerator.java

示例14: enhanceProject

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
@Override
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	IFileSystemAccess2 access = getFileSystemAccess(project, monitor);
	initialContents.generateInitialContents(access);
	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:7,代码来源:RestauranteProjectCreator.java

示例15: generateTracedFile

import org.eclipse.xtext.generator.IFileSystemAccess2; //导入依赖的package包/类
/**
 * Convenience extension, to generate traced code.
 */
public void generateTracedFile(final IFileSystemAccess2 fsa, final String path, final EObject rootTrace, final StringConcatenationClient code) {
  final CompositeGeneratorNode node = this.trace(rootTrace, code);
  this.generateTracedFile(fsa, path, node);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:8,代码来源:TracingSugar.java


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