Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java230
1 files changed, 115 insertions, 115 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
index 7e57022af..2aa65df5f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
@@ -25,132 +25,132 @@ import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.progress.IElementCollector;
public class VersionCategory extends CVSModelElement implements IAdaptable,
- IDeferredWorkbenchAdapter {
- private ICVSRepositoryLocation repository;
+ IDeferredWorkbenchAdapter {
+ private ICVSRepositoryLocation repository;
- /**
- * ProjectVersionsCategory constructor.
- */
- public VersionCategory(ICVSRepositoryLocation repo) {
- super();
- this.repository = repo;
- }
+ /**
+ * ProjectVersionsCategory constructor.
+ */
+ public VersionCategory(ICVSRepositoryLocation repo) {
+ super();
+ this.repository = repo;
+ }
- /**
- * Returns an object which is an instance of the given class associated with
- * this object. Returns <code>null</code> if no such object can be found.
- */
- public <T> T getAdapter(Class<T> adapter) {
- if (adapter == IWorkbenchAdapter.class)
- return adapter.cast(this);
- if (adapter == IDeferredWorkbenchAdapter.class)
- return adapter.cast(this);
- return null;
- }
+ /**
+ * Returns an object which is an instance of the given class associated with
+ * this object. Returns <code>null</code> if no such object can be found.
+ */
+ public <T> T getAdapter(Class<T> adapter) {
+ if (adapter == IWorkbenchAdapter.class)
+ return adapter.cast(this);
+ if (adapter == IDeferredWorkbenchAdapter.class)
+ return adapter.cast(this);
+ return null;
+ }
- /**
- * Returns the children of this object. When this object is displayed in a
- * tree, the returned objects will be this element's children. Returns an
- * empty enumeration if this object has no children.
- */
- public Object[] fetchChildren(Object o, IProgressMonitor monitor)
- throws TeamException {
- if (CVSUIPlugin.getPlugin().getRepositoryManager()
- .isDisplayingProjectVersions(repository)) {
- return getProjectVersionChildren(o, monitor);
- } else {
- return getVersionTagChildren(o, monitor);
- }
- }
+ /**
+ * Returns the children of this object. When this object is displayed in a
+ * tree, the returned objects will be this element's children. Returns an
+ * empty enumeration if this object has no children.
+ */
+ public Object[] fetchChildren(Object o, IProgressMonitor monitor)
+ throws TeamException {
+ if (CVSUIPlugin.getPlugin().getRepositoryManager()
+ .isDisplayingProjectVersions(repository)) {
+ return getProjectVersionChildren(o, monitor);
+ } else {
+ return getVersionTagChildren(o, monitor);
+ }
+ }
- /*
- * Return the children as a list of versions whose children are projects
- */
- private Object[] getVersionTagChildren(Object o, IProgressMonitor monitor)
- throws CVSException {
- CVSTag[] tags = CVSUIPlugin.getPlugin().getRepositoryManager()
- .getKnownTags(repository, getWorkingSet(), CVSTag.VERSION, monitor);
- CVSTagElement[] versionElements = new CVSTagElement[tags.length];
- for (int i = 0; i < tags.length; i++) {
- versionElements[i] = new CVSTagElement(tags[i], repository);
- }
- return versionElements;
- }
+ /*
+ * Return the children as a list of versions whose children are projects
+ */
+ private Object[] getVersionTagChildren(Object o, IProgressMonitor monitor)
+ throws CVSException {
+ CVSTag[] tags = CVSUIPlugin.getPlugin().getRepositoryManager()
+ .getKnownTags(repository, getWorkingSet(), CVSTag.VERSION, monitor);
+ CVSTagElement[] versionElements = new CVSTagElement[tags.length];
+ for (int i = 0; i < tags.length; i++) {
+ versionElements[i] = new CVSTagElement(tags[i], repository);
+ }
+ return versionElements;
+ }
- /*
- * Return the children as a list of projects whose children ar project
- * versions
- */
- private Object[] getProjectVersionChildren(Object o,
- IProgressMonitor monitor) throws TeamException {
+ /*
+ * Return the children as a list of projects whose children ar project
+ * versions
+ */
+ private Object[] getProjectVersionChildren(Object o,
+ IProgressMonitor monitor) throws TeamException {
- ICVSRemoteResource[] resources = CVSUIPlugin.getPlugin()
- .getRepositoryManager().getFoldersForTag(repository,
- CVSTag.DEFAULT, monitor);
- if (getWorkingSet() != null)
- resources = CVSUIPlugin.getPlugin().getRepositoryManager()
- .filterResources(getWorkingSet(), resources);
- Object[] modules = new Object[resources.length];
- for (int i = 0; i < resources.length; i++) {
- modules[i] = new RemoteModule((ICVSRemoteFolder) resources[i],
- VersionCategory.this);
- }
- return modules;
- }
+ ICVSRemoteResource[] resources = CVSUIPlugin.getPlugin()
+ .getRepositoryManager().getFoldersForTag(repository,
+ CVSTag.DEFAULT, monitor);
+ if (getWorkingSet() != null)
+ resources = CVSUIPlugin.getPlugin().getRepositoryManager()
+ .filterResources(getWorkingSet(), resources);
+ Object[] modules = new Object[resources.length];
+ for (int i = 0; i < resources.length; i++) {
+ modules[i] = new RemoteModule((ICVSRemoteFolder) resources[i],
+ VersionCategory.this);
+ }
+ return modules;
+ }
- /**
- * Returns an image descriptor to be used for displaying an object in the
- * workbench. Returns null if there is no appropriate image.
- *
- * @param object The object to get an image descriptor for.
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return CVSUIPlugin.getPlugin().getImageDescriptor(
- ICVSUIConstants.IMG_VERSIONS_CATEGORY);
- }
+ /**
+ * Returns an image descriptor to be used for displaying an object in the
+ * workbench. Returns null if there is no appropriate image.
+ *
+ * @param object The object to get an image descriptor for.
+ */
+ public ImageDescriptor getImageDescriptor(Object object) {
+ return CVSUIPlugin.getPlugin().getImageDescriptor(
+ ICVSUIConstants.IMG_VERSIONS_CATEGORY);
+ }
- /**
- * Returns the name of this element. This will typically be used to assign a
- * label to this object when displayed in the UI. Returns an empty string if
- * there is no appropriate name for this object.
- *
- * @param object The object to get a label for.
- */
- public String getLabel(Object o) {
- return CVSUIMessages.VersionCategory_Versions_1;
- }
+ /**
+ * Returns the name of this element. This will typically be used to assign a
+ * label to this object when displayed in the UI. Returns an empty string if
+ * there is no appropriate name for this object.
+ *
+ * @param object The object to get a label for.
+ */
+ public String getLabel(Object o) {
+ return CVSUIMessages.VersionCategory_Versions_1;
+ }
- /**
- * Returns the logical parent of the given object in its tree. Returns null
- * if there is no parent, or if this object doesn't belong to a tree.
- *
- * @param object The object to get the parent for.
- */
- public Object getParent(Object o) {
- return repository;
- }
+ /**
+ * Returns the logical parent of the given object in its tree. Returns null
+ * if there is no parent, or if this object doesn't belong to a tree.
+ *
+ * @param object The object to get the parent for.
+ */
+ public Object getParent(Object o) {
+ return repository;
+ }
- /**
- * Return the repository the given element belongs to.
- */
- public ICVSRepositoryLocation getRepository(Object o) {
- return repository;
- }
+ /**
+ * Return the repository the given element belongs to.
+ */
+ public ICVSRepositoryLocation getRepository(Object o) {
+ return repository;
+ }
- public void fetchDeferredChildren(Object o, IElementCollector collector,
- IProgressMonitor monitor) {
- try {
- collector.add(fetchChildren(o, monitor), monitor);
- } catch (TeamException e) {
- handle(collector, e);
- }
- }
+ public void fetchDeferredChildren(Object o, IElementCollector collector,
+ IProgressMonitor monitor) {
+ try {
+ collector.add(fetchChildren(o, monitor), monitor);
+ } catch (TeamException e) {
+ handle(collector, e);
+ }
+ }
- public boolean isContainer() {
- return true;
- }
+ public boolean isContainer() {
+ return true;
+ }
- public ISchedulingRule getRule(Object element) {
- return new RepositoryLocationSchedulingRule(repository);
- }
+ public ISchedulingRule getRule(Object element) {
+ return new RepositoryLocationSchedulingRule(repository);
+ }
}

Back to the top