本文整理汇总了Java中org.eclipse.core.resources.IncrementalProjectBuilder类的典型用法代码示例。如果您正苦于以下问题:Java IncrementalProjectBuilder类的具体用法?Java IncrementalProjectBuilder怎么用?Java IncrementalProjectBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IncrementalProjectBuilder类属于org.eclipse.core.resources包,在下文中一共展示了IncrementalProjectBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
public void configure() throws CoreException
{
IProjectDescription description = project.getDescription();
JPFManifestBuilder.addBuilderToProject(description);
project.setDescription(description, null);
JPFClasspathContainer.addToProject(JavaCore.create(project));
new Job("Check JPF Manifest")
{
@Override
protected IStatus run(IProgressMonitor monitor)
{
try
{
project.build(IncrementalProjectBuilder.FULL_BUILD, JPFManifestBuilder.BUILDER_ID, null, monitor);
}
catch( CoreException e )
{
JPFClasspathLog.logError(e);
}
return Status.OK_STATUS;
}
}.schedule();
}
示例2: getParserForBuilder
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
/**
* @param buildType single element array; element may be altered to indicate
* actual required build type
*/
public static PgDbParser getParserForBuilder(IProject proj, int[] buildType) {
PgDbParser pnew = new PgDbParser();
PgDbParser p = PROJ_PARSERS.putIfAbsent(proj, pnew);
if (p == null) {
p = pnew;
// prepare newly created parser
ResourcesPlugin.getWorkspace().addResourceChangeListener(p,
IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE);
if (buildType == null) {
// not a builder call, start builder
startBuildJob(proj);
} else {
// builder call, change build type to FULL for new parsers
buildType[0] = IncrementalProjectBuilder.FULL_BUILD;
}
}
return p;
}
示例3: build
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
if (AsciidocInstance.INSTANCE.getAsciidoctor() == null) {
return new IProject[0];
}
try {
if (kind == IncrementalProjectBuilder.FULL_BUILD) {
AsciidocBuildHelper.fullBuild(getProject(), monitor);
} else {
AsciidocBuildHelper.incrementalBuild(getProject(), getDelta(getProject()), monitor);
}
} catch (Exception e) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
}
return new IProject[0];
}
示例4: build
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
if (kind == IncrementalProjectBuilder.FULL_BUILD) {
fullBuild(monitor);
} else {
IResourceDelta delta = getDelta(getProject());
if (delta == null) {
fullBuild(monitor);
} else {
incrementalBuild(delta, monitor);
}
}
return null;
}
示例5: configure
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
public void configure() throws CoreException {
// Setup the builder
IProjectDescription desc = project.getDescription();
ICommand[] builders = desc.getBuildSpec();
ICommand[] newBuilders = new ICommand[builders.length + 1];
System.arraycopy(builders, 0, newBuilders, 0, builders.length);
ICommand androidBuilder = desc.newCommand();
androidBuilder.setBuilderName(AndroidBuilder.ID);
// We don't autobuild.
androidBuilder.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
newBuilders[builders.length] = androidBuilder;
desc.setBuildSpec(newBuilders);
project.setDescription(desc, 0, new NullProgressMonitor());
}
示例6: rebuildProjects
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
private static void rebuildProjects(final List<IProject> projects) {
String name = "rebuild";// Resources.BUNDLE.getString("preferences.compiler.rebuild.job.name");
Job job = new Job(name) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
for (IProject project : projects) {
if (project.isOpen() && project.hasNature(JSweetNature.ID)) {
project.build(IncrementalProjectBuilder.CLEAN_BUILD, JSweetBuilder.ID, null, monitor);
project.build(IncrementalProjectBuilder.FULL_BUILD, JSweetBuilder.ID, null, monitor);
}
}
return Status.OK_STATUS;
} catch (CoreException e) {
return e.getStatus();
}
}
};
job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
job.schedule();
}
示例7: cleanProjects
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
private static void cleanProjects(final List<IProject> projects) {
String name = "clean";// Resources.BUNDLE.getString("preferences.compiler.rebuild.job.name");
Job job = new Job(name) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
for (IProject project : projects) {
if (project.isOpen() && project.hasNature(JSweetNature.ID)) {
project.build(IncrementalProjectBuilder.CLEAN_BUILD, JSweetBuilder.ID, null, monitor);
}
}
return Status.OK_STATUS;
} catch (CoreException e) {
return e.getStatus();
}
}
};
job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
job.schedule();
}
示例8: scheduleRebuild
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
/**
* Schedules a full rebuild on a project.
*
* @param project the project to rebuild
*/
public static void scheduleRebuild(final IProject project) {
WorkspaceJob buildJob = new WorkspaceJob("Building " + project.getName()) {
@Override
public boolean belongsTo(Object family) {
return ResourcesPlugin.FAMILY_MANUAL_BUILD.equals(family);
}
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
return Status.OK_STATUS;
}
};
buildJob.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
buildJob.setUser(true);
buildJob.schedule();
}
示例9: doBuild
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
static private void doBuild(final IProgressMonitor monitor) {
try {
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
// monitor.beginTask("Cleaning and building entire workspace", size);
// for (final IProject p : projects) {
// if (p.exists() && p.isAccessible()) {
// monitor.subTask("Building " + p.getName());
// p.build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
// monitor.worked(1);
// }
// }
} catch (final CoreException e) {
e.printStackTrace();
}
}
示例10: build
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected IProject[] build(final int kind, final Map<String, String> args, final IProgressMonitor monitor) throws CoreException {
try {
final Optional<? extends FeedbackJavaProject> javaProjectOptional = this.getFeedbackJavaResourceFactory().create(getProject());
if (javaProjectOptional.isPresent()) {
final FeedbackJavaProject project = javaProjectOptional.get();
Logger.print(String.format("Triggered %S.", BuildTypes.INSTANCE.get(kind)));
if (kind == IncrementalProjectBuilder.FULL_BUILD || kind == IncrementalProjectBuilder.CLEAN_BUILD) {
fullBuild(project);
}
else {
incrementalBuild(project);
}
}
}
catch (final RequestException e) {
new RequestExceptionHandler().handle(getProject(), e);
}
return null;
}
示例11: visit
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
public boolean visit(final IResourceDelta delta) throws CoreException {
if (isRelevantForClean(delta)) {
IProject project = delta.getResource().getAdapter(IProject.class);
Job rebuild = new Job("rebuild") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
LOGGER.error("Exception during rebuild after opening of a project", e);
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}
};
rebuild.schedule();
}
if (isRelevantForDeregister(delta)) {
BackgroundTasksAdapter.getManager().deregisterProject((IProject) delta.getResource());
}
return true;
}
示例12: rebuildProjectIndexes
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
/**
* rebuildProjectIndexes
*/
private void rebuildProjectIndexes()
{
Job job = new Job(Messages.JSMetadataLoader_Rebuilding_Project_Indexes)
{
@Override
protected IStatus run(IProgressMonitor monitor)
{
IWorkspace ws = ResourcesPlugin.getWorkspace();
try
{
ws.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
}
catch (final CoreException e)
{
return e.getStatus();
}
return Status.OK_STATUS;
}
};
job.schedule();
}
示例13: build
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
if (!PlatformUI.isWorkbenchRunning()) {
return new IProject[0];
}
IProject[] projects = null;
switch (kind) {
case IncrementalProjectBuilder.CLEAN_BUILD:
clean(monitor);
break;
case IncrementalProjectBuilder.FULL_BUILD:
projects = fullBuild(args, monitor);
break;
case IncrementalProjectBuilder.AUTO_BUILD:
case IncrementalProjectBuilder.INCREMENTAL_BUILD:
projects = incrementalBuild(args, monitor);
break;
}
return projects;
}
示例14: BuildActionGroup
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
private BuildActionGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider, RefreshAction refreshAction) {
fSelectionProvider= specialSelectionProvider != null ? specialSelectionProvider : site.getSelectionProvider();
fBuildAction= new BuildAction(new ShellProviderAdapter(site.getShell()), IncrementalProjectBuilder.INCREMENTAL_BUILD);
fBuildAction.setText(ActionMessages.BuildAction_label);
fBuildAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_BUILD_PROJECT);
fRefreshAction= refreshAction;
fRefreshAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_REFRESH);
if (specialSelectionProvider != null) {
fRefreshAction.setSpecialSelectionProvider(specialSelectionProvider);
}
fSelectionProvider.addSelectionChangedListener(fBuildAction);
fSelectionProvider.addSelectionChangedListener(fRefreshAction);
}
示例15: buildProjects
import org.eclipse.core.resources.IncrementalProjectBuilder; //导入依赖的package包/类
private void buildProjects(IProgressMonitor progressMonitor) {
Set<IProject> builtProjects= new HashSet<IProject>(10);
Object[] elements= fJarPackage.getElements();
for (int i= 0; i < elements.length; i++) {
IProject project= null;
Object element= elements[i];
if (element instanceof IResource)
project= ((IResource)element).getProject();
else if (element instanceof IJavaElement)
project= ((IJavaElement)element).getJavaProject().getProject();
if (project != null && !builtProjects.contains(project)) {
try {
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, progressMonitor);
} catch (CoreException ex) {
String message= Messages.format(JarPackagerMessages.JarFileExportOperation_errorDuringProjectBuild, BasicElementLabels.getResourceName(project));
addError(message, ex);
} finally {
// don't try to build same project a second time even if it failed
builtProjects.add(project);
}
}
}
}