diff options
author | Michael Valenta | 2002-04-10 20:39:35 +0000 |
---|---|---|
committer | Michael Valenta | 2002-04-10 20:39:35 +0000 |
commit | 6991b01ea4e1ac7e68616a93909aed2798e16707 (patch) | |
tree | f7861174d0e742136bf3f0668a4db00a75e1fa47 | |
parent | e1f9c77b61f525c2ccb5f32ffbf4d35573685c4e (diff) | |
download | eclipse.platform.team-6991b01ea4e1ac7e68616a93909aed2798e16707.tar.gz eclipse.platform.team-6991b01ea4e1ac7e68616a93909aed2798e16707.tar.xz eclipse.platform.team-6991b01ea4e1ac7e68616a93909aed2798e16707.zip |
13219" NPE on CVS Property Page
2 files changed, 25 insertions, 12 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java index 8be7e7588..542c128b7 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java @@ -5,6 +5,8 @@ package org.eclipse.team.internal.ccvs.ui; * All Rights Reserved. */ +import java.util.Date; + import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.SWT; @@ -49,17 +51,24 @@ public class CVSFilePropertiesPage extends PropertyPage { } ResourceSyncInfo syncInfo = cvsResource.getSyncInfo(); - // Base - createLabel(composite, Policy.bind("CVSFilePropertiesPage.baseRevision")); - createLabel(composite, syncInfo.getRevision()); - createLabel(composite, Policy.bind("CVSFilePropertiesPage.baseTimestamp")); - createLabel(composite, CVSDateFormatter.dateToEntryLine(syncInfo.getTimeStamp())); + - // Dirty and Modified - createLabel(composite, Policy.bind("CVSFilePropertiesPage.dirty")); - createLabel(composite, cvsResource.isDirty() ? Policy.bind("yes") : Policy.bind("no")); - createLabel(composite, Policy.bind("CVSFilePropertiesPage.modified")); - createLabel(composite, cvsResource.isModified() ? Policy.bind("yes") : Policy.bind("no")); + if (syncInfo.isAdded()) { + createLabel(composite, Policy.bind("CVSFilePropertiesPage.isAdded"), 2); + } else { + // Base + createLabel(composite, Policy.bind("CVSFilePropertiesPage.baseRevision")); + createLabel(composite, syncInfo.getRevision()); + Date baseTime = syncInfo.getTimeStamp(); + if (baseTime != null) { + createLabel(composite, Policy.bind("CVSFilePropertiesPage.baseTimestamp")); + createLabel(composite, CVSDateFormatter.dateToEntryLine(syncInfo.getTimeStamp())); + } + + // Modified + createLabel(composite, Policy.bind("CVSFilePropertiesPage.modified")); + createLabel(composite, cvsResource.isModified() ? Policy.bind("yes") : Policy.bind("no")); + } // Keyword Mode createLabel(composite, Policy.bind("CVSFilePropertiesPage.keywordMode")); @@ -110,15 +119,18 @@ public class CVSFilePropertiesPage extends PropertyPage { * @param text the text for the new label * @return the new label */ - protected Label createLabel(Composite parent, String text) { + protected Label createLabel(Composite parent, String text, int span) { Label label = new Label(parent, SWT.LEFT); label.setText(text); GridData data = new GridData(); - data.horizontalSpan = 1; + data.horizontalSpan = span; data.horizontalAlignment = GridData.FILL; label.setLayoutData(data); return label; } + protected Label createLabel(Composite parent, String text) { + return createLabel(parent, text, 1); + } /** * Initializes the page */ diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index 07feaa2cc..969873515 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -89,6 +89,7 @@ CVSDecorator.folderDecoration={0} [{1}] CVSFilePropertiesPage.ignored=The file is ignored by CVS. CVSFilePropertiesPage.notManaged=The file is not managed by CVS. +CVSFilePropertiesPage.isAdded=This file has been added to CVS control but has not been committed CVSFilePropertiesPage.baseRevision=Base Revision: CVSFilePropertiesPage.baseTimestamp=Base Timestamp: CVSFilePropertiesPage.dirty=Dirty: |