JLabel nicknameLabel = new JLabel("Nickname:");
this.bufferFindNameDialog = new FindNameDialog(this.Config,this.iconServer,FindNameDialog.BUFFER_SEARCH);
this.bufferFindNameDialog.restrictToRepository(this.repositoryView.getText());
this.nicknameText = new IconifiedDomainNameTextField(this.bufferFindNameDialog,this.iconServer);
this.nicknameText.setText(this.Prefs.getConfigValue("default","domainname")+".");
this.nicknameText.setNameTextToolTipText("Right click to search the buffer database.");
this.nicknameText.addDomainNameListener(new DomainNameListener()
{
public void actionPerformed(DomainNameEvent e)
{
String buffername = ((IconifiedDomainNameTextField)e.getSource()).getText();
String repos = repositoryView.getText();
try
{
if (Connection.storageExists(buffername))
{
BufferStorage exp = (BufferStorage)Connection.getStorage(buffername);
if (exp != null)
{
// if (loadedAtLeastOneBuffer)
// {
Object[] options = {"Plan to overwrite","Cancel"};
int n = JOptionPane.showOptionDialog(SMPBFrame.this,"Buffer "+buffername+" already exists in repostory "+repos+".","Conflict with pre-existing definition",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[1]);
String ans = (String)options[n];
if (ans.equalsIgnoreCase("Cancel")) //Revert to old nickname
{
IconifiedDomainNameTextField buffertext = (IconifiedDomainNameTextField)e.getSource();
buffertext.setListening(false);
buffertext.setText(oldNickname);
buffertext.setListening(true);
}
// }
// else