Skip to content

Commit

Permalink
Merge pull request #4638 from nadment/4637
Browse files Browse the repository at this point in the history
Replace setEchoChar('*') with SWT.PASSWORD #4637
  • Loading branch information
hansva authored Nov 29, 2024
2 parents 6f80b7a + 613c293 commit 0502e90
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ public IAction open() {
new LabelTextVar(
variables,
systemGroup,
SWT.LEFT | SWT.BORDER | SWT.PASSWORD,
BaseMessages.getString(PKG, "ActionAs400CommandDialog.Password.Label"),
BaseMessages.getString(PKG, "ActionAs400CommandDialog.Password.Tooltip"));
wPassword.setEchoChar('*');
wPassword.setLayoutData(new FormDataBuilder().top(wUserName).fullWidth().result());
wPassword.addModifyListener(lsMod);
PropsUi.setLook(wPassword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ public String open() {
fdlAccessKey.top = new FormAttachment(lastControl, margin);
fdlAccessKey.right = new FormAttachment(middle, -margin);
wlAccessKey.setLayoutData(fdlAccessKey);
wAccessKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wAccessKey.setEchoChar('*');
wAccessKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wAccessKey);
FormData fdAccessKey = new FormData();
fdAccessKey.left = new FormAttachment(middle, 0);
Expand All @@ -146,8 +145,7 @@ public String open() {
fdlSecretKey.top = new FormAttachment(lastControl, margin);
fdlSecretKey.right = new FormAttachment(middle, -margin);
wlSecretKey.setLayoutData(fdlSecretKey);
wSecretKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wSecretKey.setEchoChar('*');
wSecretKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wSecretKey);
FormData fdSecretKey = new FormData();
fdSecretKey.left = new FormAttachment(middle, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public String open() {
fdlAccessKey.top = new FormAttachment(lastControl, margin);
fdlAccessKey.right = new FormAttachment(middle, -margin);
wlAccessKey.setLayoutData(fdlAccessKey);
wAccessKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wAccessKey.setEchoChar('*');
wAccessKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wAccessKey);
FormData fdAccessKey = new FormData();
fdAccessKey.left = new FormAttachment(middle, 0);
Expand All @@ -139,8 +138,7 @@ public String open() {
fdlSecretKey.top = new FormAttachment(lastControl, margin);
fdlSecretKey.right = new FormAttachment(middle, -margin);
wlSecretKey.setLayoutData(fdlSecretKey);
wSecretKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wSecretKey.setEchoChar('*');
wSecretKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wSecretKey);
FormData fdSecretKey = new FormData();
fdSecretKey.left = new FormAttachment(middle, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public String open() {
fdlSasKey.right = new FormAttachment(middle, -margin);
fdlSasKey.top = new FormAttachment(lastControl, 2 * margin);
wlSasKey.setLayoutData(fdlSasKey);
wSasKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wSasKey.setEchoChar('*');
wSasKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wSasKey);
wSasKey.addModifyListener(lsMod);
FormData fdSasKey = new FormData();
Expand Down Expand Up @@ -241,8 +240,8 @@ public String open() {
fdlStorageConnectionString.right = new FormAttachment(middle, -margin);
fdlStorageConnectionString.top = new FormAttachment(lastControl, 2 * margin);
wlStorageConnectionString.setLayoutData(fdlStorageConnectionString);
wStorageConnectionString = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wStorageConnectionString.setEchoChar('*');
wStorageConnectionString =
new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wStorageConnectionString);
wStorageConnectionString.addModifyListener(lsMod);
FormData fdStorageConnectionString = new FormData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ public String open() {
fdlSasKey.right = new FormAttachment(middle, -margin);
fdlSasKey.top = new FormAttachment(lastControl, 2 * margin);
wlSasKey.setLayoutData(fdlSasKey);
wSasKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wSasKey.setEchoChar('*');
wSasKey = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wSasKey);
wSasKey.addModifyListener(lsMod);
FormData fdSasKey = new FormData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ private void addGeneralTab() {
fdlPassword.right = new FormAttachment(middle, -margin);
wlPassword.setLayoutData(fdlPassword);
wPassword =
new TextVar(manager.getVariables(), wGeneralComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
wPassword.setEchoChar('*');
new TextVar(
manager.getVariables(),
wGeneralComp,
SWT.SINGLE | SWT.LEFT | SWT.BORDER | SWT.PASSWORD);
PropsUi.setLook(wPassword);
FormData fdPassword = new FormData();
fdPassword.top = new FormAttachment(wlPassword, 0, SWT.CENTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,21 +445,23 @@ private Control getTextControl(
}

if (guiElements.isVariablesEnabled()) {
TextVar textVar = new TextVar(variables, parent, SWT.BORDER | SWT.SINGLE | SWT.LEFT);
PropsUi.setLook(textVar);
int style = SWT.BORDER | SWT.SINGLE | SWT.LEFT;
if (guiElements.isPassword()) {
textVar.setEchoChar('*');
style |= SWT.PASSWORD;
}
TextVar textVar = new TextVar(variables, parent, style);
PropsUi.setLook(textVar);
widgetsMap.put(guiElements.getId(), textVar);
addModifyListener(textVar.getTextWidget(), guiElements.getId());
control = textVar;
text = textVar.getTextWidget();
} else {
text = new Text(parent, SWT.BORDER | SWT.SINGLE | SWT.LEFT);
PropsUi.setLook(text);
int style = SWT.BORDER | SWT.SINGLE | SWT.LEFT;
if (guiElements.isPassword()) {
text.setEchoChar('*');
style |= SWT.PASSWORD;
}
text = new Text(parent, style);
PropsUi.setLook(text);
widgetsMap.put(guiElements.getId(), text);
addModifyListener(text, guiElements.getId());
control = text;
Expand Down

0 comments on commit 0502e90

Please sign in to comment.