コード例 #1
0
 @Override
 protected void okPressed() {
   userData.setUserName(userText.getText().trim());
   userData.setPassword(passwordText.getText().trim());
   userData.setSaveCredentials(saveCredentialsCheckButton.getSelection());
   super.okPressed();
 }
コード例 #2
0
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.numColumns = 2;

    Label lblLoginToGoogle = new Label(container, SWT.NONE);
    GridData gd_lblLoginToGoogle = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_lblLoginToGoogle.widthHint = 170;
    lblLoginToGoogle.setLayoutData(gd_lblLoginToGoogle);
    lblLoginToGoogle.setText("Login to google");
    new Label(container, SWT.NONE);

    Label lblUser = new Label(container, SWT.NONE);
    lblUser.setText("User:"******"Enter your google username");
    userText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    if (userData.isSaveCredentials() && userData.getUserName() != null) {
      userText.setText(userData.getUserName());
    }

    Label lblPassword = new Label(container, SWT.NONE);
    lblPassword.setText("Password:"******"Enter your google password");
    passwordText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    if (userData.isSaveCredentials() && userData.getPassword() != null) {
      passwordText.setText(userData.getPassword());
    }

    saveCredentialsCheckButton = new Button(container, SWT.CHECK);
    saveCredentialsCheckButton.setText("Save username and password");
    saveCredentialsCheckButton.setSelection(userData.isSaveCredentials());
    new Label(container, SWT.NONE);

    return container;
  }
コード例 #3
0
 public String getUser() {
   return userData.getUserName();
 }
コード例 #4
0
 public String getPassword() {
   return userData.getPassword();
 }