Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-02-01 12:41:09 +0000
committerUwe Stieber2012-02-02 06:19:59 +0000
commit89e9991b3bd5db53ae39175960426cc362860e53 (patch)
tree76c87f74575a7939d663226124319fce762725d6 /target_explorer/plugins/org.eclipse.tcf.te.core
parenta23e1e19ea1bf0f6efd05b9fcfea10b9628dfaf1 (diff)
downloadorg.eclipse.tcf-89e9991b3bd5db53ae39175960426cc362860e53.tar.gz
org.eclipse.tcf-89e9991b3bd5db53ae39175960426cc362860e53.tar.xz
org.eclipse.tcf-89e9991b3bd5db53ae39175960426cc362860e53.zip
Target Explorer: Fix typo's in javadoc
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutable.java84
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableJob.java218
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableStepperJob.java89
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/interfaces/IAsyncExecutable.java46
6 files changed, 2 insertions, 440 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
index ceeac7c35..e798524b9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/META-INF/MANIFEST.MF
@@ -18,7 +18,6 @@ Bundle-Localization: plugin
Export-Package: org.eclipse.tcf.te.core.activator;x-internal:=true,
org.eclipse.tcf.te.core.adapters,
org.eclipse.tcf.te.core.async,
- org.eclipse.tcf.te.core.async.interfaces,
org.eclipse.tcf.te.core.nls;x-internal:=true,
org.eclipse.tcf.te.core.nodes.interfaces.wire,
org.eclipse.tcf.te.core.utils.text
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutable.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutable.java
deleted file mode 100644
index b5d6ab6c4..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutable.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.core.async;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
-
-/**
- * Abstract asynchronous executable implementation.
- */
-public abstract class AbstractAsyncExecutable extends PropertiesContainer implements IAsyncExecutable {
-
- private boolean cancelable = true;
-
- /**
- * Constructor.
- */
- public AbstractAsyncExecutable() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable#execute(org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public final void execute(ICallback callback) {
- execute(null, ProgressHelper.PROGRESS_NONE, callback);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable#execute(org.eclipse.core.runtime.IProgressMonitor, int, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public final void execute(IProgressMonitor progress, int ticksToUse, ICallback callback) {
- progress = ProgressHelper.getProgressMonitor(progress, ticksToUse);
- int jobTicks = getJobTicks();
- ProgressHelper.beginTask(progress, getTaskName(), jobTicks);
- callback = new Callback(progress, ProgressHelper.PROGRESS_DONE, callback);
-
- internalExecute(progress, callback);
- }
-
- protected abstract void internalExecute(IProgressMonitor monitor, ICallback callback);
-
- /**
- * Return the ticks for this executable.
- */
- protected int getJobTicks() {
- return 100;
- }
-
- /**
- * Return the name of the task.
- */
- protected String getTaskName() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return <code>true</code> if the job can be canceled.
- */
- public final boolean isCancelable() {
- return cancelable;
- }
-
- /**
- * Set if the job can be canceled.
- *
- * @param cancelable <code>true</code> if the job should be cancelable.
- */
- public final void setCancelable(boolean cancelable) {
- this.cancelable = cancelable;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableJob.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableJob.java
deleted file mode 100644
index 87e0e6b4c..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableJob.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.core.async;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.interfaces.IConditionTester;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
-
-/**
- * Abstract asynchronous executable job implementation.
- */
-public abstract class AbstractAsyncExecutableJob extends Job implements IAsyncExecutable {
-
- /**
- * Job family id to identify jobs based on {@link AbstractAsyncExecutableJob}.
- *
- * @see IJobManager
- */
- public final String ID = "jobfamily.jobs.asynchronous"; //$NON-NLS-1$
-
- private int rescheduleDelay = -1;
- private boolean cancelable = true;
- protected boolean finished = false;
- private boolean statusHandled = false;
-
- private String jobFamily = null;
-
- private ICallback jobCallback = null;
-
- /**
- * Constructor.
- *
- * @param name The job name.
- * @param context The context to refresh.
- * @param mode The refresh mode.
- */
- protected AbstractAsyncExecutableJob(String name) {
- super(name);
- setPriority(Job.INTERACTIVE);
- setJobFamily(ID);
- }
-
- /**
- * Set the delay if the job should be rescheduled.
- * @param seconds The reschedule delay or <code>-1</code> if job should not be rescheduled.
- */
- public final void setRescheduleDelay(int seconds) {
- this.rescheduleDelay = seconds;
- }
-
- /**
- * Return the delay in seconds until the job should be rescheduled.
- */
- public final int getRescheduleDelay() {
- return rescheduleDelay;
- }
-
- /**
- * Sets if the result status should be handled by the job manager.
- * @param handled <code>true</code> if the job manager should not handle the result status.
- */
- protected void setStatusHandled(boolean handled) {
- this.statusHandled = handled;
- }
-
- /**
- * Set if the job can be canceled.
- * @param cancelable <code>true</code> if the job should be cancelable.
- */
- public final void setCancelable(boolean cancelable) {
- this.cancelable = cancelable;
- }
-
- /**
- * Return <code>true</code> if the job can be canceled.
- */
- public final boolean isCancelable() {
- return cancelable;
- }
-
- /**
- * Set the callback for the job.
- * @param callback The callback.
- */
- public final void setJobCallback(ICallback callback) {
- this.jobCallback = callback;
- }
-
- /**
- * Return the job callback.
- */
- public final ICallback getJobCallback() {
- return jobCallback;
- }
-
- /**
- * Return <code>true</code> if the job is finished.
- */
- public final boolean isFinished() {
- return finished;
- }
-
- /**
- * Set the job family to identify a job using <code>belongsTo(Object family)</code>.
- * @param jobFamily The job family or <code>null</code>.
- */
- public final void setJobFamily(String jobFamily) {
- this.jobFamily = jobFamily;
- }
-
- /**
- * Return the job family.
- */
- public final String getJobFamily() {
- return jobFamily;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
- */
- @Override
- public boolean belongsTo(Object family) {
- if (family instanceof String && getJobFamily() != null && getJobFamily().startsWith(family.toString())) {
- return true;
- }
- return super.belongsTo(family);
- }
-
- /**
- * Number of ticks the job uses to show the progress.
- *
- * @return The number of progress ticks.
- */
- protected abstract int getJobTicks();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable#execute(org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public final void execute(ICallback callback) {
- execute(null, ProgressHelper.PROGRESS_NONE, callback);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable#execute(org.eclipse.core.runtime.IProgressMonitor, int, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public final void execute(IProgressMonitor progress, int ticksToUse, ICallback callback) {
- finished = false;
- progress = ProgressHelper.getProgressMonitor(progress, ticksToUse);
- int jobTicks = getJobTicks();
- ProgressHelper.beginTask(progress, "", jobTicks); //$NON-NLS-1$
- callback = new Callback(progress, ProgressHelper.PROGRESS_DONE, callback);
- if (getJobCallback() != null && getJobCallback() != callback) {
- callback.addParentCallback(getJobCallback());
- }
-
- internalExecute(progress, new Callback(progress, ProgressHelper.PROGRESS_DONE, callback) {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- finished = true;
- }
- });
- }
-
- /**
- * The job itself.
- *
- * @param monitor The progress monitor (never <code>null</code>).
- * @param callback The callback.
- */
- protected abstract void internalExecute(final IProgressMonitor monitor, final ICallback callback);
-
- /**
- * Hold the execution of {@link #run(IProgressMonitor)} until the asynchronous executable
- * has completed the execution and invoked the callback.
- *
- * @param timeout The timeout in milliseconds. <code>0</code> means wait forever.
- * @param conditionTester The condition tester which condition must be fulfilled until
- * the execution hold of {@link #run(IProgressMonitor)} can be released.
- */
- protected abstract void waitAndExecute(long timeout, IConditionTester conditionTester);
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected final IStatus run(final IProgressMonitor monitor) {
- finished = false;
- int jobTicks = getJobTicks();
- ProgressHelper.beginTask(monitor, "", jobTicks); //$NON-NLS-1$
- final Callback callback = new Callback(monitor, ProgressHelper.PROGRESS_DONE, getJobCallback());
- internalExecute(monitor, callback);
- waitAndExecute(0, callback.getDoneConditionTester(isCancelable() ? monitor : null));
- finished = true;
-
- if (getRescheduleDelay() >= 0 && Platform.isRunning() && (!isCancelable() || !monitor.isCanceled())) {
- schedule(getRescheduleDelay() * 1000);
- }
-
- return statusHandled ? Status.OK_STATUS : callback.getStatus();
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableStepperJob.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableStepperJob.java
deleted file mode 100644
index 6f1d901a6..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AbstractAsyncExecutableStepperJob.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.core.async;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.te.core.async.interfaces.IAsyncExecutable;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
-
-/**
- * Abstract asynchronous executable stepper job.
- * <p>
- * The job executes a list of actions. If any action returns with an error, the whole job will be
- * aborted.
- */
-public abstract class AbstractAsyncExecutableStepperJob extends AbstractAsyncExecutableJob {
- private final IAsyncExecutable[] actions;
-
- /**
- * Constructor.
- *
- * @param name The job name. Must not be <code>null</code>
- * @param actions The actions to execute. Must not be <code>null</code>.
- */
- public AbstractAsyncExecutableStepperJob(String name, IAsyncExecutable[] actions) {
- super(name);
-
- Assert.isNotNull(actions);
- this.actions = actions;
- }
-
- /**
- * Returns the actions to execute.
- *
- * @return The actions to execute.
- */
- protected IAsyncExecutable[] getActions() {
- return actions;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.AbstractAsyncExecutableJob#getJobTicks()
- */
- @Override
- protected int getJobTicks() {
- return getActions().length * 100;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.async.AbstractAsyncExecutableJob#internalExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- protected final void internalExecute(final IProgressMonitor monitor, final ICallback callback) {
- if (getActions() == null || getActions().length == 0) {
- callback.done(this, Status.OK_STATUS);
- }
- else {
- ICallback stepCallback = new Callback() {
- private int index = 0;
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.callback.Callback#internalDone(java.lang.Object, org.eclipse.core.runtime.IStatus)
- */
- @Override
- protected void internalDone(Object caller, IStatus status) {
- if (!ProgressHelper.isCancelOrError(caller, status, getProgressMonitor(), null) && index < getActions().length) {
- setProperty(PROPERTY_IS_DONE, false);
- getActions()[index++].execute(monitor, 100, this);
- }
- else {
- callback.done(caller, status);
- }
- }
- };
- stepCallback.done(this, Status.OK_STATUS);
- }
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
index 94000d9f3..e5269d9ea 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/AsyncCallbackCollector.java
@@ -68,7 +68,7 @@ public class AsyncCallbackCollector extends AsyncCallbackHandler {
/**
* Constructor.
*
- * @param collector The parent asynchronous callback collector. Must be not
+ * @param collector The parent asynchronous callback collector. Must not be
* <code>null</code>.
*/
public SimpleCollectorCallback(AsyncCallbackCollector collector) {
@@ -237,7 +237,7 @@ public class AsyncCallbackCollector extends AsyncCallbackHandler {
* the collector is finished and the error is set as the error to pass on with the callback. If
* the collector is already finished, the method will return immediately.
*
- * @param error The error to handle. Must be not <code>null</code>.
+ * @param error The error to handle. Must not be <code>null</code>.
*/
public final synchronized void handleError(final Throwable error) {
Assert.isNotNull(error);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/interfaces/IAsyncExecutable.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/interfaces/IAsyncExecutable.java
deleted file mode 100644
index 949bc0b34..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/async/interfaces/IAsyncExecutable.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.core.async.interfaces;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-
-/**
- * Describes a common interface of an encapsulated executable.
- * <p>
- * All required steps combined to execute the action must be executed by the implementor of the
- * executable. The executable itself has no UI or job control. It is only supposed to use the
- * provided progress monitors to give feedback and report errors using exceptions and the callback
- * mechanism.
- */
-public interface IAsyncExecutable {
-
- /**
- * Execute the necessary steps to complete the executable.
- * <p>
- * If the executable has been finished, the specified callback <b>must</b> be called!
- *
- * @param callback The callback to invoke or <code>null</code>
- */
- public void execute(ICallback callback);
-
- /**
- * Execute the necessary steps to complete the executable.
- * <p>
- * User feedback can be provided through the specified progress monitor, if not <code>null</code>.
- * <p>
- * If the executable has been finished, the specified callback <b>must</b> be called!
- *
- * @param progress The progress monitor or <code>null</code>.
- * @param ticksToUse The ticks to use from the progress monitor.
- * @param callback The callback to invoke or <code>null</code>
- */
- public void execute(IProgressMonitor progress, int ticksToUse, ICallback callback);
-}

Back to the top