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


Java IXtextBuilderParticipant类代码示例

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


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

示例1: findJSBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
private N4JSBuilderParticipant findJSBuilderParticipant() {
	ImmutableList<IXtextBuilderParticipant> all = builderParticipant.getParticipants();
	for (IXtextBuilderParticipant candidate : all) {
		if (candidate instanceof DeferredBuilderParticipant) {
			DeferredBuilderParticipant dbp = (DeferredBuilderParticipant) candidate;
			if (isParticipating(dbp)) {
				IXtextBuilderParticipant delegate = dbp.getDelegate();
				if (delegate instanceof N4JSBuilderParticipant) {
					return (N4JSBuilderParticipant) delegate;
				}
			}
		}
		// N4JSBuilderParticipant is never directly used, it's always delegated to via an DeferredBuilderParticipant
	}
	throw new IllegalStateException();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:17,代码来源:N4JSGenerateImmediatelyBuilderState.java

示例2: buildOtherParticipants

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
 * Builds all other registered (non-language specific) {@link IXtextBuilderParticipant}s.
 *
 * @param buildContext
 *          the {@link IBuildContext}, must not be {@code null}
 * @param monitor
 *          the {@link IProgressMonitor}, must not be {@code null}
 * @throws CoreException
 *           caused by an {@link IXtextBuilderParticipant}
 */
protected void buildOtherParticipants(final IBuildContext buildContext, final IProgressMonitor monitor) throws CoreException {
  ImmutableList<IXtextBuilderParticipant> otherBuilderParticipants = getParticipants();
  if (otherBuilderParticipants.isEmpty()) {
    return;
  }
  SubMonitor progress = SubMonitor.convert(monitor, otherBuilderParticipants.size());
  progress.subTask(Messages.RegistryBuilderParticipant_InvokingBuildParticipants);
  for (final IXtextBuilderParticipant participant : otherBuilderParticipants) {
    if (progress.isCanceled()) {
      throw new OperationCanceledException();
    }
    try {
      if (initializeParticipant(participant)) {
        participant.build(buildContext, progress.newChild(1));
      }
      // CHECKSTYLE:CHECK-OFF IllegalCatchCheck we need to recover from any exception and continue the build
    } catch (Throwable throwable) {
      // CHECKSTYLE:CHECK-ON IllegalCatchCheck
      LOG.error("Error occurred during build of builder participant: " //$NON-NLS-1$
          + participant.getClass().getName(), throwable);
    }
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:34,代码来源:RegistryBuilderParticipant.java

示例3: prepareBuild

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
 * Intentionally package visible producer for the {@link IBuildParticipantInstruction}.
 *
 * @param project
 *            the currently build project
 * @param buildType
 *            the current build type
 * @return a StatefulBuilderParticipant. Never <code>null</code>.
 */
IBuildParticipantInstruction prepareBuild(IProject project, IXtextBuilderParticipant.BuildType buildType)
		throws CoreException {

	if (!isEnabled(project)) {
		return IBuildParticipantInstruction.NOOP;
	}
	EclipseResourceFileSystemAccess2 access = fileSystemAccessProvider.get();
	access.setProject(project);
	final Map<String, OutputConfiguration> outputConfigurations = getOutputConfigurations(project);
	refreshOutputFolders(project, outputConfigurations, null);
	access.setOutputConfigurations(outputConfigurations);
	if (buildType == BuildType.CLEAN || buildType == BuildType.RECOVERY) {
		IBuildParticipantInstruction clean = new CleanInstruction(project, outputConfigurations,
				getDerivedResourceMarkers());
		if (buildType == BuildType.RECOVERY) {
			clean.finish(Collections.<Delta> emptyList(), null);
		} else {
			return clean;
		}
	}
	Map<OutputConfiguration, Iterable<IMarker>> generatorMarkers = getGeneratorMarkers(project,
			outputConfigurations.values());
	BuildInstruction buildInstruction = new BuildInstruction(project, outputConfigurations,
			getDerivedResourceMarkers(), access,
			generatorMarkers, storage2UriMapper, compositeGenerator, injector);
	return buildInstruction;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:37,代码来源:N4JSBuilderParticipant.java

示例4: initializeParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
 * Initializes the given {@link IXtextBuilderParticipant}.
 *
 * @param participant
 *          the {@link IXtextBuilderParticipant} to initialize, must not be {@code null}
 * @return whether the builder participant was initialized successfully
 */
private boolean initializeParticipant(final IXtextBuilderParticipant participant) {
  String languageId = null;
  if (participant instanceof IGeneratorModuleProvider) {
    languageId = ((IGeneratorModuleProvider) participant).getGeneratorModuleId();
  } else if (participant instanceof ILanguageSpecificBuilderParticipant) {
    languageId = ((ILanguageSpecificBuilderParticipant) participant).getLanguageId();
  }
  if (languageId != null && !BuilderParticipantSettings.isBuilderParticipantEnabled(languageId)) {
    return false;
  }
  if (!initializedParticipants.contains(participant)) {
    if (languageId != null) {
      final IResourceServiceProvider resourceServiceProvider = resourceServiceProviderLocator.getResourceServiceProviderById(languageId);
      if (resourceServiceProvider != null) {
        // inject members of the participant
        final Injector injector = resourceServiceProvider.get(Injector.class);
        injector.injectMembers(participant);
      } else {
        LOG.error(NLS.bind("No ResourceServiceProvider found for builder participant ''{0}'' and language id ''{1}''", participant.getClass().getName(), languageId)); //$NON-NLS-1$
        return false;
      }
    }
    initializedParticipants.add(participant);
  }
  return true;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:34,代码来源:RegistryBuilderParticipant.java

示例5: initParticipants

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected synchronized ImmutableList<IXtextBuilderParticipant> initParticipants() {
  if (immutableCommonParticipants == null) {
    String pluginID = "org.eclipse.xtext.builder"; //$NON-NLS-1$ // Activator.getDefault().getBundle().getSymbolicName();
    String extensionPointID = EXTENSION_POINT_ID;
    ConditionalBuilderParticipantReader reader = new ConditionalBuilderParticipantReader(extensionRegistry, pluginID, extensionPointID);
    reader.readRegistry();
    immutableCommonParticipants = reader.getCommonParticipants();
  }
  return immutableCommonParticipants;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:13,代码来源:RegistryBuilderParticipant.java

示例6: bindIXtextBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
	return BuilderParticipant.class;
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:4,代码来源:AbstractPkmntcgoUiModule.java

示例7: bindIXtextBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
 * Bind the {@link IXtextBuilderParticipant} being aware of generating the Javascript files in the output directory.
 */
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
	return N4JSBuilderParticipant.class;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:8,代码来源:N4JSUiModule.java

示例8: bindIXtextBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
  return FormatBuilderParticipant.class;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:8,代码来源:FormatUiModule.java

示例9: getParticipants

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ImmutableList<IXtextBuilderParticipant> getParticipants() {
  return initParticipants();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:6,代码来源:RegistryBuilderParticipant.java

示例10: getCommonParticipants

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
protected ImmutableList<IXtextBuilderParticipant> getCommonParticipants() {
  return ImmutableList.copyOf(commonParticipants);
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:4,代码来源:RegistryBuilderParticipant.java

示例11: bindIXtextBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
	return XtxtUMLBuilderParticipant.class;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:5,代码来源:XtxtUMLUiModule.java

示例12: bindIXtextBuilderParticipant

import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
	return DialogScriptBuilderParticipant.class;
}
 
开发者ID:RobertWalter83,项目名称:DialogScriptDSL,代码行数:5,代码来源:DialogScriptUiModule.java


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