diff --git a/platform/src/main/java/gov/nasa/arc/mct/gui/actions/CenterPaneRevertToCommitted.java b/platform/src/main/java/gov/nasa/arc/mct/gui/actions/CenterPaneRevertToCommitted.java index 5d2bfba3..02485209 100644 --- a/platform/src/main/java/gov/nasa/arc/mct/gui/actions/CenterPaneRevertToCommitted.java +++ b/platform/src/main/java/gov/nasa/arc/mct/gui/actions/CenterPaneRevertToCommitted.java @@ -42,7 +42,7 @@ public CenterPaneRevertToCommitted() { super(TEXT); } - private static String TEXT = "Revert to Committed"; + private static String TEXT = "Revert to Saved"; private ActionContext actionContext; private MCTHousingViewManifestation housingManifestation; diff --git a/platform/src/main/java/gov/nasa/arc/mct/gui/actions/InspectorPaneRevertToCommitted.java b/platform/src/main/java/gov/nasa/arc/mct/gui/actions/InspectorPaneRevertToCommitted.java index 26fa2ae6..48982d5e 100644 --- a/platform/src/main/java/gov/nasa/arc/mct/gui/actions/InspectorPaneRevertToCommitted.java +++ b/platform/src/main/java/gov/nasa/arc/mct/gui/actions/InspectorPaneRevertToCommitted.java @@ -33,7 +33,7 @@ @SuppressWarnings("serial") public class InspectorPaneRevertToCommitted extends ContextAwareAction { - private static final String TEXT = "Revert to Committed"; + private static final String TEXT = "Revert to Saved"; public InspectorPaneRevertToCommitted() { super(TEXT); diff --git a/platform/src/main/java/gov/nasa/arc/mct/identitymgr/impl/DefaultIdentityManager.java b/platform/src/main/java/gov/nasa/arc/mct/identitymgr/impl/DefaultIdentityManager.java index 3994cbe3..a1508e86 100644 --- a/platform/src/main/java/gov/nasa/arc/mct/identitymgr/impl/DefaultIdentityManager.java +++ b/platform/src/main/java/gov/nasa/arc/mct/identitymgr/impl/DefaultIdentityManager.java @@ -52,9 +52,11 @@ private void ensureInitialized() { if (username == null && persistence != null && windowing != null) { Object[] users = persistence.getAllUsers().toArray(); - if (users.length > 0) { + if (users.length > 1) { Arrays.sort(users); username = (String) windowing.showInputDialog(bundle.getString("TITLE"), bundle.getString("QUESTION"), users, users[0], null); //NOI18N + } else if (users.length == 1) { + username = users[0].toString(); } } diff --git a/platform/src/main/resources/gov/nasa/arc/mct/gui/housing/Bundle.properties b/platform/src/main/resources/gov/nasa/arc/mct/gui/housing/Bundle.properties index 07fe6639..2f8dded7 100644 --- a/platform/src/main/resources/gov/nasa/arc/mct/gui/housing/Bundle.properties +++ b/platform/src/main/resources/gov/nasa/arc/mct/gui/housing/Bundle.properties @@ -42,7 +42,7 @@ view.modified.alert.abort=Discard view.modified.alert.discard=Discard view.modified.alert.cancel=Cancel view.modified.status.bar.text=*MODIFIED* -view.modified.status.bar.tooltip.text=To see the modified object, use the Revert to Committed menu item +view.modified.status.bar.tooltip.text=To see the modified object, use the Revert to Saved menu item diff --git a/platform/src/test/java/gov/nasa/arc/mct/identitymgr/impl/TestDefaultIdentityManager.java b/platform/src/test/java/gov/nasa/arc/mct/identitymgr/impl/TestDefaultIdentityManager.java index 91750e76..529b8b10 100644 --- a/platform/src/test/java/gov/nasa/arc/mct/identitymgr/impl/TestDefaultIdentityManager.java +++ b/platform/src/test/java/gov/nasa/arc/mct/identitymgr/impl/TestDefaultIdentityManager.java @@ -84,6 +84,16 @@ public void testNoDialogForNoUsers() { Mockito.verify(mockWindowing, Mockito.never()).showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.>any()); } + @Test + public void testNoDialogForOneUsers() { + // No input dialog should be shown if there are 1 user in the DB + Set oneElementSet = new HashSet(); + oneElementSet.add("testUser1"); + Mockito.when(mockPersistence.getAllUsers()).thenReturn(oneElementSet); + new DefaultIdentityManager(mockProperties).getCurrentUser(); + Mockito.verify(mockWindowing, Mockito.never()).showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.>any()); + } + @Test public void testDialogForUsers() { // If multiple users are present, input dialog should be shown