private void processPasswordCallback( final List<ActionListener> proceedActions, JPanel inputPanel, final PasswordCallback pc) { // JLabel promptLabel = new JLabel(pc.getPrompt()); JLabel promptLabel = new JLabel(translationProvider.getTranslation( "password", locale) + " :"); final JPasswordField passwordField = new JPasswordField( DEFAULT_FIELD_LENGTH); if (!pc.isEchoOn()) { passwordField.setEchoChar('*'); } GridBagConstraints constraints = new GridBagConstraints(); constraints.insets = DEFAULT_INSETS; constraints.gridx = GridBagConstraints.RELATIVE; constraints.gridy = GridBagConstraints.RELATIVE; constraints.gridwidth = 1; inputPanel.add(promptLabel, constraints); constraints.weightx = 1.0d; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridwidth = GridBagConstraints.REMAINDER; inputPanel.add(passwordField, constraints); proceedActions.add(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { pc.setPassword(passwordField.getPassword()); } }); }
private void processPasswordCallback( final List<ActionListener> proceedActions, JPanel inputPanel, final PasswordCallback pc) { // JLabel promptLabel = new JLabel(pc.getPrompt()); JLabel promptLabel = new JLabel(translationProvider.getTranslation( "password", locale) + " :"); final JPasswordField passwordField = new JPasswordField( DEFAULT_FIELD_LENGTH); if (!pc.isEchoOn()) { passwordField.setEchoChar('*'); } GridBagConstraints constraints = new GridBagConstraints(); constraints.insets = DEFAULT_INSETS; constraints.gridx = GridBagConstraints.RELATIVE; constraints.gridy = GridBagConstraints.RELATIVE; constraints.gridwidth = 1; inputPanel.add(promptLabel, constraints); constraints.weightx = 1.0d; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridwidth = GridBagConstraints.REMAINDER; inputPanel.add(passwordField, constraints); proceedActions.add(new ActionListener() { public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { pc.setPassword(passwordField.getPassword()); } }); }
if (callbacks[i] instanceof PasswordCallback) { found = true; dialogInit(((PasswordCallback) callbacks[i]).isEchoOn());
@Override public boolean isEchoOn() { try { return callback.map(c -> c.isEchoOn()).get(); } catch (final RemoteException e) { e.printStackTrace(); } return false; }
if (callbacks[i] instanceof PasswordCallback) { found = true; dialogInit(((PasswordCallback) callbacks[i]).isEchoOn());
label.setText(call.getPrompt()); control = new Text(shell,SWT.BORDER); if(!call.isEchoOn()) { ((Text)control).setEchoChar('*');
label.setText(call.getPrompt()); control = new Text(shell,SWT.BORDER); if(!call.isEchoOn()) { ((Text)control).setEchoChar('*');
if (!pc.isEchoOn()) { passwordField.setEchoChar('*');