cookieListener.hook();
Label separator = new Label(shell,SWT.SEPARATOR | SWT.HORIZONTAL);
Button alt_method = null;
if ( isMine ){
alt_method = new Button(shell,SWT.CHECK);
final Button f_alt_method = alt_method;
alt_method.setText(MessageText.getString("externalLogin.auth_method_proxy"));
alt_method.setSelection( authMode == WebEngine.AM_PROXY );
alt_method.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
setCaptureMethod( browser, !f_alt_method.getSelection(), true );
}
});
}
setCaptureMethod( browser, authMode == WebEngine.AM_TRANSPARENT, true );
Button cancel = new Button(shell,SWT.PUSH);
cancel.setText(MessageText.getString("Button.cancel"));
Button done = new Button(shell,SWT.PUSH);
done.setText(MessageText.getString("Button.done"));
cancel.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
if(listener != null) {
listener.canceled(ExternalLoginWindow.this);
}
shell.dispose();
}
});
done.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
if(listener != null) {
listener.done(ExternalLoginWindow.this,cookiesToString());
}
shell.dispose();
}
});
FormData data;
data = new FormData();
data.left = new FormAttachment(0,5);
data.right = new FormAttachment(100,-5);
data.top = new FormAttachment(0,5);
explain.setLayoutData(data);
data = new FormData();
data.left = new FormAttachment(0,5);
data.right = new FormAttachment(100,-5);
data.top = new FormAttachment(explain,5);
data.bottom = new FormAttachment(separator,-5);
browser.setLayoutData(data);
data = new FormData();
data.left = new FormAttachment(0,0);
data.right = new FormAttachment(100,0);
data.bottom = new FormAttachment(cancel,-5);
separator.setLayoutData(data);
if ( isMine ){
data = new FormData();
data.width = 100;
data.left = new FormAttachment(0,5);
data.right = new FormAttachment(cancel,-5);
data.bottom = new FormAttachment(100,-5);
alt_method.setLayoutData(data);
}
data = new FormData();
data.width = 100;
data.right = new FormAttachment(done,-5);
data.bottom = new FormAttachment(100,-5);
cancel.setLayoutData(data);
data = new FormData();
data.width = 100;
data.right = new FormAttachment(100,-5);
data.bottom = new FormAttachment(100,-5);
done.setLayoutData(data);
shell.layout();
shell.open();
}