diff options
author | spingel | 2008-12-04 01:21:37 +0000 |
---|---|---|
committer | spingel | 2008-12-04 01:21:37 +0000 |
commit | fdde300555d2e2fbb67ef211e7b39c996748cd68 (patch) | |
tree | 0ee53a5ccfe7eec5d5dee3645bcb0536c27cb018 | |
parent | 496578e11bfc15ee2e4f872e7fd4a101b3f6086c (diff) | |
download | org.eclipse.mylyn.tasks-fdde300555d2e2fbb67ef211e7b39c996748cd68.tar.gz org.eclipse.mylyn.tasks-fdde300555d2e2fbb67ef211e7b39c996748cd68.tar.xz org.eclipse.mylyn.tasks-fdde300555d2e2fbb67ef211e7b39c996748cd68.zip |
NEW - bug 253125: externalize strings for org.eclipse.mylyn.tasks.*
https://bugs.eclipse.org/bugs/show_bug.cgi?id=253125
63 files changed, 742 insertions, 493 deletions
diff --git a/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF index 8c8b6525c..516646594 100644 --- a/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF +++ b/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF @@ -1,9 +1,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Mylyn Tasks Core +Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.mylyn.tasks.core;singleton:=true Bundle-Version: 3.1.0.qualifier -Bundle-Vendor: Eclipse.org +Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.net, @@ -17,3 +17,4 @@ Export-Package: org.eclipse.mylyn.internal.provisional.tasks.core;x-internal:=tr org.eclipse.mylyn.tasks.core, org.eclipse.mylyn.tasks.core.data, org.eclipse.mylyn.tasks.core.sync +Bundle-Localization: plugin diff --git a/org.eclipse.mylyn.tasks.core/build.properties b/org.eclipse.mylyn.tasks.core/build.properties index 812285c52..36dd8a8a4 100644 --- a/org.eclipse.mylyn.tasks.core/build.properties +++ b/org.eclipse.mylyn.tasks.core/build.properties @@ -8,7 +8,8 @@ bin.includes = META-INF/,\ plugin.xml,\ .,\ - about.html + about.html,\ + plugin.properties src.includes = about.html,\ schema/ jre.compilation.profile = J2SE-1.5 diff --git a/org.eclipse.mylyn.tasks.core/plugin.properties b/org.eclipse.mylyn.tasks.core/plugin.properties new file mode 100644 index 000000000..3fbcc8402 --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/plugin.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.mylyn.tasks.core +Bundle-Vendor = Eclipse.org +Bundle-Name = Mylyn Tasks Core diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java index 43b418486..42cde428d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java @@ -32,7 +32,7 @@ import org.eclipse.mylyn.tasks.core.ITask; */ public abstract class AbstractTask extends AbstractTaskContainer implements ITask { - public static final String DEFAULT_TASK_KIND = "task"; + public static final String DEFAULT_TASK_KIND = "task"; //$NON-NLS-1$ private String repositoryUrl; @@ -80,7 +80,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas private Date dueDate = null; - private String notes = ""; + private String notes = ""; //$NON-NLS-1$ private int estimatedTimeHours = 1; @@ -168,7 +168,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.owner, owner)) { String oldValue = this.owner; this.owner = owner; - firePropertyChange("owner", oldValue, owner); + firePropertyChange("owner", oldValue, owner); //$NON-NLS-1$ } } @@ -193,7 +193,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas @Override public final void setHandleIdentifier(String handleIdentifier) { - throw new RuntimeException("Cannot set the handle identifier of a task, set repository URL instead."); + throw new RuntimeException("Cannot set the handle identifier of a task, set repository URL instead."); //$NON-NLS-1$ } public final void setRepositoryUrl(String repositoryUrl) { @@ -271,14 +271,14 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.priority, priority)) { String oldValue = this.priority; this.priority = priority; - firePropertyChange("priority", oldValue, priority); + firePropertyChange("priority", oldValue, priority); //$NON-NLS-1$ } } public String getNotes() { // TODO: removed check for null once xml updated. if (notes == null) { - notes = ""; + notes = ""; //$NON-NLS-1$ } return notes; } @@ -348,7 +348,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.creationDate, creationDate)) { Date oldValue = this.creationDate; this.creationDate = creationDate; - firePropertyChange("creationDate", oldValue, creationDate); + firePropertyChange("creationDate", oldValue, creationDate); //$NON-NLS-1$ } } @@ -357,7 +357,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.summary, summary)) { String oldValue = this.summary; this.summary = summary; - firePropertyChange("summary", oldValue, summary); + firePropertyChange("summary", oldValue, summary); //$NON-NLS-1$ } } @@ -365,7 +365,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.completionDate, completionDate)) { Date oldValue = this.completionDate; this.completionDate = completionDate; - firePropertyChange("completionDate", oldValue, completionDate); + firePropertyChange("completionDate", oldValue, completionDate); //$NON-NLS-1$ } } @@ -414,7 +414,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.taskKind, taskKind)) { String oldValue = this.taskKind; this.taskKind = taskKind; - firePropertyChange("taskKind", oldValue, taskKind); + firePropertyChange("taskKind", oldValue, taskKind); //$NON-NLS-1$ } } @@ -431,7 +431,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.dueDate, date)) { Date oldValue = this.dueDate; this.dueDate = date; - firePropertyChange("dueDate", oldValue, date); + firePropertyChange("dueDate", oldValue, date); //$NON-NLS-1$ } } @@ -453,7 +453,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.modificationDate, modificationDate)) { Date oldValue = this.modificationDate; this.modificationDate = modificationDate; - firePropertyChange("modificationDate", oldValue, modificationDate); + firePropertyChange("modificationDate", oldValue, modificationDate); //$NON-NLS-1$ } } @@ -469,7 +469,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas if (!areEqual(this.taskKey, taskKey)) { String oldValue = this.taskKey; this.taskKey = taskKey; - firePropertyChange("taskKey", oldValue, taskKey); + firePropertyChange("taskKey", oldValue, taskKey); //$NON-NLS-1$ } } @@ -506,7 +506,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas String oldValue = getUrl(); if (!areEqual(oldValue, url)) { super.setUrl(url); - firePropertyChange("url", oldValue, url); + firePropertyChange("url", oldValue, url); //$NON-NLS-1$ } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java index dc3b3e382..bd720fa3d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java @@ -31,7 +31,7 @@ import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; */ public abstract class AbstractTaskContainer extends PlatformObject implements IRepositoryElement, ITaskContainer { - private String handleIdentifier = ""; + private String handleIdentifier = ""; //$NON-NLS-1$ private final Collection<ITask> children = new CopyOnWriteArrayList<ITask>(); @@ -147,7 +147,7 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IR @Override public String toString() { - return "container: " + handleIdentifier; + return "container: " + handleIdentifier; //$NON-NLS-1$ } public String getPriority() { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AutomaticRepositoryTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AutomaticRepositoryTaskContainer.java index 250527fcc..cb22bb48a 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AutomaticRepositoryTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AutomaticRepositoryTaskContainer.java @@ -34,7 +34,7 @@ public abstract class AutomaticRepositoryTaskContainer extends AbstractTaskCateg @Override public String getSummary() { - return getSummaryLabel() + " [" + getRepositoryUrl() + "]"; + return getSummaryLabel() + " [" + getRepositoryUrl() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ } @Override @@ -60,7 +60,7 @@ public abstract class AutomaticRepositoryTaskContainer extends AbstractTaskCateg */ public void setRepositoryUrl(String repositoryUrl) { this.repositoryUrl = repositoryUrl; - this.setHandleIdentifier(repositoryUrl + "-" + getHandleSuffix()); + this.setHandleIdentifier(repositoryUrl + "-" + getHandleSuffix()); //$NON-NLS-1$ } }
\ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java index 36c280195..f0c2c0407 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java @@ -49,10 +49,10 @@ public class CommentQuoter { public String quote(String text) { StringBuilder sb = new StringBuilder(text.length() + text.length() / lineSize); - String[] lines = text.split("\n"); + String[] lines = text.split("\n"); //$NON-NLS-1$ for (String line : lines) { - if (line.trim().equals("")) { - sb.append("> \n"); + if (line.trim().equals("")) { //$NON-NLS-1$ + sb.append("> \n"); //$NON-NLS-1$ continue; } @@ -83,10 +83,10 @@ public class CommentQuoter { // Extract the substring and recalculate the next search // start point String wrappedLine = line.substring(pos, wrapPos).trim(); - sb.append("> " + wrappedLine + "\n"); + sb.append("> " + wrappedLine + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ pos = wrapPos + 1; } else { - sb.append("> " + line.substring(pos).trim() + "\n"); + sb.append("> " + line.substring(pos).trim() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ break; } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DayDateRange.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DayDateRange.java index 6ad489dab..7e1a9004f 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DayDateRange.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DayDateRange.java @@ -45,32 +45,32 @@ public class DayDateRange extends DateRange { endNextWeek.add(Calendar.DAY_OF_YEAR, 7); boolean isNextWeek = TaskActivityUtil.getNextWeek().includes(this) && this.before(endNextWeek); if (isThisWeek || (useDayOfWeekForNextWeek && isNextWeek)) { - String day = ""; + String day = ""; //$NON-NLS-1$ switch (getStartDate().get(Calendar.DAY_OF_WEEK)) { case Calendar.MONDAY: - day = "Monday"; + day = Messages.DayDateRange_Monday; break; case Calendar.TUESDAY: - day = "Tuesday"; + day = Messages.DayDateRange_Tuesday; break; case Calendar.WEDNESDAY: - day = "Wednesday"; + day = Messages.DayDateRange_Wednesday; break; case Calendar.THURSDAY: - day = "Thursday"; + day = Messages.DayDateRange_Thursday; break; case Calendar.FRIDAY: - day = "Friday"; + day = Messages.DayDateRange_Friday; break; case Calendar.SATURDAY: - day = "Saturday"; + day = Messages.DayDateRange_Saturday; break; case Calendar.SUNDAY: - day = "Sunday"; + day = Messages.DayDateRange_Sunday; break; } if (isPresent()) { - return day + " - Today"; + return day + Messages.DayDateRange___Today; } else { return day; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java index 3bb0e5b3f..fb31a4520 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java @@ -17,24 +17,24 @@ package org.eclipse.mylyn.internal.tasks.core; */ public interface IRepositoryConstants { - public static final String OLD_PROPERTY_SYNCTIME = "synctime"; + public static final String OLD_PROPERTY_SYNCTIME = "synctime"; //$NON-NLS-1$ - public static final String PROPERTY_SYNCTIMESTAMP = "lastsynctimestamp"; + public static final String PROPERTY_SYNCTIMESTAMP = "lastsynctimestamp"; //$NON-NLS-1$ - public static final String PROPERTY_TIMEZONE = "timezone"; + public static final String PROPERTY_TIMEZONE = "timezone"; //$NON-NLS-1$ - public static final String PROPERTY_ENCODING = "encoding"; + public static final String PROPERTY_ENCODING = "encoding"; //$NON-NLS-1$ - public static final String PROPERTY_VERSION = "version"; + public static final String PROPERTY_VERSION = "version"; //$NON-NLS-1$ - public static final String PROPERTY_CONNECTOR_KIND = "kind"; + public static final String PROPERTY_CONNECTOR_KIND = "kind"; //$NON-NLS-1$ - public static final String PROPERTY_URL = "url"; + public static final String PROPERTY_URL = "url"; //$NON-NLS-1$ - public static final String PROPERTY_LABEL = "label"; + public static final String PROPERTY_LABEL = "label"; //$NON-NLS-1$ - public static final String PROPERTY_DELIM = ":"; + public static final String PROPERTY_DELIM = ":"; //$NON-NLS-1$ - public static final String KIND_UNKNOWN = "<unknown>"; + public static final String KIND_UNKNOWN = "<unknown>"; //$NON-NLS-1$ } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java index 7436e4501..9199d6d30 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java @@ -20,29 +20,29 @@ public interface ITasksCoreConstants { public static final int MAX_SUBTASK_DEPTH = 10; - public static final String ID_PLUGIN = "org.eclipse.mylyn.tasks.core"; + public static final String ID_PLUGIN = "org.eclipse.mylyn.tasks.core"; //$NON-NLS-1$ - public static final String OLD_TASK_LIST_FILE = "tasklist.xml"; + public static final String OLD_TASK_LIST_FILE = "tasklist.xml"; //$NON-NLS-1$ - public static final String FILENAME_ENCODING = "UTF-8"; + public static final String FILENAME_ENCODING = "UTF-8"; //$NON-NLS-1$ - public static final String OLD_PREFIX_TASKLIST = "tasklist"; + public static final String OLD_PREFIX_TASKLIST = "tasklist"; //$NON-NLS-1$ - public static final String PREFIX_TASKS = "tasks"; + public static final String PREFIX_TASKS = "tasks"; //$NON-NLS-1$ - public static final String DEFAULT_BACKUP_FOLDER_NAME = "backup"; + public static final String DEFAULT_BACKUP_FOLDER_NAME = "backup"; //$NON-NLS-1$ - public static final String FILE_EXTENSION = ".xml.zip"; + public static final String FILE_EXTENSION = ".xml.zip"; //$NON-NLS-1$ - public static final String OLD_FILENAME_TIMESTAMP_FORMAT = "yyyy-MM-dd"; + public static final String OLD_FILENAME_TIMESTAMP_FORMAT = "yyyy-MM-dd"; //$NON-NLS-1$ - public static final String FILENAME_TIMESTAMP_FORMAT = "yyyy-MM-dd-HHmmss"; + public static final String FILENAME_TIMESTAMP_FORMAT = "yyyy-MM-dd-HHmmss"; //$NON-NLS-1$ public static final String OLD_M_2_TASKLIST_FILENAME = OLD_PREFIX_TASKLIST + FILE_EXTENSION; public static final String DEFAULT_TASK_LIST_FILE = PREFIX_TASKS + FILE_EXTENSION; - public static final String CONTEXTS_DIRECTORY = "contexts"; + public static final String CONTEXTS_DIRECTORY = "contexts"; //$NON-NLS-1$ public static final ActivityContextSchedulingRule ACTIVITY_SCHEDULING_RULE = new ActivityContextSchedulingRule(); @@ -50,9 +50,9 @@ public interface ITasksCoreConstants { public static final ISchedulingRule ROOT_SCHEDULING_RULE = new RootSchedulingRule(); - public static final String ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL = "outgoingNewRepositoryUrl"; + public static final String ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL = "outgoingNewRepositoryUrl"; //$NON-NLS-1$ - public static final String ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND = "outgoingNewConnectorKind"; + public static final String ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND = "outgoingNewConnectorKind"; //$NON-NLS-1$ static class ActivityContextSchedulingRule extends RootSchedulingRule { @Override @@ -96,8 +96,8 @@ public interface ITasksCoreConstants { } } - public static final String PROPERTY_ACTIVATE_TASK = "org.eclipse.mylyn.activateTask"; + public static final String PROPERTY_ACTIVATE_TASK = "org.eclipse.mylyn.activateTask"; //$NON-NLS-1$ - public static final String PROPERTY_LINK_PROVIDER_TIMEOUT = "org.eclipse.mylyn.linkProviderTimeout"; + public static final String PROPERTY_LINK_PROVIDER_TIMEOUT = "org.eclipse.mylyn.linkProviderTimeout"; //$NON-NLS-1$ } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java index 339553028..94ccf1e27 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java @@ -27,15 +27,15 @@ import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession; */ public class LocalRepositoryConnector extends AbstractRepositoryConnector { - public static final String REPOSITORY_LABEL = "Local"; + public static final String REPOSITORY_LABEL = Messages.LocalRepositoryConnector_Local; - public static final String CONNECTOR_KIND = "local"; + public static final String CONNECTOR_KIND = "local"; //$NON-NLS-1$ - public static final String REPOSITORY_URL = "local"; + public static final String REPOSITORY_URL = "local"; //$NON-NLS-1$ - public static final String REPOSITORY_VERSION = "1"; + public static final String REPOSITORY_VERSION = "1"; //$NON-NLS-1$ - public static final String DEFAULT_SUMMARY = "New Task"; + public static final String DEFAULT_SUMMARY = Messages.LocalRepositoryConnector_New_Task; @Override public boolean canCreateNewTask(TaskRepository repository) { @@ -49,7 +49,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector { @Override public String getLabel() { - return "Local Task Repository"; + return Messages.LocalRepositoryConnector_Local_Task_Repository; } @Override diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java index 526fb8259..6c9aec5e5 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java @@ -16,7 +16,7 @@ package org.eclipse.mylyn.internal.tasks.core; */ public class LocalTask extends AbstractTask { - public static final String SYNC_DATE_NOW = "now"; + public static final String SYNC_DATE_NOW = "now"; //$NON-NLS-1$ public LocalTask(String taskId, String summary) { super(LocalRepositoryConnector.REPOSITORY_URL, taskId, summary); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java new file mode 100644 index 000000000..dcd455fb7 --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.core; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.core.messages"; //$NON-NLS-1$ + + static { + // load message values from bundle file + reloadMessages(); + } + + public static void reloadMessages() { + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + public static String DayDateRange_Friday; + public static String DayDateRange_Monday; + public static String DayDateRange_Saturday; + public static String DayDateRange_Sunday; + public static String DayDateRange_Thursday; + public static String DayDateRange___Today; + public static String DayDateRange_Tuesday; + public static String DayDateRange_Wednesday; + + public static String LocalRepositoryConnector_Local; + public static String LocalRepositoryConnector_Local_Task_Repository; + public static String LocalRepositoryConnector_New_Task; + + public static String RepositoryExternalizationParticipant_Task_Repositories; + + public static String TaskRepositoryManager_No_repository_available; + + public static String UncategorizedTaskContainer_Uncategorized; + + public static String UnmatchedTaskContainer_Unmatched; + + public static String UnsubmittedTaskContainer_Unsubmitted; + + public static String WeekDateRange_Next_Week; + public static String WeekDateRange_Previous_Week; + public static String WeekDateRange_This_Week; + public static String WeekDateRange_Two_Weeks; + + public static String PriorityLevel_High; + public static String PriorityLevel_Low; + public static String PriorityLevel_Normal; + public static String PriorityLevel_Very_High; + public static String PriorityLevel_Very_Low; + +} diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryExternalizationParticipant.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryExternalizationParticipant.java index d810e5309..af224d6b3 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryExternalizationParticipant.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryExternalizationParticipant.java @@ -28,7 +28,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; public class RepositoryExternalizationParticipant extends AbstractExternalizationParticipant implements IRepositoryListener { - private static final String DESCRIPTION = "Task Repositories"; + private static final String DESCRIPTION = Messages.RepositoryExternalizationParticipant_Task_Repositories; private final TaskRepositoryManager repositoryManager; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryPerson.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryPerson.java index bd83260a8..e974830a2 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryPerson.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryPerson.java @@ -59,7 +59,7 @@ public class RepositoryPerson implements IRepositoryPerson { if (getName() == null) { return getPersonId(); } else { - return getName() + " <" + getPersonId() + ">"; + return getName() + " <" + getPersonId() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryQuery.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryQuery.java index 6bac82415..1597c147a 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryQuery.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryQuery.java @@ -29,7 +29,7 @@ public class RepositoryQuery extends AbstractTaskContainer implements IRepositor private final String connectorKind; - protected String lastSynchronizedStamp = "<never>"; + protected String lastSynchronizedStamp = "<never>"; //$NON-NLS-1$ protected String repositoryUrl; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java index c2a3b302f..25ddcdabe 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java @@ -16,13 +16,13 @@ package org.eclipse.mylyn.internal.tasks.core; */ public class RepositoryTaskHandleUtil { - public static final String HANDLE_DELIM = "-"; + public static final String HANDLE_DELIM = "-"; //$NON-NLS-1$ - private static final String MISSING_REPOSITORY = "norepository"; + private static final String MISSING_REPOSITORY = "norepository"; //$NON-NLS-1$ public static String getHandle(String repositoryUrl, String taskId) { if (!isValidTaskId(taskId)) { - throw new RuntimeException("invalid handle for task, can not contain: " + HANDLE_DELIM + ", was: " + taskId); + throw new RuntimeException("invalid handle for task, can not contain: " + HANDLE_DELIM + ", was: " + taskId); //$NON-NLS-1$ //$NON-NLS-2$ } if (repositoryUrl == null) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java index 3bbc5d8b2..b62e7876c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java @@ -26,7 +26,7 @@ import org.xml.sax.helpers.DefaultHandler; */ public class SaxRepositoriesContentHandler extends DefaultHandler { - static final String ATTRIBUTE_INTERACTION_EVENT = "InteractionEvent"; + static final String ATTRIBUTE_INTERACTION_EVENT = "InteractionEvent"; //$NON-NLS-1$ private final Set<TaskRepository> taskRepositories = new HashSet<TaskRepository>(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java index 36162cac6..6f7950aa4 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java @@ -52,7 +52,7 @@ public class SaxRepositoriesWriter { public void writeRepositoriesToStream(Collection<TaskRepository> repositories) throws IOException { if (outputStream == null) { - IOException ioe = new IOException("OutputStream not set"); + IOException ioe = new IOException("OutputStream not set"); //$NON-NLS-1$ throw ioe; } @@ -62,7 +62,7 @@ public class SaxRepositoriesWriter { new SAXSource(new RepositoriesWriter(), new TaskRepositoriesInputSource(repositories)), new StreamResult(outputStream)); } catch (TransformerException e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not write repositories", + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not write repositories", //$NON-NLS-1$ e)); throw new IOException(e.getMessage()); } @@ -148,17 +148,17 @@ public class SaxRepositoriesWriter { @SuppressWarnings( { "deprecation", "restriction" }) public void parse(InputSource input) throws IOException, SAXException { if (!(input instanceof TaskRepositoriesInputSource)) { - throw new SAXException("Can only parse writable input sources"); + throw new SAXException("Can only parse writable input sources"); //$NON-NLS-1$ } Collection<TaskRepository> repositories = ((TaskRepositoriesInputSource) input).getRepositories(); handler.startDocument(); AttributesImpl rootAttributes = new AttributesImpl(); - rootAttributes.addAttribute("", TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, - TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, "", "1"); + rootAttributes.addAttribute("", TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, //$NON-NLS-1$ + TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, "", "1"); //$NON-NLS-1$ //$NON-NLS-2$ - handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, + handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, //$NON-NLS-1$ TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, rootAttributes); for (TaskRepository repository : new ArrayList<TaskRepository>(repositories)) { @@ -166,27 +166,27 @@ public class SaxRepositoriesWriter { AttributesImpl ieAttributes = new AttributesImpl(); for (String key : repository.getProperties().keySet()) { ieAttributes.addAttribute( - "", + "", //$NON-NLS-1$ key, key, - "", + "", //$NON-NLS-1$ org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(repository.getProperties() .get(key))); } - handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, + handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, //$NON-NLS-1$ TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, ieAttributes); - handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, + handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, //$NON-NLS-1$ TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY); } - handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, + handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, //$NON-NLS-1$ TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES); handler.endDocument(); } public void parse(String systemId) throws IOException, SAXException { - throw new SAXException("Can only parse writable input sources"); + throw new SAXException("Can only parse writable input sources"); //$NON-NLS-1$ } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java index 1c7e20bf0..ec8986b38 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java @@ -185,12 +185,12 @@ public class ScheduledTaskContainer extends AbstractTaskContainer { @Override public String getPriority() { - return ""; + return ""; //$NON-NLS-1$ } @Override public String getUrl() { - return ""; + return ""; //$NON-NLS-1$ } @Override diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java index 11ea2b788..61efae1cf 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java @@ -175,7 +175,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.elapsedTimeUpdated(task, getElapsedTime(task)); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task activity listener failed: \"" + listener + "\"", t)); + "Task activity listener failed: \"" + listener + "\"", t)); //$NON-NLS-1$ //$NON-NLS-2$ } } } @@ -287,7 +287,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.elapsedTimeUpdated(task, totalElapsed); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task activity listener failed: \"" + listener + "\"", t)); + "Task activity listener failed: \"" + listener + "\"", t)); //$NON-NLS-1$ //$NON-NLS-2$ } } } @@ -401,7 +401,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.preTaskActivated(task); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task activity listener failed: " + listener, t)); + "Task activity listener failed: " + listener, t)); //$NON-NLS-1$ } } @@ -413,7 +413,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.taskActivated(task); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task activity listener failed: " + listener, t)); + "Task activity listener failed: " + listener, t)); //$NON-NLS-1$ } } } @@ -436,7 +436,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.preTaskDeactivated(task); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Notification failed for: " + listener, t)); + "Notification failed for: " + listener, t)); //$NON-NLS-1$ } } @@ -448,7 +448,7 @@ public class TaskActivityManager implements ITaskActivityManager { listener.taskDeactivated(task); } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Notification failed for: " + listener, t)); + "Notification failed for: " + listener, t)); //$NON-NLS-1$ } } } else { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java index 13b1e5a9c..15f04401e 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java @@ -44,7 +44,7 @@ import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; */ public class TaskList implements ITaskList { - private static String DEFAULT_HANDLE_PREFIX = "handle-"; + private static String DEFAULT_HANDLE_PREFIX = "handle-"; //$NON-NLS-1$ private static ILock lock = Job.getJobManager().newLock(); @@ -77,8 +77,8 @@ public class TaskList implements ITaskList { try { lock(); if (categories.containsKey(category.getHandleIdentifier())) { - throw new IllegalArgumentException("Handle " + category.getHandleIdentifier() - + " already exists in task list"); + throw new IllegalArgumentException("Handle " + category.getHandleIdentifier() //$NON-NLS-1$ + + " already exists in task list"); //$NON-NLS-1$ } categories.put(category.getHandleIdentifier(), category); delta.add(new TaskContainerDelta(category, TaskContainerDelta.Kind.ADDED)); @@ -113,8 +113,8 @@ public class TaskList implements ITaskList { try { lock(); if (queries.containsKey(query.getHandleIdentifier())) { - throw new IllegalArgumentException("Handle " + query.getHandleIdentifier() - + " already exists in task list"); + throw new IllegalArgumentException("Handle " + query.getHandleIdentifier() //$NON-NLS-1$ + + " already exists in task list"); //$NON-NLS-1$ } queries.put(query.getHandleIdentifier(), query); delta.add(new TaskContainerDelta(query, TaskContainerDelta.Kind.ADDED)); @@ -259,7 +259,7 @@ public class TaskList implements ITaskList { try { listener.containersChanged(Collections.unmodifiableSet(deltasToFire)); } catch (Throwable t) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Notification failed for: " + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Notification failed for: " //$NON-NLS-1$ + listener, t)); } } @@ -428,7 +428,7 @@ public class TaskList implements ITaskList { UnmatchedTaskContainer orphans = repositoryOrphansMap.get(repositoryUrl); if (orphans == null) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Failed to find unmatched container for repository \"" + repositoryUrl + "\"")); + "Failed to find unmatched container for repository \"" + repositoryUrl + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ } return orphans; } @@ -462,8 +462,8 @@ public class TaskList implements ITaskList { } if (result == null) { - throw new IllegalArgumentException("Element " + taskListElement.getHandleIdentifier() - + " does not exist in the task list."); + throw new IllegalArgumentException("Element " + taskListElement.getHandleIdentifier() //$NON-NLS-1$ + + " does not exist in the task list."); //$NON-NLS-1$ } else { return result; } @@ -708,7 +708,7 @@ public class TaskList implements ITaskList { return handle; } } - throw new RuntimeException("No more unique handles for task list"); + throw new RuntimeException("No more unique handles for task list"); //$NON-NLS-1$ } finally { unlock(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoriesExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoriesExternalizer.java index 62b313dfc..0d8592d33 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoriesExternalizer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoriesExternalizer.java @@ -39,11 +39,11 @@ public class TaskRepositoriesExternalizer { private final SaxRepositoriesWriter writer = new SaxRepositoriesWriter(); - public static final String ELEMENT_TASK_REPOSITORIES = "TaskRepositories"; + public static final String ELEMENT_TASK_REPOSITORIES = "TaskRepositories"; //$NON-NLS-1$ - public static final String ELEMENT_TASK_REPOSITORY = "TaskRepository"; + public static final String ELEMENT_TASK_REPOSITORY = "TaskRepository"; //$NON-NLS-1$ - public static final String ATTRIBUTE_VERSION = "OutputVersion"; + public static final String ATTRIBUTE_VERSION = "OutputVersion"; //$NON-NLS-1$ public void writeRepositoriesToXML(Collection<TaskRepository> repositories, File file) { ZipOutputStream outputStream = null; @@ -57,14 +57,14 @@ public class TaskRepositoriesExternalizer { outputStream.close(); } catch (IOException e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not write: " + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not write: " //$NON-NLS-1$ + file.getAbsolutePath(), e)); } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not close: " + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not close: " //$NON-NLS-1$ + file.getAbsolutePath(), e)); } } @@ -117,8 +117,8 @@ public class TaskRepositoriesExternalizer { reader.parse(new InputSource(inputStream)); return contentHandler.getRepositories(); } catch (Throwable e) { - file.renameTo(new File(file.getAbsolutePath() + "-save")); - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error reading context file", e)); + file.renameTo(new File(file.getAbsolutePath() + "-save")); //$NON-NLS-1$ + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error reading context file", e)); //$NON-NLS-1$ return null; } finally { if (inputStream != null) { @@ -126,7 +126,7 @@ public class TaskRepositoriesExternalizer { inputStream.close(); } catch (IOException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Error closing context file", e)); + "Error closing context file", e)); //$NON-NLS-1$ } } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryLocation.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryLocation.java index 6c94faed1..3dc60bba5 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryLocation.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryLocation.java @@ -42,8 +42,8 @@ public class TaskRepositoryLocation extends AbstractWebLocation { if (!taskRepository.isDefaultProxyEnabled()) { String proxyHost = taskRepository.getProperty(TaskRepository.PROXY_HOSTNAME); String proxyPort = taskRepository.getProperty(TaskRepository.PROXY_PORT); - String proxyUsername = ""; - String proxyPassword = ""; + String proxyUsername = ""; //$NON-NLS-1$ + String proxyPassword = ""; //$NON-NLS-1$ AuthenticationCredentials credentials = taskRepository.getCredentials(AuthenticationType.PROXY); if (proxyHost != null && proxyHost.length() > 0 && credentials != null) { proxyUsername = credentials.getUserName(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java index 42df03f5d..aacf135cb 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java @@ -45,11 +45,11 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; */ public class TaskRepositoryManager implements IRepositoryManager { - public static final String OLD_REPOSITORIES_FILE = "repositories.xml"; + public static final String OLD_REPOSITORIES_FILE = "repositories.xml"; //$NON-NLS-1$ - public static final String DEFAULT_REPOSITORIES_FILE = "repositories.xml.zip"; + public static final String DEFAULT_REPOSITORIES_FILE = "repositories.xml.zip"; //$NON-NLS-1$ - public static final String PREF_REPOSITORIES = "org.eclipse.mylyn.tasklist.repositories."; + public static final String PREF_REPOSITORIES = "org.eclipse.mylyn.tasklist.repositories."; //$NON-NLS-1$ private final Map<String, AbstractRepositoryConnector> repositoryConnectors = new HashMap<String, AbstractRepositoryConnector>(); @@ -59,9 +59,9 @@ public class TaskRepositoryManager implements IRepositoryManager { private final Set<TaskRepository> orphanedRepositories = new HashSet<TaskRepository>(); - public static final String MESSAGE_NO_REPOSITORY = "No repository available, please add one using the Task Repositories view."; + public static final String MESSAGE_NO_REPOSITORY = Messages.TaskRepositoryManager_No_repository_available; - public static final String PREFIX_LOCAL = "local-"; + public static final String PREFIX_LOCAL = "local-"; //$NON-NLS-1$ private final PropertyChangeListener PROPERTY_CHANGE_LISTENER = new PropertyChangeListener() { @@ -317,7 +317,7 @@ public class TaskRepositoryManager implements IRepositoryManager { File repositoriesFile = new File(destinationPath); externalizer.writeRepositoriesToXML(repositoriesToWrite, repositoriesFile); } catch (Throwable t) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not save repositories", t)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not save repositories", t)); //$NON-NLS-1$ return false; } return true; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskTask.java index a13f1364d..9fdb9f756 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskTask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskTask.java @@ -19,7 +19,7 @@ public class TaskTask extends AbstractTask { private final String connectorKind; public TaskTask(String connectorKind, String repositoryUrl, String taskId) { - super(repositoryUrl, taskId, ""); + super(repositoryUrl, taskId, ""); //$NON-NLS-1$ this.connectorKind = connectorKind; this.taskKey = taskId; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UncategorizedTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UncategorizedTaskContainer.java index 2c4a8b41a..1d7415150 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UncategorizedTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UncategorizedTaskContainer.java @@ -20,7 +20,7 @@ import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel; */ public class UncategorizedTaskContainer extends AbstractTaskCategory { - public static final String LABEL = "Uncategorized"; + public static final String LABEL = Messages.UncategorizedTaskContainer_Uncategorized; public static final String HANDLE = LABEL; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnmatchedTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnmatchedTaskContainer.java index f8a9a28fb..f6d796f3b 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnmatchedTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnmatchedTaskContainer.java @@ -19,12 +19,12 @@ package org.eclipse.mylyn.internal.tasks.core; */ public class UnmatchedTaskContainer extends AutomaticRepositoryTaskContainer { - public static final String LABEL = "Unmatched"; + public static final String LABEL = Messages.UnmatchedTaskContainer_Unmatched; - public static final String HANDLE = "orphans"; + public static final String HANDLE = "orphans"; //$NON-NLS-1$ public UnmatchedTaskContainer(String connectorKind, String repositoryUrl) { - super(repositoryUrl + "-" + HANDLE, connectorKind, repositoryUrl); + super(repositoryUrl + "-" + HANDLE, connectorKind, repositoryUrl); //$NON-NLS-1$ } @Override diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnsubmittedTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnsubmittedTaskContainer.java index 7e20f97f7..3b94980ab 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnsubmittedTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnsubmittedTaskContainer.java @@ -17,12 +17,12 @@ package org.eclipse.mylyn.internal.tasks.core; */ public class UnsubmittedTaskContainer extends AutomaticRepositoryTaskContainer { - private static final String LABEL = "Unsubmitted"; + private static final String LABEL = Messages.UnsubmittedTaskContainer_Unsubmitted; - private static final String HANDLE = "unsubmitted"; + private static final String HANDLE = "unsubmitted"; //$NON-NLS-1$ public UnsubmittedTaskContainer(String connectorKind, String repositoryUrl) { - super(repositoryUrl + "-" + HANDLE, connectorKind, repositoryUrl); + super(repositoryUrl + "-" + HANDLE, connectorKind, repositoryUrl); //$NON-NLS-1$ } @Override diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/WeekDateRange.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/WeekDateRange.java index aa3d77eea..7c3b398c6 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/WeekDateRange.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/WeekDateRange.java @@ -20,13 +20,13 @@ import java.util.List; */ public class WeekDateRange extends DateRange { - private static final String DESCRIPTION_WEEK_AFTER_NEXT = "Two Weeks"; + private static final String DESCRIPTION_WEEK_AFTER_NEXT = Messages.WeekDateRange_Two_Weeks; - private static final String DESCRIPTION_PREVIOUS_WEEK = "Previous Week"; + private static final String DESCRIPTION_PREVIOUS_WEEK = Messages.WeekDateRange_Previous_Week; - private static final String DESCRIPTION_THIS_WEEK = "This Week"; + private static final String DESCRIPTION_THIS_WEEK = Messages.WeekDateRange_This_Week; - private static final String DESCRIPTION_NEXT_WEEK = "Next Week"; + private static final String DESCRIPTION_NEXT_WEEK = Messages.WeekDateRange_Next_Week; private final List<DayDateRange> days = new ArrayList<DayDateRange>(); @@ -157,7 +157,7 @@ public class WeekDateRange extends DateRange { } } } - throw new IllegalArgumentException("Valid day values are 1 - 7"); + throw new IllegalArgumentException("Valid day values are 1 - 7"); //$NON-NLS-1$ } public static boolean isWeekRange(Calendar calStart, Calendar calEnd) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ElementHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ElementHandler.java index 9d5456378..d5b8c3be7 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ElementHandler.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ElementHandler.java @@ -84,7 +84,7 @@ class ElementHandler extends DefaultHandler { protected String getOptionalValue(Attributes attributes, String name) throws SAXException { String value = attributes.getValue(name); if (value == null) { - return ""; + return ""; //$NON-NLS-1$ } return value; } @@ -96,7 +96,7 @@ class ElementHandler extends DefaultHandler { protected String getValue(Attributes attributes, String name) throws SAXException { String value = attributes.getValue(name); if (value == null) { - throw new SAXException("Missing required attribute \"" + name + "\""); + throw new SAXException("Missing required attribute \"" + name + "\""); //$NON-NLS-1$ //$NON-NLS-2$ } return value; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java index 8cb7315da..9c5efcb08 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java @@ -31,27 +31,27 @@ import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource; */ public class FileTaskAttachmentSource extends AbstractTaskAttachmentSource { - public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; //$NON-NLS-1$ private static Map<String, String> extensions2Types; static { extensions2Types = new HashMap<String, String>(); - extensions2Types.put("txt", "text/plain"); - extensions2Types.put("html", "text/html"); - extensions2Types.put("htm", "text/html"); - extensions2Types.put("jpg", "image/jpeg"); - extensions2Types.put("jpeg", "image/jpeg"); - extensions2Types.put("gif", "image/gif"); - extensions2Types.put("png", "image/png"); - extensions2Types.put("xml", "application/xml"); - extensions2Types.put("zip", APPLICATION_OCTET_STREAM); - extensions2Types.put("tar", APPLICATION_OCTET_STREAM); - extensions2Types.put("gz", APPLICATION_OCTET_STREAM); + extensions2Types.put("txt", "text/plain"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("html", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("htm", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("jpg", "image/jpeg"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("jpeg", "image/jpeg"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("gif", "image/gif"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("png", "image/png"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("xml", "application/xml"); //$NON-NLS-1$ //$NON-NLS-2$ + extensions2Types.put("zip", APPLICATION_OCTET_STREAM); //$NON-NLS-1$ + extensions2Types.put("tar", APPLICATION_OCTET_STREAM); //$NON-NLS-1$ + extensions2Types.put("gz", APPLICATION_OCTET_STREAM); //$NON-NLS-1$ } public static String getContentTypeFromFilename(String fileName) { - int index = fileName.lastIndexOf("."); + int index = fileName.lastIndexOf("."); //$NON-NLS-1$ if (index > 0 && index < fileName.length()) { String ext = fileName.substring(index + 1); String type = extensions2Types.get(ext.toLowerCase(Locale.ENGLISH)); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ITaskDataConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ITaskDataConstants.java index 1f117fa67..41568f3d9 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ITaskDataConstants.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/ITaskDataConstants.java @@ -13,90 +13,90 @@ package org.eclipse.mylyn.internal.tasks.core.data; public interface ITaskDataConstants { - static final String ATTRIBUTE_TASK_KIND = "taskKind"; + static final String ATTRIBUTE_TASK_KIND = "taskKind"; //$NON-NLS-1$ - static final String ATTRIBUTE_IS_PATCH = "isPatch"; + static final String ATTRIBUTE_IS_PATCH = "isPatch"; //$NON-NLS-1$ - static final String ATTRIBUTE_IS_OBSOLETE = "isObsolete"; + static final String ATTRIBUTE_IS_OBSOLETE = "isObsolete"; //$NON-NLS-1$ - static final String ATTRIBUTE_CREATOR = "creator"; + static final String ATTRIBUTE_CREATOR = "creator"; //$NON-NLS-1$ - static final String ATTRIBUTE_NUMBER = "number"; + static final String ATTRIBUTE_NUMBER = "number"; //$NON-NLS-1$ - static final String ATTRIBUTE_HAS_ATTACHMENT = "hasAttachment"; + static final String ATTRIBUTE_HAS_ATTACHMENT = "hasAttachment"; //$NON-NLS-1$ - static final String ATTRIBUTE_ATTACHMENT_ID = "attachmentId"; + static final String ATTRIBUTE_ATTACHMENT_ID = "attachmentId"; //$NON-NLS-1$ - static final String ATTRIBUTE_KNOB_NAME = "knob_name"; + static final String ATTRIBUTE_KNOB_NAME = "knob_name"; //$NON-NLS-1$ - static final String ATTRIBUTE_OPERATION_NAME = "operationName"; + static final String ATTRIBUTE_OPERATION_NAME = "operationName"; //$NON-NLS-1$ - static final String ATTRIBUTE_OPTION_NAME = "optionName"; + static final String ATTRIBUTE_OPTION_NAME = "optionName"; //$NON-NLS-1$ - static final String ATTRIBUTE_OPTION_SELECTION = "optionSelection"; + static final String ATTRIBUTE_OPTION_SELECTION = "optionSelection"; //$NON-NLS-1$ - static final String ATTRIBUTE_IS_CHECKED = "isChecked"; + static final String ATTRIBUTE_IS_CHECKED = "isChecked"; //$NON-NLS-1$ - static final String ATTRIBUTE_INPUT_NAME = "inputName"; + static final String ATTRIBUTE_INPUT_NAME = "inputName"; //$NON-NLS-1$ - static final String ATTRIBUTE_INPUT_VALUE = "inputValue"; + static final String ATTRIBUTE_INPUT_VALUE = "inputValue"; //$NON-NLS-1$ - static final String ATTRIBUTE_READONLY = "readonly"; + static final String ATTRIBUTE_READONLY = "readonly"; //$NON-NLS-1$ - static final String ATTRIBUTE_HIDDEN = "hidden"; + static final String ATTRIBUTE_HIDDEN = "hidden"; //$NON-NLS-1$ - static final String ATTRIBUTE_PARAMETER = "parameter"; + static final String ATTRIBUTE_PARAMETER = "parameter"; //$NON-NLS-1$ - static final String ATTRIBUTE_VALUE = "value"; + static final String ATTRIBUTE_VALUE = "value"; //$NON-NLS-1$ - static final String ELEMENT_META = "meta"; + static final String ELEMENT_META = "meta"; //$NON-NLS-1$ - static final String ELEMENT_OPTION = "option"; + static final String ELEMENT_OPTION = "option"; //$NON-NLS-1$ - static final String ELEMENT_VALUE = "value"; + static final String ELEMENT_VALUE = "value"; //$NON-NLS-1$ - static final String ELEMENT_ATTRIBUTE = "Attribute"; + static final String ELEMENT_ATTRIBUTE = "Attribute"; //$NON-NLS-1$ - static final String ELEMENT_NAME = "name"; + static final String ELEMENT_NAME = "name"; //$NON-NLS-1$ - static final String ELEMENT_VALUES = "values"; + static final String ELEMENT_VALUES = "values"; //$NON-NLS-1$ - static final String ELEMENT_OPTIONS = "options"; + static final String ELEMENT_OPTIONS = "options"; //$NON-NLS-1$ - static final String ELEMENT_META_DATA = "MetaData"; + static final String ELEMENT_META_DATA = "MetaData"; //$NON-NLS-1$ - static final String ELEMENT_OPERATION = "Operation"; + static final String ELEMENT_OPERATION = "Operation"; //$NON-NLS-1$ - static final String ELEMENT_COMMENT = "Comment"; + static final String ELEMENT_COMMENT = "Comment"; //$NON-NLS-1$ - static final String ELEMENT_ATTACHMENT = "Attachment"; + static final String ELEMENT_ATTACHMENT = "Attachment"; //$NON-NLS-1$ - static final String ATTRIBUTE_REPOSITORY_KIND = "repositoryKind"; + static final String ATTRIBUTE_REPOSITORY_KIND = "repositoryKind"; //$NON-NLS-1$ - static final String ATTRIBUTE_CONNECTOR_KIND = "connectorKind"; + static final String ATTRIBUTE_CONNECTOR_KIND = "connectorKind"; //$NON-NLS-1$ - static final String ATTRIBUTE_REPOSITORY_URL = "repositoryUrl"; + static final String ATTRIBUTE_REPOSITORY_URL = "repositoryUrl"; //$NON-NLS-1$ - static final String ATTRIBUTE_KEY = "key"; + static final String ATTRIBUTE_KEY = "key"; //$NON-NLS-1$ - static final String ATTRIBUTE_ID = "id"; + static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$ - static final String ATTRIBUTE_NAME = "name"; + static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$ - static final String ELEMENT_EDITS_DATA = "EditsData"; + static final String ELEMENT_EDITS_DATA = "EditsData"; //$NON-NLS-1$ - static final String ELEMENT_OLD_DATA = "OldData"; + static final String ELEMENT_OLD_DATA = "OldData"; //$NON-NLS-1$ - static final String ELEMENT_NEW_DATA = "NewData"; + static final String ELEMENT_NEW_DATA = "NewData"; //$NON-NLS-1$ - static final String ATTRIBUTE_VERSION = "version"; + static final String ATTRIBUTE_VERSION = "version"; //$NON-NLS-1$ - static final String ELEMENT_TASK_STATE = "TaskState"; + static final String ELEMENT_TASK_STATE = "TaskState"; //$NON-NLS-1$ - static final String ELEMENT_KEY = "key"; + static final String ELEMENT_KEY = "key"; //$NON-NLS-1$ - static final String ATTRIBUTE_TASK_ID = "taskId"; + static final String ATTRIBUTE_TASK_ID = "taskId"; //$NON-NLS-1$ - static final String ELEMENT_ATTRIBUTES = "Attributes"; + static final String ELEMENT_ATTRIBUTES = "Attributes"; //$NON-NLS-1$ } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataExternalizer.java index c6db9fadd..4336296cd 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataExternalizer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataExternalizer.java @@ -56,13 +56,13 @@ public class TaskDataExternalizer { String connectorKind = taskDataState.getConnectorKind(); AbstractRepositoryConnector connector = taskRepositoryManager.getRepositoryConnector(connectorKind); if (connector == null) { - throw new IOException("No repository connector for kind \"" + connectorKind + "\" found"); + throw new IOException("No repository connector for kind \"" + connectorKind + "\" found"); //$NON-NLS-1$ //$NON-NLS-2$ } String repositoryUrl = taskDataState.getRepositoryUrl(); final TaskRepository taskRepository = taskRepositoryManager.getRepository(connectorKind, repositoryUrl); if (taskRepository == null) { - throw new IOException("Repository \"" + repositoryUrl + "\" not found for kind \"" + connectorKind + "\""); + throw new IOException("Repository \"" + repositoryUrl + "\" not found for kind \"" + connectorKind + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } final AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); @@ -103,7 +103,7 @@ public class TaskDataExternalizer { return taskDataState; } catch (SAXException e) { //e.printStackTrace(); - throw new IOException("Error parsing task data: " + e.getMessage()); + throw new IOException("Error parsing task data: " + e.getMessage()); //$NON-NLS-1$ } } @@ -112,15 +112,15 @@ public class TaskDataExternalizer { SAXTransformerFactory transformerFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); TransformerHandler handler = transformerFactory.newTransformerHandler(); Transformer serializer = handler.getTransformer(); - serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - serializer.setOutputProperty(OutputKeys.INDENT, "yes"); + serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$ + serializer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ handler.setResult(new StreamResult(out)); TaskDataStateWriter writer = new TaskDataStateWriter(handler); writer.write(state); } catch (TransformerException e) { - throw new IOException("Error writing task data" + e.getMessageAndLocation()); + throw new IOException("Error writing task data" + e.getMessageAndLocation()); //$NON-NLS-1$ } catch (SAXException e) { - throw new IOException("Error writing task data" + e.getMessage()); + throw new IOException("Error writing task data" + e.getMessage()); //$NON-NLS-1$ } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java index ee6781110..531e6f11f 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java @@ -50,15 +50,15 @@ import org.eclipse.mylyn.tasks.core.data.TaskData; */ public class TaskDataManager implements ITaskDataManager { - private static final String ENCODING_UTF_8 = "UTF-8"; + private static final String ENCODING_UTF_8 = "UTF-8"; //$NON-NLS-1$ - private static final String EXTENSION = ".zip"; + private static final String EXTENSION = ".zip"; //$NON-NLS-1$ - private static final String FOLDER_TASKS = "tasks"; + private static final String FOLDER_TASKS = "tasks"; //$NON-NLS-1$ - private static final String FOLDER_DATA = "offline"; + private static final String FOLDER_DATA = "offline"; //$NON-NLS-1$ - private static final String FOLDER_TASKS_1_0 = "offline"; + private static final String FOLDER_TASKS_1_0 = "offline"; //$NON-NLS-1$ private String dataPath; @@ -114,8 +114,8 @@ public class TaskDataManager implements ITaskDataManager { final File file = getMigratedFile(task, kind); final TaskDataState state = taskDataStore.getTaskDataState(file); if (state == null) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task data at \"" - + file + "\" not found")); + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task data at \"" //$NON-NLS-1$ + + file + "\" not found")); //$NON-NLS-1$ } if (task.isMarkReadPending()) { state.setLastReadData(state.getRepositoryData()); @@ -308,7 +308,7 @@ public class TaskDataManager implements ITaskDataManager { // String pathName = task.getConnectorKind() + "-" // + URLEncoder.encode(task.getRepositoryUrl(), ENCODING_UTF_8); // String fileName = kind + "-" + URLEncoder.encode(task.getTaskId(), ENCODING_UTF_8) + EXTENSION; - String repositoryPath = task.getConnectorKind() + "-" + encode(repositoryUrl); + String repositoryPath = task.getConnectorKind() + "-" + encode(repositoryUrl); //$NON-NLS-1$ String fileName = encode(task.getTaskId()) + EXTENSION; File path = new File(dataPath + File.separator + FOLDER_TASKS + File.separator + repositoryPath + File.separator + FOLDER_DATA); @@ -322,7 +322,7 @@ public class TaskDataManager implements ITaskDataManager { if (c >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '.') { sb.append(c); } else { - sb.append("%" + Integer.toHexString(c).toUpperCase()); + sb.append("%" + Integer.toHexString(c).toUpperCase()); //$NON-NLS-1$ } } return sb.toString(); @@ -458,7 +458,7 @@ public class TaskDataManager implements ITaskDataManager { }); } catch (CoreException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Unexpected error while marking task read", e)); + "Unexpected error while marking task read", e)); //$NON-NLS-1$ } taskList.notifyElementChanged(task); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java index 364209567..19f0fdf39 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java @@ -54,7 +54,7 @@ public class TaskDataStateReader extends DefaultHandler { attribute = createAttribute(parentAttribute, TaskAttribute.PREFIX_ATTACHMENT + ++id); attribute.getMetaData().defaults().setReadOnly(true).setType(TaskAttribute.TYPE_ATTACHMENT); // the actual attachment id is stored in a child node an correctly set in end() - attribute.setValue(id + ""); + attribute.setValue(id + ""); //$NON-NLS-1$ TaskAttribute child = createAttribute(attribute, TaskAttribute.ATTACHMENT_AUTHOR); child.setValue(getValue(attributes, ITaskDataConstants.ATTRIBUTE_CREATOR)); @@ -384,11 +384,11 @@ public class TaskDataStateReader extends DefaultHandler { super(null, ITaskDataConstants.ELEMENT_TASK_STATE); this.version = version; - if ("1.0".equals(version)) { + if ("1.0".equals(version)) { //$NON-NLS-1$ addElementHandler(new TaskDataHandler10(this, ITaskDataConstants.ELEMENT_NEW_DATA)); addElementHandler(new TaskDataHandler10(this, ITaskDataConstants.ELEMENT_OLD_DATA)); addElementHandler(new TaskDataHandler10(this, ITaskDataConstants.ELEMENT_EDITS_DATA)); - } else if ("2.0".equals(version)) { + } else if ("2.0".equals(version)) { //$NON-NLS-1$ addElementHandler(new TaskDataHandler20(this, ITaskDataConstants.ELEMENT_NEW_DATA)); addElementHandler(new TaskDataHandler20(this, ITaskDataConstants.ELEMENT_OLD_DATA)); addElementHandler(new TaskDataHandler20(this, ITaskDataConstants.ELEMENT_EDITS_DATA)); @@ -445,7 +445,7 @@ public class TaskDataStateReader extends DefaultHandler { @Override protected void start(String uri, String localName, String name, Attributes attributes) throws SAXException { - if ("2.0".equals(version)) { + if ("2.0".equals(version)) { //$NON-NLS-1$ String connectorKind = getValue(attributes, ITaskDataConstants.ATTRIBUTE_CONNECTOR_KIND); String repositoryUrl = getValue(attributes, ITaskDataConstants.ATTRIBUTE_REPOSITORY_URL); String taskId = getValue(attributes, ITaskDataConstants.ATTRIBUTE_TASK_ID); @@ -501,9 +501,9 @@ public class TaskDataStateReader extends DefaultHandler { private final TaskAttribute attribute; - private String key = ""; + private String key = ""; //$NON-NLS-1$ - private String value = ""; + private String value = ""; //$NON-NLS-1$ public MapHandler20(ElementHandler parent, TaskAttribute attribute, String elementName) { super(parent, elementName); @@ -517,8 +517,8 @@ public class TaskDataStateReader extends DefaultHandler { } else if (ITaskDataConstants.ELEMENT_META.equals(getElementName())) { attribute.getMetaData().putValue(key, value); } - key = ""; - value = ""; + key = ""; //$NON-NLS-1$ + value = ""; //$NON-NLS-1$ } @Override @@ -589,12 +589,12 @@ public class TaskDataStateReader extends DefaultHandler { private TaskAttributeMapper getAttributeMapper(String connectorKind, String repositoryUrl) throws SAXException { AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(connectorKind); if (connector == null) { - throw new SAXException("No repository connector for kind \"" + connectorKind + "\" found"); + throw new SAXException("No repository connector for kind \"" + connectorKind + "\" found"); //$NON-NLS-1$ //$NON-NLS-2$ } TaskRepository taskRepository = repositoryManager.getRepository(connectorKind, repositoryUrl); if (taskRepository == null) { - throw new SAXException("Repository \"" + repositoryUrl + "\" not found for kind \"" + connectorKind + "\""); + throw new SAXException("Repository \"" + repositoryUrl + "\" not found for kind \"" + connectorKind + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } final TaskAttributeMapper attributeMapper; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateWriter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateWriter.java index 26828149a..50baffa8f 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateWriter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateWriter.java @@ -27,9 +27,9 @@ import org.xml.sax.helpers.AttributesImpl; */ public class TaskDataStateWriter { - private static final String TASK_DATA_STATE_VERSION = "2.0"; + private static final String TASK_DATA_STATE_VERSION = "2.0"; //$NON-NLS-1$ - private static final String CDATA = "CDATA"; + private static final String CDATA = "CDATA"; //$NON-NLS-1$ private final TransformerHandler handler; @@ -40,11 +40,11 @@ public class TaskDataStateWriter { public void write(ITaskDataWorkingCopy state) throws SAXException { handler.startDocument(); AttributesImpl atts = new AttributesImpl(); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_CONNECTOR_KIND, CDATA, state.getConnectorKind()); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_REPOSITORY_URL, CDATA, state.getRepositoryUrl()); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_TASK_ID, CDATA, state.getTaskId()); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_VERSION, CDATA, TASK_DATA_STATE_VERSION); - handler.startElement("", "", ITaskDataConstants.ELEMENT_TASK_STATE, atts); + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_CONNECTOR_KIND, CDATA, state.getConnectorKind()); //$NON-NLS-1$ //$NON-NLS-2$ + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_REPOSITORY_URL, CDATA, state.getRepositoryUrl()); //$NON-NLS-1$ //$NON-NLS-2$ + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_TASK_ID, CDATA, state.getTaskId()); //$NON-NLS-1$ //$NON-NLS-2$ + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_VERSION, CDATA, TASK_DATA_STATE_VERSION); //$NON-NLS-1$ //$NON-NLS-2$ + handler.startElement("", "", ITaskDataConstants.ELEMENT_TASK_STATE, atts); //$NON-NLS-1$ //$NON-NLS-2$ if (state.getRepositoryData() != null) { writeTaskData(state.getRepositoryData(), ITaskDataConstants.ELEMENT_NEW_DATA); } @@ -54,70 +54,70 @@ public class TaskDataStateWriter { if (state.getEditsData() != null) { writeTaskData(state.getEditsData(), ITaskDataConstants.ELEMENT_EDITS_DATA); } - handler.endElement("", "", ITaskDataConstants.ELEMENT_TASK_STATE); + handler.endElement("", "", ITaskDataConstants.ELEMENT_TASK_STATE); //$NON-NLS-1$ //$NON-NLS-2$ handler.endDocument(); } private void writeTaskData(TaskData taskData, String elementName) throws SAXException { AttributesImpl atts = new AttributesImpl(); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_CONNECTOR_KIND, CDATA, taskData.getConnectorKind()); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_REPOSITORY_URL, CDATA, taskData.getRepositoryUrl()); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_TASK_ID, CDATA, taskData.getTaskId()); + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_CONNECTOR_KIND, CDATA, taskData.getConnectorKind()); //$NON-NLS-1$ //$NON-NLS-2$ + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_REPOSITORY_URL, CDATA, taskData.getRepositoryUrl()); //$NON-NLS-1$ //$NON-NLS-2$ + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_TASK_ID, CDATA, taskData.getTaskId()); //$NON-NLS-1$ //$NON-NLS-2$ if (taskData.getVersion() != null) { - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_VERSION, CDATA, taskData.getVersion()); + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_VERSION, CDATA, taskData.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$ } - handler.startElement("", "", elementName, atts); + handler.startElement("", "", elementName, atts); //$NON-NLS-1$ //$NON-NLS-2$ atts.clear(); - handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES, atts); //$NON-NLS-1$ //$NON-NLS-2$ writeTaskAttribute(taskData.getRoot()); - handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES); - handler.endElement("", "", elementName); + handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES); //$NON-NLS-1$ //$NON-NLS-2$ + handler.endElement("", "", elementName); //$NON-NLS-1$ //$NON-NLS-2$ } private void writeTaskAttribute(TaskAttribute attribute) throws SAXException { AttributesImpl atts = new AttributesImpl(); - atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_ID, CDATA, attribute.getId()); - handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTE, atts); + atts.addAttribute("", "", ITaskDataConstants.ATTRIBUTE_ID, CDATA, attribute.getId()); //$NON-NLS-1$ //$NON-NLS-2$ + handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTE, atts); //$NON-NLS-1$ //$NON-NLS-2$ atts.clear(); - handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUES, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUES, atts); //$NON-NLS-1$ //$NON-NLS-2$ List<String> values = attribute.getValues(); for (String value : values) { - handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUE, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUE, atts); //$NON-NLS-1$ //$NON-NLS-2$ handler.characters(value.toCharArray(), 0, value.length()); - handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUE); + handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUE); //$NON-NLS-1$ //$NON-NLS-2$ } - handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUES); + handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUES); //$NON-NLS-1$ //$NON-NLS-2$ - handler.startElement("", "", ITaskDataConstants.ELEMENT_OPTIONS, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_OPTIONS, atts); //$NON-NLS-1$ //$NON-NLS-2$ writeMap(atts, attribute.getOptions(), ITaskDataConstants.ELEMENT_OPTION); - handler.endElement("", "", ITaskDataConstants.ELEMENT_OPTIONS); + handler.endElement("", "", ITaskDataConstants.ELEMENT_OPTIONS); //$NON-NLS-1$ //$NON-NLS-2$ - handler.startElement("", "", ITaskDataConstants.ELEMENT_META_DATA, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_META_DATA, atts); //$NON-NLS-1$ //$NON-NLS-2$ writeMap(atts, attribute.getMetaData().getValues(), ITaskDataConstants.ELEMENT_META); - handler.endElement("", "", ITaskDataConstants.ELEMENT_META_DATA); + handler.endElement("", "", ITaskDataConstants.ELEMENT_META_DATA); //$NON-NLS-1$ //$NON-NLS-2$ - handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES, atts); + handler.startElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES, atts); //$NON-NLS-1$ //$NON-NLS-2$ Map<String, TaskAttribute> children = attribute.getAttributes(); for (TaskAttribute child : children.values()) { writeTaskAttribute(child); } - handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES); + handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTES); //$NON-NLS-1$ //$NON-NLS-2$ - handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTE); + handler.endElement("", "", ITaskDataConstants.ELEMENT_ATTRIBUTE); //$NON-NLS-1$ //$NON-NLS-2$ } private void writeMap(AttributesImpl atts, Map<String, String> options, String elementName) throws SAXException { for (String key : options.keySet()) { String value = options.get(key); - handler.startElement("", "", elementName, atts); - handler.startElement("", "", ITaskDataConstants.ELEMENT_KEY, atts); + handler.startElement("", "", elementName, atts); //$NON-NLS-1$ //$NON-NLS-2$ + handler.startElement("", "", ITaskDataConstants.ELEMENT_KEY, atts); //$NON-NLS-1$ //$NON-NLS-2$ handler.characters(key.toCharArray(), 0, key.length()); - handler.endElement("", "", ITaskDataConstants.ELEMENT_KEY); - handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUE, atts); + handler.endElement("", "", ITaskDataConstants.ELEMENT_KEY); //$NON-NLS-1$ //$NON-NLS-2$ + handler.startElement("", "", ITaskDataConstants.ELEMENT_VALUE, atts); //$NON-NLS-1$ //$NON-NLS-2$ handler.characters(value.toCharArray(), 0, value.length()); - handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUE); - handler.endElement("", "", elementName); + handler.endElement("", "", ITaskDataConstants.ELEMENT_VALUE); //$NON-NLS-1$ //$NON-NLS-2$ + handler.endElement("", "", elementName); //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java index b2e583ac9..15fd25662 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java @@ -34,7 +34,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskData; */ public class TaskDataStore { - private static final String FILE_NAME_INTERNAL = "data.xml"; + private static final String FILE_NAME_INTERNAL = "data.xml"; //$NON-NLS-1$ private final TaskDataExternalizer externalizer; @@ -79,7 +79,7 @@ public class TaskDataStore { new Status( IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Reading of existing task data failed. Forcing synchronization will override outgoing changes.", + "Reading of existing task data failed. Forcing synchronization will override outgoing changes.", //$NON-NLS-1$ e)); } } @@ -119,7 +119,7 @@ public class TaskDataStore { } return null; } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error reading task data", + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error reading task data", //$NON-NLS-1$ e)); } } @@ -138,7 +138,7 @@ public class TaskDataStore { out.close(); } } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error writing task data", + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error writing task data", //$NON-NLS-1$ e)); } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TextTaskAttachmentSource.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TextTaskAttachmentSource.java index e2b2d3023..5b69dc101 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TextTaskAttachmentSource.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TextTaskAttachmentSource.java @@ -33,12 +33,12 @@ public class TextTaskAttachmentSource extends AbstractTaskAttachmentSource { @Override public String getContentType() { - return "text/plain"; + return "text/plain"; //$NON-NLS-1$ } @Override public String getDescription() { - return ""; + return ""; //$NON-NLS-1$ } @Override @@ -48,7 +48,7 @@ public class TextTaskAttachmentSource extends AbstractTaskAttachmentSource { @Override public String getName() { - return "clipboard.txt"; + return "clipboard.txt"; //$NON-NLS-1$ } @Override diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/AbstractExternalizationParticipant.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/AbstractExternalizationParticipant.java index 171f4764b..3986f826c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/AbstractExternalizationParticipant.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/AbstractExternalizationParticipant.java @@ -30,7 +30,7 @@ import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; */ public abstract class AbstractExternalizationParticipant implements IExternalizationParticipant { - public static final String SNAPSHOT_PREFIX = "."; + public static final String SNAPSHOT_PREFIX = "."; //$NON-NLS-1$ public abstract void load(File sourceFile, IProgressMonitor monitor) throws CoreException; @@ -86,8 +86,8 @@ public abstract class AbstractExternalizationParticipant implements IExternaliza if (dataFile != null) { File backup = new File(dataFile.getParentFile(), SNAPSHOT_PREFIX + dataFile.getName()); if (backup.exists()) { - StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Failed to load " - + dataFile.getName() + ", restoring from snapshot", e)); + StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Failed to load " //$NON-NLS-1$ + + dataFile.getName() + ", restoring from snapshot", e)); //$NON-NLS-1$ load(backup, monitor); return true; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java index 82c6a76a6..821c19c02 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java @@ -79,102 +79,102 @@ public final class DelegatingTaskExternalizer { static final String DEFAULT_PRIORITY = PriorityLevel.P3.toString(); - static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.S z"; + static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.S z"; //$NON-NLS-1$ - static final String KEY_NOTIFIED_INCOMING = "NotifiedIncoming"; + static final String KEY_NOTIFIED_INCOMING = "NotifiedIncoming"; //$NON-NLS-1$ - public static final String KEY_NAME = "Name"; + public static final String KEY_NAME = "Name"; //$NON-NLS-1$ - public static final String KEY_LABEL = "Label"; + public static final String KEY_LABEL = "Label"; //$NON-NLS-1$ - public static final String KEY_QUERY = "Query"; + public static final String KEY_QUERY = "Query"; //$NON-NLS-1$ - public static final String KEY_QUERY_STRING = "QueryString"; + public static final String KEY_QUERY_STRING = "QueryString"; //$NON-NLS-1$ - static final String KEY_HANDLE = "Handle"; + static final String KEY_HANDLE = "Handle"; //$NON-NLS-1$ - public static final String KEY_REPOSITORY_URL = "RepositoryUrl"; + public static final String KEY_REPOSITORY_URL = "RepositoryUrl"; //$NON-NLS-1$ - public static final String KEY_CATEGORY = "Category"; + public static final String KEY_CATEGORY = "Category"; //$NON-NLS-1$ - static final String VAL_ROOT = "Root"; + static final String VAL_ROOT = "Root"; //$NON-NLS-1$ - static final String KEY_SUBTASK = "SubTask"; + static final String KEY_SUBTASK = "SubTask"; //$NON-NLS-1$ - static final String KEY_KIND = "Kind"; + static final String KEY_KIND = "Kind"; //$NON-NLS-1$ - static final String KEY_TASK_CATEGORY = "Task" + KEY_CATEGORY; + static final String KEY_TASK_CATEGORY = "Task" + KEY_CATEGORY; //$NON-NLS-1$ - static final String KEY_LINK = "Link"; + static final String KEY_LINK = "Link"; //$NON-NLS-1$ - static final String KEY_PLAN = "Plan"; + static final String KEY_PLAN = "Plan"; //$NON-NLS-1$ - static final String KEY_TIME_ESTIMATED = "Estimated"; + static final String KEY_TIME_ESTIMATED = "Estimated"; //$NON-NLS-1$ - static final String KEY_ISSUEURL = "IssueURL"; + static final String KEY_ISSUEURL = "IssueURL"; //$NON-NLS-1$ - static final String KEY_NOTES = "Notes"; + static final String KEY_NOTES = "Notes"; //$NON-NLS-1$ - static final String KEY_ACTIVE = "Active"; + static final String KEY_ACTIVE = "Active"; //$NON-NLS-1$ - static final String KEY_PRIORITY = "Priority"; + static final String KEY_PRIORITY = "Priority"; //$NON-NLS-1$ - static final String KEY_PATH = "Path"; + static final String KEY_PATH = "Path"; //$NON-NLS-1$ - static final String VAL_FALSE = "false"; + static final String VAL_FALSE = "false"; //$NON-NLS-1$ - static final String VAL_TRUE = "true"; + static final String VAL_TRUE = "true"; //$NON-NLS-1$ - static final String KEY_DATE_END = "EndDate"; + static final String KEY_DATE_END = "EndDate"; //$NON-NLS-1$ - static final String KEY_QUERY_HIT = "QueryHit"; + static final String KEY_QUERY_HIT = "QueryHit"; //$NON-NLS-1$ - static final String KEY_TASK_REFERENCE = "TaskReference"; + static final String KEY_TASK_REFERENCE = "TaskReference"; //$NON-NLS-1$ - static final String KEY_DATE_CREATION = "CreationDate"; + static final String KEY_DATE_CREATION = "CreationDate"; //$NON-NLS-1$ - static final String KEY_DATE_REMINDER = "ReminderDate"; + static final String KEY_DATE_REMINDER = "ReminderDate"; //$NON-NLS-1$ - static final String KEY_DATE_SCHEDULED_START = "ScheduledStartDate"; + static final String KEY_DATE_SCHEDULED_START = "ScheduledStartDate"; //$NON-NLS-1$ - static final String KEY_DATE_SCHEDULED_END = "ScheduledEndDate"; + static final String KEY_DATE_SCHEDULED_END = "ScheduledEndDate"; //$NON-NLS-1$ - static final String KEY_DATE_MODIFICATION = "ModificationDate"; + static final String KEY_DATE_MODIFICATION = "ModificationDate"; //$NON-NLS-1$ - static final String KEY_DATE_DUE = "DueDate"; + static final String KEY_DATE_DUE = "DueDate"; //$NON-NLS-1$ - static final String KEY_REMINDED = "Reminded"; + static final String KEY_REMINDED = "Reminded"; //$NON-NLS-1$ - static final String KEY_FLOATING = "Floating"; + static final String KEY_FLOATING = "Floating"; //$NON-NLS-1$ /** * This element holds the date stamp recorded upon last transition to a synchronized state. */ - static final String KEY_LAST_MOD_DATE = "LastModified"; + static final String KEY_LAST_MOD_DATE = "LastModified"; //$NON-NLS-1$ - static final String KEY_DIRTY = "Dirty"; + static final String KEY_DIRTY = "Dirty"; //$NON-NLS-1$ - static final String KEY_SYNC_STATE = "offlineSyncState"; + static final String KEY_SYNC_STATE = "offlineSyncState"; //$NON-NLS-1$ - static final String KEY_OWNER = "Owner"; + static final String KEY_OWNER = "Owner"; //$NON-NLS-1$ - static final String KEY_MARK_READ_PENDING = "MarkReadPending"; + static final String KEY_MARK_READ_PENDING = "MarkReadPending"; //$NON-NLS-1$ - static final String KEY_STALE = "Stale"; + static final String KEY_STALE = "Stale"; //$NON-NLS-1$ - static final String KEY_CONNECTOR_KIND = "ConnectorKind"; + static final String KEY_CONNECTOR_KIND = "ConnectorKind"; //$NON-NLS-1$ - static final String KEY_TASK_ID = "TaskId"; + static final String KEY_TASK_ID = "TaskId"; //$NON-NLS-1$ - public static final String KEY_LAST_REFRESH = "LastRefreshTimeStamp"; + public static final String KEY_LAST_REFRESH = "LastRefreshTimeStamp"; //$NON-NLS-1$ - static final String NODE_ATTRIBUTE = "Attribute"; + static final String NODE_ATTRIBUTE = "Attribute"; //$NON-NLS-1$ - static final String NODE_QUERY = "Query"; + static final String NODE_QUERY = "Query"; //$NON-NLS-1$ - static final String NODE_TASK = "Task"; + static final String NODE_TASK = "Task"; //$NON-NLS-1$ - static final String KEY_KEY = "Key"; + static final String KEY_KEY = "Key"; //$NON-NLS-1$ // 2.0 -> 3.0 migration holds tasks to category handles private final Map<AbstractTask, String> parentCategoryMap; @@ -221,7 +221,7 @@ public final class DelegatingTaskExternalizer { if (task.getClass() == TaskTask.class || task instanceof LocalTask) { node = doc.createElement(NODE_TASK); } else { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "No externalizer for task: " + task)); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "No externalizer for task: " + task)); //$NON-NLS-1$ return null; } @@ -247,7 +247,7 @@ public final class DelegatingTaskExternalizer { node.setAttribute(KEY_ISSUEURL, task.getUrl()); } node.setAttribute(KEY_NOTES, stripControlCharacters(task.getNotes())); - node.setAttribute(KEY_TIME_ESTIMATED, "" + task.getEstimatedTimeHours()); + node.setAttribute(KEY_TIME_ESTIMATED, "" + task.getEstimatedTimeHours()); //$NON-NLS-1$ node.setAttribute(KEY_DATE_END, formatExternDate(task.getCompletionDate())); node.setAttribute(KEY_DATE_CREATION, formatExternDate(task.getCreationDate())); node.setAttribute(KEY_DATE_MODIFICATION, formatExternDate(task.getModificationDate())); @@ -333,7 +333,7 @@ public final class DelegatingTaskExternalizer { tasklist.addTask(subTask, task); } else { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Failed to add subtask with handle \"" + handle + "\" to \"" + task + "\"")); + "Failed to add subtask with handle \"" + handle + "\" to \"" + task + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } } @@ -342,14 +342,14 @@ public final class DelegatingTaskExternalizer { @SuppressWarnings( { "deprecation", "restriction" }) private String stripControlCharacters(String text) { if (text == null) { - return ""; + return ""; //$NON-NLS-1$ } return org.eclipse.mylyn.internal.commons.core.XmlStringConverter.cleanXmlString(text); } private String formatExternDate(Date date) { if (date == null) { - return ""; + return ""; //$NON-NLS-1$ } String f = DATE_FORMAT; SimpleDateFormat format = new SimpleDateFormat(f, Locale.ENGLISH); @@ -358,7 +358,7 @@ public final class DelegatingTaskExternalizer { private String formatExternCalendar(Calendar date) { if (date == null) { - return ""; + return ""; //$NON-NLS-1$ } String f = DATE_FORMAT; SimpleDateFormat format = new SimpleDateFormat(f, Locale.ENGLISH); @@ -379,11 +379,11 @@ public final class DelegatingTaskExternalizer { category = new TaskCategory(handle, name); taskList.addCategory((TaskCategory) category); } else if (!UncategorizedTaskContainer.HANDLE.equals(handle)) { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Category with handle \"" + name - + "\" already exists in task list")); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Category with handle \"" + name //$NON-NLS-1$ + + "\" already exists in task list")); //$NON-NLS-1$ } } else { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Category is missing name attribute")); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Category is missing name attribute")); //$NON-NLS-1$ // LEGACY: registry categories did not have names // category = taskList.getArchiveContainer(); // a null category will now go into appropriate orphaned category @@ -399,7 +399,7 @@ public final class DelegatingTaskExternalizer { String handle; String taskId; String repositoryUrl; - String summary = ""; + String summary = ""; //$NON-NLS-1$ final Element element = (Element) node; if (element.hasAttribute(KEY_REPOSITORY_URL) && element.hasAttribute(KEY_TASK_ID) && element.hasAttribute(KEY_HANDLE)) { @@ -411,7 +411,7 @@ public final class DelegatingTaskExternalizer { repositoryUrl = RepositoryTaskHandleUtil.getRepositoryUrl(handle); taskId = RepositoryTaskHandleUtil.getTaskId(handle); } else { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Task is missing handle attribute")); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Task is missing handle attribute")); //$NON-NLS-1$ return null; } if (element.hasAttribute(KEY_LABEL)) { @@ -438,7 +438,7 @@ public final class DelegatingTaskExternalizer { if (task != null) { if (repositoryManager.getRepositoryConnector(task.getConnectorKind()) == null) { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Missing connector for task with kind \"" + task.getConnectorKind() + "\"")); + "Missing connector for task with kind \"" + task.getConnectorKind() + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ return null; } @@ -456,7 +456,7 @@ public final class DelegatingTaskExternalizer { public void handleException(Throwable e) { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Task migration failed for task \"" + finalTask + "\"", e)); + "Task migration failed for task \"" + finalTask + "\"", e)); //$NON-NLS-1$ //$NON-NLS-2$ } public void run() throws Exception { @@ -467,8 +467,8 @@ public final class DelegatingTaskExternalizer { } return task; } else { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Missing connector for task node \"" - + node.getNodeName() + "\"")); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Missing connector for task node \"" //$NON-NLS-1$ + + node.getNodeName() + "\"")); //$NON-NLS-1$ return null; } } @@ -516,12 +516,12 @@ public final class DelegatingTaskExternalizer { if (element.hasAttribute(KEY_ISSUEURL)) { task.setUrl(element.getAttribute(KEY_ISSUEURL)); } else { - task.setUrl(""); + task.setUrl(""); //$NON-NLS-1$ } if (element.hasAttribute(KEY_NOTES)) { task.setNotes(element.getAttribute(KEY_NOTES)); } else { - task.setNotes(""); + task.setNotes(""); //$NON-NLS-1$ } if (element.hasAttribute(KEY_TIME_ESTIMATED)) { String est = element.getAttribute(KEY_TIME_ESTIMATED); @@ -610,7 +610,7 @@ public final class DelegatingTaskExternalizer { if (element.hasAttribute(KEY_REPOSITORY_URL)) { task.setRepositoryUrl(element.getAttribute(KEY_REPOSITORY_URL)); } - if (element.hasAttribute(KEY_LAST_MOD_DATE) && !element.getAttribute(KEY_LAST_MOD_DATE).equals("")) { + if (element.hasAttribute(KEY_LAST_MOD_DATE) && !element.getAttribute(KEY_LAST_MOD_DATE).equals("")) { //$NON-NLS-1$ task.setLastReadTimeStamp(element.getAttribute(KEY_LAST_MOD_DATE)); } if (element.hasAttribute(KEY_OWNER)) { @@ -639,7 +639,7 @@ public final class DelegatingTaskExternalizer { private Date getDateFromString(String dateString) { Date date = null; - if ("".equals(dateString)) { + if ("".equals(dateString)) { //$NON-NLS-1$ return null; } String formatString = DATE_FORMAT; @@ -647,8 +647,8 @@ public final class DelegatingTaskExternalizer { try { date = format.parse(dateString); } catch (ParseException e) { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Could not parse date \"" - + dateString + "\"", e)); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Could not parse date \"" //$NON-NLS-1$ + + dateString + "\"", e)); //$NON-NLS-1$ } return date; } @@ -663,7 +663,7 @@ public final class DelegatingTaskExternalizer { node = doc.createElement(NODE_QUERY); } else { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Missing factory to externalize query \"" + query + "\"")); + "Missing factory to externalize query \"" + query + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ return null; } @@ -726,12 +726,12 @@ public final class DelegatingTaskExternalizer { if (query != null) { if (repositoryManager.getRepositoryConnector(query.getConnectorKind()) == null) { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Missing connector for query with kind \"" + query.getConnectorKind() + "\"")); + "Missing connector for query with kind \"" + query.getConnectorKind() + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ return null; } if (element.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH) != null - && !element.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH).equals("")) { + && !element.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH).equals("")) { //$NON-NLS-1$ query.setLastSynchronizedStamp(element.getAttribute(DelegatingTaskExternalizer.KEY_LAST_REFRESH)); } String handle = element.getAttribute(DelegatingTaskExternalizer.KEY_HANDLE); @@ -747,7 +747,7 @@ public final class DelegatingTaskExternalizer { public void handleException(Throwable e) { errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Query migration failed for query \"" + finalQuery + "\"", e)); + "Query migration failed for query \"" + finalQuery + "\"", e)); //$NON-NLS-1$ //$NON-NLS-2$ } public void run() throws Exception { @@ -758,8 +758,8 @@ public final class DelegatingTaskExternalizer { } return query; } else { - errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Missing connector for query node \"" - + node.getNodeName() + "\"")); + errors.add(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Missing connector for query node \"" //$NON-NLS-1$ + + node.getNodeName() + "\"")); //$NON-NLS-1$ return null; } } @@ -797,7 +797,7 @@ public final class DelegatingTaskExternalizer { public Status getErrorStatus() { if (errors.size() > 0) { return new MultiStatus(ITasksCoreConstants.ID_PLUGIN, 0, errors.toArray(new IStatus[0]), - "Problems encounted while externalizing task list", null); + "Problems encounted while externalizing task list", null); //$NON-NLS-1$ } return null; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ExternalizationManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ExternalizationManager.java index 9d4dea577..6af3bf87e 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ExternalizationManager.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ExternalizationManager.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ package org.eclipse.mylyn.internal.tasks.core.externalization; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -62,7 +63,7 @@ public class ExternalizationManager { } private ExternalizationJob createJob() { - ExternalizationJob job = new ExternalizationJob("Task List Save Job"); + ExternalizationJob job = new ExternalizationJob(Messages.ExternalizationManager_Task_List_Save_Job); job.setUser(false); job.setSystem(true); return job; @@ -89,7 +90,7 @@ public class ExternalizationManager { if (statusList.size() > 0) { loadStatus = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, IStatus.ERROR, - statusList.toArray(new IStatus[0]), "Failed to load Task List", null); + statusList.toArray(new IStatus[0]), "Failed to load Task List", null); //$NON-NLS-1$ } return loadStatus; } finally { @@ -108,7 +109,7 @@ public class ExternalizationManager { if (e instanceof CoreException) { result[0] = ((CoreException) e).getStatus(); } else { - result[0] = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Load participant failed", + result[0] = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Load participant failed", //$NON-NLS-1$ e); } } @@ -148,7 +149,7 @@ public class ExternalizationManager { saveJob.join(); } catch (InterruptedException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task List save on shutdown canceled.", e)); + "Task List save on shutdown canceled.", e)); //$NON-NLS-1$ } } @@ -190,17 +191,18 @@ public class ExternalizationManager { switch (context.getKind()) { case SAVE: try { - monitor.beginTask("Saving...", externalizationParticipants.size()); + monitor.beginTask(Messages.ExternalizationManager_Saving_, externalizationParticipants.size()); for (IExternalizationParticipant participant : externalizationParticipants) { ISchedulingRule rule = participant.getSchedulingRule(); if (forceSave || participant.isDirty()) { try { Job.getJobManager().beginRule(rule, monitor); - monitor.setTaskName("Saving " + participant.getDescription()); + monitor.setTaskName(MessageFormat.format(Messages.ExternalizationManager_Saving_X, + participant.getDescription())); participant.execute(context, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } catch (CoreException e) { StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, - "Save failed for " + participant.getDescription(), e)); + "Save failed for " + participant.getDescription(), e)); //$NON-NLS-1$ } finally { Job.getJobManager().endRule(rule); } @@ -213,7 +215,7 @@ public class ExternalizationManager { break; default: StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Unsupported externalization kind: " + context.getKind())); + "Unsupported externalization kind: " + context.getKind())); //$NON-NLS-1$ } return Status.OK_STATUS; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java new file mode 100644 index 000000000..792f462b1 --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/Messages.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.core.externalization; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.core.externalization.messages"; //$NON-NLS-1$ + + static { + // load message values from bundle file + reloadMessages(); + } + + public static void reloadMessages() { + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + public static String ExternalizationManager_Saving_X; + + public static String ExternalizationManager_Saving_; + + public static String ExternalizationManager_Task_List_Save_Job; + + public static String TaskListExternalizationParticipant_Task_List; +} diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizationParticipant.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizationParticipant.java index 63b27c47f..787bfeb5a 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizationParticipant.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizationParticipant.java @@ -36,7 +36,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; public class TaskListExternalizationParticipant extends AbstractExternalizationParticipant implements IExternalizationParticipant, ITaskListChangeListener, ITaskActivationListener { - private static final String DESCRIPTION = "Task List"; + private static final String DESCRIPTION = Messages.TaskListExternalizationParticipant_Task_List; private final ExternalizationManager manager; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java index 1e40a368c..6afbdff0c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java @@ -61,31 +61,31 @@ import org.w3c.dom.NodeList; */ public class TaskListExternalizer { - private static final String ERROR_TASKLIST_READ = "Failed to load Task List"; + private static final String ERROR_TASKLIST_READ = "Failed to load Task List"; //$NON-NLS-1$ - private static final String TRANSFORM_PROPERTY_VERSION = "version"; + private static final String TRANSFORM_PROPERTY_VERSION = "version"; //$NON-NLS-1$ // May 2007: There was a bug when reading in 1.1 // Result was an infinite loop within the parser - private static final String XML_VERSION = "1.0"; + private static final String XML_VERSION = "1.0"; //$NON-NLS-1$ - public static final String ATTRIBUTE_VERSION = "Version"; + public static final String ATTRIBUTE_VERSION = "Version"; //$NON-NLS-1$ - public static final String ELEMENT_TASK_LIST = "TaskList"; + public static final String ELEMENT_TASK_LIST = "TaskList"; //$NON-NLS-1$ // Mylyn 3.0 - private static final String VALUE_VERSION = "2.0"; + private static final String VALUE_VERSION = "2.0"; //$NON-NLS-1$ // Mylyn 2.3.2 //private static final String VALUE_VERSION_1_0_1 = "1.0.1"; - private static final String VALUE_VERSION_1_0_0 = "1.0.0"; + private static final String VALUE_VERSION_1_0_0 = "1.0.0"; //$NON-NLS-1$ private final DelegatingTaskExternalizer delegatingExternalizer; private final List<Node> orphanedNodes = new ArrayList<Node>(); - private String readVersion = ""; + private String readVersion = ""; //$NON-NLS-1$ public TaskListExternalizer(RepositoryModel repositoryModel, IRepositoryManager repositoryManager) { this.delegatingExternalizer = new DelegatingTaskExternalizer(repositoryModel, repositoryManager); @@ -116,7 +116,7 @@ public class TaskListExternalizer { outStream.close(); } } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Saving Task List failed", + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Saving Task List failed", //$NON-NLS-1$ e)); } } @@ -168,7 +168,7 @@ public class TaskListExternalizer { xformer.setOutputProperty(TRANSFORM_PROPERTY_VERSION, XML_VERSION); xformer.transform(source, result); } catch (TransformerException e) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed write task list", + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed write task list", //$NON-NLS-1$ e)); } } @@ -181,18 +181,18 @@ public class TaskListExternalizer { return db.newDocument(); } catch (ParserConfigurationException e) { throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Failed to create document", e)); + "Failed to create document", e)); //$NON-NLS-1$ } } public void readTaskList(TaskList taskList, File inFile) throws CoreException { if (!inFile.exists()) { throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task list file not found \"" + inFile.getAbsolutePath() + "\"")); + "Task list file not found \"" + inFile.getAbsolutePath() + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ } if (inFile.length() == 0) { throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task list file contains no data \"" + inFile.getAbsolutePath() + "\"")); + "Task list file contains no data \"" + inFile.getAbsolutePath() + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ } delegatingExternalizer.reset(); @@ -202,8 +202,8 @@ public class TaskListExternalizer { Element root = doc.getDocumentElement(); readVersion = root.getAttribute(ATTRIBUTE_VERSION); if (readVersion.equals(VALUE_VERSION_1_0_0)) { - throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task list version \"" - + readVersion + "\" not supported")); + throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task list version \"" //$NON-NLS-1$ + + readVersion + "\" not supported")); //$NON-NLS-1$ } NodeList list = root.getChildNodes(); @@ -294,7 +294,7 @@ public class TaskListExternalizer { } if (entry == null) { throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Task list file contains no entry for the task list")); + "Task list file contains no entry for the task list")); //$NON-NLS-1$ } } else { in = new FileInputStream(inputFile); @@ -311,7 +311,7 @@ public class TaskListExternalizer { in.close(); } catch (IOException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Failed to close task list", e)); + "Failed to close task list", e)); //$NON-NLS-1$ } } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties new file mode 100644 index 000000000..399cfc7fc --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/messages.properties @@ -0,0 +1,5 @@ +ExternalizationManager_Saving_X=Saving {0} +ExternalizationManager_Saving_=Saving... +ExternalizationManager_Task_List_Save_Job=Task List Save Job + +TaskListExternalizationParticipant_Task_List=Task List diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties new file mode 100644 index 000000000..c39eee745 --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties @@ -0,0 +1,33 @@ +DayDateRange_Friday=Friday +DayDateRange_Monday=Monday +DayDateRange_Saturday=Saturday +DayDateRange_Sunday=Sunday +DayDateRange_Thursday=Thursday +DayDateRange___Today=\ - Today +DayDateRange_Tuesday=Tuesday +DayDateRange_Wednesday=Wednesday + +LocalRepositoryConnector_Local=Local +LocalRepositoryConnector_Local_Task_Repository=Local Task Repository +LocalRepositoryConnector_New_Task=New Task + +RepositoryExternalizationParticipant_Task_Repositories=Task Repositories + +TaskRepositoryManager_No_repository_available=No repository available, please add one using the Task Repositories view. + +UncategorizedTaskContainer_Uncategorized=Uncategorized + +UnmatchedTaskContainer_Unmatched=Unmatched + +UnsubmittedTaskContainer_Unsubmitted=Unsubmitted + +WeekDateRange_Next_Week=Next Week +WeekDateRange_Previous_Week=Previous Week +WeekDateRange_This_Week=This Week +WeekDateRange_Two_Weeks=Two Weeks + +PriorityLevel_High=High +PriorityLevel_Low=Low +PriorityLevel_Normal=Normal +PriorityLevel_Very_High=Very High +PriorityLevel_Very_Low=Very Low diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/Messages.java new file mode 100644 index 000000000..a962b7533 --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/Messages.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.core.sync; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.core.sync.messages"; //$NON-NLS-1$ + + static { + // load message values from bundle file + reloadMessages(); + } + + public static void reloadMessages() { + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + public static String SubmitTaskAttachmentJob_Sending_data; + + public static String SubmitTaskAttachmentJob_Submitting_attachment; + + public static String SubmitTaskAttachmentJob_Updating_task; + + public static String SubmitTaskJob_Receiving_data; + + public static String SubmitTaskJob_Sending_data; + + public static String SubmitTaskJob_Submitting_task; + + public static String SynchronizeQueriesJob_Max_allowed_number_of_hits_returned_exceeded; + + public static String SynchronizeQueriesJob_Processing; + + public static String SynchronizeQueriesJob_Querying_repository; + + public static String SynchronizeQueriesJob_Receiving_related_tasks; + + public static String SynchronizeQueriesJob_Synchronizing_Queries; + + public static String SynchronizeQueriesJob_Synchronizing_query_X; + + public static String SynchronizeQueriesJob_Updating_repository_state; + + public static String SynchronizeRepositoriesJob_Processing; + + public static String SynchronizeRepositoriesJob_Processing_; + + public static String SynchronizeRepositoriesJob_Synchronizing_Task_List; + + public static String SynchronizeRepositoriesJob_Updating_repository_configuration_for_X; + + public static String SynchronizeTasksJob_Processing; + + public static String SynchronizeTasksJob_Receiving_task_X; + + public static String SynchronizeTasksJob_Receiving_X; + + public static String SynchronizeTasksJob_Synchronizing_Tasks__X_; + + public static String SynchronizeTasksJob_Receiving_X_tasks_from_X; +} diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskAttachmentJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskAttachmentJob.java index acbd48e68..8a77fd881 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskAttachmentJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskAttachmentJob.java @@ -52,7 +52,7 @@ public class SubmitTaskAttachmentJob extends SubmitJob { public SubmitTaskAttachmentJob(TaskDataManager taskDataManager, AbstractRepositoryConnector connector, TaskRepository taskRepository, ITask task, AbstractTaskAttachmentSource source, String comment, TaskAttribute attachmentAttribute) { - super("Submitting Attachment"); + super("Submitting Attachment"); //$NON-NLS-1$ this.taskDataManager = taskDataManager; this.connector = connector; this.taskRepository = taskRepository; @@ -77,16 +77,16 @@ public class SubmitTaskAttachmentJob extends SubmitJob { final AbstractTaskAttachmentHandler attachmentHandler = connector.getTaskAttachmentHandler(); if (attachmentHandler == null) { error = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "The task repository does not support attachments."); + "The task repository does not support attachments."); //$NON-NLS-1$ return Status.OK_STATUS; } try { - monitor.beginTask("Submitting attachment", 2 * (1 + getSubmitJobListeners().length) * 100); - monitor.subTask("Sending data"); + monitor.beginTask(Messages.SubmitTaskAttachmentJob_Submitting_attachment, 2 * (1 + getSubmitJobListeners().length) * 100); + monitor.subTask(Messages.SubmitTaskAttachmentJob_Sending_data); attachmentHandler.postContent(taskRepository, task, source, comment, attachmentAttribute, Policy.subMonitorFor(monitor, 100)); fireTaskSubmitted(monitor); - monitor.subTask("Updating task"); + monitor.subTask(Messages.SubmitTaskAttachmentJob_Updating_task); TaskData taskData = connector.getTaskData(taskRepository, task.getTaskId(), Policy.subMonitorFor(monitor, 100)); taskDataManager.putUpdatedTaskData(task, taskData, true); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java index 00b8c64d9..a06d174c2 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java @@ -56,7 +56,7 @@ public class SubmitTaskJob extends SubmitJob { public SubmitTaskJob(TaskDataManager taskDataManager, AbstractRepositoryConnector connector, TaskRepository taskRepository, ITask task, TaskData taskData, Set<TaskAttribute> oldAttributes) { - super("Submitting Task"); + super("Submitting Task"); //$NON-NLS-1$ this.taskDataManager = taskDataManager; this.connector = connector; this.taskRepository = taskRepository; @@ -68,23 +68,23 @@ public class SubmitTaskJob extends SubmitJob { @Override protected IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask("Submitting task", 2 * (1 + getSubmitJobListeners().length) * 100); + monitor.beginTask(Messages.SubmitTaskJob_Submitting_task, 2 * (1 + getSubmitJobListeners().length) * 100); // post task data AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); - monitor.subTask("Sending data"); + monitor.subTask(Messages.SubmitTaskJob_Sending_data); response = taskDataHandler.postTaskData(taskRepository, taskData, oldAttributes, Policy.subMonitorFor( monitor, 100)); if (response == null || response.getTaskId() == null) { throw new CoreException(new RepositoryStatus(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, RepositoryStatus.ERROR_INTERNAL, - "Task could not be created. No additional information was provided by the connector.")); + "Task could not be created. No additional information was provided by the connector.")); //$NON-NLS-1$ } fireTaskSubmitted(monitor); // update task in task list String taskId = response.getTaskId(); - monitor.subTask("Receiving data"); + monitor.subTask(Messages.SubmitTaskJob_Receiving_data); TaskData updatedTaskData = connector.getTaskData(taskRepository, taskId, Policy.subMonitorFor(monitor, 100)); task = createTask(monitor, updatedTaskData); taskDataManager.putSubmittedTaskData(task, updatedTaskData); @@ -95,8 +95,8 @@ public class SubmitTaskJob extends SubmitJob { return Status.CANCEL_STATUS; } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Unexpected error during task submission", e)); - errorStatus = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Unexpected error: " + "Unexpected error during task submission", e)); //$NON-NLS-1$ + errorStatus = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Unexpected error: " //$NON-NLS-1$ + e.getMessage(), e); } finally { monitor.done(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java index 173106d61..1a48b1dbc 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java @@ -11,6 +11,7 @@ package org.eclipse.mylyn.internal.tasks.core.sync; +import java.text.MessageFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; @@ -107,7 +108,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { try { session.putTaskData(task, taskData); } catch (CoreException e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed to save task", e)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed to save task", e)); //$NON-NLS-1$ } taskList.addTask(task, repositoryQuery); resultCount++; @@ -123,7 +124,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { } - public static final String MAX_HITS_REACHED = "Max allowed number of hits returned exceeded. Some hits may not be displayed. Please narrow query scope."; + public static final String MAX_HITS_REACHED = Messages.SynchronizeQueriesJob_Max_allowed_number_of_hits_returned_exceeded; private final AbstractRepositoryConnector connector; @@ -141,7 +142,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { public SynchronizeQueriesJob(TaskList taskList, TaskDataManager taskDataManager, IRepositoryModel tasksModel, AbstractRepositoryConnector connector, TaskRepository repository, Set<RepositoryQuery> queries) { - super("Synchronizing Queries (" + repository.getRepositoryLabel() + ")"); + super(Messages.SynchronizeQueriesJob_Synchronizing_Queries + " (" + repository.getRepositoryLabel() + ")"); //$NON-NLS-2$ //$NON-NLS-3$ this.taskList = taskList; this.taskDataManager = taskDataManager; this.tasksModel = tasksModel; @@ -154,7 +155,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { @Override public IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask("Processing", 20 + queries.size() * 20 + 40 + 10); + monitor.beginTask(Messages.SynchronizeQueriesJob_Processing, 20 + queries.size() * 20 + 40 + 10); Set<ITask> allTasks; if (!isFullSynchronization()) { @@ -232,14 +233,14 @@ public class SynchronizeQueriesJob extends SynchronizationJob { } statuses.addAll(job.getStatuses()); } - monitor.subTask("Receiving related tasks"); + monitor.subTask(Messages.SynchronizeQueriesJob_Receiving_related_tasks); job.synchronizedTaskRelations(monitor, relationsByTaskId); monitor.worked(10); session.setChangedTasks(tasksToBeSynchronized); if (statuses.size() > 0) { Status status = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, 0, statuses.toArray(new IStatus[0]), - "Query synchronization failed", null); + "Query synchronization failed", null); //$NON-NLS-1$ session.setStatus(status); } @@ -251,7 +252,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } catch (Exception e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e)); //$NON-NLS-1$ } finally { monitor.done(); } @@ -261,7 +262,8 @@ public class SynchronizeQueriesJob extends SynchronizationJob { private void synchronizeQueries(IProgressMonitor monitor, SynchronizationSession session) { for (RepositoryQuery repositoryQuery : queries) { Policy.checkCanceled(monitor); - monitor.subTask("Synchronizing query " + repositoryQuery.getSummary()); + monitor.subTask(MessageFormat.format(Messages.SynchronizeQueriesJob_Synchronizing_query_X, + repositoryQuery.getSummary())); synchronizeQuery(repositoryQuery, session, new SubProgressMonitor(monitor, 20)); } } @@ -269,7 +271,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { private boolean postSynchronization(SynchronizationSession event, IProgressMonitor monitor) { try { Policy.checkCanceled(monitor); - monitor.subTask("Updating repository state"); + monitor.subTask(Messages.SynchronizeQueriesJob_Updating_repository_state); if (!isUser()) { monitor = Policy.backgroundMonitorFor(monitor); } @@ -284,7 +286,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { private boolean preSynchronization(ISynchronizationSession event, IProgressMonitor monitor) { try { Policy.checkCanceled(monitor); - monitor.subTask("Querying repository"); + monitor.subTask(Messages.SynchronizeQueriesJob_Querying_repository); if (!isUser()) { monitor = Policy.backgroundMonitorFor(monitor); } @@ -308,7 +310,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { IStatus result = connector.performQuery(repository, repositoryQuery, collector, event, monitor); if (result == null || result.isOK()) { if (collector.getResultCount() >= TaskDataCollector.MAX_HITS) { - StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, MAX_HITS_REACHED + "\n" + StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, MAX_HITS_REACHED + "\n" //$NON-NLS-1$ + repositoryQuery.getSummary())); } @@ -317,7 +319,7 @@ public class SynchronizeQueriesJob extends SynchronizationJob { taskList.removeFromContainer(repositoryQuery, removedChildren); } - repositoryQuery.setLastSynchronizedStamp(new SimpleDateFormat("MMM d, H:mm:ss").format(new Date())); + repositoryQuery.setLastSynchronizedStamp(new SimpleDateFormat("MMM d, H:mm:ss").format(new Date())); //$NON-NLS-1$ } else if (result.getSeverity() == IStatus.CANCEL) { throw new OperationCanceledException(); } else { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java index ae9ef8059..3b6a150a1 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ package org.eclipse.mylyn.internal.tasks.core.sync; +import java.text.MessageFormat; import java.util.Date; import java.util.Set; @@ -50,7 +51,7 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob { public SynchronizeRepositoriesJob(TaskList taskList, TaskDataManager taskDataManager, IRepositoryModel tasksModel, IRepositoryManager repositoryManager, Set<TaskRepository> repositories) { - super("Synchronizing Task List"); + super(Messages.SynchronizeRepositoriesJob_Synchronizing_Task_List); this.taskList = taskList; this.taskDataManager = taskDataManager; this.tasksModel = tasksModel; @@ -61,7 +62,7 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob { @Override public IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask("Processing", repositories.size() * 100); + monitor.beginTask(Messages.SynchronizeRepositoriesJob_Processing, repositories.size() * 100); for (TaskRepository repository : repositories) { if (monitor.isCanceled()) { @@ -73,7 +74,8 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob { continue; } - monitor.setTaskName("Processing " + repository.getRepositoryLabel()); + monitor.setTaskName(MessageFormat.format(Messages.SynchronizeRepositoriesJob_Processing_, + repository.getRepositoryLabel())); final AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(repository.getConnectorKind()); Set<RepositoryQuery> queries = taskList.getRepositoryQueries(repository.getRepositoryUrl()); @@ -136,14 +138,16 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob { if (!isUser()) { monitor = Policy.backgroundMonitorFor(monitor); } - monitor.beginTask("Updating repository configuration for " + repository.getRepositoryUrl(), 100); + monitor.beginTask(MessageFormat.format( + Messages.SynchronizeRepositoriesJob_Updating_repository_configuration_for_X, + repository.getRepositoryUrl()), 100); if (connector.isRepositoryConfigurationStale(repository, monitor)) { connector.updateRepositoryConfiguration(repository, monitor); repository.setConfigurationDate(new Date()); } } catch (CoreException e) { repository.setStatus(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Updating of repository configuration failed", e)); + "Updating of repository configuration failed", e)); //$NON-NLS-1$ } finally { monitor.done(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java index aa80a647b..2e7c8825c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java @@ -11,6 +11,7 @@ package org.eclipse.mylyn.internal.tasks.core.sync; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -79,7 +80,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { public SynchronizeTasksJob(ITaskList taskList, TaskDataManager synchronizationManager, IRepositoryModel tasksModel, AbstractRepositoryConnector connector, TaskRepository taskRepository, Set<ITask> tasks) { - super("Synchronizing Tasks (" + tasks.size() + " tasks)"); + super("Synchronizing Tasks (" + tasks.size() + " tasks)"); //$NON-NLS-1$ //$NON-NLS-2$ this.taskList = taskList; this.taskDataManager = synchronizationManager; this.tasksModel = tasksModel; @@ -92,7 +93,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { public SynchronizeTasksJob(ITaskList taskList, TaskDataManager synchronizationManager, IRepositoryModel tasksModel, AbstractRepositoryConnector connector, IRepositoryManager repositoryManager, Set<ITask> tasks) { - super("Synchronizing Tasks (" + tasks.size() + " tasks)"); + super("Synchronizing Tasks (" + tasks.size() + " tasks)"); //$NON-NLS-1$ //$NON-NLS-2$ this.taskList = taskList; this.taskDataManager = synchronizationManager; this.tasksModel = tasksModel; @@ -107,7 +108,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { try { if (taskRepository == null) { try { - monitor.beginTask("Processing", allTasks.size() * 100); + monitor.beginTask(Messages.SynchronizeTasksJob_Processing, allTasks.size() * 100); // group tasks by repository Map<TaskRepository, Set<ITask>> tasksByRepository = new HashMap<TaskRepository, Set<ITask>>(); for (ITask task : allTasks) { @@ -122,7 +123,8 @@ public class SynchronizeTasksJob extends SynchronizationJob { } // synchronize tasks for each repositories for (TaskRepository taskRepository : tasksByRepository.keySet()) { - setName("Synchronizing Tasks (" + taskRepository.getRepositoryLabel() + ")"); + setName(MessageFormat.format(Messages.SynchronizeTasksJob_Synchronizing_Tasks__X_, + taskRepository.getRepositoryLabel())); this.taskRepository = taskRepository; Set<ITask> repositoryTasks = tasksByRepository.get(taskRepository); run(repositoryTasks, new SubProgressMonitor(monitor, repositoryTasks.size() * 100)); @@ -166,7 +168,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { task = synchronizeTask(monitor, relation.getTaskId()); } catch (CoreException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Synchronization failed", e)); + "Synchronization failed", e)); //$NON-NLS-1$ } } else { removedChildTasks.remove(task); @@ -187,7 +189,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { private void runInternal(Set<ITask> tasks, IProgressMonitor monitor) { try { - monitor.beginTask("Processing", tasks.size() * 100); + monitor.beginTask(Messages.SynchronizeTasksJob_Processing, tasks.size() * 100); if (canGetMultiTaskData(taskRepository)) { try { for (ITask task : tasks) { @@ -213,7 +215,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { } catch (OperationCanceledException e) { throw e; } catch (Exception e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e)); //$NON-NLS-1$ } finally { monitor.done(); } @@ -225,7 +227,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { } private void synchronizeTask(IProgressMonitor monitor, ITask task) throws CoreException { - monitor.subTask("Receiving task " + task.getSummary()); + monitor.subTask(MessageFormat.format(Messages.SynchronizeTasksJob_Receiving_task_X, task.getSummary())); resetStatus(task); if (!isUser()) { monitor = Policy.backgroundMonitorFor(monitor); @@ -237,11 +239,11 @@ public class SynchronizeTasksJob extends SynchronizationJob { return; } throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Connector failed to return task data for task \"" + task + "\"")); + "Connector failed to return task data for task \"" + task + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ } private ITask synchronizeTask(IProgressMonitor monitor, String taskId) throws CoreException { - monitor.subTask("Receiving task " + taskId); + monitor.subTask(MessageFormat.format(Messages.SynchronizeTasksJob_Receiving_task_X, taskId)); if (!isUser()) { monitor = Policy.backgroundMonitorFor(monitor); } @@ -252,7 +254,7 @@ public class SynchronizeTasksJob extends SynchronizationJob { } throw new CoreException(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Connector failed to return task data for task \"" + taskId + "\"")); + "Connector failed to return task data for task \"" + taskId + "\"")); //$NON-NLS-1$ //$NON-NLS-2$ } private void resetStatus(ITask task) { @@ -262,7 +264,8 @@ public class SynchronizeTasksJob extends SynchronizationJob { private void synchronizeTasks(IProgressMonitor monitor, final TaskRepository repository, Set<ITask> tasks) throws CoreException { - monitor.subTask("Receiving " + tasks.size() + " tasks from " + repository.getRepositoryLabel()); + monitor.subTask(MessageFormat.format(Messages.SynchronizeTasksJob_Receiving_X_tasks_from_X, tasks.size(), + repository.getRepositoryLabel())); final Map<String, ITask> idToTask = new HashMap<String, ITask>(); for (ITask task : tasks) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/messages.properties new file mode 100644 index 000000000..7dd76f6ff --- /dev/null +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/messages.properties @@ -0,0 +1,25 @@ +SubmitTaskAttachmentJob_Sending_data=Sending data +SubmitTaskAttachmentJob_Submitting_attachment=Submitting attachment +SubmitTaskAttachmentJob_Updating_task=Updating task + +SubmitTaskJob_Receiving_data=Receiving data +SubmitTaskJob_Sending_data=Sending data +SubmitTaskJob_Submitting_task=Submitting task + +SynchronizeQueriesJob_Max_allowed_number_of_hits_returned_exceeded=Max allowed number of hits returned exceeded. Some hits may not be displayed. Please narrow query scope. +SynchronizeQueriesJob_Processing=Processing +SynchronizeQueriesJob_Querying_repository=Querying repository +SynchronizeQueriesJob_Receiving_related_tasks=Receiving related tasks +SynchronizeQueriesJob_Synchronizing_Queries=Synchronizing Queries +SynchronizeQueriesJob_Synchronizing_query_X=Synchronizing query {0} +SynchronizeQueriesJob_Updating_repository_state=Updating repository state + +SynchronizeRepositoriesJob_Processing=Processing +SynchronizeRepositoriesJob_Processing_=Processing +SynchronizeRepositoriesJob_Synchronizing_Task_List=Synchronizing Task List +SynchronizeRepositoriesJob_Updating_repository_configuration_for_X=Updating repository configuration for {0} +SynchronizeTasksJob_Processing=Processing +SynchronizeTasksJob_Receiving_task_X=Receiving task {0} +SynchronizeTasksJob_Receiving_X=Receiving {0} +SynchronizeTasksJob_Synchronizing_Tasks__X_=Synchronizing Tasks ({0}) +SynchronizeTasksJob_Receiving_X_tasks_from_X=Receiving {0} tasks from {1} diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java index a2e1715fa..749a4c03d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java @@ -98,12 +98,12 @@ public abstract class AbstractRepositoryConnector { return null; } - int i = label.indexOf("("); + int i = label.indexOf("("); //$NON-NLS-1$ if (i != -1) { return label.substring(0, i).trim(); } - i = label.indexOf(" "); + i = label.indexOf(" "); //$NON-NLS-1$ if (i != -1) { return label.substring(0, i).trim(); } @@ -140,7 +140,7 @@ public abstract class AbstractRepositoryConnector { * Used for referring to the task in the UI. */ public String getTaskIdPrefix() { - return "task"; + return "task"; //$NON-NLS-1$ } /** @@ -227,7 +227,7 @@ public abstract class AbstractRepositoryConnector { */ public void postSynchronization(ISynchronizationSession event, IProgressMonitor monitor) throws CoreException { try { - monitor.beginTask("", 1); + monitor.beginTask("", 1); //$NON-NLS-1$ } finally { monitor.done(); } @@ -240,7 +240,7 @@ public abstract class AbstractRepositoryConnector { */ public void preSynchronization(ISynchronizationSession event, IProgressMonitor monitor) throws CoreException { try { - monitor.beginTask("", 1); + monitor.beginTask("", 1); //$NON-NLS-1$ } finally { monitor.done(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListMigrator.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListMigrator.java index c7e97851d..cec9d5db5 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListMigrator.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListMigrator.java @@ -21,11 +21,11 @@ import org.w3c.dom.Element; */ public abstract class AbstractTaskListMigrator { - public static final String KEY_QUERY = "Query"; + public static final String KEY_QUERY = "Query"; //$NON-NLS-1$ - public static final String KEY_TASK = "Task"; + public static final String KEY_TASK = "Task"; //$NON-NLS-1$ - public static final String KEY_LAST_MOD_DATE = "LastModified"; + public static final String KEY_LAST_MOD_DATE = "LastModified"; //$NON-NLS-1$ public abstract String getTaskElementName(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java index a0354cf60..c1ff7bb4a 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,6 +13,8 @@ package org.eclipse.mylyn.tasks.core; import java.util.Date; +import org.eclipse.mylyn.internal.tasks.core.Messages; + /** * @author Mik Kersten * @author Steffen Pingel @@ -78,17 +80,17 @@ public interface ITask extends IRepositoryElement, IAttributeContainer { public String toString() { switch (this) { case P1: - return "P1"; + return "P1"; //$NON-NLS-1$ case P2: - return "P2"; + return "P2"; //$NON-NLS-1$ case P3: - return "P3"; + return "P3"; //$NON-NLS-1$ case P4: - return "P4"; + return "P4"; //$NON-NLS-1$ case P5: - return "P5"; + return "P5"; //$NON-NLS-1$ default: - return "P3"; + return "P3"; //$NON-NLS-1$ } } @@ -98,17 +100,17 @@ public interface ITask extends IRepositoryElement, IAttributeContainer { public String getDescription() { switch (this) { case P1: - return "Very High"; + return Messages.PriorityLevel_Very_High; case P2: - return "High"; + return Messages.PriorityLevel_High; case P3: - return "Normal"; + return Messages.PriorityLevel_Normal; case P4: - return "Low"; + return Messages.PriorityLevel_Low; case P5: - return "Very Low"; + return Messages.PriorityLevel_Very_Low; default: - return ""; + return ""; //$NON-NLS-1$ } } @@ -138,19 +140,19 @@ public interface ITask extends IRepositoryElement, IAttributeContainer { * @since 3.0 */ public static PriorityLevel fromString(String string) { - if ("P1".equals(string)) { + if ("P1".equals(string)) { //$NON-NLS-1$ return P1; } - if ("P2".equals(string)) { + if ("P2".equals(string)) { //$NON-NLS-1$ return P2; } - if ("P3".equals(string)) { + if ("P3".equals(string)) { //$NON-NLS-1$ return P3; } - if ("P4".equals(string)) { + if ("P4".equals(string)) { //$NON-NLS-1$ return P4; } - if ("P5".equals(string)) { + if ("P5".equals(string)) { //$NON-NLS-1$ return P5; } return getDefault(); @@ -163,19 +165,19 @@ public interface ITask extends IRepositoryElement, IAttributeContainer { if (string == null) { return null; } - if (string.equals("Very High")) { + if (string.equals(Messages.PriorityLevel_Very_High)) { return P1; } - if (string.equals("High")) { + if (string.equals(Messages.PriorityLevel_High)) { return P2; } - if (string.equals("Normal")) { + if (string.equals(Messages.PriorityLevel_Normal)) { return P3; } - if (string.equals("Low")) { + if (string.equals(Messages.PriorityLevel_Low)) { return P4; } - if (string.equals("Very Low")) { + if (string.equals(Messages.PriorityLevel_Very_Low)) { return P5; } return getDefault(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java index 0fb97d114..0d5c2a0ff 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java @@ -70,7 +70,7 @@ public class RepositoryStatus extends Status { super(severity, pluginId, code, message, e); if (repositoryUrl == null) { - throw new IllegalArgumentException("repositoryUrl must not be null"); + throw new IllegalArgumentException("repositoryUrl must not be null"); //$NON-NLS-1$ } this.repositoryUrl = repositoryUrl; @@ -96,7 +96,7 @@ public class RepositoryStatus extends Status { @Override public String getMessage() { String message = super.getMessage(); - if (message != null && !"".equals(message)) { + if (message != null && !"".equals(message)) { //$NON-NLS-1$ return message; } @@ -108,12 +108,12 @@ public class RepositoryStatus extends Status { return exception.toString(); } - return ""; + return ""; //$NON-NLS-1$ } @Override protected void setMessage(String message) { - super.setMessage((message != null) ? message : ""); + super.setMessage((message != null) ? message : ""); //$NON-NLS-1$ } protected void setHtmlMessage(String htmlMessage) { @@ -139,7 +139,7 @@ public class RepositoryStatus extends Status { public static RepositoryStatus createHtmlStatus(int severity, String pluginId, int code, String message, String htmlMessage) { if (htmlMessage == null) { - throw new IllegalArgumentException("htmlMessage must not be null"); + throw new IllegalArgumentException("htmlMessage must not be null"); //$NON-NLS-1$ } RepositoryStatus status = new RepositoryStatus(severity, pluginId, code, message); @@ -157,13 +157,13 @@ public class RepositoryStatus extends Status { public static RepositoryStatus createLoginError(String repositoryUrl, String pluginId) { return new RepositoryStatus(repositoryUrl, IStatus.ERROR, pluginId, RepositoryStatus.ERROR_REPOSITORY_LOGIN, - NLS.bind("Unable to login to {0}. Please validate credentials via Task Repositories view.", + NLS.bind("Unable to login to {0}. Please validate credentials via Task Repositories view.", //$NON-NLS-1$ repositoryUrl)); } public static RepositoryStatus createNotFoundError(String repositoryUrl, String pluginId) { return new RepositoryStatus(repositoryUrl, IStatus.ERROR, pluginId, - RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND, NLS.bind("Repository {0} could not be found.", + RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND, NLS.bind("Repository {0} could not be found.", //$NON-NLS-1$ repositoryUrl)); } @@ -174,20 +174,20 @@ public class RepositoryStatus extends Status { pluginId, RepositoryStatus.REPOSITORY_COLLISION, NLS.bind( - "Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.", + "Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.", //$NON-NLS-1$ repositoryUrl)); } public static RepositoryStatus createCommentRequiredError(String repositoryUrl, String pluginId) { return new RepositoryStatus(repositoryUrl, IStatus.ERROR, pluginId, RepositoryStatus.REPOSITORY_COMMENT_REQUIRED, - "You have to specify a new comment when making this change. Please comment on the reason for this change."); + "You have to specify a new comment when making this change. Please comment on the reason for this change."); //$NON-NLS-1$ } public static RepositoryStatus createHtmlStatus(String repositoryUrl, int severity, String pluginId, int code, String message, String htmlMessage) { if (htmlMessage == null) { - throw new IllegalArgumentException("htmlMessage must not be null"); + throw new IllegalArgumentException("htmlMessage must not be null"); //$NON-NLS-1$ } RepositoryStatus status = new RepositoryStatus(repositoryUrl, severity, pluginId, code, message); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java index 5c5c8375e..7fade61a4 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java @@ -59,17 +59,17 @@ import org.eclipse.mylyn.internal.tasks.core.RepositoryPerson; @SuppressWarnings("deprecation") public final class TaskRepository extends PlatformObject { - public static final String DEFAULT_CHARACTER_ENCODING = "UTF-8"; + public static final String DEFAULT_CHARACTER_ENCODING = "UTF-8"; //$NON-NLS-1$ - private static final String USERNAME = ".username"; + private static final String USERNAME = ".username"; //$NON-NLS-1$ - private static final String PASSWORD = ".password"; + private static final String PASSWORD = ".password"; //$NON-NLS-1$ - private static final String SAVE_PASSWORD = ".savePassword"; + private static final String SAVE_PASSWORD = ".savePassword"; //$NON-NLS-1$ - private static final String ENABLED = ".enabled"; + private static final String ENABLED = ".enabled"; //$NON-NLS-1$ - private static final String AUTH_REPOSITORY = "org.eclipse.mylyn.tasklist.repositories"; + private static final String AUTH_REPOSITORY = "org.eclipse.mylyn.tasklist.repositories"; //$NON-NLS-1$ // transient private IStatus errorStatus = null; @@ -89,9 +89,9 @@ public final class TaskRepository extends PlatformObject { public static final String AUTH_USERNAME = AUTH_REPOSITORY + USERNAME; @Deprecated - public static final String ANONYMOUS_LOGIN = "org.eclipse.mylyn.tasklist.repositories.anonymous"; + public static final String ANONYMOUS_LOGIN = "org.eclipse.mylyn.tasklist.repositories.anonymous"; //$NON-NLS-1$ - private static final String AUTH_HTTP = "org.eclipse.mylyn.tasklist.repositories.httpauth"; + private static final String AUTH_HTTP = "org.eclipse.mylyn.tasklist.repositories.httpauth"; //$NON-NLS-1$ /** * @deprecated use {@link #setCredentials(AuthenticationType, AuthenticationCredentials, boolean)} to access @@ -107,23 +107,23 @@ public final class TaskRepository extends PlatformObject { @Deprecated public static final String AUTH_HTTP_USERNAME = AUTH_HTTP + USERNAME; - public static final String NO_VERSION_SPECIFIED = "unknown"; + public static final String NO_VERSION_SPECIFIED = "unknown"; //$NON-NLS-1$ - private static final String AUTH_SCHEME = "Basic"; + private static final String AUTH_SCHEME = "Basic"; //$NON-NLS-1$ - private static final String AUTH_REALM = ""; + private static final String AUTH_REALM = ""; //$NON-NLS-1$ private static final URL DEFAULT_URL; - private static final String PROPERTY_CONFIG_TIMESTAMP = "org.eclipse.mylyn.tasklist.repositories.configuration.timestamp"; + private static final String PROPERTY_CONFIG_TIMESTAMP = "org.eclipse.mylyn.tasklist.repositories.configuration.timestamp"; //$NON-NLS-1$ - public static final String PROXY_USEDEFAULT = "org.eclipse.mylyn.tasklist.repositories.proxy.usedefault"; + public static final String PROXY_USEDEFAULT = "org.eclipse.mylyn.tasklist.repositories.proxy.usedefault"; //$NON-NLS-1$ - public static final String PROXY_HOSTNAME = "org.eclipse.mylyn.tasklist.repositories.proxy.hostname"; + public static final String PROXY_HOSTNAME = "org.eclipse.mylyn.tasklist.repositories.proxy.hostname"; //$NON-NLS-1$ - public static final String PROXY_PORT = "org.eclipse.mylyn.tasklist.repositories.proxy.port"; + public static final String PROXY_PORT = "org.eclipse.mylyn.tasklist.repositories.proxy.port"; //$NON-NLS-1$ - private static final String AUTH_PROXY = "org.eclipse.mylyn.tasklist.repositories.proxy"; + private static final String AUTH_PROXY = "org.eclipse.mylyn.tasklist.repositories.proxy"; //$NON-NLS-1$ /** * @deprecated use {@link #setCredentials(AuthenticationType, AuthenticationCredentials, boolean)} to access @@ -139,7 +139,7 @@ public final class TaskRepository extends PlatformObject { @Deprecated public static final String PROXY_PASSWORD = AUTH_PROXY + PASSWORD; - public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline"; + public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline"; //$NON-NLS-1$ // HACK: Lock used to work around race condition in // Platform.add/get/flushAuthorizationInfo() @@ -153,7 +153,7 @@ public final class TaskRepository extends PlatformObject { static { URL url = null; try { - url = new URL("http://eclipse.org/mylyn"); + url = new URL("http://eclipse.org/mylyn"); //$NON-NLS-1$ } catch (Exception ex) { // TODO ? } @@ -169,7 +169,7 @@ public final class TaskRepository extends PlatformObject { case REPOSITORY: return AUTH_REPOSITORY; } - throw new IllegalArgumentException("Unknown authentication type: " + type); + throw new IllegalArgumentException("Unknown authentication type: " + type); //$NON-NLS-1$ } private boolean isCachedUserName; @@ -251,7 +251,7 @@ public final class TaskRepository extends PlatformObject { } } catch (CoreException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Could not set authorization credentials", e)); + "Could not set authorization credentials", e)); //$NON-NLS-1$ } } } @@ -298,7 +298,7 @@ public final class TaskRepository extends PlatformObject { } catch (CoreException e) { // FIXME propagate exception? StatusHandler.fail(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Could not flush authorization credentials", e)); + "Could not flush authorization credentials", e)); //$NON-NLS-1$ } } } @@ -314,7 +314,7 @@ public final class TaskRepository extends PlatformObject { return Platform.getAuthorizationInfo(DEFAULT_URL, getRepositoryUrl(), AUTH_SCHEME); } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, - "Could not retrieve authorization credentials", e)); + "Could not retrieve authorization credentials", e)); //$NON-NLS-1$ } } else { Map<String, String> headlessCreds = credentials.get(getRepositoryUrl()); @@ -335,7 +335,7 @@ public final class TaskRepository extends PlatformObject { public String getCharacterEncoding() { final String encoding = properties.get(IRepositoryConstants.PROPERTY_ENCODING); - return encoding == null || "".equals(encoding) ? DEFAULT_CHARACTER_ENCODING : encoding; + return encoding == null || "".equals(encoding) ? DEFAULT_CHARACTER_ENCODING : encoding; //$NON-NLS-1$ } /** @@ -379,22 +379,22 @@ public final class TaskRepository extends PlatformObject { String key = getKeyPrefix(authType); String enabled = getProperty(key + ENABLED); - if (enabled == null || "true".equals(enabled)) { + if (enabled == null || "true".equals(enabled)) { //$NON-NLS-1$ String userName = getAuthInfo(key + USERNAME); String password; String savePassword = getProperty(key + SAVE_PASSWORD); - if (savePassword != null && "true".equals(savePassword)) { + if (savePassword != null && "true".equals(savePassword)) { //$NON-NLS-1$ password = getAuthInfo(key + PASSWORD); } else { password = transientProperties.get(key + PASSWORD); } if (userName == null) { - userName = ""; + userName = ""; //$NON-NLS-1$ } if (password == null) { - password = ""; + password = ""; //$NON-NLS-1$ } if (enabled == null && userName.length() == 0) { @@ -504,7 +504,7 @@ public final class TaskRepository extends PlatformObject { */ public boolean getSavePassword(AuthenticationType authType) { String value = getProperty(getKeyPrefix(authType) + SAVE_PASSWORD); - return value != null && "true".equals(value); + return value != null && "true".equals(value); //$NON-NLS-1$ } public String getSynchronizationTimeStamp() { @@ -513,7 +513,7 @@ public final class TaskRepository extends PlatformObject { public String getTimeZoneId() { final String timeZoneId = properties.get(IRepositoryConstants.PROPERTY_TIMEZONE); - return timeZoneId == null || "".equals(timeZoneId) ? TimeZone.getDefault().getID() : timeZoneId; + return timeZoneId == null || "".equals(timeZoneId) ? TimeZone.getDefault().getID() : timeZoneId; //$NON-NLS-1$ } public String getUrl() { @@ -549,7 +549,7 @@ public final class TaskRepository extends PlatformObject { public String getVersion() { final String version = properties.get(IRepositoryConstants.PROPERTY_VERSION); - return version == null || "".equals(version) ? NO_VERSION_SPECIFIED : version; + return version == null || "".equals(version) ? NO_VERSION_SPECIFIED : version; //$NON-NLS-1$ } /** @@ -577,7 +577,7 @@ public final class TaskRepository extends PlatformObject { */ @Deprecated public boolean isAnonymous() { - return getProperty(ANONYMOUS_LOGIN) == null || "true".equals(getProperty(ANONYMOUS_LOGIN)); + return getProperty(ANONYMOUS_LOGIN) == null || "true".equals(getProperty(ANONYMOUS_LOGIN)); //$NON-NLS-1$ } public boolean isBugRepository() { @@ -588,11 +588,11 @@ public final class TaskRepository extends PlatformObject { * Use platform proxy settings */ public boolean isDefaultProxyEnabled() { - return "true".equals(getProperty(PROXY_USEDEFAULT)); + return "true".equals(getProperty(PROXY_USEDEFAULT)); //$NON-NLS-1$ } public boolean isOffline() { - return getProperty(OFFLINE) != null && "true".equals(getProperty(OFFLINE)); + return getProperty(OFFLINE) != null && "true".equals(getProperty(OFFLINE)); //$NON-NLS-1$ } public void removeProperty(String key) { @@ -649,7 +649,7 @@ public final class TaskRepository extends PlatformObject { if (credentials == null) { setProperty(key + ENABLED, String.valueOf(false)); transientProperties.remove(key + PASSWORD); - setCredentialsInternal("", "", key + USERNAME, key + PASSWORD); + setCredentialsInternal("", "", key + USERNAME, key + PASSWORD); //$NON-NLS-1$ //$NON-NLS-2$ } else { setProperty(key + ENABLED, String.valueOf(true)); if (savePassword) { @@ -657,7 +657,7 @@ public final class TaskRepository extends PlatformObject { + PASSWORD); transientProperties.remove(key + PASSWORD); } else { - setCredentialsInternal(credentials.getUserName(), "", key + USERNAME, key + PASSWORD); + setCredentialsInternal(credentials.getUserName(), "", key + USERNAME, key + PASSWORD); //$NON-NLS-1$ transientProperties.put(key + PASSWORD, credentials.getPassword()); } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java index e455596fe..bdb461da2 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java @@ -288,7 +288,7 @@ public final class TaskAttribute { Assert.isNotNull(taskData); this.parentAttribute = null; this.taskData = taskData; - this.attributeId = "root"; + this.attributeId = "root"; //$NON-NLS-1$ this.values = new ArrayList<String>(1); } @@ -447,7 +447,7 @@ public final class TaskAttribute { if (values.size() > 0) { return values.get(0); } else { - return ""; + return ""; //$NON-NLS-1$ } } @@ -521,17 +521,17 @@ public final class TaskAttribute { @Override public String toString() { StringBuilder sb = new StringBuilder(); - toString(sb, ""); + toString(sb, ""); //$NON-NLS-1$ return sb.toString(); } private void toString(StringBuilder sb, String prefix) { sb.append(prefix); - sb.append("TaskAttribute[id=" + attributeId + ",values=" + values + ",options=" + optionByKey + ",metaData=" - + metaData + "]\n"); + sb.append("TaskAttribute[id=" + attributeId + ",values=" + values + ",options=" + optionByKey + ",metaData=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + + metaData + "]\n"); //$NON-NLS-1$ if (attributeById != null) { for (TaskAttribute child : attributeById.values()) { - child.toString(sb, prefix + " "); + child.toString(sb, prefix + " "); //$NON-NLS-1$ } } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttributeMapper.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttributeMapper.java index 093ea8f53..659f1509b 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttributeMapper.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttributeMapper.java @@ -181,10 +181,10 @@ public class TaskAttributeMapper { public String getValueLabel(TaskAttribute taskAttribute) { List<String> labels = getValueLabels(taskAttribute); StringBuilder sb = new StringBuilder(); - String sep = ""; + String sep = ""; //$NON-NLS-1$ for (String value : labels) { sb.append(sep).append(value); - sep = ", "; + sep = ", "; //$NON-NLS-1$ } return sb.toString(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java index e142ab4f9..4f2204b36 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java @@ -72,7 +72,7 @@ public class TaskDataModel { public void attributeChanged(TaskAttribute attribute) { if (attribute.getParentAttribute() != getTaskData().getRoot()) { throw new RuntimeException( - "Editing is only supported for attributes that are attached to the root of task data"); + "Editing is only supported for attributes that are attached to the root of task data"); //$NON-NLS-1$ } unsavedChangedAttributes.add(attribute); @@ -83,7 +83,7 @@ public class TaskDataModel { for (final TaskDataModelListener listener : listeners) { SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Listener failed", e)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Listener failed", e)); //$NON-NLS-1$ } public void run() throws Exception { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/sync/SubmitJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/sync/SubmitJob.java index e8b0c14b8..e78caa131 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/sync/SubmitJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/sync/SubmitJob.java @@ -99,7 +99,7 @@ public abstract class SubmitJob extends TaskJob { for (final SubmitJobListener listener : listeners) { SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable e) { - StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Listener failed", e)); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Listener failed", e)); //$NON-NLS-1$ } public void run() throws Exception { |