diff options
author | Jean Michel-Lemieux | 2002-02-12 03:54:36 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2002-02-12 03:54:36 +0000 |
commit | 85c6f204e743a82fb2b57800ac9ba8e860ddcab6 (patch) | |
tree | f877d6d425df4ea7c832daca37d3f092bdb6738e | |
parent | dc243766391fb0a5b5f995db9f1d532c5492b259 (diff) | |
download | eclipse.platform.team-85c6f204e743a82fb2b57800ac9ba8e860ddcab6.tar.gz eclipse.platform.team-85c6f204e743a82fb2b57800ac9ba8e860ddcab6.tar.xz eclipse.platform.team-85c6f204e743a82fb2b57800ac9ba8e860ddcab6.zip |
NSL work
10 files changed, 166 insertions, 142 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties index d3b8c1d37..f64528717 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties @@ -130,3 +130,16 @@ Util.invalidResource=Resource {1} is not relative to root {0} Synchronizer.reload=Examining {0} Checking_out_from_CVS..._5=Checking out from CVS... +FileSystemSynchronizer_Error_loading_from_CVS/Entries_file_1=Error loading from CVS/Entries file +FileSystemSynchronizer_Error_loading_from_.cvsignore_file_2=Error loading from .cvsignore file +FileSystemSynchronizer_Error_loading_from_CVS/Root,Repository_files_3=Error loading from CVS/Root,Repository files +FileSystemSynchronizer_Error_reloading_sync_information_5=Error reloading sync information +Malformed_entry_line___11=Malformed entry line: +Malformed_entry_line,_missing_name___12=Malformed entry line, missing name: +Malformed_entry_line,_missing_revision___13=Malformed entry line, missing revision: +FolderSyncInfo_Maleformed_root_4=Maleformed root +SyncFileUtil_Error_writing_to_Entries.log_48=Error writing to Entries.log +SyncFileUtil_Cannot_close_Entries.log_49=Cannot close Entries.log +SyncFileUtil_Error_reloading_sync_information_58=Error reloading sync information +SyncFileUtil_Error_writing_to_.cvsignore_61=Error writing to .cvsignore +SyncFileUtil_Cannot_close_.cvsignore_62=Cannot close .cvsignore diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java index 45e24c9e8..1356c368b 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java @@ -29,6 +29,7 @@ import org.eclipse.team.internal.ccvs.core.util.FileNameMatcher; import org.eclipse.team.internal.ccvs.core.util.FileUtil; import org.eclipse.team.internal.ccvs.core.util.ResourceDeltaVisitor; import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil; +import org.eclipse.team.internal.ccvs.core.Policy; /** * The FileSystemSynchronizer stores sync information to be compatible with CVS command line @@ -97,7 +98,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer { } } } catch(CVSException e) { - TeamPlugin.log(IStatus.ERROR, "Error loading from CVS/Entries file", e); + TeamPlugin.log(IStatus.ERROR, Policy.bind("FileSystemSynchronizer_Error_loading_from_CVS/Entries_file_1"), e); //$NON-NLS-1$ return null; } return idInfo; @@ -122,7 +123,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer { cache.put(cacheInfo); } } catch(CVSException e) { - TeamPlugin.log(IStatus.ERROR, "Error loading from .cvsignore file", e); + TeamPlugin.log(IStatus.ERROR, Policy.bind("FileSystemSynchronizer_Error_loading_from_.cvsignore_file_2"), e); //$NON-NLS-1$ return null; } return idInfo; @@ -148,7 +149,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer { return new CacheData(folder, info, CACHE_EXPIRATION_MINUTES); } } catch(CVSException e) { - TeamPlugin.log(IStatus.ERROR, "Error loading from CVS/Entries file", e); + TeamPlugin.log(IStatus.ERROR, Policy.bind("FileSystemSynchronizer_Error_loading_from_CVS/Root,Repository_files_3"), e); //$NON-NLS-1$ return null; } } @@ -229,7 +230,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer { handleMetaChange(file.getParentFile(), resources[i].getParent(), false); } else if(name.equals(SyncFileUtil.IGNORE_FILE)) { handleMetaChange(file, resource, true); - } else if(!name.equals("CVS")) { + } else if(!name.equals("CVS")) { //$NON-NLS-1$ delta.add(resources[i]); } } @@ -418,7 +419,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer { resource.refreshLocal(IResource.DEPTH_INFINITE, monitor); } } catch(CoreException e) { - throw new CVSException(IStatus.ERROR, 0, "Error reloading sync information", e); + throw new CVSException(IStatus.ERROR, 0, Policy.bind("FileSystemSynchronizer_Error_reloading_sync_information_5"), e); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java index bee61cd8c..0883688b2 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java @@ -9,6 +9,7 @@ import org.eclipse.team.ccvs.core.CVSTag; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.resources.*; import org.eclipse.team.internal.ccvs.core.util.Assert; +import org.eclipse.team.internal.ccvs.core.Policy; /** * Value (immutable) object that represents workspace state information about the contents of a @@ -125,11 +126,11 @@ public class FolderSyncInfo { String result; try { - result = getRoot().substring(getRoot().indexOf("@")+1); - result = result.substring(result.indexOf(":")+1); - result = result + "/" + getRepository(); + result = getRoot().substring(getRoot().indexOf("@")+1); //$NON-NLS-1$ + result = result.substring(result.indexOf(":")+1); //$NON-NLS-1$ + result = result + "/" + getRepository(); //$NON-NLS-1$ } catch (IndexOutOfBoundsException e) { - throw new CVSException("Maleformed root"); + throw new CVSException(Policy.bind("FolderSyncInfo_Maleformed_root_4")); //$NON-NLS-1$ } return result; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java index ce727133e..b916108ca 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java @@ -10,6 +10,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.resources.*; import org.eclipse.team.internal.ccvs.core.util.Assert; import org.eclipse.team.internal.ccvs.core.util.EmptyTokenizer; +import org.eclipse.team.internal.ccvs.core.Policy; /** * Value (immutable) object that represents workspace state information about a resource contained in @@ -29,28 +30,28 @@ public class ResourceSyncInfo { private boolean isDirectory = false; // utility constants - private static final String DIRECTORY_PREFIX = "D/"; - public static final String BINARY_TAG = "-kb"; - private static final String SEPERATOR = "/"; + private static final String DIRECTORY_PREFIX = "D/"; //$NON-NLS-1$ + public static final String BINARY_TAG = "-kb"; //$NON-NLS-1$ + private static final String SEPERATOR = "/"; //$NON-NLS-1$ // Timestamp constants used to identify special cases - public static final String DUMMY_TIMESTAMP = "dummy timestamp"; - public static final String RESULT_OF_MERGE = "Result of merge+"; + public static final String DUMMY_TIMESTAMP = "dummy timestamp"; //$NON-NLS-1$ + public static final String RESULT_OF_MERGE = "Result of merge+"; //$NON-NLS-1$ // safe default permissions. Permissions are saved separatly so that the correct permissions // can be sent back to the server on systems that don't save execute bits (e.g. windows). - public static final String DEFAULT_PERMISSIONS = "u=rw,g=rw,o=r"; + public static final String DEFAULT_PERMISSIONS = "u=rw,g=rw,o=r"; //$NON-NLS-1$ // file sync information can be associated with a local resource that has been deleted. This is // noted by prefixing the revision with this character. // XXX Should this be private - public static final String DELETED_PREFIX = "-"; + public static final String DELETED_PREFIX = "-"; //$NON-NLS-1$ private boolean isDeleted = false; // a sync element with a revision of '0' is considered a new file that has // not been comitted to the repo. Is visible so that clients can create sync infos // for new files. - public static final String ADDED_REVISION = "0"; + public static final String ADDED_REVISION = "0"; //$NON-NLS-1$ // fields describing the synchronization of a resource in CVS parlance private String name; @@ -171,7 +172,7 @@ public class ResourceSyncInfo { if(isDirectory) { result.append(DIRECTORY_PREFIX); - result.append(name + "////"); + result.append(name + "////"); //$NON-NLS-1$ } else { result.append(SEPERATOR); result.append(name); @@ -188,7 +189,7 @@ public class ResourceSyncInfo { result.append(timeStamp); } result.append(SEPERATOR); - result.append(keywordMode == null ? "" : keywordMode); + result.append(keywordMode == null ? "" : keywordMode); //$NON-NLS-1$ result.append(SEPERATOR); if (tag != null) { result.append(tag.toEntryLineFormat(true)); @@ -325,19 +326,19 @@ public class ResourceSyncInfo { EmptyTokenizer tokenizer = new EmptyTokenizer(entryLine,SEPERATOR); if(tokenizer.countTokens() != 5) { - throw new CVSException("Malformed entry line: " + entryLine); + throw new CVSException(Policy.bind("Malformed_entry_line___11") + entryLine); //$NON-NLS-1$ } name = tokenizer.nextToken(); if(name.length()==0) { - throw new CVSException("Malformed entry line, missing name: " + entryLine); + throw new CVSException(Policy.bind("Malformed_entry_line,_missing_name___12") + entryLine); //$NON-NLS-1$ } String rev = tokenizer.nextToken(); if(rev.length()==0 && !isDirectory()) { - throw new CVSException("Malformed entry line, missing revision: " + entryLine); + throw new CVSException(Policy.bind("Malformed_entry_line,_missing_revision___13") + entryLine); //$NON-NLS-1$ } else { setRevision(rev); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileUtil.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileUtil.java index 6efe8c7b8..d86565335 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileUtil.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileUtil.java @@ -30,31 +30,31 @@ public class SyncFileUtil { // All possible files available in the CVS subdir
- public static final String REPOSITORY = "Repository";
- public static final String ROOT = "Root";
- public static final String STATIC = "Entries.Static";
- public static final String TAG = "Tag";
- public static final String ENTRIES = "Entries";
- public static final String PERMISSIONS = "Permissions";
- public static final String ENTRIES_LOG="Entries.Log";
+ public static final String REPOSITORY = "Repository"; //$NON-NLS-1$
+ public static final String ROOT = "Root"; //$NON-NLS-1$
+ public static final String STATIC = "Entries.Static"; //$NON-NLS-1$
+ public static final String TAG = "Tag"; //$NON-NLS-1$
+ public static final String ENTRIES = "Entries"; //$NON-NLS-1$
+ public static final String PERMISSIONS = "Permissions"; //$NON-NLS-1$
+ public static final String ENTRIES_LOG="Entries.Log"; //$NON-NLS-1$
// the local workspace file that contains pattern for ignored resources
public static final String IGNORE_FILE = ".cvsignore"; //$NON-NLS-1$
// Some older CVS clients may of added a line to the entries file consisting
// of only a 'D'. It is safe to ingnore these entries.
- private static final String FOLDER_TAG="D";
+ private static final String FOLDER_TAG="D"; //$NON-NLS-1$
// Command characters found in the Entries.log file
- private static final String ADD_TAG="A ";
- private static final String REMOVE_TAG="R ";
+ private static final String ADD_TAG="A "; //$NON-NLS-1$
+ private static final String REMOVE_TAG="R "; //$NON-NLS-1$
// file and folder patterns that are ignored by default by the CVS server on import.
public static final String[] PREDEFINED_IGNORE_PATTERNS = {
- "CVS", ".#*", "#*", ",*", "_$*", "*~", "*$", "*.a", "*.bak", "*.BAK",
- "*.elc", "*.exe", "*.ln", "*.o", "*.obj", "*.olb", "*.old", "*.orig", "*.rej", "*.so",
- "*.Z", ".del-*", ".make.state", ".nse_depinfo", "core", "CVS", "CVS.adm",
- "cvslog.*", "RCS", "RCSLOG", "SCCS", "tags", "TAGS"};
+ "CVS", ".#*", "#*", ",*", "_$*", "*~", "*$", "*.a", "*.bak", "*.BAK", //$NON-NLS-1$
+ "*.elc", "*.exe", "*.ln", "*.o", "*.obj", "*.olb", "*.old", "*.orig", "*.rej", "*.so", //$NON-NLS-1$
+ "*.Z", ".del-*", ".make.state", ".nse_depinfo", "core", "CVS", "CVS.adm", //$NON-NLS-1$
+ "cvslog.*", "RCS", "RCSLOG", "SCCS", "tags", "TAGS"}; //$NON-NLS-1$
/**
@@ -83,7 +83,7 @@ public class SyncFileUtil { for (int i = 0; i < entries.length; i++) {
String line = entries[i];
- if(!FOLDER_TAG.equals(line) && !"".equals(line)) {
+ if(!FOLDER_TAG.equals(line) && !"".equals(line)) { //$NON-NLS-1$
ResourceSyncInfo info = new ResourceSyncInfo(line, null, null);
infos.put(info.getName(), info);
}
@@ -91,11 +91,11 @@ public class SyncFileUtil { if (permissions != null) {
for (int i = 0; i < permissions.length; i++) {
- if ("".equals(permissions[i])) {
+ if ("".equals(permissions[i])) { //$NON-NLS-1$
continue;
}
String line = permissions[i];
- EmptyTokenizer tokenizer = new EmptyTokenizer(line,"/");
+ EmptyTokenizer tokenizer = new EmptyTokenizer(line,"/"); //$NON-NLS-1$
String name = tokenizer.nextToken();
String perms = tokenizer.nextToken();
ResourceSyncInfo info = (ResourceSyncInfo) infos.get(name);
@@ -123,18 +123,18 @@ public class SyncFileUtil { if(!entriesLogFile.exists()) {
entriesLogFile.createNewFile();
}
- String line = prefix + info.getEntryLine(true) +"\n";
+ String line = prefix + info.getEntryLine(true) +"\n"; //$NON-NLS-1$
out = new FileOutputStream(entriesLogFile.getAbsolutePath(), true);
out.write(line.getBytes());
} catch(IOException e) {
- throw new CVSException(IStatus.ERROR, 0, "Error writing to Entries.log.", e);
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("SyncFileUtil_Error_writing_to_Entries.log_48"), e); //$NON-NLS-1$
} finally {
try {
if(out!=null) {
out.close();
}
} catch(IOException e) {
- throw new CVSException(IStatus.ERROR, 0, "Cannot close Entries.log.", e);
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("SyncFileUtil_Cannot_close_Entries.log_49"), e); //$NON-NLS-1$
}
}
}
@@ -146,13 +146,13 @@ public class SyncFileUtil { if(file.isDirectory()) {
writeEntriesLog(file, new ResourceSyncInfo(file.getName()), REMOVE_TAG);
} else {
- writeEntriesLog(file, new ResourceSyncInfo(file.getName(), "0", "", "", null, ""), REMOVE_TAG);
+ writeEntriesLog(file, new ResourceSyncInfo(file.getName(), "0", "", "", null, ""), REMOVE_TAG); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}
public static boolean isMetaFile(File file) {
File parent = file.getParentFile();
- if(parent!=null&&parent.getName().equals("CVS")) {
+ if(parent!=null&&parent.getName().equals("CVS")) { //$NON-NLS-1$
return true;
} else {
return false;
@@ -233,7 +233,7 @@ public class SyncFileUtil { writeLine(parent, TAG, null);
}
if(info.getIsStatic()) {
- writeLine(parent, STATIC, ""); // touch file
+ writeLine(parent, STATIC, ""); // touch file //$NON-NLS-1$
} else {
writeLine(parent, STATIC, null);
}
@@ -264,7 +264,7 @@ public class SyncFileUtil { if (contents == null) {
return null;
} else if (contents.length == 0) {
- return "";
+ return ""; //$NON-NLS-1$
} else {
return contents[0];
}
@@ -282,7 +282,7 @@ public class SyncFileUtil { }
public static File getCVSSubdirectory(File folder) {
- return new File(folder, "CVS");
+ return new File(folder, "CVS"); //$NON-NLS-1$
}
public static void mergeEntriesLogFiles(File root) throws CVSException {
@@ -335,7 +335,7 @@ public class SyncFileUtil { }
} catch(CoreException e) {
// XXX Should we throw or log?
- throw new CVSException(IStatus.ERROR, 0, "Error reloading sync information", e);
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("SyncFileUtil_Error_reloading_sync_information_58"), e); //$NON-NLS-1$
}
}
@@ -371,7 +371,7 @@ public class SyncFileUtil { try {
fileWriter = new BufferedWriter(new FileWriter(file));
for (int i = 0; i<content.length; i++) {
- fileWriter.write(content[i] + "\n");
+ fileWriter.write(content[i] + "\n"); //$NON-NLS-1$
}
fileWriter.close();
} catch (IOException e) {
@@ -387,18 +387,18 @@ public class SyncFileUtil { cvsignore.createNewFile();
}
String line = pattern == null ? file.getName() : pattern;
- line += "\n";
+ line += "\n"; //$NON-NLS-1$
out = new FileOutputStream(cvsignore.getAbsolutePath(), true /*append*/);
out.write(line.getBytes());
} catch(IOException e) {
- throw new CVSException(IStatus.ERROR, 0, "Error writing to .cvsignore.", e);
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("SyncFileUtil_Error_writing_to_.cvsignore_61"), e); //$NON-NLS-1$
} finally {
try {
if(out!=null) {
out.close();
}
} catch(IOException e) {
- throw new CVSException(IStatus.ERROR, 0, "Cannot close .cvsignore.", e);
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("SyncFileUtil_Cannot_close_.cvsignore_62"), e); //$NON-NLS-1$
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java index e38f03b4c..1f10296c3 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java @@ -118,7 +118,7 @@ public class CVSDecorationRunnable implements Runnable { private CVSDecoration computeTextLabelFor(IResource resource, boolean isDirty, ITeamProvider provider) { Map bindings = new HashMap(3); - String format = ""; + String format = ""; //$NON-NLS-1$ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore(); IPath resourceLocation = resource.getLocation(); @@ -214,7 +214,7 @@ public class CVSDecorationRunnable implements Runnable { } private boolean isDirty(IResource resource) { - final CoreException DECORATOR_EXCEPTION = new CoreException(new Status(IStatus.OK, "id", 1, "", null)); + final CoreException DECORATOR_EXCEPTION = new CoreException(new Status(IStatus.OK, "id", 1, "", null)); //$NON-NLS-1$ //$NON-NLS-2$ try { resource.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java index 4dce063d6..bdd46b9db 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java @@ -63,7 +63,7 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes private boolean shutdown = false; public CVSDecorator() { - decoratorUpdateThread = new Thread(new CVSDecorationRunnable(this), "CVS"); + decoratorUpdateThread = new Thread(new CVSDecorationRunnable(this), "CVS"); //$NON-NLS-1$ decoratorUpdateThread.start(); TeamPlugin.getManager().addResourceStateChangeListener(this); @@ -298,7 +298,7 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes StringBuffer buffer = new StringBuffer(); boolean isBinary = false; if(keyword!=null) { - if (keyword.equals("-kb")) { + if (keyword.equals("-kb")) { //$NON-NLS-1$ isBinary = true; } } else { @@ -309,8 +309,8 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes buffer.append(Policy.bind("CVSFilePropertiesPage.binary")); } else { buffer.append(Policy.bind("CVSFilePropertiesPage.text")); - if(keyword!=null && !keyword.equals("-ko") && !"".equals(keyword)) { - buffer.append(" " + keyword); + if(keyword!=null && !keyword.equals("-ko") && !"".equals(keyword)) { //$NON-NLS-1$ //$NON-NLS-2$ + buffer.append(" " + keyword); //$NON-NLS-1$ } } return buffer.toString(); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java index e64abc756..e224c9137 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java @@ -13,58 +13,34 @@ import org.eclipse.team.ccvs.core.CVSStatus; public class CVSDecoratorConfiguration { // bindings for - public static final String RESOURCE_NAME = "name"; - public static final String RESOURCE_TAG = "tag"; - public static final String FILE_REVISION = "revision"; - public static final String FILE_KEYWORD = "keyword"; + public static final String RESOURCE_NAME = "name"; //$NON-NLS-1$ + public static final String RESOURCE_TAG = "tag"; //$NON-NLS-1$ + public static final String FILE_REVISION = "revision"; //$NON-NLS-1$ + public static final String FILE_KEYWORD = "keyword"; //$NON-NLS-1$ // bindings for repository location - public static final String REMOTELOCATION_METHOD = "method"; - public static final String REMOTELOCATION_USER = "user"; - public static final String REMOTELOCATION_HOST = "host"; - public static final String REMOTELOCATION_ROOT = "root"; - public static final String REMOTELOCATION_REPOSITORY = "repository"; + public static final String REMOTELOCATION_METHOD = "method"; //$NON-NLS-1$ + public static final String REMOTELOCATION_USER = "user"; //$NON-NLS-1$ + public static final String REMOTELOCATION_HOST = "host"; //$NON-NLS-1$ + public static final String REMOTELOCATION_ROOT = "root"; //$NON-NLS-1$ + public static final String REMOTELOCATION_REPOSITORY = "repository"; //$NON-NLS-1$ // bindings for resource states - public static final String DIRTY_FLAG = "dirty_flag"; - public static final String ADDED_FLAG = "added_flag"; - public static final String DEFAULT_DIRTY_FLAG = ">"; - public static final String DEFAULT_ADDED_FLAG = "*"; + public static final String DIRTY_FLAG = "dirty_flag"; //$NON-NLS-1$ + public static final String ADDED_FLAG = "added_flag"; //$NON-NLS-1$ + public static final String DEFAULT_DIRTY_FLAG = ">"; //$NON-NLS-1$ + public static final String DEFAULT_ADDED_FLAG = "*"; //$NON-NLS-1$ // default text decoration formats - public static final String DEFAULT_FILETEXTFORMAT = "{dirty_flag}{name} {revision} {tag}"; - public static final String DEFAULT_FOLDERTEXTFORMAT = "{dirty_flag}{name} {tag}"; - public static final String DEFAULT_PROJECTTEXTFORMAT = "{dirty_flag}{name} {tag} [{host}]"; + public static final String DEFAULT_FILETEXTFORMAT = "{dirty_flag}{name} {revision} {tag}"; //$NON-NLS-1$ + public static final String DEFAULT_FOLDERTEXTFORMAT = "{dirty_flag}{name} {tag}"; //$NON-NLS-1$ + public static final String DEFAULT_PROJECTTEXTFORMAT = "{dirty_flag}{name} {tag} [{host}]"; //$NON-NLS-1$ // prefix characters that can be removed if the following binding is not found private static final char KEYWORD_SEPSPACE = ' '; private static final char KEYWORD_SEPCOLON = ':'; private static final char KEYWORD_SEPAT = '@'; - - /** - * Answers if the given format specification for a file is valid. - */ - public static IStatus validateFileTextFormat(String format) { - if (format == null) - return new CVSStatus(CVSStatus.ERROR, "format cannot be null"); - if (format.equals("")) - return new CVSStatus(CVSStatus.ERROR, "format cannot be empty"); - - return new CVSStatus(CVSStatus.OK, "ok"); - } - - /** - * Answers if the given format specification for a folder/project is valid. - */ - public static IStatus validateContainerTextFormat(String format) { - if (format == null) - return new CVSStatus(CVSStatus.ERROR, "format cannot be null"); - if (format.equals("")) - return new CVSStatus(CVSStatus.ERROR, "format cannot be empty"); - return new CVSStatus(CVSStatus.OK, "ok"); - } - public static String bind(String format, Map bindings) { StringBuffer output = new StringBuffer(80); int length = format.length(); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java index abd752526..4bfe11aea 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java @@ -30,7 +30,6 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; -import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; @@ -91,39 +90,39 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork } }); - createLabel(composite, "Example:", 1); + createLabel(composite, Policy.bind("Example__1"), 1); //$NON-NLS-1$ Text example = new Text(composite, SWT.BORDER); example.setEditable(false); example.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - createLabel(composite, "", 1); // spacer + createLabel(composite, "", 1); // spacer //$NON-NLS-1$ return new TextPair(format, example); } protected void updateExamples() { - String example = ""; + String example = ""; //$NON-NLS-1$ Map bindings = new HashMap(); try { - ICVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:username@host.acme.org:/home/cvsroot"); - bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, "v2_0"); - bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, CVSDecorator.getFileTypeString("file.txt",null)); - bindings.put(CVSDecoratorConfiguration.FILE_REVISION, "1.34"); + ICVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:username@host.acme.org:/home/cvsroot"); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, "v2_0"); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, CVSDecorator.getFileTypeString("file.txt",null)); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.FILE_REVISION, "1.34"); //$NON-NLS-1$ bindings.put(CVSDecoratorConfiguration.DIRTY_FLAG, dirtyFlag.getText()); bindings.put(CVSDecoratorConfiguration.ADDED_FLAG, addedFlag.getText()); bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_HOST, location.getHost()); bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_METHOD, location.getMethod().getName()); bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, location.getUsername()); bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, location.getRootDirectory()); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, "org.eclipse.project1"); + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, "org.eclipse.project1"); //$NON-NLS-1$ } catch(CVSException e) { example = e.getMessage(); } - bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "file.txt"); + bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "file.txt"); //$NON-NLS-1$ setTextFormatExample(bindings); bindings.remove(CVSDecoratorConfiguration.RESOURCE_NAME); - bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "folder"); + bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "folder"); //$NON-NLS-1$ setFolderFormatExample(bindings); bindings.remove(CVSDecoratorConfiguration.RESOURCE_NAME); - bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "Project"); + bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "Project"); //$NON-NLS-1$ setProjectFormatExample(bindings); } @@ -145,20 +144,20 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork GridData data = new GridData(); data.horizontalAlignment = GridData.FILL; fileTextGroup.setLayoutData(data); - fileTextGroup.setText("Text Labels"); - createLabel(fileTextGroup, "Select the format for file, folders, and project text labels:", 3); + fileTextGroup.setText(Policy.bind("Text_Labels_12")); //$NON-NLS-1$ + createLabel(fileTextGroup, Policy.bind("Select_the_format_for_file,_folders,_and_project_text_labels__13"), 3); //$NON-NLS-1$ - TextPair format = createFormatEditorControl(fileTextGroup, "&File Format:", "Add &Variables...", getFileBindingDescriptions()); + TextPair format = createFormatEditorControl(fileTextGroup, Policy.bind("&File_Format__14"), Policy.bind("Add_&Variables_15"), getFileBindingDescriptions()); //$NON-NLS-1$ //$NON-NLS-2$ fileTextFormat = format.t1; fileTextFormatExample = format.t2; - format = createFormatEditorControl(fileTextGroup, "F&older Format:", "Add Varia&bles...", getFolderBindingDescriptions()); + format = createFormatEditorControl(fileTextGroup, Policy.bind("F&older_Format__16"), Policy.bind("Add_Varia&bles_17"), getFolderBindingDescriptions()); //$NON-NLS-1$ //$NON-NLS-2$ folderTextFormat = format.t1; folderTextFormatExample = format.t2; - format = createFormatEditorControl(fileTextGroup, "&Project Format:", "Add Variable&s...", getFolderBindingDescriptions()); + format = createFormatEditorControl(fileTextGroup, Policy.bind("&Project_Format__18"), Policy.bind("Add_Variable&s_19"), getFolderBindingDescriptions()); //$NON-NLS-1$ //$NON-NLS-2$ projectTextFormat = format.t1; projectTextFormatExample = format.t2; - createLabel(fileTextGroup, "&Label decoration for outgoing:", 1); + createLabel(fileTextGroup, Policy.bind("&Label_decoration_for_outgoing__20"), 1); //$NON-NLS-1$ dirtyFlag = new Text(fileTextGroup, SWT.BORDER); dirtyFlag.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dirtyFlag.addModifyListener(new ModifyListener() { @@ -166,9 +165,9 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork updateExamples(); } }); - createLabel(fileTextGroup, "", 1); // spacer + createLabel(fileTextGroup, "", 1); // spacer //$NON-NLS-1$ - createLabel(fileTextGroup, "Label decorat&ion for added:", 1); + createLabel(fileTextGroup, Policy.bind("Label_decorat&ion_for_added__22"), 1); //$NON-NLS-1$ addedFlag = new Text(fileTextGroup, SWT.BORDER); addedFlag.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addedFlag.addModifyListener(new ModifyListener() { @@ -177,7 +176,7 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork } }); - createLabel(fileTextGroup, "", 1); // spacer + createLabel(fileTextGroup, "", 1); // spacer //$NON-NLS-1$ // image decoration options @@ -187,12 +186,12 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork data = new GridData(); data.horizontalAlignment = GridData.FILL; imageGroup.setLayoutData(data); - imageGroup.setText("Icon Overlays"); - imageShowDirty = createCheckBox(imageGroup, "Sho&w outgoing"); - imageShowHasRemote = createCheckBox(imageGroup, "Show has &remote"); - imageShowAdded = createCheckBox(imageGroup, "S&how is added"); + imageGroup.setText(Policy.bind("Icon_Overlays_24")); //$NON-NLS-1$ + imageShowDirty = createCheckBox(imageGroup, Policy.bind("Sho&w_outgoing_25")); //$NON-NLS-1$ + imageShowHasRemote = createCheckBox(imageGroup, Policy.bind("Show_has_&remote_26")); //$NON-NLS-1$ + imageShowAdded = createCheckBox(imageGroup, Policy.bind("S&how_is_added_27")); //$NON-NLS-1$ - showDirty = createCheckBox(composite, "&Compute deep outgoing state for folders (disabling this will improve decorator performance)"); + showDirty = createCheckBox(composite, Policy.bind("&Compute_deep_outgoing_state_for_folders_(disabling_this_will_improve_decorator_performance)_28")); //$NON-NLS-1$ initializeValues(); return composite; @@ -323,7 +322,7 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork ILabelProvider labelProvider = new LabelProvider() { public String getText(Object element) { - return ((StringPair)element).s1 + " - " + ((StringPair)element).s2; + return ((StringPair)element).s1 + " - " + ((StringPair)element).s2; //$NON-NLS-1$ } }; @@ -348,39 +347,39 @@ public class CVSDecoratorPreferencesPage extends PreferencePage implements IWork this, contentsProvider, labelProvider, - "Select the &variables to add to the decoration format:"); - dialog.setTitle("Add Variables"); + Policy.bind("Select_the_&variables_to_add_to_the_decoration_format__30")); //$NON-NLS-1$ + dialog.setTitle(Policy.bind("Add_Variables_31")); //$NON-NLS-1$ if (dialog.open() != dialog.OK) return; Object[] result = dialog.getResult(); for (int i = 0; i < result.length; i++) { - target.insert("{"+((StringPair)result[i]).s1 +"}"); + target.insert("{"+((StringPair)result[i]).s1 +"}"); //$NON-NLS-1$ //$NON-NLS-2$ } } private Map getFolderBindingDescriptions() { Map bindings = new HashMap(); - bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "name of the resource being decorated"); - bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, "the tag applied to the resource (version, branch, or date)"); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_HOST, "the repository location's hostname"); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_METHOD, "the connection method (e.g. pserver, ssh)"); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, "user name for the connection"); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, "repository home directory on server"); - bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, "root relative directory"); - bindings.put(CVSDecoratorConfiguration.DIRTY_FLAG, "flag indicating that the folder has a child resource with outgoing changes"); + bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, Policy.bind("name_of_the_resource_being_decorated_34")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, Policy.bind("the_tag_applied_to_the_resource_(version,_branch,_or_date)_35")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_HOST, Policy.bind("the_repository_location__s_hostname_36")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_METHOD, Policy.bind("the_connection_method_(e.g._pserver,_ssh)_37")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, Policy.bind("user_name_for_the_connection_38")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, Policy.bind("repository_home_directory_on_server_39")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, Policy.bind("root_relative_directory_40")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.DIRTY_FLAG, Policy.bind("flag_indicating_that_the_folder_has_a_child_resource_with_outgoing_changes_41")); //$NON-NLS-1$ return bindings; } private Map getFileBindingDescriptions() { Map bindings = new HashMap(); - bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, "name of the resource being decorated"); - bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, "the tag applied to the resource"); - bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, "keyword subsitution rule for the resource"); - bindings.put(CVSDecoratorConfiguration.FILE_REVISION, "last revision loaded into workspace"); - bindings.put(CVSDecoratorConfiguration.DIRTY_FLAG, "flag indicating that the file has outgoing changes"); - bindings.put(CVSDecoratorConfiguration.ADDED_FLAG, "flag indicating that the file has been added to the server"); + bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, Policy.bind("name_of_the_resource_being_decorated_42")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, Policy.bind("the_tag_applied_to_the_resource_43")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, Policy.bind("keyword_subsitution_rule_for_the_resource_44")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.FILE_REVISION, Policy.bind("last_revision_loaded_into_workspace_45")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.DIRTY_FLAG, Policy.bind("flag_indicating_that_the_file_has_outgoing_changes_46")); //$NON-NLS-1$ + bindings.put(CVSDecoratorConfiguration.ADDED_FLAG, Policy.bind("flag_indicating_that_the_file_has_been_added_to_the_server_47")); //$NON-NLS-1$ return bindings; } }
\ No newline at end of file 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 f6d64042b..404b10e17 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 @@ -355,3 +355,36 @@ UpdateSyncAction.Only_update_resources_that_can_be_automatically_merged_3=Only u UpdateSyncAction.Update_all_resources,_overwriting_local_changes_with_remote_contents_4=Update all resources, overwriting local changes with remote contents UpdateSyncAction.Overwrite_local_changes__5=Overwrite local changes? UpdateSyncAction.You_have_local_changes_you_are_about_to_overwrite._Do_you_wish_to_continue__6=You have local changes you are about to overwrite. Do you wish to continue? + +Example__1=Example: +Text_Labels_12=Text Labels +Select_the_format_for_file,_folders,_and_project_text_labels__13=Select the format for file, folders, and project text labels: +&File_Format__14=&File Format: +Add_&Variables_15=Add &Variables +F&older_Format__16=F&older Format: +Add_Varia&bles_17=Add Varia&bles +&Project_Format__18=&Project Format: +Add_Variable&s_19=Add Variable&s +&Label_decoration_for_outgoing__20=&Label decoration for outgoing: +Label_decorat&ion_for_added__22=Label decorat&ion for added: +Icon_Overlays_24=Icon Overlays +Sho&w_outgoing_25=Sho&w outgoing +Show_has_&remote_26=Show has &remote +S&how_is_added_27=S&how is added +&Compute_deep_outgoing_state_for_folders_(disabling_this_will_improve_decorator_performance)_28=&Compute deep outgoing state for folders (disabling this will improve decorator performance) +Select_the_&variables_to_add_to_the_decoration_format__30=Select the &variables to add to the decoration format: +Add_Variables_31=Add Variables +name_of_the_resource_being_decorated_34=name of the resource being decorated +the_tag_applied_to_the_resource_(version,_branch,_or_date)_35=the tag applied to the resource (version, branch, or date) +the_repository_location__s_hostname_36=the repository location\'s hostname +the_connection_method_(e.g._pserver,_ssh)_37=the connection method (e.g. pserver, ssh) +user_name_for_the_connection_38=user name for the connection +repository_home_directory_on_server_39=repository home directory on server +root_relative_directory_40=root relative directory +flag_indicating_that_the_folder_has_a_child_resource_with_outgoing_changes_41=flag indicating that the folder has a child resource with outgoing changes +name_of_the_resource_being_decorated_42=name of the resource being decorated +the_tag_applied_to_the_resource_43=the tag applied to the resource +keyword_subsitution_rule_for_the_resource_44=keyword subsitution rule for the resource +last_revision_loaded_into_workspace_45=last revision loaded into workspace +flag_indicating_that_the_file_has_outgoing_changes_46=flag indicating that the file has outgoing changes +flag_indicating_that_the_file_has_been_added_to_the_server_47=flag indicating that the file has been added to the server
\ No newline at end of file |