KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > mapping > CVSCheckedInChangeSet


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.ccvs.core.mapping;
12
13 import com.ibm.icu.text.DateFormat;
14 import java.util.Date JavaDoc;
15
16 import org.eclipse.team.internal.ccvs.core.ILogEntry;
17 import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry;
18 import org.eclipse.team.internal.core.subscribers.DiffChangeSet;
19
20 public class CVSCheckedInChangeSet extends DiffChangeSet {
21
22     private final ILogEntry entry;
23
24     public CVSCheckedInChangeSet(ILogEntry entry) {
25         this.entry = entry;
26         Date JavaDoc date = entry.getDate();
27         String JavaDoc comment = LogEntry.flattenText(entry.getComment());
28         if (date == null) {
29             setName("["+entry.getAuthor()+ "] " + comment); //$NON-NLS-1$ //$NON-NLS-2$
30
} else {
31             String JavaDoc dateString = DateFormat.getDateTimeInstance().format(date);
32             setName("["+entry.getAuthor()+ "] (" + dateString +") " + comment); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
33
}
34     }
35     
36     public String JavaDoc getAuthor() {
37         return entry.getAuthor();
38     }
39
40     public Date JavaDoc getDate() {
41         return entry.getDate();
42     }
43
44     public String JavaDoc getComment() {
45         return entry.getComment();
46     }
47 }
Popular Tags