本文整理汇总了Java中org.eclipse.team.core.TeamException类的典型用法代码示例。如果您正苦于以下问题:Java TeamException类的具体用法?Java TeamException怎么用?Java TeamException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TeamException类属于org.eclipse.team.core包,在下文中一共展示了TeamException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:22,代码来源:TFSRepositoryProviderType.java
示例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;
}
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:24,代码来源:RemoteSyncInfoFilter.java
示例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;
}
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:33,代码来源:SynchronizeSubscriber.java
示例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;
}
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:MergeViewResolveAction.java
示例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);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:BaseFile.java
示例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);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:RemoteResource.java
示例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();
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:DirectorySelectionPage.java
示例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);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:BaseResource.java
示例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) {
}
}
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:UpdateSynchronizeOperation.java
示例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;
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:SVNWorkspaceSubscriber.java
示例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$
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SVNTeamProviderType.java
示例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);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:30,代码来源:SVNProjectSetCapability.java
示例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();
}
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:CommentTemplatesPreferencePage.java
示例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();
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:34,代码来源:SVNProjectSetCapability.java
示例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;
}
开发者ID:subclipse,项目名称:subclipse,代码行数:26,代码来源:SVNPristineCopyQuickDiffProvider.java
示例16: getPropertyStatus
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
public static String getPropertyStatus(IResource resource) {
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
String result = null;
try {
LocalResourceStatus status = svnResource.getStatus();
if (status.isPropConflicted())
result = Policy.bind("CommitDialog.conflicted"); //$NON-NLS-1$
else if ((svnResource.getStatus() != null) &&
(svnResource.getStatus().getPropStatus() != null) &&
(svnResource.getStatus().getPropStatus().equals(SVNStatusKind.MODIFIED)))
result = Policy.bind("CommitDialog.modified"); //$NON-NLS-1$
else
result = ""; //$NON-NLS-1$
} catch (TeamException e) {
result = ""; //$NON-NLS-1$
}
return result;
}
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:ResourceWithStatusUtil.java
示例17: initializeSelection
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
private void initializeSelection() {
String lastParent = null;
try {
lastParent = settings.get(LAST_PARENT + repositoryLocationProvider.getLocation().getLocation());
if (lastParent != null && lastParent.length() > 0) {
useSpecifiedNameButton.setSelection(true);
useProjectNameButton.setSelection(false);
text.setEnabled(true);
text.setFocus();
browseButton.setEnabled(true);
text.setText(lastParent + "/" + repositoryLocationProvider.getProject().getName());
text.setSelection(text.getText().indexOf(repositoryLocationProvider.getProject().getName()), text.getText().length());
}
} catch (TeamException e1) {}
if (lastParent == null) {
useSpecifiedNameButton.setSelection(false);
text.setText("");
text.setEnabled(false);
browseButton.setEnabled(false);
useProjectNameButton.setSelection(true);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:DirectorySelectionPage.java
示例18: add
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Add the given resources to their associated providers.
* This schedules the resources for addition; they still need to be committed.
*/
public void add(IResource[] resources, IProgressMonitor monitor) throws TeamException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
Map table = getProviderMapping(resources);
// some of the resources are not associated with shared projects
if (table.get(null) != null) {
throw new SVNException(Policy.bind("RepositoryManager.addErrorNotAssociated")); //$NON-NLS-1$
}
// iterate through the svn providers
Set keySet = table.keySet();
monitor.beginTask("", keySet.size() * 1000); //$NON-NLS-1$
monitor.setTaskName(Policy.bind("RepositoryManager.adding")); //$NON-NLS-1$
Iterator iterator = keySet.iterator();
while (iterator.hasNext()) {
IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
SVNTeamProvider provider = (SVNTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
provider.add(providerResources, IResource.DEPTH_ZERO, subMonitor);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:30,代码来源:RepositoryManager.java
示例19: commit
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
/**
* Commit the given resources to their associated providers.
*
* @param resources the resources to commit
* @param monitor the progress monitor
*/
public void commit(IResource[] resources, String comment, boolean keepLocks, IProgressMonitor monitor) throws TeamException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
Map table = getProviderMapping(resources);
Set keySet = table.keySet();
monitor.beginTask("", keySet.size() * 1000); //$NON-NLS-1$
monitor.setTaskName(Policy.bind("RepositoryManager.committing")); //$NON-NLS-1$
Iterator iterator = keySet.iterator();
while (iterator.hasNext()) {
IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
SVNTeamProvider provider = (SVNTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
provider.checkin(providerResources, comment, keepLocks, IResource.DEPTH_INFINITE, subMonitor);
}
}
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:RepositoryManager.java
示例20: isEnabled
import org.eclipse.team.core.TeamException; //导入依赖的package包/类
protected boolean isEnabled() throws TeamException {
Object[] selectedObjects = selection.toArray();
if (selectedObjects.length == 0 || selectedObjects.length > 2) return false;
ISVNResource svnResource1 = null;
ISVNResource svnResource2 = null;
if (selectedObjects[0] instanceof ISVNResource) svnResource1 = (ISVNResource)selectedObjects[0];
else {
if (selectedObjects[0] instanceof ILogEntry)
svnResource1 = ((ILogEntry)selectedObjects[0]).getResource();
}
if (svnResource1 == null) return false;
if (selectedObjects.length > 1) {
if (selectedObjects[1] instanceof ISVNResource) svnResource2 = (ISVNResource)selectedObjects[1];
else {
if (selectedObjects[1] instanceof ILogEntry)
svnResource2 = ((ILogEntry)selectedObjects[1]).getResource();
}
if (!svnResource1.getRepository().getRepositoryRoot().toString().equals(svnResource2.getRepository().getRepositoryRoot().toString())) return false;
return (svnResource1.isFolder() == svnResource2.isFolder());
}
return true;
}
开发者ID:subclipse,项目名称:subclipse,代码行数:23,代码来源:ShowDifferencesAsUnifiedDiffAction.java
注:本文中的org.eclipse.team.core.TeamException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论