Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-10-30 17:14:44 -0400
committerThomas Wolf2019-11-16 06:48:18 -0500
commitd5751d4155a407f9e9877997e938a78a6e704e42 (patch)
treea34248ab0204cde40f49ba02c4bbf840031d6581
parentdb39915566b9ad4169dd596c63c721d32446c864 (diff)
downloadegit-d5751d4155a407f9e9877997e938a78a6e704e42.tar.gz
egit-d5751d4155a407f9e9877997e938a78a6e704e42.tar.xz
egit-d5751d4155a407f9e9877997e938a78a6e704e42.zip
[repo groups] move to own package
Repository groups are in fact a general concept, not tied to the repositories view. (Even though currently we use them only there, we will discover that in order to support bulk operations we'll reference them from other general code, too.) Change UIText keys accordingly, and drop the "GitRepositoriesView" prefix in the preference keys. Also make more fields final, tighten the name checking (forbid names containing vertical whitespace), and clean out groups with invalid names from the preferences. Change-Id: I9df4873581d7a6e15ca2200caafee2b1cec6bb49 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java21
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryGroupsMenu.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroup.java (renamed from org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroup.java)2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroups.java (renamed from org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroups.java)81
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroupNode.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryGroupCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteRepositoryGroupCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameRepositoryGroupCommand.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties7
16 files changed, 85 insertions, 58 deletions
diff --git a/org.eclipse.egit.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
index daf28b100..74ea01a2a 100644
--- a/org.eclipse.egit.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
@@ -91,6 +91,7 @@ Export-Package: org.eclipse.egit.ui;version="5.6.0";x-friends:="org.eclipse.egit
org.eclipse.egit.ui.internal.factories;version="5.6.0";x-internal:=true,
org.eclipse.egit.ui.internal.fetch;version="5.6.0";x-friends:="org.eclipse.mylyn.github.ui",
org.eclipse.egit.ui.internal.gerrit;version="5.6.0";x-internal:=true,
+ org.eclipse.egit.ui.internal.groups;version="5.6.0";x-internal:=true,
org.eclipse.egit.ui.internal.handler;version="5.6.0";x-internal:=true,
org.eclipse.egit.ui.internal.history;version="5.6.0";x-internal:=true,
org.eclipse.egit.ui.internal.history.command;version="5.6.0";x-internal:=true,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 74bf75b02..d14ec4abe 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -3859,15 +3859,6 @@ public class UIText extends NLS {
public static String RepositoriesView_RepoGroup_EmptyNameError;
/** */
- public static String RepositoriesView_RepoGroup_InvalidNameException;
-
- /** */
- public static String RepositoriesView_RepoGroup_GroupExists;
-
- /** */
- public static String RepositoriesView_RepoGroup_ErrorSavePreferences;
-
- /** */
public static String RepositoriesViewActionProvider_OpenWithMenu;
/** */
@@ -3898,6 +3889,18 @@ public class UIText extends NLS {
public static String RepositoriesViewLabelProvider_UnbornBranchText;
/** */
+ public static String RepositoryGroups_InvalidNameError;
+
+ /** */
+ public static String RepositoryGroups_DuplicateGroupNameError;
+
+ /** */
+ public static String RepositoryGroups_LoadPreferencesInvalidName;
+
+ /** */
+ public static String RepositoryGroups_SavePreferencesError;
+
+ /** */
public static String DialogsPreferencePage_autoConfigureLfs;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryGroupsMenu.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryGroupsMenu.java
index 9fe3b6a3d..e8d48de45 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryGroupsMenu.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryGroupsMenu.java
@@ -21,10 +21,10 @@ import java.util.stream.Collectors;
import org.eclipse.egit.ui.internal.CommonUtils;
import org.eclipse.egit.ui.internal.UIIcons;
import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.RepositoriesView;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
import org.eclipse.egit.ui.internal.repository.tree.command.CreateRepositoryGroupCommand;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroup.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroup.java
index 272b437c6..b532ad3a4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroup.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroup.java
@@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.egit.ui.internal.repository.tree;
+package org.eclipse.egit.ui.internal.groups;
import java.io.File;
import java.util.ArrayList;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroups.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroups.java
index fb179547d..50e7e64ce 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroups.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/groups/RepositoryGroups.java
@@ -8,9 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.egit.ui.internal.repository.tree;
+package org.eclipse.egit.ui.internal.groups;
import java.io.File;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -21,34 +22,38 @@ import java.util.stream.Collectors;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.jgit.util.StringUtils;
import org.osgi.service.prefs.BackingStoreException;
/**
- * This class manages the repository groups. The data is stored in the
+ * This singleton manages the repository groups. The data is stored in the
* preferences.
*/
-public class RepositoryGroups {
+public final class RepositoryGroups {
- private static RepositoryGroups INSTANCE = new RepositoryGroups();
+ private static final RepositoryGroups INSTANCE = new RepositoryGroups();
- private Map<UUID, RepositoryGroup> groupMap = new HashMap<>();
+ private static final String PREFS_GROUP_NAME_PREFIX = "RepositoryGroups."; //$NON-NLS-1$
- private RepositoryUtil util = Activator.getDefault().getRepositoryUtil();
+ private static final String PREFS_GROUPS = PREFS_GROUP_NAME_PREFIX
+ + "uuids"; //$NON-NLS-1$
- private IEclipsePreferences preferences = util.getPreferences();
+ private static final String PREFS_GROUP_PREFIX = PREFS_GROUP_NAME_PREFIX
+ + "group."; //$NON-NLS-1$
- private static final String PREFS_GROUPS = "GitRepositoriesView.RepositoryGroups.uuids"; //$NON-NLS-1$
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String PREFS_GROUP_NAME_PREFIX = "GitRepositoriesView.RepositoryGroups."; //$NON-NLS-1$
+ private static final String SEPARATOR = "\n";//$NON-NLS-1$
- private static final String PREFS_GROUP_PREFIX = "GitRepositoriesView.RepositoryGroups.group."; //$NON-NLS-1$
+ private final Map<UUID, RepositoryGroup> groupMap = new HashMap<>();
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ private final RepositoryUtil util = Activator.getDefault()
+ .getRepositoryUtil();
- private static final String SEPARATOR = "\n";//$NON-NLS-1$
+ private final IEclipsePreferences preferences = util.getPreferences();
/**
* @return singleton of the repository group manager
@@ -62,18 +67,30 @@ public class RepositoryGroups {
private RepositoryGroups() {
List<String> groups = split(
preferences.get(PREFS_GROUPS, EMPTY_STRING));
+ List<RepositoryGroup> toDelete = new ArrayList<>();
for (String groupIdString : groups) {
UUID groupId = UUID.fromString(groupIdString);
String name = preferences
.get(PREFS_GROUP_NAME_PREFIX + groupIdString, EMPTY_STRING);
+ // Guard against corrupted preferences
+ if (isGroupNameInvalid(name)) {
+ toDelete.add(new RepositoryGroup(groupId, name));
+ Activator.logWarning(MessageFormat.format(
+ UIText.RepositoryGroups_LoadPreferencesInvalidName,
+ name), null);
+ continue;
+ }
List<File> repos = split(preferences
.get(PREFS_GROUP_PREFIX + groupIdString, EMPTY_STRING))
.stream().map(util::getAbsoluteRepositoryPath)
- .map(File::new)
+ .map(File::new).filter(File::isDirectory)
.collect(Collectors.toList());
RepositoryGroup group = new RepositoryGroup(groupId, name, repos);
groupMap.put(groupId, group);
}
+ if (!toDelete.isEmpty()) {
+ delete(toDelete);
+ }
}
private List<String> split(String input) {
@@ -96,16 +113,18 @@ public class RepositoryGroups {
* @return id of the new group
*/
public UUID createGroup(String groupName) {
+ checkGroupName(groupName);
if (!groupExists(groupName)) {
- String trimmedName = groupName.trim();
UUID groupId = UUID.randomUUID();
- RepositoryGroup group = new RepositoryGroup(groupId, trimmedName);
+ RepositoryGroup group = new RepositoryGroup(groupId, groupName);
groupMap.put(groupId, group);
savePreferences();
return groupId;
} else {
throw new IllegalStateException(
- UIText.RepositoriesView_RepoGroup_GroupExists);
+ MessageFormat.format(
+ UIText.RepositoryGroups_DuplicateGroupNameError,
+ groupName));
}
}
@@ -118,7 +137,7 @@ public class RepositoryGroups {
public void renameGroup(RepositoryGroup group, String newName) {
checkGroupName(newName);
RepositoryGroup myGroup = groupMap.get(group.getGroupId());
- if (myGroup != null) {
+ if (myGroup != null && !newName.equals(myGroup.getName())) {
myGroup.setGroupName(newName);
savePreferences();
}
@@ -128,22 +147,22 @@ public class RepositoryGroups {
* @param groupName
* name of the group
* @return true if and only if a group of the given name already exists
- * @throws IllegalArgumentException
- * if the group name is not valid
- *
*/
- public boolean groupExists(String groupName)
- throws IllegalArgumentException {
- checkGroupName(groupName);
+ public boolean groupExists(String groupName) {
return groupMap.values().stream()
.anyMatch(group -> group.getName().equals(groupName));
}
- private void checkGroupName(String groupName) {
- if (StringUtils.isEmptyOrNull(groupName)
- || !groupName.equals(groupName.trim())) {
+ private static boolean isGroupNameInvalid(String groupName) {
+ return StringUtils.isEmptyOrNull(groupName)
+ || !groupName.equals(groupName.trim())
+ || Utils.isMultiLine(groupName);
+ }
+
+ private static void checkGroupName(String groupName) {
+ if (isGroupNameInvalid(groupName)) {
throw new IllegalArgumentException(
- UIText.RepositoriesView_RepoGroup_InvalidNameException);
+ UIText.RepositoryGroups_InvalidNameError);
}
}
@@ -207,7 +226,7 @@ public class RepositoryGroups {
preferences.flush();
} catch (BackingStoreException e) {
Activator.logError(
- UIText.RepositoriesView_RepoGroup_ErrorSavePreferences, e);
+ UIText.RepositoryGroups_SavePreferencesError, e);
}
}
@@ -229,12 +248,12 @@ public class RepositoryGroups {
}
/**
- * @param repositoryDirecptories
+ * @param repositoryDirectories
* repository directories to be removed from all groups
*/
- public void removeFromGroups(List<File> repositoryDirecptories) {
+ public void removeFromGroups(List<File> repositoryDirectories) {
for (RepositoryGroup group : groupMap.values()) {
- group.removeRepositoryDirectories(repositoryDirecptories);
+ group.removeRepositoryDirectories(repositoryDirectories);
}
savePreferences();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
index d9cb22653..c03b32f8f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
@@ -21,8 +21,8 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNodeType;
import org.eclipse.jface.util.LocalSelectionTransfer;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
index 3d7a7a01d..a35d73aba 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
@@ -52,6 +52,8 @@ import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.CommonUtils;
import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.AdditionalRefNode;
import org.eclipse.egit.ui.internal.repository.tree.AdditionalRefsNode;
import org.eclipse.egit.ui.internal.repository.tree.BranchHierarchyNode;
@@ -66,9 +68,7 @@ import org.eclipse.egit.ui.internal.repository.tree.RefNode;
import org.eclipse.egit.ui.internal.repository.tree.RemoteNode;
import org.eclipse.egit.ui.internal.repository.tree.RemoteTrackingNode;
import org.eclipse.egit.ui.internal.repository.tree.RemotesNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
import org.eclipse.egit.ui.internal.repository.tree.StashNode;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
index 68abc6fe0..d23cd098d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
@@ -32,9 +32,9 @@ import org.eclipse.egit.ui.internal.CommonUtils;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.internal.decorators.DecoratorRepositoryStateCache;
import org.eclipse.egit.ui.internal.decorators.GitDecorator;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.AdditionalRefNode;
import org.eclipse.egit.ui.internal.repository.tree.RefNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNodeType;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
index dd2b6ddad..eda759d0b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeLabelProvider.java
@@ -18,9 +18,9 @@ package org.eclipse.egit.ui.internal.repository;
import java.util.WeakHashMap;
import org.eclipse.egit.ui.internal.GitLabels;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.AdditionalRefNode;
import org.eclipse.egit.ui.internal.repository.tree.RefNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroupNode.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroupNode.java
index 4f3e7cc17..7dadb6888 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroupNode.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryGroupNode.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.egit.ui.internal.repository.tree;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
+
/**
* This class represents the tree node of a repository group.
*/
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java
index fcd020241..244993b5d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/RepositoryTreeNode.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.egit.ui.internal.CommonUtils;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryGroupCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryGroupCommand.java
index ea1fa392f..f6b34a514 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryGroupCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/CreateRepositoryGroupCommand.java
@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.egit.ui.internal.UIText;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNodeType;
@@ -76,7 +76,7 @@ public class CreateRepositoryGroupCommand
return UIText.RepositoriesView_RepoGroup_EmptyNameError;
}
if (groupsUtil.groupExists(name.trim())) {
- return UIText.RepositoriesView_RepoGroup_GroupExists;
+ return UIText.RepositoryGroups_DuplicateGroupNameError;
}
return null;
});
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteRepositoryGroupCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteRepositoryGroupCommand.java
index c90ea607a..9b792ab62 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteRepositoryGroupCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/DeleteRepositoryGroupCommand.java
@@ -15,9 +15,9 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
import org.eclipse.jface.window.Window;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
index da3773623..091e61356 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
@@ -44,7 +44,7 @@ import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.internal.CommonUtils;
import org.eclipse.egit.ui.internal.UIText;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryNode;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNodeType;
import org.eclipse.jface.dialogs.IDialogConstants;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameRepositoryGroupCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameRepositoryGroupCommand.java
index cec7e5fc7..4b279eff7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameRepositoryGroupCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RenameRepositoryGroupCommand.java
@@ -15,9 +15,9 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.egit.ui.internal.UIText;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroup;
+import org.eclipse.egit.ui.internal.groups.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroupNode;
-import org.eclipse.egit.ui.internal.repository.tree.RepositoryGroups;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
/**
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
index 467f196da..beded8819 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
@@ -1362,9 +1362,6 @@ RepositoriesView_RepoGroup_Rename_Title=Rename Repository Group
RepositoriesView_RepoGroup_Rename_IllegalSelection=Only a single repository group can be renamed.
RepositoriesView_RepoGroup_EnterName=Enter the name of the repository group:
RepositoriesView_RepoGroup_EmptyNameError=A repository group name must not be empty.
-RepositoriesView_RepoGroup_InvalidNameException=A repository group name must not be empty or be surrounded by white spaces.
-RepositoriesView_RepoGroup_GroupExists=A repository group with this name already exists.
-RepositoriesView_RepoGroup_ErrorSavePreferences=Error saving repository group state
RepositoriesViewActionProvider_OpenWithMenu=Open Wit&h
RepositoriesViewContentProvider_ExceptionNodeText=Exception encountered while fetching children
RepositoriesViewContentProvider_ReadReferencesJob=Reading repository references
@@ -1375,6 +1372,10 @@ RepositoriesViewLabelProvider_SubmodulesNodeText=Submodules
RepositoriesViewLabelProvider_SymbolicRefNodeText=References
RepositoriesViewLabelProvider_TagsNodeText=Tags
RepositoriesViewLabelProvider_UnbornBranchText=unborn branch; will be created on commit
+RepositoryGroups_InvalidNameError=A repository group name must not be empty or be surrounded by white spaces.
+RepositoryGroups_DuplicateGroupNameError=Repository group ''{0}'' already exists.
+RepositoryGroups_LoadPreferencesInvalidName=Invalid group name in preferences; removing group ''{0}''
+RepositoryGroups_SavePreferencesError=Error saving repository group state
DialogsPreferencePage_autoConfigureLfs=Automatically configure LFS without confirmation
DialogsPreferencePage_DetachedHeadCombo=D&etached HEAD and checkout of remote-tracking branch

Back to the top