/*
* 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 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2013 ForgeRock AS.
*/
/**
* The dialog that is displayed when we want to add entries to a set of groups.
* @author jvergara
*
*/
{
/**
* Default constructor.
*
*/
public AddToGroupPanel()
{
super();
createLayout();
}
/**
* Sets the entries we want to add to groups.
* @param dns the DN of the entries we want to add to groups.
*/
{
{
}
{
scrollEntries.setVisible(true);
lEntries.setVisible(false);
}
else
{
scrollEntries.setVisible(false);
lEntries.setVisible(true);
}
}
/**
* {@inheritDoc}
*/
{
return groups;
}
/**
* {@inheritDoc}
*/
public void okClicked()
{
{
/**
* {@inheritDoc}
*/
public Void processBackgroundTask()
{
try
{
}
catch (Throwable t)
{
}
return null;
}
/**
* {@inheritDoc}
*/
{
if (t != null)
{
}
setEnabledCancel(true);
setEnabledOK(true);
}
};
setEnabledCancel(false);
setEnabledOK(false);
}
/**
* {@inheritDoc}
*/
{
return INFO_CTRL_PANEL_ADD_TO_GROUP_TITLE.get();
}
/**
* {@inheritDoc}
*/
{
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
{
/**
* {@inheritDoc}
*/
{
}
});
{
/**
* {@inheritDoc}
*/
public void dragEnter(DropTargetDragEvent e)
{
}
/**
* {@inheritDoc}
*/
public void dragExit(DropTargetEvent e)
{
}
/**
* {@inheritDoc}
*/
public void dragOver(DropTargetDragEvent e)
{
}
/**
* {@inheritDoc}
*/
public void dropActionChanged(DropTargetDragEvent e)
{
}
/**
* {@inheritDoc}
*/
public void drop(DropTargetDropEvent e)
{
try {
//flavor not supported, reject drop
{
e.rejectDrop();
}
//cast into appropriate data type
{
{
}
}
e.getDropTargetContext().dropComplete(true);
}
catch (IOException io)
{
e.rejectDrop();
}
catch (UnsupportedFlavorException ufe)
{
e.rejectDrop();
}
}
};
}
private void browseGroupsClicked()
{
if (browseGroupDlg == null)
{
browseGroupPanel = new LDAPEntrySelectionPanel();
Utilities.getParentDialog(this));
browseGroupDlg.setModal(true);
}
browseGroupDlg.setVisible(true);
{
{
{
}
}
}
}
{
{
/**
* {@inheritDoc}
*/
public void run()
{
}
});
boolean oneGroupDefined = false;
{
{
try
{
if (!entryExists(groupDn))
{
}
{
}
else
{
oneGroupDefined = true;
}
}
catch (OpenDsException ode)
{
}
}
}
{
}
{
{
/**
* {@inheritDoc}
*/
public void run()
{
}
});
}
}
{
{
Utilities.getParentDialog(this),
try
{
{
{
}
}
}
catch (OpenDsException ode)
{
throw new RuntimeException(
ode);
}
try
{
{
}
{
null,
dlg);
dlg.setVisible(true);
}
}
catch (Throwable t)
{
// Unexpected error: getEntry() should work after calling checkSyntax
throw new RuntimeException("Unexpected error: "+t, t);
}
}
{
}
}
}