use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class BranchTagAction method isEnabledForMultipleResources.
/*
* (non-Javadoc)
* @see org.tigris.subversion.subclipse.ui.actions.WorkspaceAction#isEnabledForMultipleResources()
*/
protected boolean isEnabledForMultipleResources() {
try {
// Must all be from same repository.
ISVNRepositoryLocation repository = null;
IResource[] selectedResources = getSelectedResources();
for (int i = 0; i < selectedResources.length; i++) {
ISVNRepositoryLocation compareToRepository = null;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(selectedResources[i]);
if (svnResource == null || !svnResource.isManaged()) {
return false;
}
LocalResourceStatus status = svnResource.getStatusFromCache();
if (status != null) {
compareToRepository = status.getRepository();
}
if (compareToRepository == null) {
return false;
}
if (repository != null && !compareToRepository.equals(repository)) {
return false;
}
repository = compareToRepository;
}
return true;
} catch (Exception e) {
return false;
}
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class SwitchAction method isEnabledForMultipleResources.
/*
* (non-Javadoc)
* @see org.tigris.subversion.subclipse.ui.actions.WorkspaceAction#isEnabledForMultipleResources()
*/
protected boolean isEnabledForMultipleResources() {
try {
// Must all be from same repository.
ISVNRepositoryLocation repository = null;
IResource[] selectedResources = getSelectedResources();
for (int i = 0; i < selectedResources.length; i++) {
ISVNRepositoryLocation compareToRepository = null;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(selectedResources[i]);
if (svnResource == null || !svnResource.isManaged()) {
return false;
}
LocalResourceStatus status = svnResource.getStatusFromCache();
if (status != null) {
compareToRepository = status.getRepository();
}
if (compareToRepository == null) {
return false;
}
if (repository != null && !compareToRepository.equals(repository)) {
return false;
}
repository = compareToRepository;
}
return true;
} catch (Exception e) {
return false;
}
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class SVNRepositoryPropertiesPage method initialize.
/**
* Initializes the page
*/
private void initialize() {
location = null;
IAdaptable element = getElement();
if (element instanceof ISVNRepositoryLocation) {
location = (ISVNRepositoryLocation) element;
} else {
Object adapter = element.getAdapter(ISVNRepositoryLocation.class);
if (adapter instanceof ISVNRepositoryLocation) {
location = (ISVNRepositoryLocation) adapter;
}
}
showCredentials = SVNProviderPlugin.getPlugin().getSVNClientManager().getSvnClientInterface().equals(COMMANDLINE_CLIENT);
if (!showCredentials) {
if (location.getUsername() != null && !location.getUsername().trim().equals(""))
showCredentials = true;
}
}
use of org.tigris.subversion.subclipse.core.ISVNRepositoryLocation in project subclipse by subclipse.
the class RemoveOperation method execute.
protected void execute(IProgressMonitor monitor) throws SVNException, InterruptedException {
ISVNClientAdapter client = null;
ISVNRepositoryLocation repository = null;
ArrayList files = new ArrayList();
for (int i = 0; i < resources.length; i++) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
if (client == null) {
repository = svnResource.getRepository();
client = repository.getSVNClient();
}
files.add(svnResource.getFile());
}
File[] fileArray = new File[files.size()];
files.toArray(fileArray);
try {
client.remove(fileArray, true);
refresh();
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
if (repository != null) {
repository.returnSVNClient(client);
}
monitor.done();
}
}
Aggregations