public class SyncConfigManager extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addConfig(IProject project,
SyncConfig config)
Add a new sync configuration to the project
|
static void |
addSyncConfigListener(String natureId,
ISyncConfigListener listener)
Register to receive sync configuration events.
|
static SyncConfig |
getActive(IProject project)
Get the active configuration for the project.
|
static URI |
getActiveSyncLocationURI(IResource resource)
Get the synchronize location URI of the resource associated with the active sync configuration.
|
static SyncConfig |
getConfig(IProject project,
String name)
Find a configuration by name
|
static SyncConfig[] |
getConfigs(IProject project)
Get the sync configurations associated with the project
|
static SyncConfig |
getLocalConfig(ISynchronizeService syncService)
Get a local sync config, really a config that does no sync'ing, for when the user wants to just work locally.
|
static URI |
getSyncLocationURI(SyncConfig config,
IResource resource)
Get the synchronize location URI of the resource associated with the sync configuration.
|
static boolean |
isActive(IProject project,
SyncConfig config)
Check if this config is active for the project.
|
static boolean |
isLocal(SyncConfig config)
Return whether the config is local (no sync'ing is done)
This definition must agree with how local configs are created in
#getLocalConfig() . |
static boolean |
isRemote(SyncConfig config)
Return whether the config is remote (sync'ing is done)
|
static SyncConfig |
newConfig(String name,
String providerId,
IRemoteConnection conn,
String location) |
static SyncConfig |
newConfig(String name,
String providerId,
String remoteServicesId,
String connName,
String location) |
static void |
removeConfig(IProject project,
SyncConfig config)
Remove the sync configuration from the project.
|
static void |
removeSyncConfigListener(String natureId,
ISyncConfigListener listener)
Remove the listener for sync config events
|
static void |
saveConfigs(IProject project)
Save the current configurations for the project.
|
static void |
setActive(IProject project,
SyncConfig config)
Set the active sync configuration for the project.
|
static void |
updateConfigs(IProject project,
SyncConfig[] addedConfigs,
SyncConfig[] removedConfigs)
Batch update configurations for the project
|
public static void addConfig(IProject project, SyncConfig config)
project
- projectconfig
- sync configuration to add to the projectpublic static void addSyncConfigListener(String natureId, ISyncConfigListener listener)
natureId
- project nature ID of projects to notify of changeslistener
- listener to receive eventspublic static SyncConfig getActive(IProject project)
project
- public static URI getActiveSyncLocationURI(IResource resource) throws CoreException
resource
- target resource - cannot be nullCoreException
public static SyncConfig getConfig(IProject project, String name)
project
- project containing configurationname
- name of configurationpublic static SyncConfig[] getConfigs(IProject project)
project
- public static SyncConfig getLocalConfig(ISynchronizeService syncService) throws CoreException
isLocal(SyncConfig)
.CoreException
- on problems retrieving local service elementspublic static URI getSyncLocationURI(SyncConfig config, IResource resource) throws CoreException
config
- sync configurationresource
- target resourceCoreException
public static boolean isActive(IProject project, SyncConfig config)
project
- config
- public static boolean isLocal(SyncConfig config)
#getLocalConfig()
.config
- public static boolean isRemote(SyncConfig config)
config
- public static SyncConfig newConfig(String name, String providerId, IRemoteConnection conn, String location)
name
- providerId
- conn
- location
- public static SyncConfig newConfig(String name, String providerId, String remoteServicesId, String connName, String location)
name
- providerId
- remoteServicesId
- connName
- location
- public static void removeConfig(IProject project, SyncConfig config)
setActive(IProject, SyncConfig)
if necessary.
Clients will not be allowed to remove all configurations from the project. There must always be at least one configuration
for each project.project
- projectconfig
- configuration to removepublic static void removeSyncConfigListener(String natureId, ISyncConfigListener listener)
natureId
- listener
- public static void saveConfigs(IProject project) throws CoreException
project
- CoreException
public static void setActive(IProject project, SyncConfig config)
project
- config
- public static void updateConfigs(IProject project, SyncConfig[] addedConfigs, SyncConfig[] removedConfigs)
project
- project to updateaddedConfigs
- configs to be addedremovedConfigs
- configs to be removedCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.