本文整理匯總了Java中org.eclipse.core.runtime.SubProgressMonitor.done方法的典型用法代碼示例。如果您正苦於以下問題:Java SubProgressMonitor.done方法的具體用法?Java SubProgressMonitor.done怎麽用?Java SubProgressMonitor.done使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.runtime.SubProgressMonitor
的用法示例。
在下文中一共展示了SubProgressMonitor.done方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public void run ( final RunnerContext ctx, final IProgressMonitor monitor )
{
monitor.beginTask ( "Executing task", this.task.getExecute ().size () );
for ( final Execute execute : this.task.getExecute () )
{
final Executable runnable = convert ( execute, ctx );
// inject sub progress monitor
final SubProgressMonitor sm = new SubProgressMonitor ( monitor, 1 );
ctx.getMap ().put ( KEY_PROGRESS_MONITOR, sm );
runnable.run ( ctx );
// remove sub progress monitor
ctx.getMap ().remove ( KEY_PROGRESS_MONITOR );
// step is complete
sm.done ();
}
monitor.done ();
}
示例2: chooseTypes
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
private void chooseTypes(ConstraintVariable2[] allConstraintVariables, SubProgressMonitor pm) {
pm.beginTask("", allConstraintVariables.length); // $NON-NLS-1$
for (int i = 0; i < allConstraintVariables.length; i++) {
ConstraintVariable2 cv = allConstraintVariables[i];
TypeEquivalenceSet set = cv.getTypeEquivalenceSet();
if (set == null)
continue; // TODO: should not happen iff all unused constraint variables got pruned
// TODO: should calculate only once per EquivalenceRepresentative; can throw away estimate
// TypeSet afterwards
TType type =
chooseSingleType((TypeSet) cv.getTypeEstimate()); // TODO: is null for Universe TypeSet
setChosenType(cv, type);
if (cv instanceof CollectionElementVariable2) {
CollectionElementVariable2 elementCv = (CollectionElementVariable2) cv;
fUpdate.addDeclaration(elementCv);
}
pm.worked(1);
if (pm.isCanceled()) throw new OperationCanceledException();
}
pm.done();
}
示例3: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例4: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例5: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例6: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例7: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例8: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavalueResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例9: build
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
public IStatus build(de.darwinspl.preferences.resource.dwprofile.mopp.DwprofileResource resource, IProgressMonitor monitor) {
// Set option 'overrideBuilder' to 'false' and then perform build here.
// We use one tick from the parent monitor because the BuilderAdapter reserves one
// tick for the Builder.
SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
subMonitor.beginTask("Building " + resource.getURI().lastSegment(), 10);
// The actual work of the builder can be performed here.
subMonitor.worked(10);
subMonitor.done();
return Status.OK_STATUS;
}
示例10: doRun
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
@Override
protected IStatus doRun(final IProgressMonitor progressMonitor) throws Exception {
final int work = (removes != null && removes.length > 0 && adds != null && adds.length > 0) ? 2 : 1;
final String messageFormat = Messages.getString("EditLabelCommand.ProgressTextFormat"); //$NON-NLS-1$
final String message = MessageFormat.format(messageFormat, newLabel.getName());
progressMonitor.beginTask(message, work);
if (removes != null && removes.length > 0) {
final SubProgressMonitor unlabelMonitor = new SubProgressMonitor(progressMonitor, 1);
final UnlabelCommand unlabelCommand = new UnlabelCommand(repository, originalLabel, removes);
try {
final IStatus unlabelStatus = unlabelCommand.run(unlabelMonitor);
if (!unlabelStatus.isOK()) {
return unlabelStatus;
}
} finally {
unlabelMonitor.done();
}
}
if ((adds != null && adds.length > 0) || !originalLabel.getComment().equals(newLabel.getComment())) {
final SubProgressMonitor createMonitor = new SubProgressMonitor(progressMonitor, 1);
final CreateLabelCommand createCommand = new CreateLabelCommand(repository, newLabel, adds);
try {
final IStatus createStatus = createCommand.run(createMonitor);
if (!createStatus.isOK()) {
return createStatus;
}
} finally {
createMonitor.done();
}
}
return Status.OK_STATUS;
}
示例11: runSolver
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
private void runSolver(SubProgressMonitor pm) {
pm.beginTask("", fWorkList.size() * 3); // $NON-NLS-1$
while (!fWorkList.isEmpty()) {
// Get a variable whose type estimate has changed
ConstraintVariable2 cv = fWorkList.removeFirst();
List<ITypeConstraint2> usedIn = fTCModel.getUsedIn(cv);
processConstraints(usedIn);
pm.worked(1);
if (pm.isCanceled()) throw new OperationCanceledException();
}
pm.done();
}
示例12: createNewWorkingCopies
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
static ICompilationUnit[] createNewWorkingCopies(
ICompilationUnit[] compilationUnitsToModify,
TextChangeManager manager,
WorkingCopyOwner owner,
SubProgressMonitor pm)
throws CoreException {
pm.beginTask("", compilationUnitsToModify.length); // $NON-NLS-1$
ICompilationUnit[] newWorkingCopies = new ICompilationUnit[compilationUnitsToModify.length];
for (int i = 0; i < compilationUnitsToModify.length; i++) {
ICompilationUnit cu = compilationUnitsToModify[i];
newWorkingCopies[i] = createNewWorkingCopy(cu, manager, owner, new SubProgressMonitor(pm, 1));
}
pm.done();
return newWorkingCopies;
}
示例13: processLocal
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
@Override
public void processLocal ( final IFolder output, final IProgressMonitor parentMonitor ) throws Exception
{
final IProgressMonitor monitor = new SubProgressMonitor ( parentMonitor, 13 );
// create context
final OscarContext ctx = createContext ();
// generate common content
new SecurityProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new JdbcUserServiceModuleProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new EventStoragePostgresModuleProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new EventStorageJdbcModuleProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new EventInjectorJdbcProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new EventInjectorPostgresProcessor ( this.app, ctx ).process ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
new ConnectionProcessor ( this.app, ctx ).process ();
new ExporterProcessor ( this.app, ctx ).process ();
// generate based on processors
final Collection<OscarProcessor> processors = createProcessors ();
monitor.worked ( 1 ); // COUNT:1
{
final SubProgressMonitor subMonitor = new SubProgressMonitor ( monitor, 1 ); // COUNT:1
subMonitor.beginTask ( "Process application modules", processors.size () );
for ( final OscarProcessor processor : processors )
{
processor.process ( ctx, this.app, subMonitor );
subMonitor.worked ( 1 );
}
subMonitor.done ();
}
// generate custom content
processForContext ( ctx, output, monitor );
// write out oscar context
final OscarWriter writer = new OscarWriter ( ctx.getData (), ctx.getIgnoreFields () );
monitor.worked ( 1 ); // COUNT:1
final IFile file = output.getFile ( "configuration.oscar" ); //$NON-NLS-1$
try ( FileOutputStream fos = new FileOutputStream ( file.getRawLocation ().toOSString () ) )
{
writer.write ( fos );
}
monitor.worked ( 1 ); // COUNT:1
final IFile jsonFile = output.getFile ( "data.json" ); //$NON-NLS-1$
try ( final FileOutputStream fos = new FileOutputStream ( jsonFile.getRawLocation ().toOSString () ) )
{
OscarWriter.writeData ( ctx.getData (), fos );
}
monitor.worked ( 1 ); // COUNT:1
// write out profile
new P2ProfileProcessor ( this.app ).process ( output.getLocation ().toFile (), monitor );
monitor.worked ( 1 ); // COUNT:1
// refresh
output.refreshLocal ( IResource.DEPTH_INFINITE, monitor );
monitor.done ();
}
示例14: downloadTempFiles
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
/**
* Downloads this command's current resource in each of the given changesets
* to temporary files on disk.
*
* Consumes one unit of work from the given {@link IProgressMonitor}.
*
* @param progressMonitor
* a progress monitor used for cancellation and status repotring and
* passed to {@link GetVersionedItemToTempLocationCommand}; 1 unit of
* work will be used by this method (must not be <code>null</code>)
* @param multiStatus
* a {@link MultiStatus} into which the status of the download
* commands will be merged (must not be <code>null</code>)
* @param changesets
* the changesets to download items for (must not be
* <code>null</code>)
* @return the {@link Map} of {@link Changeset} to {@link File} or
* <code>null</code> if the user cancelled
* @throws Exception
* if {@link GetVersionedItemToTempLocationCommand} throw an
* exception
*/
private Map downloadTempFiles(
final IProgressMonitor progressMonitor,
final MultiStatus multiStatus,
final Changeset[] changesets) throws Exception {
final Map changesetToFilePathMap = new LinkedHashMap();
/*
* Use a sub monitor to give the user more feedback.
*/
final SubProgressMonitor downloadMonitor = new SubProgressMonitor(progressMonitor, 1);
try {
downloadMonitor.beginTask(
Messages.getString("AnnotateCommand.ProgressRetrievingHistory"), //$NON-NLS-1$
changesets.length);
for (int i = 0; i < changesets.length; i++) {
checkForCancellation(downloadMonitor);
final Changeset changeset = changesets[i];
final String messageFormat = Messages.getString("AnnotateCommand.ProgressRetrievingHistoryFormat"); //$NON-NLS-1$
final String message =
MessageFormat.format(messageFormat, Integer.toString(changeset.getChangesetID()));
downloadMonitor.subTask(message);
final Item item = changeset.getChanges()[0].getItem();
final GetVersionedItemToTempLocationCommand cmd = new GetVersionedItemToTempLocationCommand(
repository,
item.getServerItem(),
new ChangesetVersionSpec(changeset.getChangesetID()));
final IStatus status = cmd.run(new NullProgressMonitor());
multiStatus.merge(status);
if (status.isOK()) {
final String tempFilePath = cmd.getTempLocation();
if (tempFilePath != null) {
changesetToFilePathMap.put(changeset, tempFilePath);
}
findChangeBlocks(changesetToFilePathMap);
}
downloadMonitor.worked(1);
}
} finally {
downloadMonitor.done();
}
return changesetToFilePathMap;
}
示例15: setTpMapping
import org.eclipse.core.runtime.SubProgressMonitor; //導入方法依賴的package包/類
/**
* Associates the specified mapping with the specified filename (optional
* operation). If the {@link Spec} previously contained a mapping for the
* filename, the old mapping is replaced by the specified map.
*
* @param mapping
* The {@link TLAtoPCalMapping} object for the given
* <tt>filename</tt>. <code>null</code>, will cause an
* {@link IllegalArgumentException}.
* @param filename
* key with which the specified value is to be associated.
* <code>null</code>, will cause an
* {@link IllegalArgumentException}.
* @param monitor
* A valid {@link IProgressMonitor}, <code>null</code>, will
* cause an {@link IllegalArgumentException}.
* @return the previous value associated with <tt>filename</tt>, or
* <tt>null</tt> if there was no mapping for <tt>filename</tt>.
* @throws NullPointerException
* if the specified key or value is null and this map does not
* permit null keys or values
* @throws IllegalArgumentException
* if some property of the specified key or value prevents it
* from being stored in this map
*/
public TLAtoPCalMapping setTpMapping(final TLAtoPCalMapping mapping,
final String filename, final IProgressMonitor monitor) {
// Safeguard against inproper use of this API
if (mapping == null || filename == null || monitor == null) {
throw new IllegalArgumentException();
}
lock.lock();
try {
final TLAtoPCalMapping oldMapping = spec2mappings.put(filename,
mapping);
// Check if old and new mapping are identical to avoid disk flush.
// This requires proper equals/hashcode in TLAtoPCalMapping and
// nested.
if (!mapping.equals(oldMapping)) {
// Use a submonitor to show progress as well as failure
final SubProgressMonitor subProgressMonitor = new SubProgressMonitor(
monitor, 1);
subProgressMonitor
.setTaskName("Writing TLA+ to PCal mapping for "
+ filename);
// Eagerly flush mapping to its persistent disk storage
// (overwriting
// any previous mapping stored on disk). This is relatively
// cheap
// compared to how often a mapping is re-generated, but has the
// advantage that the mapping doesn't get lost if the Toolbox
// decides to
// not shut down gracefully.
try {
Assert.isTrue(ResourceHelper.writeTLAtoPCalMapping(project,
filename, mapping, subProgressMonitor));
} finally {
subProgressMonitor.done();
}
}
return oldMapping;
} finally {
lock.unlock();
}
}