本文整理汇总了Java中org.eclipse.team.core.TeamException类的典型用法代码示例。如果您正苦于以下问题:Java TeamException类的具体用法?Java TeamException怎么用?Java TeamException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TeamException类属于org.eclipse.team.core包,在下文中一共展示了TeamException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asReference
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
@Override
public String[] asReference(
final IProject[] providerProjects,
final ProjectSetSerializationContext context,
final IProgressMonitor monitor) throws TeamException {
final String[] references = new String[providerProjects.length];
for (int i = 0; i < providerProjects.length; i++) {
final IProject project = providerProjects[i];
/* MULTIPLE REPOSITORIES TODO */
final Workspace repositoryWorkspace =
TFSEclipseClientPlugin.getDefault().getRepositoryManager().getDefaultRepository().getWorkspace();
final String serverPath = repositoryWorkspace.getMappedServerPath(project.getLocation().toOSString());
final String serverUrl = repositoryWorkspace.getClient().getConnection().getBaseURI().toString();
references[i] = serverUrl + SEPARATOR + serverPath;
}
return references;
}
示例2: filter
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
@Override
public ResourceFilterResult filter(final IResource resource, final int flags) {
SyncInfo syncInfo;
try {
syncInfo = SynchronizeSubscriber.getInstance().getSyncInfo(resource);
} catch (final TeamException e) {
log.warn(MessageFormat.format("Could not determine synchronization info for {0}", resource), e); //$NON-NLS-1$
return ResourceFilterResult.REJECT;
}
/*
* Resource does not exist in the synchronization tree.
*/
if (syncInfo != null && syncInfo instanceof SynchronizeInfo) {
/* If there's a remote operation, allow this to proceed. */
if (((SynchronizeInfo) syncInfo).getRemoteOperation() != null) {
return ResourceFilterResult.ACCEPT;
}
}
return ResourceFilterResult.REJECT;
}
示例3: isSupervised
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Determine if a particular resource is managed by TFS, and thus eligable
* for synchronization through this interface.
*
* Note that all IResources passed must be in an IProject which is managed
* by TFS.
*
* This method returns <code>true</code> even for ignored resources. If they
* are pending changes, they should show as outgoing changes. If they are
* incoming changes, the ignored items list will not prevent them from being
* retrieved on a recursive get latest.
*
* @see org.eclipse.team.core.subscribers.Subscriber#isSupervised(org.eclipse.core.resources.IResource)
*/
@Override
public boolean isSupervised(final IResource resource) throws TeamException {
blockForConnection();
// make sure we're the repository provider for this project
if (TeamUtils.isConfiguredWith(resource.getProject(), TFSRepositoryProvider.PROVIDER_ID) == false) {
return false;
}
/*
* Return true for all other kinds. Projects are inherently managed
* (otherwise synchronize isn't very useful). Linked, team ignored,
* .tpignore, and team private resources will have been filtered from
* becoming pending changes before synchronize runs and we don't want to
* hide them if they're inbound (get latest will not ignore them).
*/
return true;
}
示例4: isEnabled
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected boolean isEnabled() throws TeamException {
boolean enabled = super.isEnabled();
if (enabled) {
Iterator iter = fSelection.iterator();
while (iter.hasNext()) {
Object selectedObject = iter.next();
if (selectedObject instanceof MergeResult) {
MergeResult mergeResult = (MergeResult)selectedObject;
if (mergeResult.isResolved() && mergeResult.isPropertyResolved() && mergeResult.isTreeConflictResolved()) {
enabled = false;
break;
}
}
}
}
return enabled;
}
示例5: getAnnotations
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public ISVNAnnotations getAnnotations(SVNRevision fromRevision,
SVNRevision toRevision, boolean includeMergedRevisions, boolean ignoreMimeType) throws TeamException {
ISVNClientAdapter svnClient = getRepository().getSVNClient();
try {
SVNRevision pegRevision = null;
ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (localResource != null) {
pegRevision = localResource.getRevision();
}
return svnClient.annotate(
localResourceStatus.getFile(), fromRevision, toRevision, pegRevision, ignoreMimeType, includeMergedRevisions);
} catch (SVNClientException e) {
throw new TeamException("Failed in BaseFile.getAnnotations()", e);
}
finally {
getRepository().returnSVNClient(svnClient);
}
}
示例6: getLogMessages
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public ISVNLogMessage[] getLogMessages(SVNRevision pegRevision,
SVNRevision revisionStart, SVNRevision revisionEnd,
boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions)
throws TeamException {
ISVNClientAdapter svnClient = repository.getSVNClient();
try {
return svnClient.getLogMessages(getUrl(),
pegRevision, revisionStart, revisionEnd, stopOnCopy, fetchChangePath,
limit, includeMergedRevisions);
} catch (SVNClientException e) {
throw new TeamException("Failed in RemoteResource.getLogMessages()",
e);
}
finally {
repository.returnSVNClient(svnClient);
}
}
示例7: setVisible
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
if (useSpecifiedNameButton.getSelection()) {
useSpecifiedNameButton.setFocus();
}
else {
useProjectNameButton.setFocus();
}
try {
String location = repositoryLocationProvider.getLocation().getLocation();
if (lastLocation == null || !lastLocation.equals(location)) {
initializeSelection();
}
lastLocation = location;
} catch (TeamException e) {}
setUrlText();
}
}
示例8: getLogMessages
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public ISVNLogMessage[] getLogMessages(SVNRevision pegRevision,
SVNRevision revisionStart, SVNRevision revisionEnd,
boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions)
throws TeamException {
ISVNClientAdapter svnClient = getRepository().getSVNClient();
try {
return svnClient.getLogMessages(getFile(), pegRevision,
revisionStart, revisionEnd, stopOnCopy, fetchChangePath,
limit, includeMergedRevisions);
} catch (SVNClientException e) {
throw new TeamException("Failed in BaseResource.getLogMessages()",
e);
}
finally {
getRepository().returnSVNClient(svnClient);
}
}
示例9: run
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
IResource[] resourceArray = extractResources(resources, set);
Map<ISVNRepositoryLocation, List<IResource>> items = groupByRepository(resourceArray, set);
Set<ISVNRepositoryLocation> keys = items.keySet();
for (Iterator<ISVNRepositoryLocation> iterator = keys.iterator(); iterator.hasNext();) {
ISVNRepositoryLocation repos = iterator.next();
List<IResource> resourceList = items.get(repos);
resourceArray = new IResource[resourceList.size()];
resourceList.toArray(resourceArray);
SVNRevision revision = getRevisionForUpdate(resourceArray, set);
IResource[] resourcesToUpdate = changeSetSelected ? resourceArray : trimResources(resourceArray);
doUpdate(provider, monitor, resourcesToUpdate, revision);
if (SVNProviderPlugin.getPlugin().getPluginPreferences().getBoolean(
ISVNCoreConstants.PREF_SHOW_OUT_OF_DATE_FOLDERS) && resourcesToUpdate.length != resourceArray.length) {
try {
SVNWorkspaceSubscriber.getInstance().refresh(resourceArray, IResource.DEPTH_INFINITE, monitor);
} catch (TeamException e) {
}
}
}
}
示例10: isSupervised
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public boolean isSupervised(IResource resource) throws TeamException {
try {
if (resource.isTeamPrivateMember() || SVNWorkspaceRoot.isLinkedResource(resource)) return false;
RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), SVNProviderPlugin.getTypeId());
if (provider == null) return false;
// TODO: what happens for resources that don't exist?
// TODO: is it proper to use ignored here?
ISVNLocalResource svnThing = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (svnThing.isIgnored()) {
// An ignored resource could have an incoming addition (conflict)
return (remoteSyncStateStore.getBytes(resource) != null) ||
((remoteSyncStateStore.members(resource) != null) && (remoteSyncStateStore.members(resource).length > 0));
}
return true;
} catch (TeamException e) {
// If there is no resource in coe this measn there is no local and no remote
// so the resource is not supervised.
if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND) {
return false;
}
throw e;
}
}
示例11: autoconnectSVNProject
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
private void autoconnectSVNProject(IProject project, IProgressMonitor monitor) {
try {
PeekStatusCommand command = new PeekStatusCommand(project);
try {
command.execute();
} catch (SVNException e1) {
if (e1.getMessage() != null && e1.getMessage().contains(SVNProviderPlugin.UPGRADE_NEEDED)) {
if (!SVNProviderPlugin.handleQuestion("Upgrade Working Copy", project.getName() + " appears to be managed by Subversion, but the working copy needs to be upgraded. Do you want to upgrade the working copy now?\n\nWarning: This operation cannot be undone.")) {
return;
}
}
SVNWorkspaceRoot.upgradeWorkingCopy(project, monitor);
}
SVNWorkspaceRoot.setSharing(project, monitor);
} catch (TeamException e) {
SVNProviderPlugin.log(IStatus.ERROR, "Could not auto-share project " + project.getName(), e); //$NON-NLS-1$
}
}
示例12: addToWorkspace
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Override superclass implementation to load the referenced projects into
* the workspace.
*
* @see org.eclipse.team.core.ProjectSetSerializer#addToWorkspace(java.lang.String[],
* org.eclipse.team.core.ProjectSetSerializationContext,
* org.eclipse.core.runtime.IProgressMonitor)
*/
public IProject[] addToWorkspace(String[] referenceStrings,
ProjectSetSerializationContext context, IProgressMonitor monitor)
throws TeamException {
monitor = Policy.monitorFor(monitor);
Policy.checkCanceled(monitor);
// Confirm the projects to be loaded
Map<IProject, LoadInfo> infoMap = new HashMap<IProject, SVNProjectSetCapability.LoadInfo>(referenceStrings.length);
IProject[] projects = asProjects(context, referenceStrings, infoMap);
projects = confirmOverwrite(context, projects);
if (projects == null) {
return new IProject[0];
}
// Load the projects
try {
return checkout(projects, infoMap, monitor);
} catch (MalformedURLException e) {
throw SVNException.wrapException(e);
}
}
示例13: performOk
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public boolean performOk() {
int numTemplates = viewer.getList().getItemCount();
String[] templates = new String[numTemplates];
for (int i = 0; i < numTemplates; i++) {
templates[i] = (String) viewer.getElementAt(i);
}
try {
SVNUIPlugin.getPlugin().getRepositoryManager().getCommentsManager().replaceAndSaveCommentTemplates(templates);
} catch (TeamException e) {
SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_OTHER_EXCEPTIONS);
}
SVNUIPlugin.getPlugin().getPreferenceStore().setValue(ISVNUIConstants.PREF_COMMENTS_TO_SAVE, getCommentsToSave());
return super.performOk();
}
示例14: importExistingProject
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Imports a existing SVN Project to the workbench
*
* @param monitor
* project monitor
* @return true if loaded, else false
* @throws TeamException
*/
boolean importExistingProject(IProgressMonitor monitor)
throws TeamException {
if (directory == null) {
return false;
}
try {
monitor.beginTask("Importing", 3 * 1000);
createExistingProject(new SubProgressMonitor(monitor, 1000));
monitor.subTask("Refreshing " + project.getName());
RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
monitor.worked(1000);
SVNWorkspaceRoot.setSharing(project, new SubProgressMonitor(
monitor, 1000));
return true;
} catch (CoreException ce) {
throw new SVNException("Failed to import External SVN Project"
+ ce, ce);
} finally {
monitor.done();
}
}
示例15: computeChange
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Determine if the file represented by this quickdiff provider has changed with
* respect to it's remote state. Return true if the remote contents should be
* refreshed, and false if not.
*/
private boolean computeChange(IProgressMonitor monitor) throws TeamException {
boolean needToUpdateReferenceDocument = false;
if(isReferenceInitialized) {
SyncInfo info = getSyncState(getFileFromEditor());
if(info == null && fLastSyncState != null) {
return true;
} else if(info == null) {
return false;
}
if(fLastSyncState == null) {
needToUpdateReferenceDocument = true;
} else if(! fLastSyncState.equals(info)) {
needToUpdateReferenceDocument = true;
}
if(DEBUG) debug(fLastSyncState, info);
fLastSyncState = info;
}
return needToUpdateReferenceDocument;
}