diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java deleted file mode 100644 index b2a3f884b..000000000 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSourceResourceAdapter.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.team.internal.ccvs.ui.tags; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.team.internal.ccvs.core.*; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * A workbench adapter that can be used to view the resources that make up - * a tag source. It is used by the TagConfigurationDialog. - */ -public class TagSourceResourceAdapter implements IAdaptable, IWorkbenchAdapter { - - public static Object getViewerInput(TagSource tagSource) { - return new TagSourceResourceAdapter(tagSource); - } - - TagSource tagSource; - - private TagSourceResourceAdapter(TagSource tagSource) { - this.tagSource = tagSource; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object) - */ - public Object[] getChildren(Object o) { - ICVSResource[] children = tagSource.getCVSResources(); - if (children.length == 0) return new Object[0]; - List result = new ArrayList(); - for (int i = 0; i < children.length; i++) { - ICVSResource resource = children[i]; - if (resource.isFolder()) { - result.add(new CVSFolderElement((ICVSFolder)resource, false)); - } else { - result.add(new CVSFileElement((ICVSFile)resource)); - } - } - return result.toArray(new Object[result.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object) - */ - public ImageDescriptor getImageDescriptor(Object object) { - // No imgae descriptor - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object) - */ - public String getLabel(Object o) { - return tagSource.getShortDescription(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object) - */ - public Object getParent(Object o) { - // No parent - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter == IWorkbenchAdapter.class) { - return this; - } - return null; - } - -} |