[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] Forcing a synchronization
|
Hi Brian
There is not yet an exported API for doing a sync, but unofficially you can use the public methods in:
org.eclipse.ptp.rdt.sync.core.SyncManager
For example, to do a forced, non-blocking sync on an IProject called "project":
SyncManager.sync(null, project, SyncFlag.FORCE, null);
The last argument is an ISyncExceptionHandler, which you can optionally define for handling sync exceptions.
An example handler can be found at:
org.eclipse.ptp.rdt.sync.ui.CommonSyncExceptionHandler
There is also a blocking sync call, SyncManager.syncBlocking(), which comes in two flavors.
One will throw sync exceptions and the other again takes an exception handler.
Confusingly, the two calls which take handlers also claim to throw CoreException, but this should
never happen. So a simple assert or log message should be sufficient for the corresponding catch block.
John
On Wed, Jul 18, 2012 at 11:26 AM, Brian Watt
<bwatt@xxxxxxxxxx> wrote:
Hi John,
I have a plugin that converts an executable into an instrumented executable on my remote system through a menu selection. Afterwards I want to have the instrumented executable appear in my synchronized project. Today I do a synchronization > sync active now to get it to appear. What is the recommended programming technique (code idiom) to force a synchronization in a plugin.
Brian Watt, Eclipse IBM
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev