public void initFromPreferences() {
CredentialsAgent cm = CredentialsManager.getInstance();
try {
decorationPanel.removeAll();
decorationPanel.add(cm.getPreferencesDecorationPanel(), BorderLayout.CENTER);
PasswordAuthentication pa = cm.lookup(RequestorType.SERVER, OsmApi.getOsmApi().getHost());
if (pa == null) {
tfOsmUserName.setText("");
tfOsmPassword.setText("");
} else {
tfOsmUserName.setText(pa.getUserName() == null? "" : pa.getUserName());