KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > history > AbstractHistoryCategory


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ui.history;
12
13 import org.eclipse.swt.graphics.Image;
14 import org.eclipse.team.core.history.IFileRevision;
15
16
17 public abstract class AbstractHistoryCategory {
18     
19     /**
20      * Returns the name of this category.
21      * @return a string
22      */

23     abstract public String JavaDoc getName();
24
25     /**
26      * Returns the image that will be displayed next to the category name or <code>null</code>
27      * if no image is required.
28      * @return an image or <code>null</code>
29      */

30     public Image getImage() {
31         return null;
32     }
33     
34     /**
35      * Returns whether this category currently has any revisions associated with it.
36      * @return <code>true</code> if there are any revisions, <code>false</code> otherwise.
37      */

38     abstract public boolean hasRevisions();
39
40     /**
41      * Takes in an array of IFileRevision and collects the revisions that belong to this category.
42      * The shouldRemove flag indicates whether match file revisions need to be removed from the
43      * passed in file revision array (in order to increase efficency).
44      * @param fileRevisions an array of IFileRevisions
45      * @param shouldRemove <code>true</code> if the method should remove the matching revisions from fileRevisions, <code>false</code> otherwise
46      * @return <code>true</code> if any revisions match this category, <code>false</code> otherwise
47      */

48     abstract public boolean collectFileRevisions(IFileRevision[] fileRevisions, boolean shouldRemove);
49     
50     /**
51      * Returns the file revisions that are currently associated with this category or <code>null</code> if
52      * there are no file revisions associated with this category.
53      * @return an array of IFileRevision or <code>null</code>
54      */

55     abstract public IFileRevision[] getRevisions();
56 }
57
Popular Tags