Commit 46d18193 authored by Matija Obreza's avatar Matija Obreza
Browse files

trim() text for client_id, secret in Settings dialog

parent ed5e7746
...@@ -34,6 +34,8 @@ import org.scribe.exceptions.OAuthConnectionException; ...@@ -34,6 +34,8 @@ import org.scribe.exceptions.OAuthConnectionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import swing2swt.layout.BorderLayout; import swing2swt.layout.BorderLayout;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
public class SettingsDialog extends Dialog { public class SettingsDialog extends Dialog {
private static final Logger _log = Logger.getLogger(SettingsDialog.class); private static final Logger _log = Logger.getLogger(SettingsDialog.class);
...@@ -119,6 +121,12 @@ public class SettingsDialog extends Dialog { ...@@ -119,6 +121,12 @@ public class SettingsDialog extends Dialog {
lblGenesysServer.setText("Genesys Server URL"); lblGenesysServer.setText("Genesys Server URL");
txtGenesysURL = new Text(grpGenesysApiConfiguration, SWT.BORDER); txtGenesysURL = new Text(grpGenesysApiConfiguration, SWT.BORDER);
txtGenesysURL.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
txtGenesysURL.setText(txtGenesysURL.getText().trim());
}
});
txtGenesysURL.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtGenesysURL.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblAuthorizationEndpoint = new Label(grpGenesysApiConfiguration, SWT.NONE); Label lblAuthorizationEndpoint = new Label(grpGenesysApiConfiguration, SWT.NONE);
...@@ -151,6 +159,12 @@ public class SettingsDialog extends Dialog { ...@@ -151,6 +159,12 @@ public class SettingsDialog extends Dialog {
lblClientApiKey.setText("Client API key"); lblClientApiKey.setText("Client API key");
txtClientKey = new Text(grpGenesysApiConfiguration, SWT.BORDER); txtClientKey = new Text(grpGenesysApiConfiguration, SWT.BORDER);
txtClientKey.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
txtClientKey.setText(txtClientKey.getText().trim());
}
});
txtClientKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtClientKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblClientSecret = new Label(grpGenesysApiConfiguration, SWT.NONE); Label lblClientSecret = new Label(grpGenesysApiConfiguration, SWT.NONE);
...@@ -159,6 +173,12 @@ public class SettingsDialog extends Dialog { ...@@ -159,6 +173,12 @@ public class SettingsDialog extends Dialog {
lblClientSecret.setAlignment(SWT.RIGHT); lblClientSecret.setAlignment(SWT.RIGHT);
txtClientSecret = new Text(grpGenesysApiConfiguration, SWT.BORDER); txtClientSecret = new Text(grpGenesysApiConfiguration, SWT.BORDER);
txtClientSecret.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent arg0) {
txtClientSecret.setText(txtClientSecret.getText().trim());
}
});
txtClientSecret.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtClientSecret.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Group grpOauthTokens = new Group(composite, SWT.NONE); Group grpOauthTokens = new Group(composite, SWT.NONE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment