@Override public PlainDocument getDocument() { return (PlainDocument) super.getDocument(); }
void registerListeners() { textFieldPath.getDocument().addDocumentListener(this); passwordField.getDocument().addDocumentListener(this); textFieldKeyAlias.getDocument().addDocumentListener(this); passwordFieldKey.getDocument().addDocumentListener(this); }
private void registerListeners() { DocumentListener documentListener = new DefaultDocumentListener(); hostTextField.getDocument().addDocumentListener(documentListener); portTextField.getDocument().addDocumentListener(documentListener); userTextField.getDocument().addDocumentListener(documentListener); passwordTextField.getDocument().addDocumentListener(documentListener); knownHostsFileTextField.getDocument().addDocumentListener(documentListener); identityFileTextField.getDocument().addDocumentListener(documentListener); initialDirectoryTextField.getDocument().addDocumentListener(documentListener); timeoutTextField.getDocument().addDocumentListener(documentListener); keepAliveTextField.getDocument().addDocumentListener(documentListener); }
public DocumentListener addValueChangeListener(JPasswordField component, ChangeListener listener) { DocumentListener documentListener = new DocumentChangeListener(listener); component.getDocument().addDocumentListener(documentListener); return documentListener; }
@Override public void removeHandler() { passwordField.getDocument().removeDocumentListener( docListener ); }
public void removeValueChangelistener(JPasswordField component, DocumentListener listener) { component.getDocument().removeDocumentListener(listener); } }
/** * Creates new form AddInstanceVisualNamePasswordPanel */ public AddInstanceVisualNamePasswordPanel() { initComponents(); DocumentListener l = new MyDocListener(); adminName.getDocument().addDocumentListener(l); adminPassword.getDocument().addDocumentListener(l); }
private void updateDialogButtonsAndMessage() { if(!radioButtonSpecKey.isSelected()) { warningSigning.setText(NbBundle.getMessage(JFXSigningPanel.class, "JFXSigningPanel.warningSigning.message")); //NOI18N warningSigning.setVisible(true); desc.setValid(true); } else { if(textFieldPath.getDocument().getLength()>0 && passwordField.getDocument().getLength()>5 && textFieldKeyAlias.getDocument().getLength()>0 && passwordFieldKey.getDocument().getLength()>5 ) { desc.setValid(true); warningSigning.setText(null); warningSigning.setVisible(false); } else { desc.setValid(false); warningSigning.setText(NbBundle.getMessage(JFXSigningPanel.class, "JFXSigningPanel.WarnMissingInfo")); // NOI18N warningSigning.setVisible(true); } } }
void unregisterListeners() { textFieldPath.getDocument().removeDocumentListener(this); passwordField.getDocument().removeDocumentListener(this); textFieldKeyAlias.getDocument().removeDocumentListener(this); passwordFieldKey.getDocument().removeDocumentListener(this); }
/** Constructs a new write key panel. */ WriteKeyPanel() { initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; newPasswd1Field.getDocument().addDocumentListener(dl); newPasswd2Field.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
/** Constructs a new write key panel. */ public WriteKeyPanel() { initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; newPasswd1Field.getDocument().addDocumentListener(dl); newPasswd2Field.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
private BasicOptionsPanel() { super(new FlowLayout(FlowLayout.LEFT, 10, 0)); userNameLabel = new JLabel("Username:"); add(userNameLabel); userNameInput = new JTextField(10); userNameInput.getDocument().addDocumentListener(this); add(userNameInput); passwordLabel = new JLabel("Password:"); add(passwordLabel); passwordInput = new JPasswordField(10); passwordInput.getDocument().addDocumentListener(this); add(passwordInput); setVisible(false); }
/** Constructs a new write key panel. */ WriteKeyPanel(final SwingPromptingPbeParametersView<?, ?> view) { assert null != view; this.view = view; initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; newPasswd1Field.getDocument().addDocumentListener(dl); newPasswd2Field.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
public boolean isEmptyField(String fieldLabel) { Component c = this.fieldMap.get(fieldLabel); if (c != null) { Object value = null; if (c instanceof ZapTextField) { value = ((ZapTextField)c).getText(); } else if (c instanceof JPasswordField) { return ((JPasswordField) c).getDocument().getLength() == 0; } else if (c instanceof ZapTextArea) { value = ((ZapTextArea)c).getText(); } else if (c instanceof JComboBox) { value = ((JComboBox<?>)c).getSelectedItem(); } else if (c instanceof ZapNumberSpinner) { value = ((ZapNumberSpinner)c).getValue(); if ((Integer)value < 0) { value = null; } } else { logger.error("Unrecognised field class " + fieldLabel + ": " + c.getClass().getCanonicalName()); } return value == null || value.toString().length() == 0; } return true; }
private void initPanel() { repositoryPanel = new RepositoryPanel(); urlComboEditor = (JTextComponent) repositoryPanel.urlComboBox .getEditor().getEditorComponent(); urlDoc = urlComboEditor.getDocument(); usernameDoc = repositoryPanel.userTextField.getDocument(); passwordDoc = repositoryPanel.userPasswordField.getDocument(); tunnelCmdDoc = repositoryPanel.tunnelCommandTextField.getDocument(); DocumentListener documentListener = new DocumentChangeHandler(); urlDoc.addDocumentListener(documentListener); passwordDoc.addDocumentListener(documentListener); usernameDoc.addDocumentListener(documentListener); tunnelCmdDoc.addDocumentListener(documentListener); repositoryPanel.savePasswordCheckBox.addItemListener(this); repositoryPanel.urlComboBox.addItemListener(this); repositoryPanel.proxySettingsButton.addActionListener(this); repositoryPanel.userPasswordField.addFocusListener(this); tweakComboBoxEditor(); }
/** Constructs a new read key panel. */ ReadKeyPanel(final SwingPromptingPbeParametersView<?, ?> view) { assert null != view; this.view = view; initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; passwdField.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
/** Constructs a new read key panel. */ public ReadKeyPanel() { initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; passwdField.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
CertificateOptionsPanel() { super(new FlowLayout(FlowLayout.LEFT, 10, 0)); keyStoreLabel = new JLabel("Key Store:"); add(keyStoreLabel); keyStoreInput = new JTextField(23); keyStoreInput.setEnabled(false); add(keyStoreInput); loadKeyStoreButton = new JButton("Open"); loadKeyStoreButton.addActionListener(this); add(loadKeyStoreButton); passwordLabel = new JLabel("Password:"); add(passwordLabel); passwordInput = new JPasswordField(10); passwordInput.getDocument().addDocumentListener(this); add(passwordInput); fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileFilter() { public boolean accept(File pathname) { String s = pathname.getName(); return pathname.isDirectory() || s.endsWith(".p12") || s.endsWith(".jks"); } public String getDescription() { return "Key Store Files (*.jks; *.p12)"; } }); setVisible(false); }
/** Constructs a new read key panel. */ ReadKeyPanel() { initComponents(); final DocumentListener dl = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { setError(null); } @Override public void removeUpdate(DocumentEvent e) { setError(null); } @Override public void changedUpdate(DocumentEvent e) { setError(null); } }; passwdField.getDocument().addDocumentListener(dl); authenticationPanel.getKeyFileDocument().addDocumentListener(dl); defaultForeground = resource.getForeground(); }
public LoginPanel(final LoginDialog dialog) { hostTextField.getEmptyText().setText("https://review.example.org"); hostTextField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { SettingsPanel.fixUrl(hostTextField); } }); DocumentListener listener = new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { dialog.clearErrors(); } }; loginTextField.getDocument().addDocumentListener(listener); passwordField.getDocument().addDocumentListener(listener); gerritLoginInfoTestField.setText(LOGIN_CREDENTIALS_INFO); gerritLoginInfoTestField.setMargin(new Insets(5, 0, 0, 0)); gerritLoginInfoTestField.setBackground(UIUtil.TRANSPARENT_COLOR); }