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 tabAgreements();
|
||||||
|
|
||||||
String buttonDeleteSshKey();
|
String buttonDeleteSshKey();
|
||||||
|
String buttonClearSshKeyInput();
|
||||||
String buttonAddSshKey();
|
String buttonAddSshKey();
|
||||||
|
|
||||||
String sshKeyInvalid();
|
String sshKeyInvalid();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ tabWebIdentities = Web Identities
|
|||||||
tabAgreements = Agreements
|
tabAgreements = Agreements
|
||||||
|
|
||||||
buttonDeleteSshKey = Delete
|
buttonDeleteSshKey = Delete
|
||||||
|
buttonClearSshKeyInput = Clear
|
||||||
buttonAddSshKey = Add
|
buttonAddSshKey = Add
|
||||||
|
|
||||||
sshKeyInvalid = Invalid Key
|
sshKeyInvalid = Invalid Key
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import java.util.List;
|
|||||||
class SshKeyPanel extends Composite {
|
class SshKeyPanel extends Composite {
|
||||||
private SshKeyTable keys;
|
private SshKeyTable keys;
|
||||||
|
|
||||||
|
private Button clearNew;
|
||||||
private Button addNew;
|
private Button addNew;
|
||||||
private TextArea addTxt;
|
private TextArea addTxt;
|
||||||
private Button delSel;
|
private Button delSel;
|
||||||
@@ -74,13 +75,25 @@ class SshKeyPanel extends Composite {
|
|||||||
addTxt.setCharacterWidth(80);
|
addTxt.setCharacterWidth(80);
|
||||||
fp.add(addTxt);
|
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 = new Button(Util.C.buttonAddSshKey());
|
||||||
addNew.addClickListener(new ClickListener() {
|
addNew.addClickListener(new ClickListener() {
|
||||||
public void onClick(final Widget sender) {
|
public void onClick(final Widget sender) {
|
||||||
doAddNew();
|
doAddNew();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fp.add(addNew);
|
buttons.add(addNew);
|
||||||
body.add(fp);
|
body.add(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user