proxyPortHttpsTB.setColumns(4);
proxyAuthUsernameTB.setFont(LABEL_FONT);
proxyAuthUsernameTB.setColumns(30);
+
+ // check for any change to enable applyProxyButton
+ DocumentListener d = new DocumentListener()
+ {
+ @Override
+ public void changedUpdate(DocumentEvent e)
+ {
+ applyProxyButtonEnabled(true);
+ }
+
+ @Override
+ public void insertUpdate(DocumentEvent e)
+ {
+ applyProxyButtonEnabled(true);
+ }
+
+ @Override
+ public void removeUpdate(DocumentEvent e)
+ {
+ applyProxyButtonEnabled(true);
+ }
+ };
+ proxyServerHttpTB.getDocument().addDocumentListener(d);
+ proxyPortHttpTB.getDocument().addDocumentListener(d);
+ proxyServerHttpsTB.getDocument().addDocumentListener(d);
+ proxyPortHttpsTB.getDocument().addDocumentListener(d);
+ proxyAuthUsernameTB.getDocument().addDocumentListener(d);
proxyAuthPasswordPB.setFont(LABEL_FONT);
proxyAuthPasswordPB.setColumns(30);
proxyAuthPasswordPB.getDocument()
@Override
public void changedUpdate(DocumentEvent e)
{
- proxyAuthPasswordHighlight(true);
+ proxyAuthPasswordCheckHighlight(true);
+ applyProxyButtonEnabled(true);
}
@Override
public void insertUpdate(DocumentEvent e)
{
- proxyAuthPasswordHighlight(true);
+ proxyAuthPasswordCheckHighlight(true);
+ applyProxyButtonEnabled(true);
}
@Override
public void removeUpdate(DocumentEvent e)
{
- proxyAuthPasswordHighlight(true);
+ proxyAuthPasswordCheckHighlight(true);
+ applyProxyButtonEnabled(true);
}
});
public void actionPerformed(ActionEvent e)
{
saveProxySettings();
+ applyProxyButton.setEnabled(false);
}
});
gbc.gridy++;
return proxyPanel;
}
- public void proxyAuthPasswordHighlight(boolean enabled)
+ public void proxyAuthPasswordCheckHighlight(boolean enabled)
{
if (enabled && proxyType.isSelected(customProxy.getModel())
&& proxyAuth.isSelected()
}
}
+ public void applyProxyButtonEnabled(boolean enabled)
+ {
+ applyProxyButton.setEnabled(enabled);
+ }
+
public void saveProxySettings()
{
// overridden in Preferences
public void proxyType_actionPerformed()
{
setCustomProxyEnabled();
- proxyAuthPasswordHighlight(true);
+ proxyAuthPasswordCheckHighlight(true);
+ applyProxyButtonEnabled(true);
}
public void proxyAuth_actionPerformed()
{
setProxyAuthEnabled();
- proxyAuthPasswordHighlight(true);
+ proxyAuthPasswordCheckHighlight(true);
+ applyProxyButtonEnabled(true);
}
/**