项目:subclipse
文件:SVNMoveDeleteHook.java
public boolean deleteFolder(IResourceTree tree,IFolder folder,int updateFlags,IProgressMonitor monitor) {
if (SVNWorkspaceRoot.isLinkedResource(folder))
return false;
ISVNLocalFolder resource = new LocalFolder(folder);
try {
if (!resource.isManaged()) {
return false;
}
monitor.beginTask(null,1000);
deleteResource(resource);
tree.deletedFolder(folder);
} catch (SVNException e) {
tree.Failed(e.getStatus());
} finally {
monitor.done();
}
return true;
}
public boolean deleteFolder(IResourceTree tree,1000);
deleteResource(resource);
tree.deletedFolder(folder);
} catch (SVNException e) {
tree.Failed(e.getStatus());
} finally {
monitor.done();
}
return true;
}
项目:subclipse
文件:SVNMoveDeleteHook.java
public boolean deleteFile(IResourceTree tree,IFile file,IProgressMonitor monitor) {
if (SVNWorkspaceRoot.isLinkedResource(file))
return false;
ISVNLocalFile resource = new LocalFile(file);
try {
if (!resource.isManaged()) {
return false;
}
if (getDeferFileDelete(file))
return false;
monitor.beginTask(null,1000);
deletedFiles.add(file);
deleteResource(resource);
tree.deletedFile(file);
} catch (SVNException e) {
tree.Failed(e.getStatus());
} finally {
monitor.done();
}
return true;
}
项目:subclipse
文件:SVNMoveDeleteHook.java
public boolean deleteProject(IResourceTree tree,IProject project,IProgressMonitor monitor) {
ISVNLocalFolder resource = new LocalFolder(project);
try {
// If contents are not being deleted,let Eclipse handle.
if ((updateFlags & IResource.NEVER_DELETE_PROJECT_CONTENT) == IResource.NEVER_DELETE_PROJECT_CONTENT) {
return false;
}
// If not managed,let Eclipse handle.
if (!resource.isManaged())
return false;
File projectDirectory = new File(project.getLocationURI());
// If Meta directory does not exist,let Eclipse handle.
File MetaFolder = new File(projectDirectory,".svn"); //$NON-NLS-1$
if (!MetaFolder.exists()) {
return false;
}
// If database file does not exist,let Eclipse handle.
File databaseFile = new File(MetaFolder,"wc.db"); //$NON-NLS-1$
if (!databaseFile.exists()) {
return false;
}
// If we can delete database file,let Eclipse handle project deletion.
if (databaseFile.delete()) {
return false;
}
// Show message dialog in UI thread and cancel deletion.
SVNProviderPlugin.handleMessage(Policy.bind("SVNMoveDeleteHook.4"),Policy.bind("SVNMoveDeleteHook.5") + project.getName() + Policy.bind("SVNMoveDeleteHook.6"),IMessageHandler.ERROR); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return true;
} catch (Exception e) {
// Let Eclipse try to handle it.
return false;
}
}
public boolean deleteFile(IResourceTree tree,1000);
deletedFiles.add(file);
deleteResource(resource);
tree.deletedFile(file);
} catch (SVNException e) {
tree.Failed(e.getStatus());
} finally {
monitor.done();
}
return true;
}
public boolean deleteProject(IResourceTree tree,IMessageHandler.ERROR); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return true;
} catch (Exception e) {
// Let Eclipse try to handle it.
return false;
}
}
项目:team-explorer-everywhere
文件:TFSMoveDeleteHook.java
@Override
public boolean deleteFile(
final IResourceTree tree,final IFile file,final int updateFlags,final IProgressMonitor progressMonitor) {
log.trace("deleteFile: " + file.getFullPath()); //$NON-NLS-1$
progressMonitor.beginTask(
messageformat.format(Messages.getString("TFSMoveDeleteHook.DeletingPathFormat"),file.getFullPath()),//$NON-NLS-1$
30);
try {
/* Do the common pre-deletion resource inspection */
final ResourceinspectionResult inspectionResult = inspectResource(
tree,file,true,DELETE_DENIED_CHANGE_TYPES,updateFlags,false,new SubProgressMonitor(progressMonitor,5));
/*
* Defer to the platform,returning false meaning we do not do any
* work.
*/
if (inspectionResult.getStatus().equals(ResourceinspectionStatus.DEFER)) {
return false;
}
if (repositoryProvider.getRepositoryStatus() == ProjectRepositoryStatus.CONNECTING) {
throw new RuntimeException(
Messages.getString("TFSMoveDeleteHook.ConnectionInProgressWaitBeforeDeleting")); //$NON-NLS-1$
}
log.info(messageformat.format("Deletion detected for file {0}",file)); //$NON-NLS-1$
final TFSRepository repository = inspectionResult.getRepository();
final PendingChange[] pendingChanges = inspectionResult.getPendingChanges();
final IStatus deleteStatus =
deleteFile(file,repository,pendingChanges,10));
if (!deleteStatus.isOK()) {
throw new RuntimeException(deleteStatus.getMessage());
}
tree.standardDeleteFile(file,5));
return true;
} finally {
progressMonitor.done();
}
}
项目:team-explorer-everywhere
文件:TFSMoveDeleteHook.java
@Override
public boolean moveProject(
final IResourceTree tree,final IProject source,final IProjectDescription target,final IProgressMonitor progressMonitor) {
log.trace(messageformat.format("moveProject: {0}",source.getFullPath())); //$NON-NLS-1$
progressMonitor.beginTask(
messageformat.format(Messages.getString("TFSMoveDeleteHook.MovingProjectFormat"),source.getFullPath()),//$NON-NLS-1$
10);
log.info(messageformat.format("Rename detected from project {0} to {1}",source,target)); //$NON-NLS-1$
try {
/*
* Renaming the project only. Does not move folders,only sets the
* new name in the .project file.
*/
if (target.getName() != source.getName()) {
target.setLocation(source.getLocation());
tree.standardMoveProject(source,target,10));
return true;
} else {
/*
* User is attempting to relocate the project. This gets hairy
* and would involve changing WF mappings in order to pend a
* rename.
*/
tree.Failed(
new Status(
IStatus.ERROR,TFSEclipseClientPlugin.PLUGIN_ID,messageformat.format(
Messages.getString("TFSMoveDeleteHook.MovingProjectNotSupportedInProductFormat"),//$NON-NLS-1$
Productinformation.getCurrent().toString()),null));
return true;
}
} finally {
progressMonitor.done();
}
}
项目:subclipse
文件:SVNMoveDeleteHook.java
public boolean moveProject(IResourceTree tree,IProject source,IProjectDescription description,IProgressMonitor monitor) {
return false;
}
public boolean moveProject(IResourceTree tree,IProgressMonitor monitor) {
return false;
}