use of org.eclipse.team.core.synchronize.FastSyncInfoFilter in project subclipse by subclipse.
the class EditConflictsSynchronizeAction method getSyncInfoFilter.
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
public boolean select(SyncInfo info) {
IStructuredSelection selection = getStructuredSelection();
if (selection.size() != 1)
return false;
ISynchronizeModelElement element = (ISynchronizeModelElement) selection.getFirstElement();
IResource resource = element.getResource();
if (resource == null)
return false;
if (!(resource instanceof IFile))
return false;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
return svnResource.getStatus().isTextConflicted();
} catch (SVNException e) {
return false;
}
}
};
}
use of org.eclipse.team.core.synchronize.FastSyncInfoFilter in project subclipse by subclipse.
the class ShowHistorySynchronizeAction method getSyncInfoFilter.
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
public boolean select(SyncInfo info) {
IStructuredSelection selection = getStructuredSelection();
if (selection.size() != 1)
return false;
ISynchronizeModelElement element = (ISynchronizeModelElement) selection.getFirstElement();
IResource resource = element.getResource();
if (resource == null)
return false;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
return !resource.exists() || (svnResource.getStatus().isManaged() && !svnResource.getStatus().isAdded());
} catch (SVNException e) {
return false;
}
}
};
}
use of org.eclipse.team.core.synchronize.FastSyncInfoFilter in project subclipse by subclipse.
the class MarkMergedSynchronizeAction method getSyncInfoFilter.
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
public boolean select(SyncInfo info) {
SyncInfoDirectionFilter filter = new SyncInfoDirectionFilter(new int[] { SyncInfo.CONFLICTING });
if (!filter.select(info))
return false;
IStructuredSelection selection = getStructuredSelection();
Iterator iter = selection.iterator();
while (iter.hasNext()) {
ISynchronizeModelElement element = (ISynchronizeModelElement) iter.next();
IResource resource = element.getResource();
if (resource == null || !resource.exists())
return false;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
if (!svnResource.isManaged() || svnResource.isAdded())
return false;
} catch (SVNException e) {
return false;
}
}
return true;
}
};
}
use of org.eclipse.team.core.synchronize.FastSyncInfoFilter in project subclipse by subclipse.
the class ResolveSynchronizeAction method getSyncInfoFilter.
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
public boolean select(SyncInfo info) {
IStructuredSelection selection = getStructuredSelection();
Iterator iter = selection.iterator();
while (iter.hasNext()) {
ISynchronizeModelElement element = (ISynchronizeModelElement) iter.next();
if (element.getResource() instanceof IFile) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(element.getResource());
try {
if (svnResource.getStatus().isTextConflicted() || svnResource.getStatus().hasTreeConflict())
return true;
} catch (SVNException e) {
}
}
}
return false;
}
};
}
use of org.eclipse.team.core.synchronize.FastSyncInfoFilter in project subclipse by subclipse.
the class ShowPropertiesSynchronizeAction method getSyncInfoFilter.
protected FastSyncInfoFilter getSyncInfoFilter() {
return new FastSyncInfoFilter() {
public boolean select(SyncInfo info) {
SyncInfoDirectionFilter outgoingFilter = new SyncInfoDirectionFilter(new int[] { SyncInfo.OUTGOING });
if (!outgoingFilter.select(info))
return false;
IStructuredSelection selection = getStructuredSelection();
if (selection.size() != 1)
return false;
ISynchronizeModelElement element = (ISynchronizeModelElement) selection.getFirstElement();
IResource resource = element.getResource();
if (resource == null)
return false;
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
try {
return !svnResource.getStatus().isDeleted() && svnResource.getStatus().isManaged() && resource.exists();
} catch (SVNException e) {
return false;
}
}
};
}
Aggregations