use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.
the class CompareRemoteResourcesAction method isEnabled.
/*
* @see TeamAction#isEnabled()
*/
protected boolean isEnabled() {
ISVNRemoteResource[] resources = getSelectedRemoteResources();
boolean enabled = (resources.length == 2) && (resources[0].isContainer() == resources[1].isContainer());
if (!enabled) {
Object[] selectedObjects = selection.toArray();
if (selectedObjects.length == 2 && selectedObjects[0] instanceof ILogEntry && selectedObjects[1] instanceof ILogEntry) {
ILogEntry logEntry1 = (ILogEntry) selectedObjects[0];
ILogEntry logEntry2 = (ILogEntry) selectedObjects[1];
if (logEntry1.getResource() != null && logEntry1.getResource().isFolder() && logEntry2.getResource() != null && logEntry2.getResource().isFolder())
enabled = true;
}
}
return enabled;
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.
the class CopyRemoteResourceAction method execute.
/*
* (non-Javadoc)
*
* @see org.tigris.subversion.subclipse.ui.actions.SVNAction#execute(org.eclipse.jface.action.IAction)
*/
protected void execute(IAction action) {
ISVNRemoteResource[] remoteResources = getSelectedRemoteResources();
Clipboard clipboard = new Clipboard(getShell().getDisplay());
clipboard.setContents(new Object[] { remoteResources[0] }, new Transfer[] { RemoteResourceTransfer.getInstance() });
clipboard.dispose();
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.
the class CopyUrlToClipboardAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
Clipboard clipboard = new Clipboard(Display.getCurrent());
Transfer transfer = TextTransfer.getInstance();
ISVNRemoteResource[] selectedResources = getSelectedRemoteResources();
clipboard.setContents(new String[] { selectedResources[0].getUrl().toString() }, new Transfer[] { transfer });
clipboard.dispose();
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.
the class PasteRemoteResourceAction method execute.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.ui.actions.SVNAction#execute(org.eclipse.jface.action.IAction)
*/
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
Clipboard clipboard = new Clipboard(getShell().getDisplay());
final ISVNRemoteResource resource = (ISVNRemoteResource) clipboard.getContents(RemoteResourceTransfer.getInstance());
clipboard.dispose();
RepositoryManager manager = SVNUIPlugin.getPlugin().getRepositoryManager();
final String message = manager.promptForComment(getShell(), new IResource[] {});
// canceled
if (message == null)
return;
ISVNRemoteResource selectedResource = getSelectedRemoteResources()[0];
final ISVNRemoteFolder destination = (selectedResource.isFolder() ? (ISVNRemoteFolder) selectedResource : selectedResource.getParent());
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().copyRemoteResource(resource, destination, message, monitor);
} catch (TeamException e) {
throw new InvocationTargetException(e);
}
}
}, true, /* cancelable */
PROGRESS_BUSYCURSOR);
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.
the class RepositoryBranchTagAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
ISVNRemoteResource[] resources = getSelectedRemoteResources();
BranchTagWizard wizard = new BranchTagWizard(resources);
WizardDialog dialog = // $NON-NLS-1$
new SizePersistedWizardDialog(getShell(), wizard, "BranchTag");
if (dialog.open() == WizardDialog.OK) {
SVNUrl[] sourceUrls = wizard.getUrls();
SVNUrl destinationUrl = wizard.getToUrl();
String message = wizard.getComment();
SVNRevision revision = wizard.getRevision();
boolean makeParents = wizard.isMakeParents();
ISVNClientAdapter client = null;
try {
ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(sourceUrls[0].toString());
if (repository != null)
client = repository.getSVNClient();
if (client == null)
client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
RepositoryBranchTagOperation branchTagOperation = new RepositoryBranchTagOperation(getTargetPart(), client, sourceUrls, destinationUrl, revision, message, makeParents);
branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
branchTagOperation.run();
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), e.getMessage());
} finally {
// BranchTagCommand will dispose.
// SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
}
}
Aggregations