Add a clear button to make it easier to replace the key
This way the current key can be easily whacked and replaced with the user's desired key. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -34,6 +34,7 @@ public interface AccountConstants extends Constants {
|
||||
String tabAgreements();
|
||||
|
||||
String buttonDeleteSshKey();
|
||||
String buttonClearSshKeyInput();
|
||||
String buttonAddSshKey();
|
||||
|
||||
String sshKeyInvalid();
|
||||
|
||||
@@ -15,6 +15,7 @@ tabWebIdentities = Web Identities
|
||||
tabAgreements = Agreements
|
||||
|
||||
buttonDeleteSshKey = Delete
|
||||
buttonClearSshKeyInput = Clear
|
||||
buttonAddSshKey = Add
|
||||
|
||||
sshKeyInvalid = Invalid Key
|
||||
|
||||
@@ -42,6 +42,7 @@ import java.util.List;
|
||||
class SshKeyPanel extends Composite {
|
||||
private SshKeyTable keys;
|
||||
|
||||
private Button clearNew;
|
||||
private Button addNew;
|
||||
private TextArea addTxt;
|
||||
private Button delSel;
|
||||
@@ -74,13 +75,25 @@ class SshKeyPanel extends Composite {
|
||||
addTxt.setCharacterWidth(80);
|
||||
fp.add(addTxt);
|
||||
|
||||
final FlowPanel buttons = new FlowPanel();
|
||||
fp.add(buttons);
|
||||
|
||||
clearNew = new Button(Util.C.buttonClearSshKeyInput());
|
||||
clearNew.addClickListener(new ClickListener() {
|
||||
public void onClick(final Widget sender) {
|
||||
addTxt.setText("");
|
||||
addTxt.setFocus(true);
|
||||
}
|
||||
});
|
||||
buttons.add(clearNew);
|
||||
|
||||
addNew = new Button(Util.C.buttonAddSshKey());
|
||||
addNew.addClickListener(new ClickListener() {
|
||||
public void onClick(final Widget sender) {
|
||||
doAddNew();
|
||||
}
|
||||
});
|
||||
fp.add(addNew);
|
||||
buttons.add(addNew);
|
||||
body.add(fp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user