diff options
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java')
-rw-r--r-- | bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java index 3f9227b3a..91d86b17b 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java @@ -32,13 +32,13 @@ import org.eclipse.ui.progress.IProgressConstants; * An operation that can be configured to run in the foreground using * the {@link org.eclipse.ui.progress.IProgressService} or the background * as a {@link org.eclipse.core.runtime.jobs.Job}. The execution context is determined - * by what is returned by the {@link #canRunAsJob()} hint which may be overridden by subclasses. - * Subclass must override the <code>run(IProgressMonitor)</code> method to perform + * by what is returned by the {@link #canRunAsJob()} hint which may be overridden by subclasses. + * Subclass must override the <code>run(IProgressMonitor)</code> method to perform * the behavior of the operation in the desired execution context. * <p> - * If this operation is run as a job, it is registered with the job as a + * If this operation is run as a job, it is registered with the job as a * {@link org.eclipse.core.runtime.jobs.IJobChangeListener} and is scheduled with - * the part of this operation if it is not <code>null</code>. + * the part of this operation if it is not <code>null</code>. * Subclasses can override the methods of this interface to receive job change notifications. * </p> * @see org.eclipse.ui.progress.IProgressService @@ -48,10 +48,10 @@ import org.eclipse.ui.progress.IProgressConstants; * @since 3.0 */ public abstract class TeamOperation extends JobChangeAdapter implements IRunnableWithProgress { - + private IWorkbenchPart part; private IRunnableContext context; - + /* * Job context that configures how the team operation will * interact with the progress service @@ -65,14 +65,14 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl super(operation.getJobName(), operation, operation.getSite()); this.operation = operation; } - + @Override protected void configureJob(Job job) { super.configureJob(job); if (operation.isKeepOneProgressServiceEntry()) - job.setProperty(IProgressConstants.KEEPONE_PROPERTY, Boolean.TRUE); + job.setProperty(IProgressConstants.KEEPONE_PROPERTY, Boolean.TRUE); else if(operation.getKeepOperation()) - job.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); + job.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); gotoAction = operation.getGotoAction(); if(gotoAction != null) job.setProperty(IProgressConstants.ACTION_PROPERTY, gotoAction); @@ -95,7 +95,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl } return operation.belongsTo(family); } - + /* (non-Javadoc) * @see org.eclipse.team.internal.ui.actions.JobRunnableContext#getCompletionStatus() */ @@ -106,7 +106,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl } return super.getCompletionStatus(); } - + /* (non-Javadoc) * @see org.eclipse.team.internal.ui.actions.JobRunnableContext#isUser() */ @@ -115,7 +115,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl return operation.isUserInitiated(); } } - + /** * Create an team operation associated with the given part. * @param part the part the operation is associated with or <code>null</code> if the @@ -132,9 +132,9 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl protected TeamOperation(IRunnableContext context) { this(null, context); } - + /** - * Create an team operation associated with the given part + * Create an team operation associated with the given part * that will run in the given context. * @param part the part the operation is associated with or <code>null</code> * @param context a runnable context @@ -146,13 +146,13 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl /** * Return the part that is associated with this operation. - * + * * @return Returns the part or <code>null</code> */ public IWorkbenchPart getPart() { return part; } - + /** * Run the operation in a context that is determined by the {@link #canRunAsJob()} * hint. If this operation can run as a job then it will be run in a background thread. @@ -169,7 +169,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl * the operation is run in the operation's context. Subclasses may * override in order to perform pre-checks to determine if the operation * should run. This may include prompting the user for information, etc. - * + * * @return whether the operation should be run. */ protected boolean shouldRun() { @@ -179,7 +179,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl /** * Returns the scheduling rule that is to be obtained before this * operation is executed by its context or <code>null</code> if - * no scheduling rule is to be obtained. If the operation is run + * no scheduling rule is to be obtained. If the operation is run * as a job, the scheduling rule is used as the scheduling rule of the * job. Otherwise, it is obtained before execution of the operation * occurs. @@ -188,90 +188,90 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl * rule is obtained. Subclasses can override in order to obtain a * scheduling rule or can obtain scheduling rules within their operation * if finer grained scheduling is desired. - * + * * @return the scheduling rule to be obtained by this operation * or <code>null</code>. */ protected ISchedulingRule getSchedulingRule() { return null; } - + /** * Return whether the auto-build should be postponed until after * the operation is complete. The default is to postpone the auto-build. * subclasses can override. - * + * * @return whether to postpone the auto-build while the operation is executing. */ protected boolean isPostponeAutobuild() { return true; } - + /** * If this operation can safely be run in the background, then subclasses can * override this method and return <code>true</code>. This will make their - * action run in a {@link org.eclipse.core.runtime.jobs.Job}. - * Subclass that override this method should + * action run in a {@link org.eclipse.core.runtime.jobs.Job}. + * Subclass that override this method should * also override the <code>getJobName()</code> method. - * + * * @return <code>true</code> if this action can be run in the background and * <code>false</code> otherwise. */ protected boolean canRunAsJob() { return false; } - + /** * Return the job name to be used if the action can run as a job. (i.e. * if <code>canRunAsJob()</code> returns <code>true</code>). - * + * * @return the string to be used as the job name */ protected String getJobName() { return ""; //$NON-NLS-1$ } - + /** * This method is called to allow subclasses to configure an action that could be run to show * the results of the action to the user. Default is to return null. - * + * * @return an action that could be run to see the results of this operation */ protected IAction getGotoAction() { return null; } - + /** * This method is called to allow subclasses to configure an icon to show when running this * operation. - * + * * @return an URL to an icon */ protected URL getOperationIcon() { return null; } - + /** * This method is called to allow subclasses to have the results of the * operation remain available to the user in the progress service even after * the job is done. This method is only relevant if the operation is run as * a job (i.e., <code>canRunAsJob</code> returns <code>true</code>). - * + * * @return <code>true</code> to keep the operation and <code>false</code> * otherwise. */ protected boolean getKeepOperation() { return false; } - + /** * This method is similar to <code>getKeepOperation</code> but will - * only keep one entry of a particular type available. + * only keep one entry of a particular type available. * This method is only relevant if the operation is run as * a job (i.e., <code>canRunAsJob</code> returns <code>true</code>). - * Subclasses that override this method should also override + * Subclasses that override this method should also override * <code>isSameFamilyAs</code> in order to match operations of the same type. - * + * * @return <code>true</code> to keep the operation and <code>false</code> * otherwise. * @since 3.1 @@ -279,7 +279,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl public boolean isKeepOneProgressServiceEntry() { return false; } - + /** * Return whether this Team operation belongs to the same family * as the given operation for the purpose of showing only one @@ -293,7 +293,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl protected boolean isSameFamilyAs(TeamOperation operation) { return false; } - + /** * Return whether the job that is running this operation should be considered * a member member of the given family. Subclasses can override this method in @@ -301,7 +301,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl * By default, <code>false</code> is always returned. Subclasses that override the * <code>isKeepOneProgressServiceEntry</code> method do not need to override * this method, but instead should override <code>isSameFamilyAs</code>. - * + * * @param family the family being tested. * @return whether the job that is running this operation should be considered * a member member of the given family. @@ -310,9 +310,9 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl public boolean belongsTo(Object family) { return false; } - + /** - * Indicates whether the operation was user initiated. The + * Indicates whether the operation was user initiated. The * progress for user initiated jobs may be presented differently * than non-user initiated operations if they are run as jobs. * @return whether the operation is user initiated @@ -321,10 +321,10 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl public boolean isUserInitiated() { return true; } - + /** * Return a shell that can be used by the operation to display dialogs, etc. - * + * * @return a shell */ protected Shell getShell() { @@ -341,12 +341,12 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl } return shell[0]; } - + /* * Uses the {@link #canRunAsJob()} hint to return a {@link ITeamRunnableContext} * that is used to execute the <code>run(SyncInfoSet, IProgressMonitor)</code> - * method of this action. - * + * method of this action. + * * @param syncSet the sync info set containing the selected elements for which this * action is enabled. * @return the runnable context in which to run this action. @@ -367,7 +367,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl return context; } } - + private IWorkbenchSite getSite() { IWorkbenchSite site = null; if(part != null) { |