Java 类org.eclipse.xtext.builder.IXtextBuilderParticipant 实例源码

项目:n4js    文件:N4JSGenerateImmediatelyBuilderState.java   
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();
}
项目:dsl-devkit    文件:RegistryBuilderParticipant.java   
/**
 * 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);
    }
  }
}
项目:n4js    文件:N4JSBuilderParticipant.java   
/**
 * 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;
}
项目:dsl-devkit    文件:RegistryBuilderParticipant.java   
/**
 * 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;
}
项目:dsl-devkit    文件:RegistryBuilderParticipant.java   
/** {@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;
}
项目:pokemon-tcgo-deck-generator    文件:AbstractPkmntcgoUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:n4js    文件:AbstractN4JSUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:n4js    文件:N4JSUiModule.java   
/**
 * Bind the {@link IXtextBuilderParticipant} being aware of generating the Javascript files in the output directory.
 */
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return N4JSBuilderParticipant.class;
}
项目:n4js    文件:AbstractRegularExpressionUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:Xtext_Xtend_HTML_Generator    文件:AbstractMyDslUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:bromium    文件:AbstractBromiumUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:gw4e.project    文件:AbstractDSLPoliciesUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:lcdsl    文件:AbstractLcDslUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:gemoc-studio    文件:AbstractDslUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:org.xtext.dsl.restaurante    文件:AbstractRestauranteUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:OCCI-Studio    文件:AbstractOCCIUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:M2Doc    文件:AbstractMyDslUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:minitl    文件:AbstractMinitlUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:Sparrow    文件:AbstractModelEditorUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:dsl-devkit    文件:FormatUiModule.java   
/**
 * {@inheritDoc}
 */
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
  return FormatBuilderParticipant.class;
}
项目:dsl-devkit    文件:RegistryBuilderParticipant.java   
/** {@inheritDoc} */
@Override
public ImmutableList<IXtextBuilderParticipant> getParticipants() {
  return initParticipants();
}
项目:dsl-devkit    文件:RegistryBuilderParticipant.java   
protected ImmutableList<IXtextBuilderParticipant> getCommonParticipants() {
  return ImmutableList.copyOf(commonParticipants);
}
项目:CooperateModelingEnvironment    文件:AbstractComponentUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:CooperateModelingEnvironment    文件:AbstractClsUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:CooperateModelingEnvironment    文件:AbstractUsecaseUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:txtUML    文件:XtxtUMLUiModule.java   
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return XtxtUMLBuilderParticipant.class;
}
项目:cs2as    文件:AbstractASBHLangUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:cs2as    文件:AbstractMiniOCLUiModule.java   
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return BuilderParticipant.class;
}
项目:DialogScriptDSL    文件:DialogScriptUiModule.java   
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
    return DialogScriptBuilderParticipant.class;
}