Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Macguire2002-04-04 18:44:21 -0500
committerKevin Macguire2002-04-04 18:44:21 -0500
commitc7386121756d549aedb048c7d29a2df5b6918ac7 (patch)
tree78e7ec158168d2bc38f852d81727ba9c7925b2ba
parent5d5539ed6cf71152711cdd599362c2f6256ce1cc (diff)
downloadeclipse.platform.team-c7386121756d549aedb048c7d29a2df5b6918ac7.tar.gz
eclipse.platform.team-c7386121756d549aedb048c7d29a2df5b6918ac7.tar.xz
eclipse.platform.team-c7386121756d549aedb048c7d29a2df5b6918ac7.zip
- Renamed FileModificationValidator to FileModificationValidatorManager.
- Added file name to message for read-only failure status
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultFileModificationValidator.java14
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidatorManager.java (renamed from bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java)9
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties4
3 files changed, 14 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultFileModificationValidator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultFileModificationValidator.java
index 0afef8cab..554850edb 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultFileModificationValidator.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultFileModificationValidator.java
@@ -19,11 +19,10 @@ import org.eclipse.team.core.TeamPlugin;
public class DefaultFileModificationValidator implements IFileModificationValidator {
private static final Status OK = new Status(Status.OK, TeamPlugin.ID, Status.OK, Policy.bind("FileModificationValidator.ok"), null); //$NON-NLS-1$
- private static final Status READ_ONLY = new Status(Status.ERROR, TeamPlugin.ID, Status.ERROR, Policy.bind("FileModificationValidator.isReadOnly"), null); //$NON-NLS-1$
private IStatus getDefaultStatus(IFile file) {
return file.isReadOnly()
- ? READ_ONLY
+ ? new Status(Status.ERROR, TeamPlugin.ID, Status.ERROR, Policy.bind("FileModificationValidator.fileIsReadOnly", file.getFullPath().toString()), null) //$NON-NLS-1$
: OK;
}
@@ -36,12 +35,21 @@ public class DefaultFileModificationValidator implements IFileModificationValida
}
IStatus[] stati = new Status[files.length];
+ boolean allOK = true;
for (int i = 0; i < files.length; i++) {
stati[i] = getDefaultStatus(files[i]);
+ if(! stati[i].isOK())
+ allOK = false;
}
- return new MultiStatus(TeamPlugin.ID, 0, stati, Policy.bind("FileModificationValidator.validateEdit"), null); //$NON-NLS-1$
+ return new MultiStatus(TeamPlugin.ID,
+ 0, stati,
+ Policy.bind(
+ allOK
+ ? "FileModificationValidator.ok" //$NON-NLS-1$
+ : "FileModificationValidator.someReadOnly" ), //$NON-NLS-1$
+ null);
}
/**
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidatorManager.java
index dab2c7fb5..13ec6971c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidatorManager.java
@@ -18,16 +18,9 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamPlugin;
-public class FileModificationValidator implements IFileModificationValidator {
+public class FileModificationValidatorManager implements IFileModificationValidator {
private static final IFileModificationValidator DEFAULT_VALIDATOR =
new DefaultFileModificationValidator();
-
- private static final Status OK = new Status(Status.OK, TeamPlugin.ID,
- Status.OK,
- Policy.bind("FileModificationValidator.ok"), null); //$NON-NLS-1$
- private static final Status READ_ONLY = new Status(Status.ERROR, TeamPlugin.ID,
- Status.ERROR,
- Policy.bind("FileModificationValidator.isReadOnly"), null); //$NON-NLS-1$
/*
* @see IFileModificationValidator#validateEdit(IFile[], Object)
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
index 61e92c662..adad17eed 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
@@ -16,8 +16,8 @@ manager.errorRemovingNature=Error removing nature {1} on project {0}.
manager.badClassType=Error creating validator decorator: bad class type
manager.coreException=Error creating validator decorator: core exception
-FileModificationValidator.validateEdit=Validate Edit
-FileModificationValidator.isReadOnly=File is Read Only.
+FileModificationValidator.someReadOnly=Some files are read-only.
+FileModificationValidator.fileIsReadOnly=File {0} is read-only.
FileModificationValidator.ok=OK
RepositoryProvider_Error_removing_nature_from_project___1=Error removing nature from project:

Back to the top