use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class RepositoryManager method startup.
/**
* called when plugin is started
*/
public void startup() {
commentsManager.loadCommentHistory();
commentsManager.loadCommentTemplates();
keyFilesManager.loadKeyFileHistory();
// we listen to changes to repository so that we can advise concerned views
SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().addRepositoryListener(new ISVNListener() {
public void repositoryAdded(ISVNRepositoryLocation root) {
rootAdded(root);
}
public void repositoryRemoved(ISVNRepositoryLocation root) {
rootRemoved(root);
}
public void remoteResourceDeleted(ISVNRemoteResource resource) {
resourceDeleted(resource);
}
public void remoteResourceCreated(ISVNRemoteFolder parent, String resourceName) {
resourceCreated(parent, resourceName);
}
public void remoteResourceCopied(ISVNRemoteResource source, ISVNRemoteFolder destination) {
resourceCopied(source, destination);
}
public void remoteResourceMoved(ISVNRemoteResource resource, ISVNRemoteFolder destinationFolder, String destinationResourceName) {
resourceMoved(resource, destinationFolder, destinationResourceName);
}
public void repositoryModified(ISVNRepositoryLocation root) {
rootModified(root);
}
});
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class SVNRepositoryRootElement method internalGetChildren.
public Object[] internalGetChildren(Object o, IProgressMonitor monitor) {
ISVNRepositoryLocation location = null;
if (o instanceof ISVNRepositoryLocation) {
location = (ISVNRepositoryLocation) o;
}
if (location == null)
return null;
Object[] result = null;
try {
result = location.members(monitor);
} catch (Exception e) {
}
return result;
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class SVNRepositoryRootElement method fetchDeferredChildren.
public void fetchDeferredChildren(Object o, IElementCollector collector, IProgressMonitor monitor) {
// If it's not a folder, return an empty array
if (!(o instanceof ISVNRepositoryLocation)) {
collector.add(new Object[0], monitor);
}
try {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(Policy.bind("RemoteFolderElement_fetchingRemoteMembers.message", getLabel(o)), // $NON-NLS-1$
100);
FetchMembersOperation operation = new FetchMembersOperation(null, ((ISVNRepositoryLocation) o).getRootFolder(), collector);
operation.run(Policy.subMonitorFor(monitor, 100));
} catch (InvocationTargetException e) {
SVNUIPlugin.openError(null, null, null, e);
} catch (InterruptedException e) {
// Cancelled by the user;
} finally {
monitor.done();
}
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class ExportOperation method execute.
protected void execute(SVNTeamProvider provider, IResource[] resources, IProgressMonitor monitor) throws SVNException, InterruptedException {
ISVNClientAdapter client = null;
ISVNRepositoryLocation repository = null;
try {
for (int i = 0; i < resources.length; i++) {
if (client == null) {
repository = SVNWorkspaceRoot.getSVNResourceFor(resources[i]).getRepository();
client = repository.getSVNClient();
}
File srcPath = new File(resources[i].getLocation().toString());
File destPath = new File(directory + File.separator + resources[i].getName());
try {
client.doExport(srcPath, destPath, true);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
}
}
} catch (SVNException e) {
if (e.operationInterrupted()) {
showCancelledMessage();
} else {
collectStatus(e.getStatus());
}
} finally {
if (repository != null) {
repository.returnSVNClient(client);
}
monitor.done();
}
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class SvnWizardNewRepositoryPage method performFinish.
public boolean performFinish() {
success = true;
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
ISVNClientAdapter svnClient = null;
try {
SVNProviderPlugin provider = SVNProviderPlugin.getPlugin();
String url = getUrl();
if (provider.getRepositories().isKnownRepository(url, true)) {
MessageDialog.openError(getShell(), Policy.bind("NewRepositoryDialog.title"), // $NON-NLS-1$
Policy.bind("NewRepositoryDialog.alreadyExists"));
success = false;
return;
}
svnClient = SVNProviderPlugin.getPlugin().getSVNClient();
File path = new File(folderText.getText().trim());
if (!path.exists())
path.mkdirs();
svnClient.createRepository(path, ISVNClientAdapter.REPOSITORY_FSTYPE_FSFS);
if (connectionButton.getSelection()) {
Properties properties = new Properties();
// $NON-NLS-1$
properties.setProperty("url", url);
ISVNRepositoryLocation repository = provider.getRepositories().createRepository(properties);
provider.getRepositories().addOrUpdateRepository(repository);
}
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("NewRepositoryDialog.title"), // $NON-NLS-1$
e.getLocalizedMessage());
success = false;
} finally {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClient);
}
}
});
return success;
}
Aggregations