Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2016-03-31 13:42:31 -0400
committerSam Davis2016-03-31 14:42:23 -0400
commit2737da7b991ad0a12d95793067964a19cce58659 (patch)
tree8d6ed1df641d8b1fc9f4cbab06e6e7712eed7404
parent8db7d99d992c6703d57d0bd70462bbe91f532fc1 (diff)
downloadorg.eclipse.mylyn.tasks-e_4_5_m_3_19_x.tar.gz
org.eclipse.mylyn.tasks-e_4_5_m_3_19_x.tar.xz
org.eclipse.mylyn.tasks-e_4_5_m_3_19_x.zip
[3.19] 490820: always set password field echo character if possibleR_3_19_0e_4_5_m_3_19_x
Change-Id: Idac6aec404f7dfaeec89935e4f13cc0b56990940 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=490820 Signed-off-by: Jaxsun McCarthy Huggan <jaxsun.mccarthy@tasktop.com>
-rw-r--r--org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java4
2 files changed, 17 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
index 82880e2af..6c35ee5fa 100644
--- a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/wizards/RepositorySettingsPageTest.java
@@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
@@ -225,6 +226,7 @@ public class RepositorySettingsPageTest {
assertTrue(page.needsRepositoryCredentials());
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -233,10 +235,12 @@ public class RepositorySettingsPageTest {
page.setNeedsRepositoryCredentials(true);
page.createControl(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -246,9 +250,11 @@ public class RepositorySettingsPageTest {
page.createControl(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(true);
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -261,15 +267,18 @@ public class RepositorySettingsPageTest {
assertTrue(page.needsRepositoryCredentials());
assertTrue(page.isAnonymousAccess());
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setAnonymous(false);
page.setNeedsRepositoryCredentials(false);
assertCredentialsDisabled(page);
+ assertPasswordIsSecret(page);
page.setNeedsRepositoryCredentials(true);
assertCredentialsEnabled(page);
+ assertPasswordIsSecret(page);
}
@Test
@@ -312,4 +321,9 @@ public class RepositorySettingsPageTest {
assertFalse(page.repositoryUserNameEditor.getTextControl(page.compositeContainer).isEnabled());
assertFalse(page.repositoryPasswordEditor.getTextControl(page.compositeContainer).isEnabled());
}
+
+ private void assertPasswordIsSecret(TestRepositorySettingsPage page) {
+ StringFieldEditor passwordEditor = page.repositoryPasswordEditor;
+ assertEquals('*', passwordEditor.getTextControl(page.compositeContainer).getEchoChar());
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
index e8303d243..330051107 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
@@ -560,10 +560,12 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit
}
});
- if (needsRepositoryCredentials()) {
+ if (repositoryPasswordEditor != null) {
// bug 131656: must set echo char after setting value on Mac
((RepositoryStringFieldEditor) repositoryPasswordEditor).getTextControl().setEchoChar('*');
+ }
+ if (needsRepositoryCredentials()) {
if (needsAnonymousLogin()) {
// do this after username and password widgets have been intialized
if (repository != null) {

Back to the top