func (u *UI) setError(err error) {
	u.dom.RemoveChildren(u.errorText)
	if err != nil {
		u.dom.AppendChild(u.errorText, u.dom.NewText(err.Error()), nil)
	}
}
setError updates the UI to display the supplied error. If the supplied error
is nil, then any displayed error is cleared.
package optionsui
import (
	"crypto/rand"
	"encoding/base64"
	"fmt"
	"math"
	"math/big"
	"sort"
	"time"
	"github.com/google/chrome-ssh-agent/go/dom"
	"github.com/google/chrome-ssh-agent/go/keys"
	"github.com/google/chrome-ssh-agent/go/keys/testdata"
	"github.com/gopherjs/gopherjs/js"
	"github.com/kr/pretty"
)
type UI struct {
	mgr              keys.Manager
	dom              *dom.DOM
	passphraseDialog *js.Object
	passphraseInput  *js.Object
	passphraseOk     *js.Object
	passphraseCancel *js.Object
	addButton        *js.Object
	addDialog        *js.Object
	addName          *js.Object
	addKey           *js.Object
	addOk            *js.Object
	addCancel        *js.Object
	removeDialog     *js.Object
	removeName       *js.Object
	removeYes        *js.Object
	removeNo         *js.Object
	errorText        *js.Object
	keysData         *js.Object
	keys             []*displayedKey
}
func New(mgr keys.Manager, domObj *dom.DOM) *UI {
	result := &UI{
		mgr:              mgr,
		dom:              domObj,
		passphraseDialog: domObj.GetElement("passphraseDialog"),
		passphraseInput:  domObj.GetElement("passphrase"),
		passphraseOk:     domObj.GetElement("passphraseOk"),
		passphraseCancel: domObj.GetElement("passphraseCancel"),
		addButton:        domObj.GetElement("add"),
		addDialog:        domObj.GetElement("addDialog"),
		addName:          domObj.GetElement("addName"),
		addKey:           domObj.GetElement("addKey"),
		addOk:            domObj.GetElement("addOk"),
		addCancel:        domObj.GetElement("addCancel"),
		removeDialog:     domObj.GetElement("removeDialog"),
		removeName:       domObj.GetElement("removeName"),
		removeYes:        domObj.GetElement("removeYes"),
		removeNo:         domObj.GetElement("removeNo"),
		errorText:        domObj.GetElement("errorMessage"),
		keysData:         domObj.GetElement("keysData"),
	}
	result.dom.OnDOMContentLoaded(result.updateKeys)
	result.dom.OnClick(result.addButton, result.add)
	return result
}