DuplicateEntryPanel.java revision 998747bfaaa3c6b28bbfaf0e282e6c0ccbf46bc0
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
* Portions Copyright 2012-2015 ForgeRock AS
*/
/**
* The panel used to duplicate an entry.
*
*/
public class DuplicateEntryPanel extends AbstractNewEntryPanel
{
private static final long serialVersionUID = -9879879123123123L;
private JTextField name;
private JTextField parentDN;
private JLabel lconfirmPassword;
private JLabel lPasswordInfo;
private GenericDialog browseDlg;
private LDAPEntrySelectionPanel browsePanel;
private CustomSearchResult entryToDuplicate;
private String rdnAttribute;
/**
* Default constructor.
*
*/
public DuplicateEntryPanel()
{
super();
createLayout();
}
/**
* {@inheritDoc}
*/
public Component getPreferredFocusComponent()
{
return name;
}
/**
* {@inheritDoc}
*/
public boolean requiresScroll()
{
return true;
}
/**
* {@inheritDoc}
*/
{
throw new IllegalArgumentException("this method must not be called");
}
/**
* Sets the entry to be duplicated.
* @param node the node to be duplicated.
* @param controller the browser controller.
*/
{
{
throw new IllegalArgumentException("node is null.");
}
setEnabledOK(false);
super.controller = controller;
try
{
{
aRdn = "(1)";
}
else
{
}
}
catch (DirectoryException de)
{
throw new IllegalStateException("Unexpected error decoding dn: '"+
}
}
/**
* {@inheritDoc}
*/
protected LocalizableMessage getProgressDialogTitle()
{
return INFO_CTRL_PANEL_DUPLICATE_ENTRY_TITLE.get();
}
/**
* {@inheritDoc}
*/
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_DUPLICATE_ENTRY_TITLE.get();
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
{
/**
* {@inheritDoc}
*/
{
}
});
gbc);
{
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
};
}
/**
* {@inheritDoc}
*/
{
{
}
{
}
else if (!entryExists(parentDN))
{
}
{
}
{
try
{
getEntry();
}
catch (IOException ioe)
{
}
catch (LDIFException le)
{
}
}
}
/**
* {@inheritDoc}
*/
{
{
{
{
}
}
{
{
continue;
}
{
if (value instanceof byte[])
{
}
else
{
}
}
}
else
{
try
{
}
catch (DirectoryException de)
{
}
{
}
else
{
try
{
}
catch (DirectoryException de)
{
throw new IllegalStateException("Unexpected error with dn: '"+
}
{
{
}
else
{
}
}
}
}
}
}
private void browseClicked()
{
{
browsePanel = new LDAPEntrySelectionPanel();
browsePanel.setMultipleSelection(false);
Utilities.getParentDialog(this));
}
browseDlg.setVisible(true);
{
{
}
}
}
{
new BackgroundTask<CustomSearchResult>()
{
{
return reader.processBackgroundTask();
}
{
{
}
else
{
try
{
setEnabledOK(true);
}
catch (DirectoryException de)
{
de.getMessageObject());
}
}
}
};
}
private void updateDNValue()
{
{
}
else
{
}
}
{
if (tSleep > 0)
{
try
{
}
catch (Throwable t)
{
}
}
}
}