/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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.
*/
/**
* The generic dialog of the Control Panel. It contains a StatusGenericPanel.
*
*/
{
/**
* The close button.
*/
//private JPanel contentPanel;
/**
* The panel contained in the dialog.
*/
//private ProgressPanel progressPanel;
//private boolean displayInputInNextVisible;
/**
* The different combinations of buttons that the dialog can have.
*
*/
public enum ButtonType
{
/**
* The dialog contains OK and CANCEL buttons.
*/
/**
* The dialog contains a OK button.
*/
OK,
/**
* The dialog contains a CLOSE button.
*/
/**
* The dialog has no buttons.
*/
};
/**
* Constructor of the dialog.
* @param parentFrame the parent frame of the dialog.
* @param panel the panel contained in this dialog.
*/
{
super(parentFrame);
if (panel.requiresBorder())
{
}
{
}
setResizable(true);
if (panel.requiresScroll())
{
}
else
{
}
{
}
{
/**
* {@inheritDoc}
*/
{
setVisible(false);
}
};
{
/**
* {@inheritDoc}
*/
{
}
};
addWindowListener(new WindowAdapter() {
/**
* {@inheritDoc}
*/
public void windowClosing(WindowEvent e) {
}
});
pack();
if (!SwingUtilities.isEventDispatchThread())
{
}
}
/**
* Method used to add a focus listeners to all the components in the panel.
* This is done to recover the focus on an item when the dialog is closed
* and then opened again.
* @param focusListener the focus listener.
* @param container the container where the components are layed out.
*/
{
{
if ((comp instanceof AbstractButton) ||
(comp instanceof JTextComponent) ||
{
}
{
}
}
}
/**
* {@inheritDoc}
*/
{
{
}
{
if (lastComponentWithFocus == null)
{
}
}
updateTitle();
super.setVisible(visible);
}
/**
* Sets the enable state of the OK button.
* @param enable whether the OK button must be enabled or not.
*/
{
}
/**
* Sets the enable state of the Cancel button.
* @param enable whether the Cancel button must be enabled or not.
*/
{
}
/**
* Sets the enable state of the Close button.
* @param enable whether the Close button must be enabled or not.
*/
{
}
/**
* Updates the title of the dialog using the title of the panel.
*
*/
public void updateTitle()
{
{
}
}
{
}
{
buttonsPanel.setOpaque(true);
{
{
{
}
});
cancelButton.setOpaque(false);
{
{
}
});
}
{
{
{
}
});
}
{
closeButton.setOpaque(false);
{
{
}
});
}
return buttonsPanel;
}
/**
* Updates the default button of the dialog, depending on the type of
* generic panel that it contains.
* @param panel the generic panel contained in this dialog.
*/
{
{
}
{
}
{
}
}
}