本文整理汇总了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();
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例6: bindIXtextBuilderParticipant
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
return BuilderParticipant.class;
}
示例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;
}
示例8: bindIXtextBuilderParticipant
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
return FormatBuilderParticipant.class;
}
示例9: getParticipants
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ImmutableList<IXtextBuilderParticipant> getParticipants() {
return initParticipants();
}
示例10: getCommonParticipants
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
protected ImmutableList<IXtextBuilderParticipant> getCommonParticipants() {
return ImmutableList.copyOf(commonParticipants);
}
示例11: bindIXtextBuilderParticipant
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
return XtxtUMLBuilderParticipant.class;
}
示例12: bindIXtextBuilderParticipant
import org.eclipse.xtext.builder.IXtextBuilderParticipant; //导入依赖的package包/类
@Override
public Class<? extends IXtextBuilderParticipant> bindIXtextBuilderParticipant() {
return DialogScriptBuilderParticipant.class;
}